feat: sku
This commit is contained in:
31
app/Model/UserAccount.php
Normal file
31
app/Model/UserAccount.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Model;
|
||||||
|
|
||||||
|
use Hyperf\DbConnection\Model\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $id
|
||||||
|
* @property int $user_id
|
||||||
|
* @property string $balance
|
||||||
|
* @property string $integral
|
||||||
|
*/
|
||||||
|
class UserAccount extends Model
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The table associated with the model.
|
||||||
|
*/
|
||||||
|
protected ?string $table = 'user_account';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that are mass assignable.
|
||||||
|
*/
|
||||||
|
protected array $fillable = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that should be cast to native types.
|
||||||
|
*/
|
||||||
|
protected array $casts = ['id' => 'integer', 'user_id' => 'integer'];
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@ namespace App\Service\Api\Login;
|
|||||||
|
|
||||||
use App\Constants\Common\ThirdCode;
|
use App\Constants\Common\ThirdCode;
|
||||||
use App\Exception\ErrException;
|
use App\Exception\ErrException;
|
||||||
|
use App\Model\UserAccount;
|
||||||
use App\Model\UserThird;
|
use App\Model\UserThird;
|
||||||
use App\Service\ServiceTrait\Api\WxMiniTrait;
|
use App\Service\ServiceTrait\Api\WxMiniTrait;
|
||||||
use Hyperf\DbConnection\Db;
|
use Hyperf\DbConnection\Db;
|
||||||
@@ -74,6 +75,8 @@ class WxFastLoginService extends LoginBaseService
|
|||||||
|
|
||||||
$this->addUserThird();
|
$this->addUserThird();
|
||||||
|
|
||||||
|
$this->addAccount();
|
||||||
|
|
||||||
//todo 要不要生成邀请码 有没有注册奖励
|
//todo 要不要生成邀请码 有没有注册奖励
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -92,4 +95,19 @@ class WxFastLoginService extends LoginBaseService
|
|||||||
|
|
||||||
if (!$model->save()) throw new ErrException('注册失败-00001');
|
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');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -106,6 +106,7 @@ class OssCallbackService
|
|||||||
'avatar',
|
'avatar',
|
||||||
'menu',
|
'menu',
|
||||||
'site',
|
'site',
|
||||||
|
'category',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
19
app/Service/Common/Pay/ThirdPayInterface.php
Normal file
19
app/Service/Common/Pay/ThirdPayInterface.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This service file is part of item.
|
||||||
|
*
|
||||||
|
* @author ctexthuang
|
||||||
|
* @contact ctexthuang@qq.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Service\Common\Pay;
|
||||||
|
|
||||||
|
class ThirdPayInterface extends
|
||||||
|
{
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
//todo Write logic
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user