Browse Source

搜索条件

tgz 2 years ago
parent
commit
6db043c763
1 changed files with 22 additions and 0 deletions
  1. 22 0
      src/Services/LandingPage/LandingPageLinkService.php

+ 22 - 0
src/Services/LandingPage/LandingPageLinkService.php

@@ -206,6 +206,16 @@ class LandingPageLinkService
             ->where('orders.status', 'PAID')
             ->select('orders.*')
             ->orderBy('orders.id', 'desc');
+
+        //限制用户的创建时间
+        if (isset($params['user_begin_time']) || isset($params['user_end_time'])) {
+            if (isset($params['user_begin_time']) && $params['user_begin_time']) {
+                $sql->where('users.created_at', '>=', $params['user_begin_time']);
+            }
+            if (isset($params['user_end_time']) && $params['user_end_time']) {
+                $sql->where('users.created_at', '<=', $params['user_end_time']);
+            }
+        }
         if (isset($params['begin_time']) && $params['begin_time']) {
             $sql->where('orders.created_at', '>=', $params['begin_time']);
         }
@@ -215,6 +225,13 @@ class LandingPageLinkService
         if (isset($params['uid']) && $params['uid']) {
             $sql->where('orders.uid', $params['uid']);
         }
+
+
+
+        //限制派单ID
+        if (isset($params['send_order_id']) && $params['send_order_id']) {
+            $sql->where('orders.send_order_id', $params['send_order_id']);
+        }
         if (isset($params['adid']) && $params['adid']) {
             $sql->whereExists(function ($query) use ($params) {
                 $query->select(DB::raw(1))
@@ -239,6 +256,11 @@ class LandingPageLinkService
         if (!empty($qapp_account)) {
             $sql->join('qapp_send_orders', 'orders.send_order_id', 'qapp_send_orders.send_order_id')
             ->where('qapp_send_orders.account', $params['qapp_account']);
+
+            // 限制 回传方式--》 根据回传方式找派单
+            if(isset($params['report_type']) && $params['report_type']){
+                $sql->where('report_type',$params['report_type']);
+            }
         }
         
         if ($is_page) {