|
@@ -2,7 +2,9 @@
|
|
|
|
|
|
|
|
namespace app\api\controller\user;
|
|
namespace app\api\controller\user;
|
|
|
|
|
|
|
|
|
|
+use app\admin\model\sms\SmsRecord;
|
|
|
use app\admin\model\system\SystemConfig;
|
|
use app\admin\model\system\SystemConfig;
|
|
|
|
|
+use app\api\controller\ZjSMSServerService;
|
|
|
use app\models\store\StoreOrder;
|
|
use app\models\store\StoreOrder;
|
|
|
use app\models\user\UserBill;
|
|
use app\models\user\UserBill;
|
|
|
use app\models\user\UserExtract;
|
|
use app\models\user\UserExtract;
|
|
@@ -99,9 +101,39 @@ class UserExtractController
|
|
|
if (!preg_match('/^([1-9]{1})(\d{14}|\d{18})$/', $extractInfo['cardnum']))
|
|
if (!preg_match('/^([1-9]{1})(\d{14}|\d{18})$/', $extractInfo['cardnum']))
|
|
|
return app('json')->fail('银行卡号输入有误');
|
|
return app('json')->fail('银行卡号输入有误');
|
|
|
cache($request->uid(), 1, 5);
|
|
cache($request->uid(), 1, 5);
|
|
|
- if (UserExtract::userExtract($request->user(), $extractInfo))
|
|
|
|
|
|
|
+ if (UserExtract::userExtract($request->user(), $extractInfo)){
|
|
|
|
|
+ $this->NewSmsSend('13905801201', ['code' => $user['uid']], '');
|
|
|
return app('json')->successful('申请提现成功!');
|
|
return app('json')->successful('申请提现成功!');
|
|
|
- else
|
|
|
|
|
|
|
+ } else
|
|
|
return app('json')->fail(UserExtract::getErrorInfo('提现失败'));
|
|
return app('json')->fail(UserExtract::getErrorInfo('提现失败'));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 发送短信
|
|
|
|
|
+ * @param string $phone 手机号码
|
|
|
|
|
+ * @param array $data 模板替换内容
|
|
|
|
|
+ * @param string $template 模板编号
|
|
|
|
|
+ * @return bool|string
|
|
|
|
|
+ * @throws DataNotFoundException
|
|
|
|
|
+ * @throws ModelNotFoundException
|
|
|
|
|
+ */
|
|
|
|
|
+ public function NewSmsSend(string $phone, array $data, string $template)
|
|
|
|
|
+ {
|
|
|
|
|
+ try {
|
|
|
|
|
+ $res = ZjSMSServerService::send($phone, $data, $template);
|
|
|
|
|
+// var_dump($res);
|
|
|
|
|
+// exit;
|
|
|
|
|
+ if ($res['status'] != '200') {
|
|
|
|
|
+ return $res['msg'];
|
|
|
|
|
+ } else {
|
|
|
|
|
+ SmsRecord::sendRecord($phone, $data['code'], $template, '');
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ } catch (Exception $exception) {
|
|
|
|
|
+// Log::info($exception->getMessage());
|
|
|
|
|
+ return $exception->getMessage();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|