提现发送短信
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: your name
|
* @Author: your name
|
||||||
* @Date: 2020-10-10 13:58:14
|
* @Date: 2020-10-10 13:58:14
|
||||||
* @LastEditTime: 2020-10-21 20:47:18
|
* @LastEditTime: 2023-07-28 18:49:53
|
||||||
* @LastEditors: kangkang
|
* @LastEditors: “wanyongkang” “937888580@qq.com”
|
||||||
* @Description: In User Settings Edit
|
* @Description: In User Settings Edit
|
||||||
* @FilePath: /phptest/app/order/controller/Index.php
|
* @FilePath: /phptest/app/order/controller/Index.php
|
||||||
*/
|
*/
|
||||||
@@ -14,6 +14,9 @@ use app\order\model\CashOut as CashMoedl;
|
|||||||
use app\order\model\User as UserModel;
|
use app\order\model\User as UserModel;
|
||||||
use app\order\model\UserScore as ScoreModel;
|
use app\order\model\UserScore as ScoreModel;
|
||||||
use fastphp\base\Controller;
|
use fastphp\base\Controller;
|
||||||
|
use extend\alisms\Sms;
|
||||||
|
use app\manager\model\Manager;
|
||||||
|
use app\user\model\manager as ModelManager;
|
||||||
|
|
||||||
class CashOutIndex extends Controller
|
class CashOutIndex extends Controller
|
||||||
{
|
{
|
||||||
@@ -29,7 +32,8 @@ class CashOutIndex extends Controller
|
|||||||
$data['alipay_account'] = $post['alipay_account'];
|
$data['alipay_account'] = $post['alipay_account'];
|
||||||
$data['real_name'] = $post['real_name'];
|
$data['real_name'] = $post['real_name'];
|
||||||
$user = new UserModel;
|
$user = new UserModel;
|
||||||
$user_rest = $user->getOne(['id'=>$data['userid']],'RestAmount')['RestAmount'];
|
$user_one_info = $user->getOne(['id'=>$data['userid']],'RestAmount,ManagerId');
|
||||||
|
$user_rest = $user_one_info['RestAmount'];
|
||||||
$rest = $user_rest - abs($post['cash_out_money']);
|
$rest = $user_rest - abs($post['cash_out_money']);
|
||||||
|
|
||||||
if($data['money']<=0){
|
if($data['money']<=0){
|
||||||
@@ -60,6 +64,13 @@ class CashOutIndex extends Controller
|
|||||||
$score->add($score_data);
|
$score->add($score_data);
|
||||||
}
|
}
|
||||||
echo json_encode(['Code'=>10000,]);
|
echo json_encode(['Code'=>10000,]);
|
||||||
|
|
||||||
|
$alisms = new Sms;
|
||||||
|
$manager_model = new ModelManager;
|
||||||
|
$manager_info = $manager_model->getOne(['id' => $user_one_info['ManagerId']]);
|
||||||
|
if ($manager_info['RoleId'] == 100) {
|
||||||
|
$alisms::sendToCashout($manager_info['Phone'], ['name'=>$manager_info['RealName'],'phone'=>$data['username']]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取记录
|
//获取记录
|
||||||
|
|||||||
@@ -53,4 +53,31 @@ class Sms
|
|||||||
return ['code' => 1];
|
return ['code' => 1];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string[] $args
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function sendToCashout($phone,$data){
|
||||||
|
$client = self::createClient("LTAI4FmSkDSwFuXeLxsDB3jB", "r8FfRmoeWcCJyZSqqkQP2G3dKPPl2N");
|
||||||
|
$sendSmsRequest = new SendSmsRequest([
|
||||||
|
"phoneNumbers" => $phone,
|
||||||
|
"signName" => "聚IP",
|
||||||
|
"templateCode" => "SMS_462280213",
|
||||||
|
"templateParam" => json_encode($data)
|
||||||
|
]);
|
||||||
|
// 复制代码运行请自行打印 API 的返回值
|
||||||
|
$sendResp = $client->sendSms($sendSmsRequest);
|
||||||
|
$code = $sendResp->body->code;
|
||||||
|
if (!Utils::equalString($code, "OK")) {
|
||||||
|
$return_info = [
|
||||||
|
'code' => 0,
|
||||||
|
'msg' => $sendResp->body->message
|
||||||
|
];
|
||||||
|
return $return_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ['code' => 1];
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user