feat: sku

This commit is contained in:
2025-01-10 17:20:00 +08:00
parent 09d9bfaf7e
commit 988c690f6f
4 changed files with 69 additions and 0 deletions

View File

@@ -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');
}
}