|
@@ -7,6 +7,8 @@ use app\api\model\Store; |
|
@@ -7,6 +7,8 @@ use app\api\model\Store; |
7
|
use app\common\controller\Backend;
|
7
|
use app\common\controller\Backend;
|
8
|
use app\admin\model\Litestorespec as SpecModel;
|
8
|
use app\admin\model\Litestorespec as SpecModel;
|
9
|
use app\admin\model\Litestorespecvalue as SpecValueModel;
|
9
|
use app\admin\model\Litestorespecvalue as SpecValueModel;
|
|
|
10
|
+use think\Db;
|
|
|
11
|
+
|
10
|
/**
|
12
|
/**
|
11
|
*
|
13
|
*
|
12
|
*
|
14
|
*
|
|
@@ -21,8 +23,8 @@ class Litestoregoods extends Backend |
|
@@ -21,8 +23,8 @@ class Litestoregoods extends Backend |
21
|
* @var \app\admin\model\Litestoregoods
|
23
|
* @var \app\admin\model\Litestoregoods
|
22
|
*/
|
24
|
*/
|
23
|
protected $model = null;
|
25
|
protected $model = null;
|
24
|
- protected $dataLimit = true;
|
|
|
25
|
- protected $dataLimitField = 'store_id';
|
26
|
+ protected $admin_id;
|
|
|
27
|
+ protected $group_id;
|
26
|
protected $multiFields = 'is_recommend';
|
28
|
protected $multiFields = 'is_recommend';
|
27
|
protected $noNeedRight = ['selectpage'];
|
29
|
protected $noNeedRight = ['selectpage'];
|
28
|
|
30
|
|
|
@@ -42,7 +44,7 @@ class Litestoregoods extends Backend |
|
@@ -42,7 +44,7 @@ class Litestoregoods extends Backend |
42
|
$this->view->assign("spec_attr", '');
|
44
|
$this->view->assign("spec_attr", '');
|
43
|
$this->view->assign("spec_list", '');
|
45
|
$this->view->assign("spec_list", '');
|
44
|
$auth_group = new AuthGroupAccess();
|
46
|
$auth_group = new AuthGroupAccess();
|
45
|
- $admin_id = session('admin.id');
|
47
|
+ $this->admin_id = $admin_id = session('admin.id');
|
46
|
$group_id = $auth_group->where(['uid'=>$admin_id,'group_id'=>1])->count();
|
48
|
$group_id = $auth_group->where(['uid'=>$admin_id,'group_id'=>1])->count();
|
47
|
$store = '';
|
49
|
$store = '';
|
48
|
if($group_id == 1) {
|
50
|
if($group_id == 1) {
|
|
@@ -77,15 +79,26 @@ class Litestoregoods extends Backend |
|
@@ -77,15 +79,26 @@ class Litestoregoods extends Backend |
77
|
{
|
79
|
{
|
78
|
return $this->selectpage();
|
80
|
return $this->selectpage();
|
79
|
}
|
81
|
}
|
|
|
82
|
+ $where_g = [];
|
|
|
83
|
+ $auth_group = new AuthGroupAccess();
|
|
|
84
|
+ $group = $auth_group->where(['uid'=>$this->admin_id,'group_id'=>4])->count();
|
|
|
85
|
+ if($group) {
|
|
|
86
|
+ $store = Db::name('store')->where('admin_id',$this->admin_id)->value('id');
|
|
|
87
|
+ $where_g = [
|
|
|
88
|
+ 'store_id' => $store
|
|
|
89
|
+ ];
|
|
|
90
|
+ }
|
80
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
91
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
81
|
$total = $this->model
|
92
|
$total = $this->model
|
82
|
->with(['category','freight'])
|
93
|
->with(['category','freight'])
|
|
|
94
|
+ ->where($where_g)
|
83
|
->where($where)
|
95
|
->where($where)
|
84
|
->order($sort, $order)
|
96
|
->order($sort, $order)
|
85
|
->count();
|
97
|
->count();
|
86
|
|
98
|
|
87
|
$list = $this->model
|
99
|
$list = $this->model
|
88
|
->with(['category','freight'])
|
100
|
->with(['category','freight'])
|
|
|
101
|
+ ->where($where_g)
|
89
|
->where($where)
|
102
|
->where($where)
|
90
|
->order($sort, $order)
|
103
|
->order($sort, $order)
|
91
|
->limit($offset, $limit)
|
104
|
->limit($offset, $limit)
|