作者 刘朕
1 个管道 的构建 通过 耗费 0 秒

销售订单列表筛选问题修复

@@ -296,20 +296,26 @@ class MemberSalesController extends HomeBaseController @@ -296,20 +296,26 @@ class MemberSalesController extends HomeBaseController
296 $date = $this->request->param('date'); 296 $date = $this->request->param('date');
297 $sort_id = $this->request->param('sort_id'); 297 $sort_id = $this->request->param('sort_id');
298 $user_id = cmf_get_current_user_sale_id(); 298 $user_id = cmf_get_current_user_sale_id();
299 - $order_where = [  
300 - 'o.user_id' => $user_id,  
301 - 'o.is_stop' => 0,  
302 - 'o.delete_time' => 0 299 + $order_where1 = [
  300 + 'user_id' => $user_id,
  301 + 'status' => 0,
  302 + 'over_time' => ['egt',time()],
  303 + 'is_stop' => 0,
  304 + 'delete_time' => 0
  305 + ];
  306 + $order_where2 = [
  307 + 'user_id' => $user_id,
  308 + 'status' => 1,
  309 + 'is_stop' => 0,
  310 + 'delete_time' => 0
303 ]; 311 ];
304 if($date) { 312 if($date) {
305 - $order_where['o.create_time'] = ['between',strtotime($date).','.strtotime("$date +1 day")]; 313 + $order_where1['create_time'] = $order_where2['create_time'] = ['between',strtotime($date).','.strtotime("$date +1 day")];
306 } 314 }
307 - $orderList = $this->order_model  
308 - ->alias('o')  
309 - ->field(['o.id,o.order_sn,o.status,o.create_time,o.over_time,os.name'])  
310 - ->join('__ORDER_SORT__ os','o.sort_id = os.id')  
311 - ->where($order_where)  
312 - ->select(); 315 + $orderList = Db::name('OrderView')
  316 + ->where(function ($q) use ($order_where1) {$q->where($order_where1);})
  317 + ->whereOr(function ($q) use ($order_where2) {$q->where($order_where2);})
  318 + ->select()->toArray();
313 foreach ($orderList as $k=>$v) { 319 foreach ($orderList as $k=>$v) {
314 $orderList[$k]['detail_url'] = url('detail',['id'=>$sort_id,'order_id'=>$v['id']]); 320 $orderList[$k]['detail_url'] = url('detail',['id'=>$sort_id,'order_id'=>$v['id']]);
315 $orderList[$k]['edit_url'] = url('edit',['id'=>$sort_id,'order_id'=>$v['id']]); 321 $orderList[$k]['edit_url'] = url('edit',['id'=>$sort_id,'order_id'=>$v['id']]);