|
@@ -51,12 +51,24 @@ class Order extends Backend
|
|
|
return $this->selectpage();
|
|
|
}
|
|
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
|
|
+
|
|
|
+ //核销组只能看已核销的,且核销人是自己的
|
|
|
+ $where_user = [];
|
|
|
+ if($this->auth->getGroupIds()[0] == 6){
|
|
|
+ $where_user = [
|
|
|
+ 'order.have_received' => ['neq',0],
|
|
|
+ 'order.hexiao_uid' => ['=',$this->auth->user_id],
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
$total = $this->model
|
|
|
->alias('order')
|
|
|
->join('user', 'user.id = order.user_id','LEFT')
|
|
|
->join('user intro', 'intro.id = order.intro_uid','LEFT')
|
|
|
->join('user hexiao', 'hexiao.id = order.hexiao_uid','LEFT')
|
|
|
->where($where)
|
|
|
+ ->where($where_user)
|
|
|
->count();
|
|
|
|
|
|
$sum_price = $this->model
|
|
@@ -65,6 +77,7 @@ class Order extends Backend
|
|
|
->join('user intro', 'intro.id = order.intro_uid','LEFT')
|
|
|
->join('user hexiao', 'hexiao.id = order.hexiao_uid','LEFT')
|
|
|
->where($where)
|
|
|
+ ->where($where_user)
|
|
|
->sum('total_price');
|
|
|
|
|
|
$list = $this->model
|
|
@@ -73,6 +86,7 @@ class Order extends Backend
|
|
|
->join('user intro', 'intro.id = order.intro_uid','LEFT')
|
|
|
->join('user hexiao', 'hexiao.id = order.hexiao_uid','LEFT')
|
|
|
->where($where)
|
|
|
+ ->where($where_user)
|
|
|
->order($sort, $order)
|
|
|
->limit($offset, $limit)
|
|
|
->field('order.*,user.username,intro.username as intro_username,intro.mobile as intro_mobile,hexiao.username as hexiao_username,hexiao.mobile as hexiao_mobile')
|