Commit abce67be authored by hujun's avatar hujun

预约看铺列表

parent 342ce2a4
......@@ -78,7 +78,7 @@ class WatchShop extends Basic
}
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['total'] = $applies->getAppointWatchOurTotal($where);
}
......
......@@ -77,11 +77,13 @@ class AppointWatchShop extends BaseModel
*/
public function getAppointWatchOurList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params)
{
$params['d.is_del'] = 0;
return $this
->field($field)
->alias('a')
->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)
->order($order_)
->limit($pageSize)
......@@ -97,10 +99,12 @@ class AppointWatchShop extends BaseModel
*/
public function getAppointWatchOurTotal($params)
{
$params['d.is_del'] = 0;
return $this
->alias('a')
->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)
->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