From 787ff2d42ce132d995f73a69c164a51549db7e6a Mon Sep 17 00:00:00 2001 From: lccsw <1127794702@qq.com> Date: Tue, 16 Nov 2021 11:53:29 +0800 Subject: [PATCH] edit-liche-robot2 --- common/libraries/Qyrobot.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common/libraries/Qyrobot.php b/common/libraries/Qyrobot.php index a80d334e..8968a938 100644 --- a/common/libraries/Qyrobot.php +++ b/common/libraries/Qyrobot.php @@ -70,18 +70,18 @@ class Qyrobot{ 'pay_price>=' => 100 ]; $where["pay_time>="] = date('Y-m-d 00:00:00'); - $where['pay_time<='] = date('Y-m-d H:i:s'); $today_count = $this->ci->app_liche_orders_model->count($where);//今日成交订单数 $where['pay_time>='] = date('Y-m-01 00:00:00'); $month_count = $this->ci->app_liche_orders_model->count($where);//本月成交订单数 //意向金等于定金的支付订单 - $sql = "select count(*) as total from lc_app_liche_orders as a left join lc_receiver_orders as b on a.o_id=b.id and a.total_price=b.deposit where a.type=4 and a.status=1 and a.pay_price>=0 and a.pay_time>='".date('Y-m-d 00:00:00')."'"; - $int_query = $this->ci->db->query($sql)->row_array(); - if($int_query['total']){ - $today_count += $int_query['total']; - $month_count += $int_query['total']; - } + $sql = "select count(*) as total from lc_app_liche_orders as a left join lc_receiver_orders as b on a.o_id=b.id where a.total_price=b.deposit and a.type=4 and a.status=1 and a.pay_price>=0 and a.pay_time>='".date('Y-m-d 00:00:00')."'"; + $today_query = $this->ci->db->query($sql)->row_array(); + $sql = "select count(*) as total from lc_app_liche_orders as a left join lc_receiver_orders as b on a.o_id=b.id where a.total_price=b.deposit and a.type=4 and a.status=1 and a.pay_price>=0 and a.pay_time>='".date('Y-m-01 00:00:00')."'"; + $month_query = $this->ci->db->query($sql)->row_array(); + $today_query['total_price'] && $today_count += $today_query['total']; + $month_query['total_price'] && $month_count += $month_query['total']; + $url = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key='.$this->key; $this->ci->load->library('mycurl'); $data = [