From e8113d23839f8c42363437ba5794c063ae2e1b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=B1=BC=E5=BC=80=E5=8F=91?= Date: Sun, 1 Mar 2026 17:33:12 +0800 Subject: [PATCH] fixed --- api/controllers/Welcome.php | 52 ++++++++++++++++++++++ api/controllers/wxapp/licheb/Customers.php | 2 +- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/api/controllers/Welcome.php b/api/controllers/Welcome.php index c3c233e6..3e65cdf4 100644 --- a/api/controllers/Welcome.php +++ b/api/controllers/Welcome.php @@ -13,6 +13,28 @@ class Welcome extends CI_Controller public function test() { + $open_key = 'CdJiji028'; + $secret_key = 'MjkJiji'; + + // 获取当前时间戳(秒)和微秒数 + $microtime = microtime(true); // 返回一个浮点数,单位为秒 + // 将其转换为毫秒时间戳(整数) + $t = (int)($microtime * 1000); + $t = time(); + $token = $this->encode($secret_key.$t, $open_key); + + $data = file_get_contents("https://xmmjk.dongzhumeijia.com/api/api/goodlist/token/{$token}/times/{$t}/start/0/number/50"); + + $str = trim($data, '\"'); + + // 解码Unicode转义字符 + $str = json_decode('"' . $str . '"'); + + // 现在$str是有效的JSON字符串,可以解析为数组 + $array = json_decode($str, true); + + print_r($array); + // $this->load->library('carHome/daiFu'); // $daiFu = new DaiFu(); // $daiFu->uploadIdCardImage(); @@ -48,4 +70,34 @@ class Welcome extends CI_Controller // $res = $this->customers_model->Commissions($rid, $bizId); // var_dump($res); } + + function encode($string, $key) + { + $key = md5($key); + $key_length = strlen($key); + $string = substr(md5($string . $key), 0, 8) . $string; + $string_length = strlen($string); + $rndkey = $box = array(); + $result = ''; + for ($i = 0; $i <= 255; $i++) { + $rndkey[$i] = ord($key[$i % $key_length]); + $box[$i] = $i; + } + for ($j = $i = 0; $i < 256; $i++) { + $j = ($j + $box[$i] + $rndkey[$i]) % 256; + $tmp = $box[$i]; + $box[$i] = $box[$j]; + $box[$j] = $tmp; + } + for ($a = $j = $i = 0; $i < $string_length; $i++) { + $a = ($a + 1) % 256; + $j = ($j + $box[$a]) % 256; + $tmp = $box[$a]; + $box[$a] = $box[$j]; + $box[$j] = $tmp; + $result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % + 256])); + } + return str_replace('=', '', base64_encode($result)); + } } diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php index 0e57977e..c5b34d55 100644 --- a/api/controllers/wxapp/licheb/Customers.php +++ b/api/controllers/wxapp/licheb/Customers.php @@ -1246,7 +1246,7 @@ class Customers extends Wxapp if ($visit == 1) {//客户回访记录 $status = intval($params['status']); $t_day = date('Y-m-d'); - $where = array('a.biz_id' => $this->biz_id, 'a.cs_biz_id<>' => -1, 'a.status in(0,1)' => null, 'b.t_day' => $t_day); + $where = array('a.biz_id' => $this->biz_id, 'a.status in(0,1)' => null); $params['level'] && $where['a.level'] = $params['level'];//等级 $params['admin_id'] && $where['a.admin_id'] = $params['admin_id'];//等级 if ($status == 2) {//已跟进