From 2c3bb0a074b29e48e6faba21347df646c391b30e Mon Sep 17 00:00:00 2001 From: qianhy Date: Fri, 3 Mar 2023 17:45:55 +0800 Subject: [PATCH] cost plan add biz_type not 1 and kiapiao can select --- api/controllers/plan/Order.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/api/controllers/plan/Order.php b/api/controllers/plan/Order.php index 1623f0f5..de032698 100644 --- a/api/controllers/plan/Order.php +++ b/api/controllers/plan/Order.php @@ -464,7 +464,12 @@ class Order extends CI_Controller{ !$page && $page = 1; !$size && $size = 5; !$debug && $where = [ - '(status = 1 or ( status = 0 and id in (select o_id from `lc_receiver_order_status` where (pid_status = 4 and `status` in (1,2)) or (pid_status = 3 and `status` = 1) group by o_id having count(distinct pid_status) = 2 )) or ( status = 0 and id in (select id from lc_receiver_orders_v2 where if_usedcar = 1 and bill_time > 0 )) )' => null, + '( + status = 1 + or ( status = 0 and id in (select o_id from `lc_receiver_order_status` where (pid_status = 4 and `status` in (1,2)) or (pid_status = 3 and `status` = 1) group by o_id having count(distinct pid_status) = 2 )) + or (`status` =0 and id in (select o_id from `lc_receiver_order_status` where `pid_status` = 3 and `status` = 1 ) and biz_id in (select id from lc_biz where type <> 1)) + or ( status = 0 and id in (select id from lc_receiver_orders_v2 where if_usedcar = 1 and bill_time > 0 )) + )' => null, 'id not in (select o_id from lc_items_cost)' => null, 'item_id>' => 0, 'id>=' => Orders_v2_entity::V2_START_ID @@ -474,7 +479,12 @@ class Order extends CI_Controller{ if (!$id){ exit('debug下,只支持单个id参数'); } - $where['(status = 1 or ( status = 0 and id in (select o_id from `lc_receiver_order_status` where (pid_status = 4 and `status` in (1,2)) or (pid_status = 3 and `status` = 1) group by o_id having count(distinct pid_status) = 2 )) or ( status = 0 and id in (select id from lc_receiver_orders_v2 where if_usedcar = 1 and bill_time > 0 )) )'] = null; + $where['( + status = 1 + or ( status = 0 and id in (select o_id from `lc_receiver_order_status` where (pid_status = 4 and `status` in (1,2)) or (pid_status = 3 and `status` = 1) group by o_id having count(distinct pid_status) = 2 )) + or (`status` =0 and id in (select o_id from `lc_receiver_order_status` where `pid_status` = 3 and `status` = 1 ) and biz_id in (select id from lc_biz where type <> 1)) + or ( status = 0 and id in (select id from lc_receiver_orders_v2 where if_usedcar = 1 and bill_time > 0 )) + )'] = null; } $rows = $this->receiver_orders_v2_model->select($where,'',$page,$size); if ($recost){