| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace app\workerapi\logic;
- use app\common\enum\notice\NoticeEnum;
- use app\common\logic\BaseLogic;
- use app\common\model\master_worker_register\MasterWorkerRegister;
- use app\common\service\sms\SmsDriver;
- /**
- * @author 林海涛
- * @date ${DATA}
- */
- class LoginLogic extends BaseLogic
- {
- /**
- * @notes 确认手机号
- * @param $params
- * @return bool
- * @author 段誉
- * @date 2022/9/21 17:28
- */
- public static function confirmMobile(array $params)
- {
- try {
- // 变更手机号场景
- $sceneId = NoticeEnum::OTHER_CAPTCHA;
- // 校验短信
- // $checkSmsCode = (new SmsDriver())->verify($params['mobile'], $params['code'], $sceneId);
- // if (!$checkSmsCode) {
- // throw new \Exception('验证码错误');
- // }
- return true;
- } catch (\Exception $e) {
- self::setError($e->getMessage());
- return false;
- }
- }
- public static function register(array $params)
- {
- try {
- MasterWorkerRegister::create([
- 'maintain_exp_type' => $params['maintain_exp_type'],
- 'other_exp_type' => $params['other_exp_type'],
- 'city' => $params['city'],
- 'vehicle_type' => $params['vehicle_type'],
- 'name' => $params['name'],
- 'age' => $params['age'],
- 'mobile' => $params['mobile'],
- ]);
- return true;
- } catch (\Exception $e) {
- self::setError($e->getMessage());
- return false;
- }
- }
- }
|