Commit abce67be authored by hujun's avatar hujun

预约看铺列表

parent 342ce2a4
...@@ -78,7 +78,7 @@ class WatchShop extends Basic ...@@ -78,7 +78,7 @@ class WatchShop extends Basic
} }
if ($params['check_status'] == 2) { if ($params['check_status'] == 2) {
$where['a.appoint_agent_id'] = $this->userId; $where['a.appoint_agent_id'] = $where['d.agent_id'] = $this->userId;
$data['list'] = $applies->getAppointWatchOurList($pageNo, $pageSize, 'id DESC', 'a.*', $where); $data['list'] = $applies->getAppointWatchOurList($pageNo, $pageSize, 'id DESC', 'a.*', $where);
$data['total'] = $applies->getAppointWatchOurTotal($where); $data['total'] = $applies->getAppointWatchOurTotal($where);
} }
......
...@@ -77,11 +77,13 @@ class AppointWatchShop extends BaseModel ...@@ -77,11 +77,13 @@ class AppointWatchShop extends BaseModel
*/ */
public function getAppointWatchOurList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params) public function getAppointWatchOurList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params)
{ {
$params['d.is_del'] = 0;
return $this return $this
->field($field) ->field($field)
->alias('a') ->alias('a')
->join('u_users b', 'a.user_id=b.id', 'left') ->join('u_users b', 'a.user_id=b.id', 'left')
->join('a_agents c', 'b.agent_id=c.id', 'left') ->join('u_user_agent d', 'b.id=d.user_id', 'left')
->join('a_agents c', 'd.agent_id=c.id', 'left')
->where($params) ->where($params)
->order($order_) ->order($order_)
->limit($pageSize) ->limit($pageSize)
...@@ -97,10 +99,12 @@ class AppointWatchShop extends BaseModel ...@@ -97,10 +99,12 @@ class AppointWatchShop extends BaseModel
*/ */
public function getAppointWatchOurTotal($params) public function getAppointWatchOurTotal($params)
{ {
$params['d.is_del'] = 0;
return $this return $this
->alias('a') ->alias('a')
->join('u_users b', 'a.user_id=b.id', 'left') ->join('u_users b', 'a.user_id=b.id', 'left')
->join('a_agents c', 'b.agent_id=c.id', 'left') ->join('u_user_agent d', 'b.id=d.user_id', 'left')
->join('a_agents c', 'd.agent_id=c.id', 'left')
->where($params) ->where($params)
->count(); ->count();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment