Forráskód Böngészése

修复农贸市场系统模型fillable属性和updated_at字段问题

- 为MexWarehouse模型添加fillable属性
- 为MexAdminOperation模型添加fillable属性和禁用updated_at字段
- 测试验证农贸市场系统基础功能正常运行
- 管理员注入功能、仓库统计功能、成交记录功能均正常
AI Assistant 6 hónapja
szülő
commit
55e75258fb

+ 1 - 0
app/Module/Mex/Commands/MexUserBuyItemMatchCommand.php

@@ -10,6 +10,7 @@ use Illuminate\Support\Facades\Log;
  * 用户买入物品撮合计划任务
  *
  * 定时执行用户买入物品撮合任务,处理待撮合的用户买入物品订单
+ * php artisan mex:user-buy-item-match
  */
 class MexUserBuyItemMatchCommand extends \UCore\Command\Command
 {

+ 1 - 0
app/Module/Mex/Commands/MexUserSellItemMatchCommand.php

@@ -11,6 +11,7 @@ use UCore\Command\Command;
  * 用户卖出物品撮合计划任务
  *
  * 定时执行用户卖出物品撮合任务,处理待撮合的用户卖出物品订单
+ * php artisan mex:user-sell-item-match
  */
 class MexUserSellItemMatchCommand extends Command
 {

+ 15 - 2
app/Module/Mex/Models/MexAdminOperation.php

@@ -27,8 +27,21 @@ class MexAdminOperation extends ModelCore
 {
     protected $table = 'mex_admin_operations';
 
-
-
+    // 禁用updated_at字段的自动管理,因为表中只有created_at字段
+    public const UPDATED_AT = null;
+
+    protected $fillable = [
+        'admin_user_id',
+        'operation_type',
+        'item_id',
+        'quantity',
+        'price',
+        'total_amount',
+        'before_warehouse_quantity',
+        'after_warehouse_quantity',
+        'transaction_id',
+        'remark',
+    ];
 
     protected $casts = [
         'admin_user_id' => 'integer',

+ 9 - 1
app/Module/Mex/Models/MexWarehouse.php

@@ -24,7 +24,15 @@ class MexWarehouse extends ModelCore
 {
     protected $table = 'mex_warehouse';
 
-
+    protected $fillable = [
+        'item_id',
+        'quantity',
+        'total_buy_amount',
+        'total_sell_amount',
+        'total_buy_quantity',
+        'total_sell_quantity',
+        'last_transaction_at',
+    ];
 
     protected $casts = [
         'item_id' => 'integer',