Commit 789b85ad authored by zhuwei's avatar zhuwei

PC-进场记录列表-搜索条件完善

parent c8dc4c34
......@@ -49,37 +49,43 @@ class MarchIn extends Basic
if (!empty($params['create_time_start']) && !empty($params['create_time_end'])) {
$where['a.create_time'] = ['between time', [$params['create_time_start']. ' 00:00:00', $params['create_time_end'] . ' 23:59:59']];
}
//2.部门
if (!empty($params['district_id'])) {
$where['a.district_id'] = $params['district_id'];
$where['b.district_id'] = $params['district_id'];
}
//3.门店名称
if (!empty($params['store_id'])) {
$where['c.store_id'] = $params['store_id'];
$where['e.store_id'] = $params['store_id'];
}
//4.客户姓名
if (!empty($params['user_name'])) {
$where['b.user_name'] = ['LIKE','%'.$params['user_name'].'%'];
$where['d.user_name'] = ['LIKE','%'.$params['user_name'].'%'];
}
//5.客户手机号
if (!empty($params['user_phone'])) {
$where['b.user_phone'] = ['LIKE','%'.$params['user_phone'].'%'];
$where['d.user_phone'] = ['LIKE','%'.$params['user_phone'].'%'];
}
//6.报备人手机号
if (!empty($params['user_phone'])) {
$where['b.user_phone'] = ['LIKE','%'.$params['user_phone'].'%'];
if (!empty($params['report_agent_phone'])) {
$where['d.report_agent_phone'] = ['LIKE','%'.$params['report_agent_phone'].'%'];
}
//7.报备人姓名
if (!empty($params['user_phone'])) {
$where['b.user_phone'] = ['LIKE','%'.$params['user_phone'].'%'];
if (!empty($params['report_agent_name'])) {
$where['d.report_agent_name'] = ['LIKE','%'.$params['report_agent_name'].'%'];
}
//8.商铺名
if (!empty($params['user_phone'])) {
$where['b.user_phone'] = ['LIKE','%'.$params['user_phone'].'%'];
if (!empty($params['house_title'])) {
$where['c.house_title'] = ['LIKE','%'.$params['house_title'].'%'];
}
//9.商铺类型
if (!empty($params['user_phone'])) {
$where['b.user_phone'] = ['LIKE','%'.$params['user_phone'].'%'];
if (!empty($params['shop_type'])) {
$where['f.shop_type'] = $params['shop_type'] ;
}
//搜索条件 end
......
......@@ -181,6 +181,7 @@ class OMarchInModel extends Model
->join('o_order c', 'a.order_id = c.id', 'left')
->join('o_report d', 'a.report_id = d.id', 'left')
->join('a_store e', 'd.report_store_id = e.id', 'left')
->join('g_houses f', 'c.house_id = f.id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
......@@ -198,6 +199,7 @@ class OMarchInModel extends Model
->join('o_order c', 'a.order_id = c.id', 'left')
->join('o_report d', 'a.report_id = d.id', 'left')
->join('a_store e', 'd.report_store_id = e.id', 'left')
->join('g_houses f', 'c.house_id = f.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