geek преди 4 години
родител
ревизия
48a661387f

+ 1 - 1
application/api/controller/Admin.php

@@ -169,7 +169,7 @@ class Admin extends BaseController {
         Until::check($rule, $input);
         if( !captcha_check($input['code'] )) {
             // 验证失败
-//            throw new ApiException('验证码错误');
+            throw new ApiException('验证码错误');
         }
         $model = (new AdminModel());
         $where[] = ['a.account', '=', $input['account']];

+ 1 - 0
application/api/controller/Brand.php

@@ -42,6 +42,7 @@ class Brand extends BaseController {
         if (!empty($input['name'])) {
             $where[] = ['b.brand_name', 'like', "%{$input['name']}%"];
         }
+        $where[] = ['gr.admin_id','=',$this->adminId];
         $model->setWhere($where);
         $data = $model->getBrandList();
         Until::output($data);

+ 2 - 2
application/api/controller/Group.php

@@ -31,9 +31,9 @@ class Group extends BaseController {
         $model->setPage($input['page'] ?? 1);
         $model->setPageSize($input['pageSize'] ?? 10);
         $where = [];
-
+        $where[] = ['gr.admin_id','=',$this->adminId];
         $model->setWhere($where);
-        $data = $model->getPageList($model);
+        $data = $model->getGroupList();
         Until::output($data);
     }
 

+ 1 - 1
application/api/controller/Order.php

@@ -71,7 +71,7 @@ class Order extends BaseController {
         }
 
         if (!empty($input['storeId'])) {
-            $where[] = ['store.store_id', '=', $input['storeId']];
+            $where[] = ['store.id', '=', $input['storeId']];
         }
 
         if (!empty($input['appointmentTime'])) {

+ 4 - 2
application/api/model/BrandModel.php

@@ -14,10 +14,12 @@ class BrandModel  extends BaseModel {
 
     public function getBrandList() {
         $countModel = $this->alias('b')
-            ->join('group g', 'b.group_id = g.id');
+            ->join('group g', 'b.group_id = g.id')
+            ->join('group_role gr', 'gr.group_id = g.id');
         $selectModel = $this->alias('b')
             ->field('b.*,g.group_name')
-            ->join('group g', 'b.group_id = g.id');
+            ->join('group g', 'b.group_id = g.id')
+            ->join('group_role gr', 'gr.group_id = g.id');
         return $this->joinModelPageList($countModel, $selectModel);
 
     }

+ 2 - 2
application/api/model/CompanyModel.php

@@ -14,12 +14,12 @@ class CompanyModel  extends BaseModel {
 
     public function getCompanyList() {
         $countModel = $this->alias('c')
-            ->join('group g','g.id = c.group_id','left')
+            ->join('group g','g.id = c.group_id')
             ->join('pay_config p','p.id = c.pay_id','left');
 
         $selectModel = $this->alias('c')
             ->field('c.*,g.group_name,p.pay_code')
-            ->join('group g','g.id = c.group_id','left')
+            ->join('group g','g.id = c.group_id')
             ->join('pay_config p','p.id = c.pay_id','left');
         return $this->joinModelPageList($countModel, $selectModel);
     }

+ 9 - 1
application/api/model/GroupModel.php

@@ -6,8 +6,16 @@
 
 namespace app\api\model;
 
-class GroupModel  extends BaseModel {
+class GroupModel extends BaseModel {
 
     protected $table = 'group';
 
+    public function getGroupList() {
+        $count = $this->alias('g')
+            ->join('group_role gr', 'gr.group_id = g.id');
+        $select = $this->alias('g')
+            ->field('g.*')
+            ->join('group_role gr', 'gr.group_id = g.id');
+        return $this->joinModelPageList($count, $select);
+    }
 }

+ 9 - 7
config/cache.php

@@ -15,14 +15,16 @@
 
 return [
     // 驱动方式
-    'type'   => 'redis',
+    'type'     => 'Redis',
     // 缓存保存目录
-    'path'   => '',
+    'path'     => '',
     // 缓存前缀
-    'prefix' => '',
+    'prefix'   => '',
     // 缓存有效期 0表示永久缓存
-    'expire' => 0,
-    'host'     => '127.0.0.1',
-//    'port'     => '',
-//    'password' => ''
+    'expire'   => 0,
+    'host'     => '150.158.237.55',
+    'port'     => '9011',
+    'password' => 'hsaYi130718!@',
+    'select'   => '4'
+//    'host' => '127.0.0.1',
 ];