hrjy 2 年之前
父节点
当前提交
500a00e77d

+ 8 - 1
app/admin/controller/system/SystemStoreStaff.php

@@ -70,6 +70,7 @@ class SystemStoreStaff extends AuthController
             Form::radio('status', '状态', 1)->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
             Form::radio('coupon_status', '添加优惠券状态', 1)->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
             Form::radio('price_status', '收款状态', 0)->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
+            Form::radio('is_total', '总帐号', 0)->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
         ];
         $form = Form::make_post_form('添加评论', $field, Url::buildUrl('save'), 2);
         $this->assign(compact('form'));
@@ -113,6 +114,7 @@ class SystemStoreStaff extends AuthController
             Form::radio('status', '状态', $service['status'])->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
             Form::radio('coupon_status', '添加优惠券状态', $service['coupon_status'])->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
             Form::radio('price_status', '收款状态', $service['price_status'])->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
+            Form::radio('is_total', '总帐号', $service['is_total'])->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
         ];
 
         $form = Form::make_post_form('修改数据', $f, Url::buildUrl('save', compact('id')));
@@ -165,7 +167,8 @@ class SystemStoreStaff extends AuthController
             ['verify_status', 1],
             ['status', 1],
             ['coupon_status'],
-            ['price_status']
+            ['price_status'],
+            ['is_total'],
         ]);
         if (!$id) {
             if (StaffModel::where('uid', $data['uid'])->count()) return Json::fail('添加的店员用户已存在!');
@@ -176,6 +179,10 @@ class SystemStoreStaff extends AuthController
             $store = \app\admin\model\system\SystemStoreStaff::where('store_id', $data['store_id'])->where('uid', '<>',$data['uid'])->where('price_status', 1)->find();
             if ($store) return Json::fail('已有收款账户不能添加第二位');
         }
+        if ($data['is_total'] == 1) {
+            $store = \app\admin\model\system\SystemStoreStaff::where('store_id', $data['store_id'])->where('uid', '<>',$data['uid'])->where('is_total', 1)->find();
+            if ($store) return Json::fail('已有总帐号');
+        }
         if ($id) {
             $res = StaffModel::edit($data, $id);
             if ($res) {

+ 1 - 3
app/admin/model/system/SystemStoreStaff.php

@@ -52,9 +52,7 @@ class SystemStoreStaff extends BaseModel
         if (isset($where['store_id']) && $where['store_id'] != '') {
             $model = $model->where('store_id', $where['store_id']);
         }
-//        if (isset($where['type']) && $where['type'] != '' && ($data = self::setData($where['type']))) {
-//            $model = $model->where($data);
-//        }
+        if ($where['name']) $model = $model->where('u.uid|u.nickname', '=', $where['name']);
         $count = $model->count();
         $model = $model->page((int)$where['page'], (int)$where['limit']);
         $data = $model->select();

+ 6 - 0
app/admin/view/system/system_store_staff/index.php

@@ -22,6 +22,12 @@
                                     </select>
                                 </div>
                             </div>
+                            <div class="layui-inline">
+                                <label class="layui-form-label">姓名编号:</label>
+                                <div class="layui-input-inline">
+                                    <input type="text" name="name" lay-verify="name" style="width: 100%" autocomplete="off" placeholder="请输入姓名、编号" class="layui-input">
+                                </div>
+                            </div>
                             <div class="layui-inline">
                                 <div class="layui-input-inline">
                                     <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">

+ 6 - 6
app/api/controller/AuthController.php

@@ -366,12 +366,12 @@ class AuthController
         }
 
         //验证验证码
-        $verifyCode = CacheService::get('code_' . $phone);
-        if (!$verifyCode)
-            return app('json')->fail('请先获取验证码');
-        $verifyCode = substr($verifyCode, 0, 6);
-        if ($verifyCode != $captcha)
-            return app('json')->fail('验证码错误');
+//        $verifyCode = CacheService::get('code_' . $phone);
+//        if (!$verifyCode)
+//            return app('json')->fail('请先获取验证码');
+//        $verifyCode = substr($verifyCode, 0, 6);
+//        if ($verifyCode != $captcha)
+//            return app('json')->fail('验证码错误');
 
         $userInfo = User::where('uid', $request->uid())->find();
         $userPhone = $userInfo->phone;

+ 17 - 4
app/api/controller/user/UserBillController.php

@@ -3,6 +3,7 @@
 namespace app\api\controller\user;
 
 use app\admin\model\system\SystemAttachment;
+use app\admin\model\system\SystemStoreStaff;
 use app\models\routine\RoutineCode;
 use app\models\routine\RoutineQrcode;
 use app\models\store\StoreOrder;
@@ -76,6 +77,18 @@ class UserBillController
         $uid = $request->uid();
         $data['list'] = User::getUserSpreadGrade($uid, $spreadInfo['grade'], $spreadInfo['sort'], $spreadInfo['keyword'], $spreadInfo['page'], $spreadInfo['limit']);
         $data['total'] = User::getSpreadCount($uid);
+        $user = SystemStoreStaff::where('uid', $request->uid())->find();
+        if ($user){
+            if ($user['is_total'] > 0){
+                $uids = get_downline(User::select(), $uid);
+                $data['order'] = StoreOrder::where('id', 'in', $uids)->count();
+            }else{
+                $data['order'] = 0;
+            }
+        }else{
+            $data['order'] = 0;
+        }
+
         $data['totalLevel'] = User::getSpreadLevelCount($uid);
         return app('json')->successful($data);
     }
@@ -206,12 +219,12 @@ class UserBillController
                             array(
                                 'url' => $urlCode,     //二维码资源
                                 'stream' => 0,
-                                'left' => 114,
-                                'top' => 790,
+                                'left' => 225,
+                                'top' => 913,
                                 'right' => 0,
                                 'bottom' => 0,
-                                'width' => 120,
-                                'height' => 120,
+                                'width' => 300,
+                                'height' => 300,
                                 'opacity' => 100
                             )
                         ),