Yin Bin 4 maanden geleden
bovenliggende
commit
8bb4a07aa4
4 gewijzigde bestanden met toevoegingen van 14 en 35 verwijderingen
  1. 0 20
      .zshrc
  2. 9 5
      _ide_helper_models.php
  3. 4 9
      app/Services/Coach/WalletService.php
  4. 1 1
      script/bin/mydoc

+ 0 - 20
.zshrc

@@ -1,21 +1 @@
-export ZSH="$HOME/.oh-my-zsh"
-export LANG=en_US.UTF-8
-# 禁用 csh 兼容模式
-unsetopt CSH_JUNKIE_QUOTES
-unsetopt CSH_JUNKIE_LOOPS
-unsetopt CSH_NULLCMD
-
-# 禁用系统级 zshrc
-setopt no_global_rcs
-
-# Oh My Zsh 设置
-ZSH_THEME="robbyrussell"  # 使用稳定主题
-DISABLE_AUTO_UPDATE="true"
-DISABLE_MAGIC_FUNCTIONS="true"
-DISABLE_AUTO_TITLE="true"
-ENABLE_CORRECTION="false"
-
-# 加载 Oh My Zsh
-source $ZSH/oh-my-zsh.sh
-
 export PATH="$PATH:./script/bin:./script/ansible/bin"

+ 9 - 5
_ide_helper_models.php

@@ -1742,16 +1742,17 @@ namespace App\Models{
  * @property int $trans_type 交易类型(income:收入 expense:支出)
  * @property string $storage_type 存储类型(balance:余额 recharge:充值)
  * @property string $amount 交易金额
- * @property string $before_balance 交易前余额
- * @property string $after_balance 交易后余额
- * @property string $before_recharge_balance 交易前充值余额
- * @property string $after_recharge_balance 交易后充值余额
- * @property string $trans_time 交易时间
+ * @property string|null $before_balance 交易前余额
+ * @property string|null $after_balance 交易后余额
+ * @property string|null $before_recharge_balance 交易前充值余额
+ * @property string|null $after_recharge_balance 交易后充值余额
+ * @property string|null $trans_time 交易时间
  * @property string|null $remark 备注
  * @property string $state 交易状态(processing:进行中 success:成功 fail:失败 cancel:取消)
  * @property string|null $province 省份
  * @property string|null $city 城市
  * @property string|null $district 地区
+ * @property string|null $trans_no 交易单号
  * @property \Illuminate\Support\Carbon|null $created_at
  * @property \Illuminate\Support\Carbon|null $updated_at
  * @property \Illuminate\Support\Carbon|null $deleted_at
@@ -1782,6 +1783,7 @@ namespace App\Models{
  * @method static \Illuminate\Database\Eloquent\Builder<static>|WalletTransRecord whereRole($value)
  * @method static \Illuminate\Database\Eloquent\Builder<static>|WalletTransRecord whereState($value)
  * @method static \Illuminate\Database\Eloquent\Builder<static>|WalletTransRecord whereStorageType($value)
+ * @method static \Illuminate\Database\Eloquent\Builder<static>|WalletTransRecord whereTransNo($value)
  * @method static \Illuminate\Database\Eloquent\Builder<static>|WalletTransRecord whereTransTime($value)
  * @method static \Illuminate\Database\Eloquent\Builder<static>|WalletTransRecord whereTransType($value)
  * @method static \Illuminate\Database\Eloquent\Builder<static>|WalletTransRecord whereUpdatedAt($value)
@@ -1811,6 +1813,7 @@ namespace App\Models{
  * @property string|null $audit_time 审核时间
  * @property string|null $audit_remark 审核回执
  * @property string $audit_state 审核状态
+ * @property string|null $trans_no 交易单号
  * @property int $state 状态
  * @property \Illuminate\Support\Carbon|null $created_at
  * @property \Illuminate\Support\Carbon|null $updated_at
@@ -1834,6 +1837,7 @@ namespace App\Models{
  * @method static \Illuminate\Database\Eloquent\Builder<static>|WalletWithdrawRecord whereId($value)
  * @method static \Illuminate\Database\Eloquent\Builder<static>|WalletWithdrawRecord whereRemark($value)
  * @method static \Illuminate\Database\Eloquent\Builder<static>|WalletWithdrawRecord whereState($value)
+ * @method static \Illuminate\Database\Eloquent\Builder<static>|WalletWithdrawRecord whereTransNo($value)
  * @method static \Illuminate\Database\Eloquent\Builder<static>|WalletWithdrawRecord whereUpdatedAt($value)
  * @method static \Illuminate\Database\Eloquent\Builder<static>|WalletWithdrawRecord whereWalletId($value)
  * @method static \Illuminate\Database\Eloquent\Builder<static>|WalletWithdrawRecord whereWithdrawAccount($value)

+ 4 - 9
app/Services/Coach/WalletService.php

@@ -39,7 +39,6 @@ class WalletService
                 'month_income' => number_format($statistics['month_income'], 2, '.', ''), // 本月收入
                 'last_month_income' => number_format($statistics['last_month_income'], 2, '.', ''), // 上月收入
             ];
-
         } catch (\Exception $e) {
             Log::error('获取技师钱包信息失败', [
                 'user_id' => $userId,
@@ -152,7 +151,6 @@ class WalletService
                 'total' => $records->total(),
                 'summary' => $summary,
             ];
-
         } catch (\Exception $e) {
             Log::error('获取钱包流水记录失败', [
                 'user_id' => $userId,
@@ -194,7 +192,7 @@ class WalletService
                 abort_if($amount > $wallet->available_balance, 422, '可提现余额不足');
 
                 // 生成交易流水号
-                $transNo = 'W'.date('YmdHis').mt_rand(1000, 9999);
+                $transNo = 'W' . date('YmdHis') . mt_rand(1000, 9999);
 
                 // 创建提现记录
                 $withdraw = WalletWithdrawRecord::create([
@@ -241,7 +239,6 @@ class WalletService
                     'amount' => number_format($amount, 2, '.', ''),
                     'state' => '处理中',
                 ];
-
             } catch (\Exception $e) {
                 \Log::error('技师提现申请失败', [
                     'user_id' => $userId,
@@ -304,16 +301,15 @@ class WalletService
         try {
             // 计算总收入和总支出
             $totals = WalletTransRecord::where('wallet_id', $walletId)
-                ->selectRaw('
+                ->selectRaw(expression: '
                     SUM(CASE WHEN amount > 0 THEN amount ELSE 0 END) as total_income,
                     ABS(SUM(CASE WHEN amount < 0 THEN amount ELSE 0 END)) as total_withdraw
-                ')
-                ->first();
+                ')->first();
 
             // 计算今日收入
             $todayIncome = WalletTransRecord::where('wallet_id', $walletId)
                 ->where('amount', '>', 0)
-                ->whereDate('created_at', today())
+                ->whereDate('created_at', operator: today())
                 ->sum('amount');
 
             // 计算本月收入
@@ -337,7 +333,6 @@ class WalletService
                 'month_income' => $monthIncome,
                 'last_month_income' => $lastMonthIncome,
             ];
-
         } catch (\Exception $e) {
             Log::error('获取钱包统计信息失败', [
                 'wallet_id' => $walletId,

+ 1 - 1
script/bin/mydoc

@@ -9,4 +9,4 @@ if ! command -v http-server &> /dev/null; then
 fi
 
 # 启动 http-server
-http-server
+http-server -p 9000