This commit is contained in:
小鱼开发
2024-07-02 10:10:26 +08:00
parent 459416e5f4
commit 1965729ebc
2 changed files with 10 additions and 11 deletions
+3 -4
View File
@@ -723,6 +723,7 @@ class Statistics extends Wxapp{
protected function get_stats_days()
{
$days = intval($this->input_param('days'));
$province_id = intval($this->input_param('province_id'));
$city_id = intval($this->input_param('city_id'));
!$days && $days = 7;
$customers = $orders = $xAxis = [];
@@ -733,10 +734,9 @@ class Statistics extends Wxapp{
$xAxis[] = $days > 7 ? date('d', strtotime($s_time)) : date('n-d', strtotime($s_time));
$where = [
'status>=' => 0,
'cs_biz_id!=' => -1,
'c_time>=' => $c_time['s_time'],
'c_time<=' => $c_time['e_time'],
"biz_id in (select id from lc_biz where city_id={$city_id} and status=1)" => null
"biz_id in (select id from lc_biz where province_id={$province_id} and status=1)" => null
];
$customers[] = $this->customers_model->count($where);
$where = [
@@ -744,8 +744,7 @@ class Statistics extends Wxapp{
'order_time>=' => $o_time['s_time'],
'order_time<=' => $o_time['e_time'],
"customer_id in (
select id from lc_receiver_customers where status>=0 and cs_biz_id!=-1 and
biz_id in (select id from lc_biz where city_id={$city_id} and status=1)
select id from lc_receiver_customers where status>=0 and biz_id in (select id from lc_biz where province_id={$province_id} and status=1)
)" => null
];
$orders[] = $this->mdOrders->count($where);
+7 -7
View File
@@ -180,7 +180,7 @@ class Hd_wechat
{
$access_token = $this->access_token();
if (!$access_token) {
debug_log("[error] " . __FUNCTION__ . ": not access_token", $this->log_dir);
debug_log("[error] " . __FUNCTION__ . ": not access_token", __FUNCTION__, $this->log_dir);
return ['code' => 0, 'msg' => '获取微信token失败'];
}
@@ -199,7 +199,7 @@ class Hd_wechat
$ret = json_decode($res, true);
}
if (isset($ret['errcode'])) {
debug_log("[error] " . __FUNCTION__ . ": httpcode:{$code}, response:{$res}, filename:{$filename}, scene:{$scene}, page:{$page}, width:{$width}", $this->log_dir);
debug_log("[error] " . __FUNCTION__ . ": httpcode:{$code}, response:{$res}, filename:{$filename}, scene:{$scene}, page:{$page}, width:{$width}", __FUNCTION__, $this->log_dir);
return ['code' => 0, 'msg' => $res['errcode']];
}
@@ -209,7 +209,7 @@ class Hd_wechat
if (!is_dir($dir)) {
$ret = mkdir($dir, 0777, true);// 如果文件夹不存在,将以递归方式创建该文件夹
if (!$ret) {
debug_log("[error] " . __FUNCTION__ . ": mkdir {$ret}, filename:{$filename}, scene:{$scene}, page:{$page}, width:{$width}", $this->log_dir);
debug_log("[error] " . __FUNCTION__ . ": mkdir {$ret}, filename:{$filename}, scene:{$scene}, page:{$page}, width:{$width}", __FUNCTION__, $this->log_dir);
return ['code' => 0, 'msg' => '创建文件夹失败'];
}
}
@@ -219,7 +219,7 @@ class Hd_wechat
}
$ret = file_put_contents($file, $res);
if (false === $ret) {
debug_log("[error] " . __FUNCTION__ . ": file_put_contents {$ret}, filename:{$filename}, scene:{$scene}, page:{$page}, width:{$width}", $this->log_dir);
debug_log("[error] " . __FUNCTION__ . ": file_put_contents {$ret}, filename:{$filename}, scene:{$scene}, page:{$page}, width:{$width}", __FUNCTION__, $this->log_dir);
return ['code' => 0, 'msg' => '保存图片失败'];
}
return ['code' => 1, 'file' => $file, 'url' => 'wx/' . $filename . '.png'];
@@ -265,7 +265,7 @@ class Hd_wechat
*/
private function http_post($url, $data)
{
debug_log("[info] " . __FUNCTION__ . ":url={$url}, data=" . json_encode($data), $this->log_dir);
debug_log("[info] " . __FUNCTION__ . ":url={$url}, data=" . json_encode($data), __FUNCTION__, $this->log_dir);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
@@ -279,9 +279,9 @@ class Hd_wechat
$size = strlen($res);
if ($size > 5000) {
debug_log("[info] " . __FUNCTION__ . ":httpcode={$code}, response is big only show size={$size}", $this->log_dir);
debug_log("[info] " . __FUNCTION__ . ":httpcode={$code}, response is big only show size={$size}", __FUNCTION__, $this->log_dir);
} else {
debug_log("[info] " . __FUNCTION__ . ":httpcode={$code}, response={$res}", $this->log_dir);
debug_log("[info] " . __FUNCTION__ . ":httpcode={$code}, response={$res}", __FUNCTION__, $this->log_dir);
}
return array($code, $res);