xieruidong 2 年之前
父节点
当前提交
5725c6ed06
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 2 1
      application/common/model/Category.php
  2. 1 1
      application/common/model/OrderInfo.php

+ 2 - 1
application/common/model/Category.php

@@ -4,13 +4,14 @@ namespace app\common\model;
 
 
 use app\common\service\InstallService;
 use app\common\service\InstallService;
 use think\Model;
 use think\Model;
+use traits\model\SoftDelete;
 
 
 /**
 /**
  * 分类模型
  * 分类模型
  */
  */
 class Category extends Model
 class Category extends Model
 {
 {
-
+    use SoftDelete;
     // 开启自动写入时间戳字段
     // 开启自动写入时间戳字段
     protected $autoWriteTimestamp = 'int';
     protected $autoWriteTimestamp = 'int';
     // 定义时间戳字段名
     // 定义时间戳字段名

+ 1 - 1
application/common/model/OrderInfo.php

@@ -53,7 +53,7 @@ class OrderInfo extends Model
         $orderInfo['amount_goods']=$goods['amount_goods'];
         $orderInfo['amount_goods']=$goods['amount_goods'];
         $orderInfo['amount_goods_real']=$goods['amount_goods_real'];
         $orderInfo['amount_goods_real']=$goods['amount_goods_real'];
         $orderInfo['category_id']=$goods['goods']['category_id'];
         $orderInfo['category_id']=$goods['goods']['category_id'];
-        $orderInfo['category_name']=Category::where('id',$orderInfo['category_id'])->value('name');
+        $orderInfo['category_name']=Category::withTrashed()->where('id',$orderInfo['category_id'])->value('name');
         if(!$orderInfo->save()){
         if(!$orderInfo->save()){
             throw_user('保存失败');
             throw_user('保存失败');
         }
         }