@@ -51,9 +51,16 @@ class Banner extends Backend
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+ //只能看自己的
+ $where_op = [];
+ if($this->auth->company_id){
+ $where_op['banner.company_id'] = $this->auth->company_id;
+ }
+
$list = $this->model
->with(['company'])
->where($where)
+ ->where($where_op)
->order($sort, $order)
->paginate($limit);
@@ -51,9 +51,16 @@ class Company extends Backend
+ $where_op['company.id'] = $this->auth->company_id;
->with(['wallet'])
@@ -50,9 +50,16 @@ class CompanyBank extends Backend
+ $where_op['company_bank.company_id'] = $this->auth->company_id;
@@ -50,9 +50,16 @@ class Companycomment extends Backend
+ $where_op['companycomment.company_id'] = $this->auth->company_id;
->with(['user','company'])
@@ -56,9 +56,16 @@ class CompanyStaff extends Backend
+ $where_op['company_staff.company_id'] = $this->auth->company_id;
@@ -50,12 +50,18 @@ class CompanyTakeCash extends Backend
+ $where_op['company_take_cash.user_id'] = $this->auth->company_id;
-
foreach ($list as $row) {
$row->getRelation('company')->visible(['name']);
@@ -50,9 +50,16 @@ class Companymoneylog extends Backend
+ $where_op['companymoneylog.user_id'] = $this->auth->company_id;
@@ -48,8 +48,15 @@ class Coupons extends Backend
+ $where_op['coupons.company_id'] = $this->auth->company_id;
$list = $this->model->with(['company'])
@@ -52,9 +52,16 @@ class Order extends Backend
+ $where_op['order.company_id'] = $this->auth->company_id;
->with(['company','staff','user','preOrder','servicetype'])
@@ -50,9 +50,16 @@ class Package extends Backend
+ $where_op['package.company_id'] = $this->auth->company_id;
->with(['company','servicetype'])
@@ -48,8 +48,15 @@ class PreOrder extends Backend
+ $where_op['pre_order.company_id'] = $this->auth->company_id;
$list = $this->model->with(['user','company','servicetype'])
@@ -50,9 +50,16 @@ class RechargeConfig extends Backend
+ $where_op['recharge_config.company_id'] = $this->auth->company_id;
@@ -50,9 +50,16 @@ class UserCouponsLog extends Backend
+ $where_op['user_coupons_log.company_id'] = $this->auth->company_id;
->with(['company','user','coupons','staff'])
@@ -232,6 +232,7 @@ class Order extends Apic
$data = [
+ 'company_id' => $this->auth->company_id,
'order_id' => $id,
'name' => $name,
'price' => $price,