...
|
...
|
@@ -7,6 +7,8 @@ use app\api\model\Store; |
|
|
use app\common\controller\Backend;
|
|
|
use app\admin\model\Litestorespec as SpecModel;
|
|
|
use app\admin\model\Litestorespecvalue as SpecValueModel;
|
|
|
use think\Db;
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
*
|
...
|
...
|
@@ -21,8 +23,8 @@ class Litestoregoods extends Backend |
|
|
* @var \app\admin\model\Litestoregoods
|
|
|
*/
|
|
|
protected $model = null;
|
|
|
protected $dataLimit = true;
|
|
|
protected $dataLimitField = 'store_id';
|
|
|
protected $admin_id;
|
|
|
protected $group_id;
|
|
|
protected $multiFields = 'is_recommend';
|
|
|
protected $noNeedRight = ['selectpage'];
|
|
|
|
...
|
...
|
@@ -42,7 +44,7 @@ class Litestoregoods extends Backend |
|
|
$this->view->assign("spec_attr", '');
|
|
|
$this->view->assign("spec_list", '');
|
|
|
$auth_group = new AuthGroupAccess();
|
|
|
$admin_id = session('admin.id');
|
|
|
$this->admin_id = $admin_id = session('admin.id');
|
|
|
$group_id = $auth_group->where(['uid'=>$admin_id,'group_id'=>1])->count();
|
|
|
$store = '';
|
|
|
if($group_id == 1) {
|
...
|
...
|
@@ -77,15 +79,26 @@ class Litestoregoods extends Backend |
|
|
{
|
|
|
return $this->selectpage();
|
|
|
}
|
|
|
$where_g = [];
|
|
|
$auth_group = new AuthGroupAccess();
|
|
|
$group = $auth_group->where(['uid'=>$this->admin_id,'group_id'=>4])->count();
|
|
|
if($group) {
|
|
|
$store = Db::name('store')->where('admin_id',$this->admin_id)->value('id');
|
|
|
$where_g = [
|
|
|
'store_id' => $store
|
|
|
];
|
|
|
}
|
|
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
|
|
$total = $this->model
|
|
|
->with(['category','freight'])
|
|
|
->where($where_g)
|
|
|
->where($where)
|
|
|
->order($sort, $order)
|
|
|
->count();
|
|
|
|
|
|
$list = $this->model
|
|
|
->with(['category','freight'])
|
|
|
->where($where_g)
|
|
|
->where($where)
|
|
|
->order($sort, $order)
|
|
|
->limit($offset, $limit)
|
...
|
...
|
|