shish 1 year ago
parent
commit
13ed35f125
2 changed files with 42 additions and 4 deletions
  1. 23 3
      app-hd/controllers/LlEventController.php
  2. 19 1
      app-hd/controllers/LlUserController.php

+ 23 - 3
app-hd/controllers/LlEventController.php

@@ -13,9 +13,29 @@ class LlEventController extends BaseController
     public function actionAdd()
     {
         $post = Yii::$app->request->post();
-        echo "<pre>";
-        print_r($post);
-        die;
+        $name = $post['name']??'';
+        if(empty($name)){
+            util::fail('请填写店名或姓名');
+        }
+        $no = $post['no']??'';
+        if(!empty($no)){
+            $pattern = '/^(?:\d{15}|\d{17}[\dxX])$/';
+            $valid = preg_match($pattern, $no);
+            if($valid == false){
+                util::fail('身份证号错误');
+            }
+        }
+        $mobile = $post['mobile']??'';
+        $wx = $post['wx']??'';
+        if(empty($wx) && empty($mobile) && empty($no)){
+            util::fail('手机号、微信号、身份证必填一项');
+        }
+        $prove = $post['prove']??[];
+        if(empty($prove)){
+            util::fail('证据最少要一张');
+        }
+        $json = json_encode($prove);
+        $intro = $post['intro']??'';
         util::complete('添加成功');
     }
 

+ 19 - 1
app-hd/controllers/LlUserController.php

@@ -16,9 +16,27 @@ class LlUserController extends BaseController
     public function actionList()
     {
         $get = Yii::$app->request->get();
-        $where = [];
+        $requestType = $get['requestType'] ?? '';
+        if ($requestType == 'my') {
+            $shopId = $this->shopId;
+            $where = ['launchShopId' => $shopId];
+        } else {
+            $where = [];
+        }
         $respond = LlUserClass::getUserList($where);
         util::success($respond);
     }
 
+    //详情 ssh 20240906
+    public function actionDetail()
+    {
+        $get = Yii::$app->request->get();
+        $id = $get['id'] ?? 0;
+        if (empty($id)) {
+            util::fail('没有找到');
+        }
+        $user = LlUserClass::getById($id, true);
+        util::success(['user' => $user]);
+    }
+
 }