'全部', self::Popular => '热销支付', self::Payment => '转让支付', self::Receive => '转让收款', self::Recharge => '充值', self::Withdraw => '提现', self::Share => '分享', ]; /** * 更新钱包余额并添加账变记录 * @param int $uid 用户ID * @param string $asset 资产类型 * @param string $amount 金额 正:表示加 负:表示减 * @param int $action 账变类型 * @return void * @throws Exception */ public static function changeWalletAccount(int $uid, int $type_id, string $amount, int $before, string $after, int $from_id, string $action = '+') { // 更新钱包余额 UserModel::updateForRBalance($uid, $amount, $action); // 创建账变记录 $insertRs = self::create([ 'user_id' => $uid, 'from_id' => $from_id, 'type_id' => $type_id, 'amount' => $amount, 'before' => $before, 'after' => $after, 'action' => $action ]); if (empty($insertRs)) return false; } }