1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- declare (strict_types = 1);
- namespace app\admin\model;
- use think\facade\Config;
- use think\Model;
- /**
- * @mixin \think\Model
- */
- class OrderMsg extends Model
- {
- //每个用户的消息
- public static function addmsg($msg){
- $conf=Config::get("order");
- $order_type = $conf['order_type'];
- $order_status = $conf['order_status'][$msg['order_type']];
- $content = $order_type[$msg['order_type']].':'.$msg['order_code']."状态由".$msg['action_name']."修改为"
- .$order_status[$msg['action_process']];
- $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){
- if($value["action_uid"]==$msg['action_uid']){
- continue;
- }
- $temp=[];
- $temp['content']=$content;
- $temp['orderCode']=$msg['order_code'];
- $temp['order_type']=$msg['order_type'];
- $temp['order_status']=$msg['order_status'];
- $temp['order_id']=$msg['order_id'];
- $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);
- }
- }
- }
|