From 32f36864c4d1248c213637a01c092a62cce01ae8 Mon Sep 17 00:00:00 2001 From: zengchaoxin Date: Fri, 18 Oct 2019 02:30:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E7=9F=AD=E4=BF=A1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/controllers/CarController.php | 11 ++++++----- frontend/controllers/PhoneController.php | 11 ++--------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/frontend/controllers/CarController.php b/frontend/controllers/CarController.php index f7beb48..545f1b9 100644 --- a/frontend/controllers/CarController.php +++ b/frontend/controllers/CarController.php @@ -4544,7 +4544,8 @@ class CarController extends BaseController $MessageContent = str_replace("\t","",$MessageContent); $url = 'https://sms.yunpian.com/v2/sms/single_send.json'; - $params['apikey'] = '453067dc4b9eb0dc0c448674d79e85aa'; + $url = 'https://www.banmacar.com/api/single_send'; + $params['token'] = '84c5722fd1455582c53b7195ccef44c2'; $params['mobile'] = $UserNumber; $params['text'] = $MessageContent; $post_url = http_build_query($params); @@ -4552,13 +4553,13 @@ class CarController extends BaseController $msg = MyLib::Post($post_url,$url); // $msg = mb_convert_encoding($msg,'UTF8','GBK'); // parse_str($msg,$obj); - $obj = json_decode($msg); + $obj = json_decode($msg,true); $result = array(); // $result['success'] = true; - if($obj->code == 0){ - $result['msg'] = $obj->msg; + if($obj['success']) { + $result['msg'] = $obj['msg']; }else{ - $result['msg'] = $obj->msg.'('.$obj->detail.')'; + $result['msg'] = $obj['msg']; } return $result; } diff --git a/frontend/controllers/PhoneController.php b/frontend/controllers/PhoneController.php index 80e5638..4c3ea26 100644 --- a/frontend/controllers/PhoneController.php +++ b/frontend/controllers/PhoneController.php @@ -248,7 +248,8 @@ class PhoneController extends \yii\web\Controller } } -public function actionPushApi() + + public function actionPushApi() { // header("Content-type: text/html; charset=utf-8"); // Yii::$app->response->format = Response::FORMAT_JSON; @@ -330,13 +331,6 @@ public function actionPushApi() $network_phone->extend=$extend; $network_phone->begin_date=date('Y-m-d'); - - - - - - - $network_phone->is_called=$is_called; $res = $network_phone->save(false); @@ -474,7 +468,6 @@ public function actionPushApi() } - public function actionCallApi() { header("Content-type: application/json;charset=UTF-8");