add-wuliu-api
This commit is contained in:
@@ -49,4 +49,19 @@ class Pdfapi extends CI_Controller {
|
||||
die(json_encode($res,JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
}
|
||||
|
||||
//获取物流信息
|
||||
public function get_wuliu(){
|
||||
$sign_str = "dzwl145Afe";
|
||||
$this->load->library('AliWuliu');
|
||||
$no = $this->input->get('no');
|
||||
$type = $this->input->get('type');
|
||||
$sign = $this->input->get('sign');
|
||||
if(!$no || $sign!=md5($sign_str)){
|
||||
$res = ["code"=>0,"msg"=>"参数错误"];
|
||||
die(json_encode($res,JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
$res = $this->aliwuliu->kdi($no, $type);
|
||||
echo json_encode($res,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,36 +639,41 @@ class Syt extends CI_Controller
|
||||
if($rows){
|
||||
$count = $this->market_sylive_order_model->count($where);
|
||||
foreach ($rows as $key => $order) {
|
||||
$re_kpi = $this->mdSytActivityKpiData->count(array("activityId" => $order['activityId'], 'tagId' => $order['id'], 'kpi' => 'order'));
|
||||
if($re_kpi){ //kpi存在
|
||||
$res = "订单kpi数据已存在";
|
||||
}else{
|
||||
//增加记录
|
||||
$addData = [
|
||||
'activityId' => $order['activityId'],
|
||||
'userId' => $order['userId'],
|
||||
'cfUserId' => $order['cfUserId'],
|
||||
'kpi' => 'order',
|
||||
];
|
||||
$addData['createTime'] = strtotime($order['createTime']);
|
||||
$addData['updateTime'] = date('Y-m-d H:i:s',$addData['createTime']);
|
||||
$addData['day'] = date('Y-m-d',$addData['createTime']);
|
||||
$addData['bizId'] = $order['bizId'];
|
||||
$addData['levelId1'] = $order['levelId1'];
|
||||
$addData['levelId2'] = $order['levelId2'];
|
||||
$addData['levelId3'] = $order['levelId3'];
|
||||
$addData['tagId'] = $order['id'];
|
||||
$addData['itemId'] = $order['itemId'];
|
||||
$jsondata = ['order_id'=>$order['id'],'sid'=>$order['sid']];
|
||||
$addData['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
|
||||
$id = $this->mdSytActivityKpiData->add($addData);
|
||||
if (!$id) {
|
||||
$res = "添加记录失败";
|
||||
if($order['cfUserId']){
|
||||
$re_kpi = $this->mdSytActivityKpiData->count(array("activityId" => $order['activityId'], 'tagId' => $order['id'], 'kpi' => 'order'));
|
||||
if($re_kpi){ //kpi存在
|
||||
$res = "订单kpi数据已存在";
|
||||
}else{
|
||||
$this->sylive2_entity->kpi_count($order['activityId'],"order",$order["cfUserId"]);
|
||||
$res = "添加记录成功";
|
||||
//增加记录
|
||||
$addData = [
|
||||
'activityId' => $order['activityId'],
|
||||
'userId' => $order['userId'],
|
||||
'cfUserId' => $order['cfUserId'],
|
||||
'kpi' => 'order',
|
||||
];
|
||||
$addData['createTime'] = strtotime($order['createTime']);
|
||||
$addData['updateTime'] = date('Y-m-d H:i:s',$addData['createTime']);
|
||||
$addData['day'] = date('Y-m-d',$addData['createTime']);
|
||||
$addData['bizId'] = $order['bizId'];
|
||||
$addData['levelId1'] = $order['levelId1'];
|
||||
$addData['levelId2'] = $order['levelId2'];
|
||||
$addData['levelId3'] = $order['levelId3'];
|
||||
$addData['tagId'] = $order['id'];
|
||||
$addData['itemId'] = $order['itemId'];
|
||||
$jsondata = ['order_id'=>$order['id'],'sid'=>$order['sid']];
|
||||
$addData['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
|
||||
$id = $this->mdSytActivityKpiData->add($addData);
|
||||
if (!$id) {
|
||||
$res = "添加记录失败";
|
||||
}else{
|
||||
$this->sylive2_entity->kpi_count($order['activityId'],"order",$order["cfUserId"]);
|
||||
$res = "添加记录成功";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$res = "无需添加cfUserId=0";
|
||||
}
|
||||
|
||||
echo "订单id-{$order['id']},kpi结果:{$res}<br>\n";
|
||||
}
|
||||
echo "剩余:".($count-$size*$page);
|
||||
|
||||
Reference in New Issue
Block a user