|
|
|
@ -16,6 +16,7 @@ use common\models\NetworkPhoneAssignT; |
|
|
|
|
use common\models\NetworkPhoneSubT; |
|
|
|
|
use common\models\NetworkPhoneT; |
|
|
|
|
|
|
|
|
|
use GuzzleHttp\Client; |
|
|
|
|
use Yii; |
|
|
|
|
use yii\console\Request; |
|
|
|
|
use yii\web\Response; |
|
|
|
@ -723,11 +724,30 @@ class PhoneController extends \yii\web\Controller |
|
|
|
|
$phone = $request->get('phone',''); |
|
|
|
|
$user_id = $request->get('user_id',0); |
|
|
|
|
|
|
|
|
|
//检查通话剩余分钟 |
|
|
|
|
$url = Yii::$app->params['userPanel']['myinfo_url']; |
|
|
|
|
$token = Yii::$app->params['userPanel']['token']; |
|
|
|
|
|
|
|
|
|
$client = new Client(); |
|
|
|
|
$res = $client->request('GET', $url.'?token='.$token); |
|
|
|
|
$phone_time = 0; |
|
|
|
|
if($res->getStatusCode() == 200) { |
|
|
|
|
$obj = json_decode($res->getBody(), true); |
|
|
|
|
if($obj['code'] == 400) { |
|
|
|
|
$result['msg'] = $obj['msg']; |
|
|
|
|
return $result; |
|
|
|
|
} |
|
|
|
|
$phone_time = intval($obj['data']['phone_time']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if($phone_time <= 0) { |
|
|
|
|
$result['msg'] = '电话剩余话费不足,请联系管理员充值'; |
|
|
|
|
return $result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$headers = array( |
|
|
|
|
"Content-Type: application/json;charset=UTF-8", |
|
|
|
|
"Accept:application/json", |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
$uri = "http://api.1ketong.com/ykt-pool/number/ax2/call_out"; |
|
|
|
|
$app_key = '0946239060682011'; |
|
|
|
|