diff --git a/admin/controllers/base/DivideAccountController.php b/admin/controllers/base/DivideAccountController.php index 36f98e7..177cdb0 100644 --- a/admin/controllers/base/DivideAccountController.php +++ b/admin/controllers/base/DivideAccountController.php @@ -336,7 +336,7 @@ class DivideAccountController extends BaseAdminController throw new \yii\db\Exception('银行卡相关配置不能为空'); } - $sendPrice = $CashApply->user_id == 0? bcadd($CashApply->true_cash, 1, 2): bcadd($CashApply->true_cash, 0, 2); + $sendPrice = $CashApply->user_id == 0? bcadd($CashApply->true_cash, 0, 2): bcadd($CashApply->true_cash, 1, 2); // 准备打款参数 $param = [ diff --git a/admin/foundation/JsonResponseFormatter.php b/admin/foundation/JsonResponseFormatter.php index 1249800..e4901ca 100644 --- a/admin/foundation/JsonResponseFormatter.php +++ b/admin/foundation/JsonResponseFormatter.php @@ -27,6 +27,9 @@ class JsonResponseFormatter extends \yii\web\JsonResponseFormatter 'express_name', 'express_region', 'doctor', + 'accept_tel', + 'patient', + 'patient_mobile' ]; private $defaultErrorCode = -1; @@ -46,19 +49,21 @@ class JsonResponseFormatter extends \yii\web\JsonResponseFormatter return $result; } - private static function aseEncode($data) { - if (is_array($data)) { - foreach ($data as $key => &$value) { - if (is_array($value)) { - $value = self::aseEncode($value); // 递归处理子数组 - } else { - if (in_array($key, self::$arr)) { - $value = ase_encode($value); // 加密指定键值 - } - } - } - } + private static function aseEncode($data) + { return $data; +// if (is_array($data)) { +// foreach ($data as $key => &$value) { +// if (is_array($value)) { +// $value = self::aseEncode($value); // 递归处理子数组 +// } else { +// if (in_array($key, self::$arr)) { +// $value = ase_encode($value); // 加密指定键值 +// } +// } +// } +// } +// return $data; } public $encrypt = true; //是不加密 @@ -69,8 +74,6 @@ class JsonResponseFormatter extends \yii\web\JsonResponseFormatter */ protected function formatJson($response) { - //$response->getHeaders()->set('Content-Type', 'text/plain; charset=UTF-8'); - //$response->getHeaders()->set("Access-Control-Allow-Origin","*"); if ($response->data !== null) { $options = $this->encodeOptions; if ($this->prettyPrint) { @@ -98,22 +101,7 @@ class JsonResponseFormatter extends \yii\web\JsonResponseFormatter } $response->data = self::formatData($data, $errcode, $msg); - // var_dump($response->data);exit; - // if(!$response->isSuccessful){ - // $response->statusCode = 200; - // if($response->data['code']>20000) - // $code = $response->data['code']; - // else - // $code = ErrorCode::APP_EXCEPTION; - // $redirect = ''; - // $response->data = BController::ApiResponse([],$response->data['message'],$code,$redirect); - // } - // if(isset(Yii::$app->params['response_encrpyt']) && Yii::$app->params['response_encrpyt']){ - // $encryption = new MCrypt(); - // $response->content = $encryption->encrypt(Json::encode($response->data, $options)); - // }else{ $response->content = Json::encode($response->data, $options); - // } } } @@ -132,19 +120,7 @@ class JsonResponseFormatter extends \yii\web\JsonResponseFormatter } if (!$response->isSuccessful) { $response->statusCode = 200; - if ($response->data['code'] > 20000) - $code = $response->data['code']; - else - $code = $this->defaultErrorCode; - $redirect = ''; - // $response->data = BController::ApiResponse([],$response->data['message'],$code,$redirect); } - // if(isset(Yii::$app->params['response_encrpyt']) && Yii::$app->params['response_encrpyt']){ - // $encryption = new MCrypt(); - // $response->content = $encryption->encrypt(Json::encode($response->data, $options)); - // }else{ - // $response->content = Json::encode($response->data, $options); - // } } $response->data = ['data' => $response->data, 'callback' => Yii::$app->getRequest()->get('callback')];