|
|
@@ -74,12 +74,14 @@ class LedgerWalletModel extends Model
|
|
|
* @param string $asset 资产类型
|
|
|
* @param string $amount 金额 正:表示加 负:表示减
|
|
|
* @param int $action 账变类型
|
|
|
+ * @param bool $team_level 层级账变
|
|
|
* @return void
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
- public function changeWalletAccount(int $uid, string $asset, string $amount, int $action, int $from_id = 0)
|
|
|
+ public function changeWalletAccount(int $uid, string $asset, string $amount, int $action, int $from_id = 0, bool $team_level = false)
|
|
|
{
|
|
|
$available = $this->getWallet($uid);
|
|
|
+ if($team_level && empty($available['team_level_id'])) return;
|
|
|
if (empty($available)) (new LedgerWalletModel())->insertGetId(['user_id' => $uid]); // 创建钱包
|
|
|
// 账变资产模型
|
|
|
switch ($asset) {
|