fixed
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {//已跟进
|
||||
|
||||
Reference in New Issue
Block a user