From 7413ff267168353d5b0426cccd407ad616828978 Mon Sep 17 00:00:00 2001 From: xiaoyu Date: Thu, 18 Jan 2024 17:49:38 +0800 Subject: [PATCH] order --- admin/controllers/hdcloud/Clues.php | 4 +- home/controllers/Welcome.php | 57 ++++++++++++++++++-- home/controllers/h5/market/sylive2/Order.php | 8 +++ home/views/h5/market/sylive2/order/index.php | 1 + 4 files changed, 63 insertions(+), 7 deletions(-) diff --git a/admin/controllers/hdcloud/Clues.php b/admin/controllers/hdcloud/Clues.php index b5d206e5..bc1f1d29 100644 --- a/admin/controllers/hdcloud/Clues.php +++ b/admin/controllers/hdcloud/Clues.php @@ -48,8 +48,8 @@ class Clues extends HD_Controller ), '100690' => array( 'biz' => '龙岩胜华成', - 'sa' => '邱霜霜', - 'mobile' => '18659799369' + 'sa' => '郭晓芬', + 'mobile' => '13600983210' ), '101207' => array( 'biz' => '厦门胜华嘉', diff --git a/home/controllers/Welcome.php b/home/controllers/Welcome.php index 5ab36e9d..b02eb4a1 100644 --- a/home/controllers/Welcome.php +++ b/home/controllers/Welcome.php @@ -16,11 +16,11 @@ class Welcome extends CI_Controller { //测试地址 //$url = 'https://salespp-sit.hozonauto.com/appservice/app/if/salesclue/createSalesclue'; - $name = 'Li668822'; //客户姓名 - $mobile = '18350486789';//客户手机 + $name = '福州客户'; //客户姓名 + $mobile = '13950425509';//客户手机 - $comments = '100690'; //门店编码 - $samobile = '18659799369';//销售手机 + $comments = '100958'; //门店编码 + $samobile = '17758949069';//销售手机 $city_id = '350200'; $voId = $city_id . date('mdHis') . sprintf("%06d", rand(1,999999)); @@ -35,7 +35,7 @@ class Welcome extends CI_Controller { 'saMobile' => $samobile, 'cusType' => '30111001', 'remark' => "", - 'intentModel' => "哪吒X", + 'intentModel' => "哪吒V", ); print_r(json_encode($data,JSON_UNESCAPED_UNICODE)); @@ -63,6 +63,53 @@ class Welcome extends CI_Controller { var_dump($response); } + + public function add_clues() + { + $mobiles = array(''); + + foreach ($mobiles as $k => $v) { + $city_id = '350200'; + $voId = $city_id . date('mdHis') . sprintf("%06d", rand(1,999999)); + + $data[] = array( + 'voId' => $voId, + 'cusSource3' => '023409', + 'customerName' => '客户', + 'dealerCode' => '', + 'fromSystem' => "好店云", + 'mobile' => $v, + 'saMobile' => '', + 'cusType' => '30111001', + 'remark' => "", + 'intentModel' => "哪吒V", + ); + } + + $data = json_encode($data, JSON_UNESCAPED_UNICODE); + + $url = 'https://salesapp.hozonauto.com/appservice/app/if/salesclue/createSalesclue'; + $ch = curl_init(); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + //https + if (strlen($url) > 5 && strtolower(substr($url, 0, 5)) == "https") { + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + } + curl_setopt($ch, CURLOPT_HTTPHEADER, array( + 'Content-Type: application/json; charset=utf-8', + 'Content-Length: ' . strlen($data) + ) + ); + $response = curl_exec($ch); + $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + curl_close($ch); + + var_dump($response); + } } diff --git a/home/controllers/h5/market/sylive2/Order.php b/home/controllers/h5/market/sylive2/Order.php index b01da261..f07b34e8 100644 --- a/home/controllers/h5/market/sylive2/Order.php +++ b/home/controllers/h5/market/sylive2/Order.php @@ -264,6 +264,11 @@ class Order extends Admin if ($user_ids) { $user_rows = $this->user_model->map('userId', '', ["userId in ({$user_ids})" => null], '', 0, 0, 'userId,nickname,headimg'); } + $seller_ids = implode(',', array_unique(array_column($rows, 'cfUserId'))); + $seller_rows = []; + if ($seller_ids) { + $seller_rows = $this->user_model->map('userId', '', ["userId in ({$seller_ids})" => null], '', 0, 0, 'uname'); + } if ($iswin) { $re_draw = $this->mdSyliveActivityDraw->get(['activityId' => $this->a_id]); $winTypeAry = []; @@ -295,8 +300,10 @@ class Order extends Admin $imgs = json_decode($item['imgs'], true); $img = $imgs['banner'][0] ? build_qiniu_image_url($imgs['banner'][0]) : ''; $user = $user_rows[$val['userId']] ? $user_rows[$val['userId']][0] : []; + $seller = $seller_rows[$val['cfUserId']] ? $user_rows[$val['cfUserId']][0] : []; $time = $iswin ? '开奖时间 ' . date('Y.m.d H:i:s', strtotime($val['winTime'])) : '下单时间 ' . date('Y.m.d H:i:s', strtotime($val['createTime'])); $address = $jsondata['address'] ? $jsondata['address']['region'] . ' ' . $jsondata['address']['detail'] : ''; + if ($iswin) { $winTypeItem = $winTypeAry[$val['winType']]; $img = $winTypeItem['img']; @@ -315,6 +322,7 @@ class Order extends Admin 'headimg' => $user['headimg'], 'tel' => $val['mobile'], 'customer_name' => $val['uname'], + 'seller' => $seller['uname'], 'address' => $address, 'grade' => $grade, 'name' => $title, diff --git a/home/views/h5/market/sylive2/order/index.php b/home/views/h5/market/sylive2/order/index.php index 19e0854f..6beb8fd1 100644 --- a/home/views/h5/market/sylive2/order/index.php +++ b/home/views/h5/market/sylive2/order/index.php @@ -42,6 +42,7 @@ {{item.name}}
{{item.time}}
+
{{item.seller}}