panlumeng 2 years ago
parent
commit
e0f313d81a
1 changed files with 5 additions and 1 deletions
  1. 5 1
      app/admin/controller/Cat.php

+ 5 - 1
app/admin/controller/Cat.php

@@ -3,6 +3,7 @@
 namespace app\admin\controller;
 
 use app\admin\model\ActionLog;
+use app\admin\model\ChangeLog;
 use app\BaseController;
 use think\App;
 use think\facade\Db;
@@ -341,10 +342,13 @@ public function edit(){
             "search"=>$search
         ];
         $strinfo = Db::name('cat')->where(['id'=>$id])->save($str);
+        $temp = array_diff($str,$idinfo);
+        $json = json_encode($temp,JSON_UNESCAPED_UNICODE);
+        $jsp = json_encode($idinfo,JSON_UNESCAPED_UNICODE);
         if($strinfo){
             $order = ["order_code"=>$id,"status"=>$status,"action_remark"=>'',"action_type"=>"edit"];
             ActionLog::logAdd($this->post['token'],$order,"sxd",$status,$order);
-
+            ChangeLog::logAdd(7,$idinfo['id'],$jsp,$json,$this->post['token'],$this->post);
             $spc =[];
             $vp = Db::name('cat_spec')->where(['cat_id'=>$idinfo['id'],'is_del'=>0])->find();
           $str ="";