wugg 1 year ago
parent
commit
157bc78563
2 changed files with 18 additions and 353 deletions
  1. 13 46
      app/admin/controller/Consult.php
  2. 5 307
      app/admin/controller/Customer.php

+ 13 - 46
app/admin/controller/Consult.php

@@ -101,33 +101,17 @@ class Consult extends Base
 
 		 $userCommon = \app\admin\common\User::getIns();
         $names = $userCommon->handle('getCodeAndName', ['code' =>array_unique(array_merge(array_column($list,"khNo"),array_column($list,"companyNo")))]);
-//        $kh = $tmp['data']??[];
-
-
         $brand = Db::name("brand")
             ->where(['id'=>array_column($list,'brand_id')])
             ->column('brand_name','id');
-
-//        $userCommon = \app\admin\common\User::getIns();
-//        $names = $userCommon->handle('getCodeAndName', ['code' => array_column($list, 'khNo')]);
-
-
         $data=[];
         foreach ($list as $value){
             $value['can']= isset($value['cat_id']) && $value['cat_id'] !=0 ? made($value['cat_id']):[];
             $value['specinfo']=isset($value['specinfo'])&&$value['specinfo']!=""? json_decode($value['specinfo'], true):[];
-//            $brand = Db::name("brand")->where(['id'=>$value['brand_id']])->find();
             $value['brand_name']= $brand[$value['brand_id']]??'';//isset($brand['brand_name']) && $brand['brand_name']!='' ? $brand['brand_name']:"";
             $value['khname']="";
-
             if($value['khNo']!==""){
-//                $kh=Db::name("customer_info")->where(['companyNo'=>$value['khNo']])->find();
                 $value['khname']=$names['data'][$value['khNo']]??"";
-
-//            if ($value['khNo'] !== "") {
-////                $kh=Db::name("customer_info")->where(['companyNo'=>$value['khNo']])->find();
-//                $value['khname'] = $names['data'][$value['khNo']] ?? '';//isset($kh['companyName'])?$kh['companyName']:"";
-
             }
             $value['metal_name']=isset($value['metal_id'])&& $value['metal_id']!=0?$this->noble[$value['metal_id']]:"";
             $value['company_name'] = $item[$value['createrid']]??'';
@@ -183,15 +167,20 @@ class Consult extends Base
         if($khNo===""){
             return error_show(1002,"参数khNo不能为空");
         }
+        $kehu= \app\admin\common\User::getIns()->handle("cInfo",['companyNo'=>$khNo]);
+        if($kehu['code']!=0) return error_show($kehu['code'],$kehu['message']);
+        $kehu_info = $kehu['data']??[];
         $companyNo =  isset($this->post['companyNo']) && $this->post['companyNo'] !=="" ? trim($this->post['companyNo']) : "";
         if($companyNo===""){
             return error_show(1002,"参数companyNo不能为空");
         }
+        $companyinfo= \app\admin\common\User::getIns()->handle("getCodeAndName",['code'=>$companyNo]);
+        if($companyinfo['code']!=0) return error_show($companyinfo['code'],$companyinfo['message']);
+        $companyName = $companyinfo['data'][$companyNo]??"";
         $endtime =  isset($this->post['endtime']) && $this->post['endtime'] !=="" ? $this->post['endtime'] : "";
         if($endtime===""){
             return error_show(1002,"参数endtime不能为空");
         }
-
         $platform_code =  isset($this->post['platform_code']) && $this->post['platform_code'] !=="" ? trim($this->post['platform_code']) : "";
         if($platform_code===""){
             return error_show(1002,"参数platform_code不能为空");
@@ -210,20 +199,8 @@ class Consult extends Base
         if($ladder==""){
             return error_show(1005,"参数ladder不能为空");
         }
-//        $token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
-//        if($token==''){
-//            return error_show(105,"参数token不能为空");
-//        }
-
-//        $pay_id = isset($this->post['pay_id']) && $this->post['pay_id'] !== "" ? intval($this->post['pay_id']) : "0";
-
-//        $user =GetUserInfo($token);
-//        if(empty($user)||$user['code']!=0){
-//            return error_show(102,"用户数据不存在");
-//        }
         $createrid= $this->uid;//isset($user["data"]['id']) ?  $user["data"]['id'] : "";
         $creater= $this->uname;//isset($user["data"]['nickname']) ?  $user["data"]['nickname'] : "";
-//        $depart= Db::name("depart_user")->where(["uid"=>$createrid,"status"=>1,"is_del"=>0])->find();
         $depart = Db::connect('mysql_sys')
             ->name('account_item')
             ->field('itemid')
@@ -239,7 +216,10 @@ class Consult extends Base
                 "is_project"=>$is_project,
                 "projectNo"=>isset($projectNo) ? $projectNo:"",
                 "khNo"=>$khNo,
+                "khName"=>$kehu_info['companyName']??"",
                 "companyNo"=>$companyNo,
+                "companyName"=>$companyName,
+                "area"=>$kehu_info['area']??"",
                 "endtime"=>$endtime,
                 "salesman"=>$creater,
                 "platform_code"=>$platform_code,
@@ -386,6 +366,7 @@ class Consult extends Base
         $zxinfo['khname']="";
         $zxinfo['original_price']=sprintf("%.2f",$zxinfo['budget_price']* (1 -$budget));
         $zxinfo['khNo'] = $zxorder['khNo'];
+        $zxinfo['area'] = $zxorder['area'];
         $zxinfo['brand_id']=$zxinfo['brand_id']==0 ?"":$zxinfo['brand_id'];
         $zxinfo['brand']="";
         $zxinfo['companyNo']=isset($zxorder['companyNo'])?$zxorder['companyNo']:"";
@@ -2183,7 +2164,7 @@ class Consult extends Base
         $page = $page >= $total ? $total : $page;
         $list = Db::name('bargain_order')
             ->alias('bo')
-            ->field('bo.*,b.companyNo,c.num,b.platform_code')
+            ->field('bo.*,b.companyNo,b.area,c.num,b.platform_code')
             ->leftJoin('consult_order b', 'b.zxNo=bo.zxNo')
             ->leftJoin('consult_info c', 'c.infoNo=bo.infoNo')
             ->where($where)
@@ -2325,9 +2306,6 @@ class Consult extends Base
         $relaComNo = isset($this->post['relaComNo']) && $this->post['relaComNo'] != "" ? trim($this->post['relaComNo']) : "";
         if ($relaComNo != "") {
             if ($this->level == 3) {
-//            	$where[] = ['b.companyNo', '<>', $relaComNo];
-//}
-//            else {
                 $relaComArr = $userCommon->handle("hqInfo", ["code" => $relaComNo]);
                 $where[] = ['b.companyNo', '<>', $relaComArr['data']['relation_code'] ?? ''];
             }
@@ -2347,7 +2325,7 @@ class Consult extends Base
             ->leftJoin("platform c","c.id=b.platform_code")
             ->where($where)
             ->page($page,$size)
-            ->field("a.*,b.createrid,b.creater,b.is_project,b.projectNo,b.khNo,b.endtime,b.saleid,b.salesman,b.depart,b.companyNo,c.id platform_id,c.platform_code,c.platform_name")
+            ->field("a.*,b.createrid,b.creater,b.is_project,b.projectNo,b.area,b.khNo,b.endtime,b.saleid,b.salesman,b.depart,b.companyNo,c.id platform_id,c.platform_code,c.platform_name")
             ->select()
             ->toArray();
         $data=[];
@@ -2361,26 +2339,15 @@ class Consult extends Base
 
         foreach ($list as $value){
             $value['can']= isset($value['cat_id']) && $value['cat_id'] !=0 ? made($value['cat_id']):[];
-//              $cat =Db::name("cat")
-//                  ->where(["id"=>$value['cat_id']])
-//                  ->find();
-//              $budget = isset($cat['order_rate']) ? $cat['order_rate']:0;
             $budget = get_budget((int)$value['cat_id'], $value['companyNo'], (int)$value['platform_id']);
-               $value['original_price']=sprintf("%.2f",$value['budget_price']* (1 -$budget));
-
-//            $brand = Db::name("brand")->where(['id'=>$value['brand_id']])->find();
+            $value['original_price']=sprintf("%.2f",$value['budget_price']* (1 -$budget));
             $value['brand_name']= $brand[$value['brand_id']]??'';//isset($brand['brand_name']) && $brand['brand_name']!='' ? $brand['brand_name']:"";
             $value['khname'] = $value['companyName'] = "";
             $value['specinfo']=isset($value['specinfo'])&&$value['specinfo']!=""? json_decode($value['specinfo'],true):[];
             if($value['khNo']!==""){
-//                $kh=Db::name("customer_info")
-//                    ->where(['companyNo'=>$value['khNo']])
-//                    ->find();
                 $value['khname']= $names['data'][$value['khNo']]??'';//isset($kh['companyName'])?$kh['companyName']:"";
             }
-
             if($value['companyNo']!='') $value['companyName'] = $names['data'][$value['companyNo']]??'';
-
             $consult =Db::name("consult_bids")
                 ->where(["infoNo"=>$value['infoNo'],"createrid"=>$this->uid,"is_del"=>0])
                 ->find();

+ 5 - 307
app/admin/controller/Customer.php

@@ -25,142 +25,7 @@ class Customer extends Base
         $rs = $userCommon->handle('customer_org_list', $param);
 
         return json_show($rs['code'], $rs['message'], $rs['data']);
-//        $page= isset($this->post['page']) && $this->post['page']!==""? intval($this->post['page']):"1";
-//        $size = isset($this->post['size']) && $this->post['size'] != "" ? intval($this->post['size']) :"10";
-//        $pid =  isset($this->post['pid']) &&$this->post['pid']!=="" ?intval($this->post['pid']): "0";
-//        $where =[];
-//        $where []= ['ci.is_del',"=",0];
-//        $condition = [['co.is_del',"=",0]];
-//        if($pid!==""){
-//            $condition[]=["co.pid","=",$pid];
-//        }
-//        $companyNo = isset($this->post['companyNo']) && $this->post['companyNo'] !=="" ? trim($this->post['companyNo']):"";
-//        if($companyNo !==""){
-//            $where[] = ['ci.companyNo',"like","%$companyNo%"];
-//        }
-//        $creater = isset($this->post['creater']) && $this->post['creater'] !=="" ? trim($this->post['creater']):"";
-//        if($creater !==""){
-//            $where[] = ['ci.creater',"like","%$creater%"];
-//        }
-//        $name= isset($this->post['name'])&&$this->post['name']!=="" ? trim($this->post['name']):"";
-//        if($name!=""){
-//            $condition[]=["co.name","like","%{$this->post['name']}%"];
-//        }
-//        $start = isset($this->post['start']) && $this->post['start'] !== "" ? $this->post['start'] : "";
-//        if ($start != "") {
-//            $where[] = ["ci.addtime", '>=', $start];
-//        }
-//        $end = isset($this->post['end']) && $this->post['end'] !== "" ? $this->post['end'] : "";
-//        if ($end != "") {
-//            $where[] = ["ci.addtime", '<=', $end];
-//        }
-//        $status = isset($this->post['status']) && $this->post['status'] !=="" ? intval($this->post['status']):"";
-//        if($status!==""){
-//            $where[] = ['ci.status',"=",$status];
-//        }
-////        $count = Db::name('customer_org1')->where($condition)->count();
-////        $page>=ceil($count/$size) ? $page=ceil($count/$size) :"";
-//        $creater = isset($this->post['creater']) && $this->post['creater'] !=="" ? trim($this->post['creater']):"";
-//        if($creater !==""){
-//            $condition[] = ['co.creater',"like","%$creater%"];
-//        }
-//        $name= isset($this->post['name'])&&$this->post['name']!=="" ? trim($this->post['name']):"";
-//        if($name!=""){
-//            $condition[]=["co.name","like","%{$this->post['name']}%"];
-//        }
-//        $start = isset($this->post['start']) && $this->post['start'] !== "" ? $this->post['start'] : "";
-//        if ($start != "") {
-//            $condition[] = ["co.addtime", '>=', $start];
-//        }
-//        $end = isset($this->post['end']) && $this->post['end'] !== "" ? $this->post['end'] : "";
-//        if ($end != "") {
-//            $condition[] = ["co.addtime", '<=', $end];
-//        }
-//        $status = isset($this->post['status']) && $this->post['status'] !=="" ? intval($this->post['status']):"";
-//        if($status!==""){
-//            $condition[] = ['co.status',"=",$status];
-//        }
-//        $company_name = isset($this->post['company_name']) && $this->post['company_name'] !== "" ? trim($this->post['company_name']) : "";
-//        if ($company_name !== "") {
-//            $company_ids = get_company_item_user_by_name($company_name);
-//            $where[] = ["u.uid", 'in', $company_ids];
-//            $condition[] = ['u.uid',"in",$company_ids];
-//        }
-//
-//        $pidlist = Db::name("customer_org1")
-//            ->alias('co')
-//            ->leftJoin("depart_user u", "u.uid=co.createrid AND u.is_del=0")
-//            ->where($condition)
-//            ->order("co.addtime desc")->column("co.pid");
-//        if(!empty($pidlist)){
-//            $where[]=[["ci.itemid","in",$pidlist]];
-//
-//        }else{
-//            if($pid===""){
-//                $where[]=['ci.itemid','=',0];
-//            }else{
-//                $where[]=['ci.itemid','=',$pid];
-//            }
-//        }
-//        $list = Db::name('customer_org1')
-//            ->alias('co')
-//            ->where($condition)
-//            ->order("co.addtime",'desc')
-//            ->column("co.id,co.pid,co.name,co.level,co.depart_link,co.creater,co.createrid,co.addtime,co.status");
-//
-//        $all_createrid = array_column($list,'createrid');
-//        $all_item = get_company_name_by_uid($all_createrid);
-//
-//        $var=[];
-//        foreach ($list as $item) {
-//            $iten=[];
-//            $iten['name']=$item['name'];
-////            $iten['code']="";
-//            $iten['id']=$item['id'];
-//            $iten['creater']=$item['creater'];
-//            $iten['status']=$item['status'];
-//            $iten['addtime']=$item['addtime'];
-//            $iten['kh']=0;//组织架构
-//            $iten['company_name'] = $all_item[$item['createrid']]??'';
-//
-//            $var[]=$iten;
-//        }
-//        $itm = Db::connect('mysql_sys')
-//            ->name('customer_info')
-//            ->alias('ci')
-////            ->leftJoin("depart_user u", "u.nickname=ci.creater AND u.is_del=0")
-//            ->where($where)
-//            ->order("ci.addtime desc")
-//            ->select()
-//            ->toArray();
-//
-//        //同理,这个表里只存了创建人名称,没有id
-//
-//        foreach ($itm as $vat){
-//            $inm=[];
-//            $inm['name']=$vat['companyName'];
-//           $inm['id']=$vat['id'];
-//            $inm['code']=$vat['companyNo'];
-////            $inm['companyName']=$vat['companyName'];
-////            $inm['invoice_bank']=$vat['invoice_bank'];
-////            $inm['invoice_bankNo']=$vat['invoice_bankNo'];
-////            $inm['invoice_code']=$vat['invoice_code'];
-////            $inm['invoice_people']=$vat['invoice_people'];
-////            $inm['invoice_mobile']=$vat['invoice_mobile'];
-////            $inm['invoice_addr']=$vat['invoice_addr'];
-////            $inm['parent']=$vat['parent'];
-////            $inm['branch']=$vat['branch'];
-////            $inm['middle']=$vat['middle'];
-////            $inm['country']=$vat['country'];
-//            $inm['status']=$vat['status'];
-//            $inm['creater']=$vat['creater'];
-//            $inm['addtime']=$vat['addtime'];
-//            $inm['kh']=1;//客户
-//            $inm['company_name'] = '待处理';
-//            $var[]=$inm;
-//        }
-//        return app_show(0,"获取成功",$var);
-    }
+  }
 
     /*新建*/
     public function create()
@@ -174,78 +39,7 @@ class Customer extends Base
         $rs = $userCommon->handle('customer_org_create', $param);
 
         return json_show($rs['code'], $rs['message'], $rs['data']);
-//        $name = isset($this->post['name']) && $this->post['name'] !== "" ? trim($this->post['name']) : "";
-//        if ($name == "") {
-//            return error_show(1003, "公司名称不能为空");
-//        }
-//        $weight = isset($this->post['weight']) && $this->post['weight'] !== "" ? trim($this->post['weight']) : "0";
-//        $pid = isset($this->post['pid']) && $this->post['pid'] !== "" ? trim($this->post['pid']) : "0";
-////        if ($pid === "") {
-////            return error_show(1002, "父级id不能为空");
-////        }
-//        if($pid!=0){
-//            $spid = Db::name('customer_org1')->where(['id'=>$pid, 'is_del'=>0])->find();
-//            //var_dump( Db::name('customer_org1')->getLastSql());
-//            if(empty($spid)){
-//                return error_show(1004,"父级不能为空");
-//            }
-//        }
-//        $rename = Db::name('customer_org1')->where(['is_del' => 0, 'name' => $name,'pid'=>$pid])->find();
-//        if (!empty($rename)) {
-//            return error_show(1002, "组织名称已存在");
-//        }
-//        $token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
-//        if($token==''){
-//            return error_show(105,"参数token不能为空");
-//        }
-//        $user =GetUserInfo($token);
-//        if(empty($user)||$user['code']!=0){
-//            return error_show(1002,"创建人数据不存在");
-//        }
-//        $createrid= isset($user["data"]['id']) ?  $user["data"]['id'] : "";
-//        $creater= isset($user["data"]['nickname']) ?  $user["data"]['nickname'] : "";
-//        $level = isset($this->post['level']) && $this->post['level'] !== "" ? trim($this->post['level']) : "1";
-//        Db::startTrans();
-//        try {
-//            $tada = [
-//                "name" => $name,
-//                "weight" => $weight,
-//                "pid" => $pid,
-//                "level" => $level,
-//                "updatetime" => date("Y-m-d H:i:s"),
-//                "addtime" => date("Y-m-d H:i:s"),
-//                "depart_link" => "",
-//                "is_del" => 0,
-//                "pname"=>isset($spid['name']) ? $spid['name']:"",
-//                "creater"=>$creater,
-//                "createrid"=>$createrid
-//            ];
-//            $t = Db::name('customer_org1')->insert($tada, true);
-//           //var_dump(Db::name('customer_org1')->getLastSql());
-//            if ($t > 0) {
-//                if(isset($spid)){
-//                   // var_dump($spid);
-//                    $depart_link = $spid['depart_link']."{$t}-";
-//                }else{
-//                   $depart_link="{$t}-";
-//                }
-//                $level = explode('-', $depart_link);
-//              //  var_dump($level);
-//                $level = array_filter($level);
-//                $level = count($level);
-//                $k = ['depart_link' => $depart_link, 'level' => $level];
-//                $u = Db::name('customer_org1')->where(['id' => $t])->save($k);
-//               // var_dump( Db::name('customer_org1')->getLastSql());
-//                if ($u) {
-//                    Db::commit();
-//                    return error_show(0, "新建成功");
-//                }
-//            }
-//            Db::rollback();
-//        } catch (\Exception $e) {
-//            Db::rollback();
-//            return error_show(1003, $e->getMessage());
-//        }
+
     }
 
     /*更新*/
@@ -262,63 +56,6 @@ class Customer extends Base
 
         return json_show($rs['code'], $rs['message'], $rs['data']);
 
-//        $id = isset($this->post['id'])?intval($this->post['id']):"";
-//        if($id===""){
-//            return error_show(1004,"参数id不能为空");
-//        }
-//        $sid = Db::name('customer_org1')->where("id","=","$id")->find();
-//       // var_dump(Db::name('customer_org1')->getLastSql());
-//        if($sid==false){
-//            return error_show(1004,"公司不存在");
-//        }
-//        if($sid['status']==1){
-//            return error_show(1002,"状态是启用状态,无法编辑");
-//        }
-//        $pid = isset($this->post['pid']) && $this->post['pid'] !=="" ? intval($this->post['pid']):"";
-//        if($pid===""){
-//            return error_show(1004,"父级id不能为空");
-//        }
-//
-//        if($pid!=0){
-//            $fpid = Db::name('customer_org1')->where(['id'=>"$pid",'is_del'=>0])->find();
-//        if(empty($fpid)){
-//            return error_show(1004,"父级不能为空");
-//        }
-//        }
-//
-//        $weight = isset($this->post['weight']) && $this->post['weight'] !==""? intval($this->post['weight']):"0";
-//
-////      $level = isset($this->post['level']) && $this->post['level'] !==""? intval($this->post['level']):"";
-//        $name = isset($this->post['name'])? trim($this->post['name']):"";
-//        if($name==""){
-//            return error_show(1004,"公司名称不能为空");
-//        }
-//        $repeat_name = Db::name('customer_org1')->where(["is_del"=>0,"name"=>$name,'pid'=>$pid])->where("id","<>","$id")->find();
-//        // echo Db::name('customer_org1')->getLastSql();
-//        if(!empty($repeat_name)){
-//            return error_show(1004,"部门名称已存在");
-//        }
-//        if(isset($fpid)){
-//            $depart_link=$fpid['depart_link']."{$id}-";
-//        }else{
-//            $depart_link= "{$id}-";
-//        }
-//        $level =explode('-',$depart_link);
-//        $level = array_filter($level);
-//        $level= count($level);
-//        $vir=[
-//            "id"=>$id,
-//            "name"=>$name,"pid"=>$pid,
-//            "weight"=>$weight,"depart_link"=>$depart_link,
-//            "level"=>$level,"is_del"=>0,"addtime"=>date("Y-m-d H:i:s"),
-//            "updatetime"=>date("Y-m-d H:i:s"),
-//        ];
-//        $org = Db::name('customer_org1')->save($vir);
-//        if($org){
-//            return error_show(0,"更新成功");
-//        }else{
-//            return error_show(1004,"更新失败");
-//        }
     }
 
     /*查询*/
@@ -333,9 +70,7 @@ class Customer extends Base
         $rs = $userCommon->handle('customer_org_info', ['id' => $id]);
 
         return json_show($rs['code'], $rs['message'], $rs['data']);
-//        $tod=Db::name('customer_org1')->where(['id'=>$id,'is_del'=>0])->find();
-//        //var_dump(Db::name('customer_org1')->getLastSql());
-//        return app_show(0,"获取成功",$tod);
+
     }
 
     /*删除*/
@@ -350,25 +85,7 @@ class Customer extends Base
         $rs = $userCommon->handle('customer_org_delete', ['id' => $id]);
 
         return json_show($rs['code'], $rs['message'], $rs['data']);
-//        $id=isset($this->post['id']) ?intval($this->post['id']):"";
-//        $custy = Db::name('customer_org1')->where(["is_del"=>0,'id'=>$id])->find();
-//        if($custy==false){
-//            return error_show(1004,"公司不存在");
-//        }
-//        //$var= Db::name('customer_info')->where(['itemid'=>$id,'is_del'=>0])->find();
-//        $db= Db::name('customer_org1')->where(['pid'=>$custy['id'],'is_del'=>0])->count();
-//        if($db>0){
-//            return error_show(1004,"下一级还有组织,不允许删除");
-//        }
-//        $var= Db::connect('mysql_sys')
-//            ->name('customer_info')->where(['itemid'=>$id,'is_del'=>0])->count();
-//        if($var>0){
-//            return error_show(1004,"下一级还有分公司,不允许删除");
-//        }
-//        $custy['is_del']=1;
-//        $custy['updatetime']=date("Y-m-d H:i:s");
-//        $compy = Db::name('customer_org1')->save($custy);
-//        return $compy ? error_show(0,"删除成功"):error_show(1004,"删除失败");
+
     }
 
     public function status()
@@ -380,26 +97,7 @@ class Customer extends Base
         $rs = $userCommon->handle('customer_org_status', $param);
 
         return json_show($rs['code'], $rs['message'], $rs['data']);
-//        $id = isset($this->post['id']) && $this->post['id'] !==""? intval($this->post['id']):"";
-//        if($id==""){
-//            return error_show(1002,"参数id不能为空");
-//        }
-//        $info =  Db::name("customer_org1")->where([["id","=",$id]])->find();
-//        if(!$info){
-//            return error_show(1002,"未找到对应数据");
-//        }
-//        $status =  isset($this->post['status']) && $this->post['status']!==""? intval($this->post['status']):"";
-//        if($status===""){
-//            return error_show(1002,"参数status不能为空");
-//        }
-//        if(!in_array($status,[0,1])){
-//            return error_show(1002,"参数status无效");
-//        }
-//        $info['status']=$status;
-//        $info['updatetime']=date("Y-m-d H:i:s");
-//        $msg = $status==1?"启用":"禁用";
-//        $update = Db::name("customer_org1")->save($info);
-//        return  $update? error_show(0,"{$msg}成功"):error_show(1004,"{$msg}失败");
+
     }
 
 }