diff --git a/app/Model/UserAccount.php b/app/Model/UserAccount.php new file mode 100644 index 0000000..d503e58 --- /dev/null +++ b/app/Model/UserAccount.php @@ -0,0 +1,31 @@ + 'integer', 'user_id' => 'integer']; +} diff --git a/app/Service/Api/Login/WxFastLoginService.php b/app/Service/Api/Login/WxFastLoginService.php index 9a0a3c7..2ae06d2 100644 --- a/app/Service/Api/Login/WxFastLoginService.php +++ b/app/Service/Api/Login/WxFastLoginService.php @@ -12,6 +12,7 @@ namespace App\Service\Api\Login; use App\Constants\Common\ThirdCode; use App\Exception\ErrException; +use App\Model\UserAccount; use App\Model\UserThird; use App\Service\ServiceTrait\Api\WxMiniTrait; use Hyperf\DbConnection\Db; @@ -74,6 +75,8 @@ class WxFastLoginService extends LoginBaseService $this->addUserThird(); + $this->addAccount(); + //todo 要不要生成邀请码 有没有注册奖励 }); } @@ -92,4 +95,19 @@ class WxFastLoginService extends LoginBaseService if (!$model->save()) throw new ErrException('注册失败-00001'); } + + /** + * 添加账户 + * @return void + */ + private function addAccount(): void + { + $model = new UserAccount(); + + $model->user_id = $this->userId; + $model->balance = 0; + $model->integral = 0; + + if (!$model->save()) throw new ErrException('注册失败-00002'); + } } \ No newline at end of file diff --git a/app/Service/Common/OssCallbackService.php b/app/Service/Common/OssCallbackService.php index 0874ab1..0ddf1b2 100644 --- a/app/Service/Common/OssCallbackService.php +++ b/app/Service/Common/OssCallbackService.php @@ -106,6 +106,7 @@ class OssCallbackService 'avatar', 'menu', 'site', + 'category', ]; /** diff --git a/app/Service/Common/Pay/ThirdPayInterface.php b/app/Service/Common/Pay/ThirdPayInterface.php new file mode 100644 index 0000000..8165038 --- /dev/null +++ b/app/Service/Common/Pay/ThirdPayInterface.php @@ -0,0 +1,19 @@ +