wugg 3 years ago
parent
commit
56933916a0
3 changed files with 34 additions and 20 deletions
  1. 14 1
      app/admin/controller/Good.php
  2. 2 2
      app/admin/controller/Log.php
  3. 18 17
      app/admin/model/OrderMsg.php

+ 14 - 1
app/admin/controller/Good.php

@@ -12,7 +12,20 @@ class Good extends \app\BaseController
         private $acton=[
             "allotsend"=>'调拨发货',
             "allotin"=>'调拨入库',
-            "allotincheck"=>'调拨验货'
+            "allotincheck"=>'调拨验货',
+            'CGD'=>'采购单',
+            'BHD'=>'备库单',
+            'FKD'=>'备库反馈单',
+            'RKD'=>'入库单',
+            'ZXQRD'=>'咨询单',
+            'XSQRD'=>'销售单',
+            'PDD'=>'盘点单',
+            'DBD'=>'调拨单',
+            'CKD'=>'出库单',
+            'CGTHD'=>'采购退货单',
+            'XSTHD'=>'销售退货单',
+            'CGGCD'=>'采购工差单',
+            'ZXGCD'=>'咨询工差单'
         ];
         public function __construct(App $app)
         {

+ 2 - 2
app/admin/controller/Log.php

@@ -138,8 +138,8 @@ class Log extends BaseController
             return error_show(1002, "用户数据不存在");
         }
         $rm = isset($apply_id["data"]['id']) ? $apply_id["data"]['id'] : "";
-        if($rm==$info['uid']){
-            Db::name("order_msg")->where(["id"=>$id])->save(["is_read"=>1]);
+        if($rm==$info['uid'] && $info['is_read']==0){
+            Db::name("order_msg")->where(["id"=>$id])->save(["is_read"=>1,"updatetime"=>date("Y-m-d H:i:s")]);
         }
         return app_show(0,"获取成功",$info);
     }

+ 18 - 17
app/admin/model/OrderMsg.php

@@ -11,27 +11,28 @@ use think\Model;
  */
 class OrderMsg extends Model
 {
-    public function addmsg($msg){
+    public static function addmsg($msg){
         $conf=Config::get("order");
         $order_type = $conf['order_type'];
-        $order_status = $conf['order_status'];
-        $content = $order_type[$msg['order_type']].':'.$msg['order_code']."状态由".$msg['name']."修改为"
-            .$order_status[$msg['status']];
-        $mguid =ProcessOrder::Where(["order_type"=>$msg['order_type'],['order_code'=>$msg['order_code']]])->column('action_uid,action_name');
+        $order_status = $conf['order_status'][$msg['order_type']];
+        $content = $order_type[$msg['order_type']].':'.$msg['order_code']."状态由".$msg['action_name']."修改为"
+            .$order_status[$msg['order_status']];
+        $mguid =ProcessOrder::Where(["order_type"=>$msg['order_type'],'order_code'=>$msg['order_code']])->column('action_uid,action_name');
         if(!empty($mguid)){
             $data=[];
-           foreach ($mguid as $value){
-               $temp=[];
-               $temp['content']=$content;
-               $temp['orderCode']=$msg['order_code'];
-               $temp['order_type']=$msg['order_type'];
-               $temp['uid']=$value['action_uid'];
-               $temp['uname']=$value['action_uname'];
-               $temp['is_read']=0;
-               $temp['addtime']=date("Y-m-d H:i:s");
-               $data[]=$temp;
-           }
-            $this->insertAll($data);
+            foreach ($mguid as $value){
+                $temp=[];
+                $temp['content']=$content;
+                $temp['orderCode']=$msg['order_code'];
+                $temp['order_type']=$msg['order_type'];
+                $temp['uid']=$value['action_uid'];
+                $temp['uname']=$value['action_name'];
+                $temp['is_read']=0;
+                $temp['addtime']=date("Y-m-d H:i:s");
+                $temp['updatetime']=date("Y-m-d H:i:s");
+                $data[]=$temp;
+            }
+            self::insertAll($data);
         }
     }
 }