|
|
@@ -12,6 +12,7 @@ namespace app\shop\controller;
|
|
|
|
|
|
use app\model\member\Member;
|
|
|
use app\model\store\Store;
|
|
|
+use app\model\system\UserGroup;
|
|
|
use app\model\verify\Verifier;
|
|
|
use app\model\verify\Verify as VerifyModel;
|
|
|
use app\model\verify\VerifyRecord;
|
|
|
@@ -176,6 +177,18 @@ class Verify extends BaseShop
|
|
|
} elseif (!empty($start_time) && !empty($end_time)) {
|
|
|
$condition[] = [ 'create_time', 'between', [ date_to_time($start_time), date_to_time($end_time) ] ];
|
|
|
}
|
|
|
+
|
|
|
+ $store_id_arr = [];
|
|
|
+ $userGroupModel = new UserGroup();
|
|
|
+ $userInfo = $this->user_info;
|
|
|
+ $userGroupWhere['uid'] = $userInfo['uid'];
|
|
|
+ $userGroupList = $userGroupModel->getUserList($userGroupWhere,'uid,store_id');
|
|
|
+ $store_id_arr = array_column($userGroupList['data'],'store_id');
|
|
|
+ array_push($store_id_arr,0);
|
|
|
+ if(!empty($store_id_arr) && !$userInfo['is_admin']){
|
|
|
+ $condition[] = [ "store_id", "in", $store_id_arr];
|
|
|
+ }
|
|
|
+
|
|
|
$list = $verify_model->getVerifyPageList($condition, $page, $page_size, 'id desc');
|
|
|
return $list;
|
|
|
} else {
|
|
|
@@ -260,13 +273,35 @@ class Verify extends BaseShop
|
|
|
}
|
|
|
if ($store_id) {
|
|
|
$condition[] = [ 'v.store_id', '=', $store_id ];
|
|
|
+ }else{
|
|
|
+ $store_model = new Store();
|
|
|
+ $store_id_arr = [];
|
|
|
+ $userGroupModel = new UserGroup();
|
|
|
+ $userInfo = $this->user_info;
|
|
|
+ $userGroupWhere['uid'] = $userInfo['uid'];
|
|
|
+ $userGroupList = $userGroupModel->getUserList($userGroupWhere,'uid,store_id');
|
|
|
+ $store_id_arr = array_column($userGroupList['data'],'store_id');
|
|
|
+ if(!empty($store_id_arr) && !$userInfo['is_admin']){
|
|
|
+ $condition[] = [ "v.store_id", "in", $store_id_arr];
|
|
|
+ }
|
|
|
}
|
|
|
$list = $verifier->getVerifierPageList($condition, $page, $page_size, $order);
|
|
|
return $list;
|
|
|
} else {
|
|
|
// 门店列表
|
|
|
$store_model = new Store();
|
|
|
- $store_list = $store_model->getStoreList([ [ 'site_id', "=", $this->site_id ], [ 'is_frozen', '=', 0 ] ], 'store_id,store_name', 'store_id desc')[ 'data' ];
|
|
|
+ $store_id_arr = [];
|
|
|
+ $userGroupModel = new UserGroup();
|
|
|
+ $userInfo = $this->user_info;
|
|
|
+ $userGroupWhere['uid'] = $userInfo['uid'];
|
|
|
+ $userGroupList = $userGroupModel->getUserList($userGroupWhere,'uid,store_id');
|
|
|
+ $store_id_arr = array_column($userGroupList['data'],'store_id');
|
|
|
+ if(!empty($store_id_arr) && !$userInfo['is_admin']){
|
|
|
+ $condition[] = [ "store_id", "in", $store_id_arr];
|
|
|
+ }
|
|
|
+
|
|
|
+ $condition[] = [ [ 'site_id', "=", $this->site_id ], [ 'is_frozen', '=', 0 ] ];
|
|
|
+ $store_list = $store_model->getStoreList($condition, 'store_id,store_name', 'store_id desc')[ 'data' ];
|
|
|
$this->assign('store_list', $store_list);
|
|
|
return $this->fetch("verify/user");
|
|
|
}
|