浏览代码

新增产品管理接口

huangsanjia 1 年之前
父节点
当前提交
882282dfd8

+ 217 - 0
application/api/controller/ProcessDocument.php

@@ -0,0 +1,217 @@
+<?php
+
+namespace app\api\controller;
+
+use app\common\controller\Api;
+use \think\Request;
+use \think\Db;
+/**
+ * 流程单接口
+ */
+class ProcessDocument extends Api
+{
+    protected $noNeedLogin = ['*'];
+    protected $noNeedRight = ['*'];
+
+    /**
+     * 首页
+     *
+     */
+    public function index()
+    {
+        $this->success('请求成功');
+    }
+    /**
+     * 获取工单基本数据
+     *
+     * @ApiMethod GET
+     * @params string order
+    */
+    public function getData(){
+        if (Request::instance()->isGet() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->param();
+        $order = $params['order'];
+        if (!isset($order)){
+            $this->error('参数不能为空');
+        }
+        $map = array();
+        $map['a.Gd_gdbh'] = $order;
+        $map['a.行号'] = 1;
+        //胶印车间计量单位为”张“,凹印车间计量单位一般为”吨“
+        $info = Db::name('工单_基本资料')->alias('a')
+            ->join('工单_bom资料 b ',' a.Gd_gdbh=b.BOM_工单编号','left')
+            ->field('a.成品代号,a.产品版本号,b.BOM_计划用量,b.BOM_物料名称')
+            ->where($map)
+            ->where('b.BOM_产出单位',['eq','张'],['eq','吨'],'or')
+            ->select();
+        $res =array();
+        $product_number = '';
+        if (count($info) > 1){
+            foreach ($info as $k=>$v){
+                $product_number = rtrim($v['成品代号']);
+                $str = rtrim($v['BOM_物料名称']);
+                $res['paper'][$k] ['bom_物料名称'] =  $str;
+                $res['paper'][$k] ['产品版本号'] =  rtrim($v['产品版本号']);
+                $res['paper'][$k] ['bom_计划用量'] = intval($v['BOM_计划用量']);
+            }
+            $where['_string'] = 'FIND_IN_SET('."'$product_number'".',product_number)';
+            $list = Db::connect('db2')->name('qr_history_peijian')->where($where)->field('id,peijian_name')->select();
+            $res['peijian'] = $list;
+        }else{
+            $res['paper'][0]['bom_物料名称'] = rtrim($info[0]['BOM_物料名称']);
+            $res['paper'][0]['产品版本号'] = rtrim($info[0]['产品版本号']);
+            $res['paper'][0]['bom_计划用量'] = intval($info[0]['BOM_计划用量']);
+        }
+        $res['num'] = count($info);
+        $this->success('请求成功',$res);
+    }
+    /**
+     * 获取历史工艺信息
+     *
+     * @ApiMethod GET
+     * @params string order
+    */
+    public function getHistory(){
+        if (Request::instance()->isGet() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->param();
+        $order = $params['order'];
+        if (!isset($params['order'])){
+            $this->error('参数不能为空');
+        }
+
+        $where = array();
+        $where['Gd_gdbh'] = $order;
+        $where['行号'] = 1;
+        $product = Db::name('工单_基本资料')
+            ->where($where)
+            ->field('成品代号')
+            ->find();
+        $map =array();
+        $map['product_number'] = rtrim($product['成品代号']);
+        if ($params['peijian'] > 0){
+            $map['peijian'] = $params['peijian'];
+        }
+        $res = Db::connect('db2')->name('qr_history')->where($map)->order('id desc')->field('data,update')->find();
+        $result = array();
+        $result['update'] = '暂无';
+        $result['data'] = '';
+        $result['num'] = 0;
+        $result['department'] = '车间';
+        if ($res){
+            $data = explode(',',$res['data']);
+            $result['num'] = 1;
+            $result['data'] = $data;
+            $result['update'] = $res['update'];
+        }
+        $this->success('请求成功',$result);
+    }
+    /**
+     * 保存产品工艺信息
+     *
+     * @ApiMethod POST
+     * @params
+    */
+    public function saveData(){
+        if (Request::instance()->isPost() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->param();
+
+        if (empty($params['order'])){
+            $this->error('参数不能为空');
+        }
+        $ip = request()->ip();
+        //定义各部门ip地址
+        $JYarray=array('20.0.3.253','60.190.242.28','127.0.0.1');
+        $WYarray=array('20.0.3.110','60.190.242.26');
+        $MQarray=array('20.0.2.200','60.190.242.29');
+        $department = -1;
+        //确认是不是凹印车间,ip确认部门不准
+        $explode_data = explode(',',$params['data']);
+        if (in_array($ip,$MQarray)){
+            $department = 3;
+        }elseif (in_array($ip,$WYarray) || $explode_data[0] == '卷凹' || $explode_data[0] == '凹印'){
+            $department = 2;
+        }else{
+            $department = 1;
+        }
+        $data = [];
+        $data['department'] = $department;
+        $data['data'] = substr($params['data'],0,-1);
+        $where = array();
+        $where['Gd_gdbh'] = $params['order'];
+        $where['行号'] = 1;
+        $product = DB::name('工单_基本资料')
+            ->where($where)
+            ->field('成品代号')
+            ->find();
+
+        $data['product_number'] = rtrim($product['成品代号']);
+        $map['product_number'] = $data['product_number'];
+        $map['department'] = $department;
+        if ($params['peijian']){
+            $map['peijian'] = $params['peijian'];
+        }
+        $data['update'] = date('Y-m-d H:i:s');
+        $data['ip'] =$ip;
+        $isNull = Db::connect('db2')->name('qr_history')->where($map)->find();
+        if ($isNull){//去更新工艺及时间
+            $res = Db::connect('db2')->name('qr_history')->where('id',$isNull['id'])->update($data);
+        }else{//新增
+            $res = Db::connect('db2')->name('qr_history')->insert($data);
+        }
+        if ($res){
+            $this->success('更新成功');
+        }else{
+            $this->error('更新失败');
+        }
+    }
+    /**
+     * 获取流程单头部信息
+     *
+     * @ApiMethod POST
+     * @params string order
+    */
+    public function getInfo(){
+        if (Request::instance()->isPost() == false){
+            $this->error('非法请求');
+        }
+        $data = Request::instance()->param();
+        if (!isset($data['order'])){
+            $this->error('参数不能为空');
+        }
+        $str = '原纸';
+        $where = [
+            'Gd_gdbh'=> $data['order'],
+        ];
+        $field  = 'Gd_gdbh,rtrim(销售订单号) as 销售订单号,rtrim(Gd_cpmc) as Gd_cpmc,rtrim(成品名称) as 成品名称,计划投料,实际投料,rtrim(产品版本号) as 产品版本号,rtrim(警语版面) as 警语版面,
+        rtrim(Gd_desc) as Gd_desc';
+        $gdinfo =  Db::name('工单_基本资料')
+            ->where($where)
+            ->field($field)
+            ->select();
+        $length = count($gdinfo);
+        if (!empty($data['num'])){
+            $gdinfo[0]['计划投料'] = $data['num'];
+        }
+        if (rtrim($gdinfo[0]['成品名称']) == ''){
+            $cpmc = trim($gdinfo[0]['Gd_cpmc']);
+            $gdinfo[0]['成品名称'] = $cpmc;
+        }
+        $gdinfo[0]['mabao'] = $data['mabao'];
+        $gdinfo[0]['version'] = $data['version'];
+        $gdinfo[0]['liucheng_num'] = '';
+
+        $newdata = explode(',',$data['string']);
+
+        $gdinfo['gy_data'] = array_filter($newdata);
+        $gdinfo['technique_sequence'] = trim($gdinfo[0]['version']).'、'.trim($gdinfo[0]['警语版面']).'、'.trim($gdinfo[0]['Gd_desc']);
+        $gdinfo['total_liuchen'] = ceil(($gdinfo[0]['计划投料']?$gdinfo[0]['计划投料']:$gdinfo[0]['实际投料']*10000)/$data['tldx']); //总的流程数
+        $gdinfo['length'] = $length;
+        $this->success('请求成功',$gdinfo);
+    }
+}

+ 373 - 5
application/api/controller/Product.php

@@ -52,11 +52,20 @@ class Product extends Api
                     `客户编号`ASC,`状态` ASC,`产品编号` DESC LIMIT {$limit} OFFSET {$pages}";
             $total = Db::name('产品_基本资料')->where('客户编号',$customCode)->count();
         }else{
-            $sql = "SELECT rtrim(客户编号) as 客户编号,rtrim(客户名称) as 客户名称,客户料号,rtrim(产品编号) as 产品编号,rtrim(产品名称) as 产品名称,版本号,成品规格,
+            if (isset($params['search'])){
+                $search = $params['search'];
+                $sql = "SELECT rtrim(客户编号) as 客户编号,rtrim(客户名称) as 客户名称,客户料号,rtrim(产品编号) as 产品编号,rtrim(产品名称) as 产品名称,版本号,成品规格,
+                    rtrim(计量单位) as 计量单位,rtrim(产品类别) as 产品类别,生产类别,产品备注,投产日期,状态,U8UID,rtrim(Sys_id) as Sys_id,Sys_rq,Mod_rq,UniqID
+                    FROM `产品_基本资料` WHERE `产品名称` LIKE '%{$search}%' OR `产品编号` LIKE '%{$search}%' ORDER BY CASE WHEN `状态` IS NULL THEN 0 ELSE 1 END, 
+                    `客户编号`ASC,`状态` ASC,`产品编号` DESC LIMIT {$limit} OFFSET {$pages}";
+                $total = Db::name('产品_基本资料')->where('产品名称','like','%'.$search.'%')->count();
+            }else{
+                $sql = "SELECT rtrim(客户编号) as 客户编号,rtrim(客户名称) as 客户名称,客户料号,rtrim(产品编号) as 产品编号,rtrim(产品名称) as 产品名称,版本号,成品规格,
                     rtrim(计量单位) as 计量单位,rtrim(产品类别) as 产品类别,生产类别,产品备注,投产日期,状态,U8UID,rtrim(Sys_id) as Sys_id,Sys_rq,Mod_rq,UniqID
                     FROM `产品_基本资料` ORDER BY CASE WHEN `状态` IS NULL THEN 0 ELSE 1 END, 
                     `客户编号`ASC,`状态` ASC,`产品编号` DESC LIMIT {$limit} OFFSET {$pages}";
-            $total = Db::name('产品_基本资料')->count();
+                $total = Db::name('产品_基本资料')->count();
+            }
         }
         $list = Db::query($sql);
         foreach ($list as $key=>$value){
@@ -125,8 +134,367 @@ class Product extends Api
         $list['jsData'] = [];
         $this->success('请求成功',$list);
     }
+    /**
+     * 获取单个产品工艺数据
+     *
+     * @ApiMethod GET
+     *@param string product_code
+    */
+    public function getProductGy(){
+        if (Request::instance()->isGet() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->param();
+        $code = $params['product_code'];
+        if (!isset($code)){
+            $this->error('参数不能为空');
+        }
+        $option['a.Gy0_cpdh'] = $code;
+        if (!empty($params['plan'])){
+            $option['a.Gy0_方案'] = $params['plan'];
+        }
+        $gy_field = 'rtrim(a.Gy0_方案) as programme,a.Gy0_yjno,a.Gy0_gxh,rtrim(a.gy0_gxmc) as gy0_gxmc,a.A类产能 as A_power,rtrim(a.Gy0_shdh) as Gy0_shdh,rtrim(a.Gy0_sbbh) as Gy0_sbbh,
+        a.工价系数 as difficulty_coe,a.损耗系数 as loss_coe,a.Gy0_Ms as ms_coe,a.Gy0_Ks,a.Gy0_ls,rtrim(a.Gy0_site) as Gy0_site,rtrim(a.Add_gxmc) as Add_gxmc,a.UniqID,
+        rtrim(a.工序备注) as remark,a.人工检_正品板 as artificial_zp,a.人工检_次品板 as artificial_cp,a.人工检_废检 as artificial_fj,a.机检_正品板 as machine_zp,a.机检_次品板 as machine_cp,
+        a.机检_废检 as machine_fj,rtrim(b.客户名称) as custom_name,rtrim(b.产品名称) as product_name';
+        $gyRes = Db::name('产品_工艺资料')->alias('a')
+            ->join('产品_基本资料 b','a.Gy0_cpdh = b.产品编号','left')
+            ->where($option)->field($gy_field)->order('a.Gy0_yjno asc,a.Gy0_gxh asc')->select();
+        $this->success('请求成功',$gyRes);
+    }
+    /**
+     * 修改工艺参数
+     *
+     * @ApiMethod
+     * @params array data
+    */
+    public function editGy(){
+        if (Request::instance()->isPost() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->post();
+        if (!isset($params) || !isset($params[0]['UniqID'])){
+            $this->error('参数不能为空');
+        }
+        $i = 0;
+        foreach ($params as $key=>$value){
+            $data = [];
+            if (!empty($value['A_power'])){
+                $data['A类产能'] = $value['A_power'];
+            }
+            if (!empty($value['shdh'])){
+                $data['Gy0_shdh'] = $value['shdh'];
+            }
+            if (!empty($value['machine'])){
+                $data['Gy0_sbbh'] = $value['machine'];
+            }
+            if (!empty($value['time'])){
+                $data['Gy0_辅助工时'] = $value['time'];
+            }
+            if (!empty($value['difficulty_coe'])){
+                $data['工价系数'] = $value['difficulty_coe'];
+            }
+            if (!empty($value['loss_coe'])){
+                $data['损耗系数'] = $value['loss_coe'];
+            }
+            if (!empty($value['ms_coe'])){
+                $data['Gy0_Ms'] = $value['ms_coe'];
+            }
+            $sql = Db::name('产品_工艺资料')->where('UniqID',$value['UniqID'])->fetchSql(true)->update($data);
+            $res = Db::query($sql);
+            if ($res !== false){
+                $i++;
+            }
+        }
+        if ($i !== 0){
+            $this->success('更新成功');
+        }else{
+            $this->error('更新失败');
+        }
+    }
+    /**
+     * 修改产品信息
+     *
+     * @ApiMethod POST
+     *
+     * @params object data
+    */
+    public function editProduct(){
+        if (Request::instance()->isPost() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->post();
+        if (empty($params)){
+            $this->error('参数不能为空');
+        }
+        if (!isset($params['印品代号'])){
+            $this->error('印品代号不能为空');
+        }
+        $code = $params['印品代号'];
+        unset($params['印品代号']);
+        $sql = Db::name('产品_基本资料')->where('产品编号',$code)->fetchSql(true)->update($params);
+        $res = Db::query($sql);
+        if ($res !== false){
+            $this->success('更新成功');
+        }else{
+            $this->error('更新失败');
+        }
+    }
+    /**
+     * 设置产品状态
+     *
+     * @ApiMethod POST
+     * @params string status
+     * @params string code
+    */
+    public function setProductStatus(){
+        if (Request::instance()->isPost() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->post();
+        if (empty($params['code']) || empty($params['status'])){
+            $this->error('参数不能为空');
+        }
+        $code = $params['code'];
+        $status = '';
+        if ($params['status'] == 2){
+            $status = '停产';
+        }
+        $sql = Db::name('产品_基本资料')->where('产品编号',$code)->fetchSql(true)->setField('状态',$status);
+        $res = Db::query($sql);
+        if ($res !== false){
+            $this->success('更新成功');
+        }else{
+            $this->error('更新失败');
+        }
+    }
+    /**
+     * 获取产品工艺数量
+     *
+     * @ApiMethod GET
+     * @params string code
+    */
+    public function getGyTotal(){
+        if (Request::instance()->isGet() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->param();
+        $code = $params['code'];
+        if (!isset($code)){
+            $this->error('参数不能为空');
+        }
+        $res = Db::name('产品_工艺资料')->where('Gy0_cpdh',$code)->distinct(true)->column('rtrim(Gy0_方案) as gy_plan');
+        $data['gy'] = $res;
+        $product = Db::name('产品_基本资料')->where('产品编号',$code)->find();
+        $data['name'] = rtrim($product['产品名称']);
+        $this->success('请求成功',$data);
+    }
+    /**
+     * 复制产品工艺信息
+     *
+     * @ApiMethod POST
+     * @params string from_code
+     * @params string from_pro
+     * @params string to_code
+     * @params string to_pro
+     * @params int is_copy_gy
+    */
+    public function copyProductGy(){
+        if (Request::instance()->isPost() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->post();
+        if (empty($params['from_code']) || empty($params['from_pro']) || empty($params['to_code']) ){
+            $this->error('参数不能为空');
+        }
+        if ($params['is_copy_gy'] == 1){
+            if (empty($params['to_pro'])){
+                $this->error('工艺方案不能为空');
+            }
+            //查出参考的工艺数据
+            $where['Gy0_cpdh'] = $params['from_code'];
+            $where['Gy0_方案'] = $params['from_pro'];
+            $gyList = Db::name('产品_工艺资料')->where($where)->select();
+            if (empty($gyList)){
+                $this->error('参考产品无工艺资料数据');
+            }
+            foreach ($gyList as $key=>$value){
+                unset($gyList[$key]['UniqID']);
+                $gyList[$key]['Gy0_方案'] = $params['to_pro'];
+                $gyList[$key]['Gy0_cpdh'] = $params['to_code'];
+            }
+            $gyResult = Db::name('产品_工艺资料')->insertAll($gyList);
+            if (!$gyResult){
+                $this->error('复制产品工艺资料数据失败');
+            }
+        }
+        $option['YB_Cpdh'] = $params['from_code'];
+        $ybList = Db::name('产品_印版资料')->where($option)->select();
+        if (empty($ybList)){
+            $this->error('参考产品无印版资料数据');
+        }
+        foreach ($ybList as $key=>$value){
+            unset($ybList[$key]['UniqID']);
+            $ybList[$key]['YB_Cpdh'] = $params['to_code'];
+        }
+        $ybResult = Db::name('产品_印版资料')->insertAll($ybList);
+        if (!$ybResult){
+            $this->error('复制产品工艺资料数据失败');
+        }
+        $this->success('工艺复制成功');
+    }
+    /**
+     * 工艺方案更名
+     *
+     * @ApiMethod POST
+     * @params string code
+     * @params string name
+    */
+    public function editGyName(){
+        if (Request::instance()->isPost() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->post();
+        if (empty($params['code']) || empty($params['old_name']) || empty($params['new_name'])){
+            $this->error('参数不能为空');
+        }
+        $where['Gy0_cpdh'] = $params['code'];
+        $where['Gy0_方案'] = $params['old_name'];
+        $sql = Db::name('产品_工艺资料')->where($where)->fetchSql(true)->setField('Gy0_方案',$params['new_name']);
+        $res = Db::query($sql);
+        if ($res !== false){
+            $this->success('更新成功');
+        }else{
+            $this->error('更新失败');
+        }
+    }
+    /**
+     * 工艺方案附加
+     *
+     * @ApiMethod POST
+     * @params object data
+    */
+    public function editGyNo(){
+        if (Request::instance()->isPost() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->post();
+        if (empty($params) || !isset($params[0]['UniqID'])){
+            $this->error('参数不能为空');
+        }
+        $i = 0;
+        foreach ($params as $key=>$value){
+            $data = [];
+            if (!empty($value['Gy0_yjno'])){
+                $data['Gy0_yjno'] = $value['Gy0_yjno'];
+            }
+            if (!empty($value['Gy0_gxh'])){
+                $data['Gy0_gxh'] = $value['Gy0_gxh'];
+            }
+            if (!empty($value['Gy0_Ks'])){
+                $data['Gy0_Ks'] = $value['Gy0_Ks'];
+            }
+            if (!empty($value['Gy0_ls'])){
+                $data['Gy0_ls'] = $value['Gy0_ls'];
+            }
+            $sql = Db::name('产品_工艺资料')->where('UniqID',$value['UniqID'])->fetchSql(true)->update($data);
+            $res = Db::query($sql);
+            if ($res !== false){
+                $i++;
+            }
+        }
+        if ($i !== 0){
+            $this->success('更新成功');
+        }else{
+            $this->error('更新失败');
+        }
+    }
+    /**
+     * 计损色数修正
+     *
+     * @ApiMethod POST
+     * @params object data
+    */
+    public function editGyMs(){
+        if (Request::instance()->isPost() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->post();
+        if (empty($params) || !isset($params[0]['UniqID'])){
+            $this->error('参数不能为空');
+        }
+        $i = 0;
+        foreach ($params as $key=>$value){
+            $data = [];
+            if (!empty($value['Gy0_Ms'])){
+                $data['Gy0_Ms'] = $value['Gy0_Ms'];
+            }
+            if (!empty($value['Gy0_Ks'])){
+                $data['Gy0_Ks'] = $value['Gy0_Ks'];
+            }
+            if (!empty($value['Gy0_ls'])){
+                $data['Gy0_ls'] = $value['Gy0_ls'];
+            }
+            $data['Add_gxmc'] = $value['Add_gxmc'];
+            $data['工序备注'] = $value['remark'];
 
-
-
-
+            $sql = Db::name('产品_工艺资料')->where('UniqID',$value['UniqID'])->fetchSql(true)->update($data);
+            $res = Db::query($sql);
+            if ($res !== false){
+                $i++;
+            }
+        }
+        if ($i !== 0){
+            $this->success('更新成功');
+        }else{
+            $this->error('更新失败');
+        }
+    }
+    /**
+     * 产品质检废品系数调整
+     *
+     * @ApiMethod POST
+     * @params object data
+    */
+    public function editGyWaste(){
+        if (Request::instance()->isPost() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->post();
+        if (empty($params) || !isset($params[0]['UniqID'])){
+            $this->error('参数不能为空');
+        }
+        $i = 0;
+        foreach ($params as $key=>$value){
+            $data = [];
+            if (!empty($value['artificial_zp'])){
+                $data['人工检_正品板'] = $value['artificial_zp'];
+            }
+            if (!empty($value['artificial_cp'])){
+                $data['人工检_次品板'] = $value['artificial_cp'];
+            }
+            if (!empty($value['artificial_fj'])){
+                $data['人工检_废检'] = $value['artificial_fj'];
+            }
+            if (!empty($value['machine_zp'])){
+                $data['机检_正品板'] = $value['machine_zp'];
+            }
+            if (!empty($value['machine_cp'])){
+                $data['机检_次品板'] = $value['machine_cp'];
+            }
+            if (!empty($value['machine_fj'])){
+                $data['机检_废检'] = $value['machine_fj'];
+            }
+            $sql = Db::name('产品_工艺资料')->where('UniqID',$value['UniqID'])->fetchSql(true)->update($data);
+            $res = Db::query($sql);
+            if ($res !== false){
+                $i++;
+            }
+        }
+        if ($i !== 0){
+            $this->success('更新成功');
+        }else{
+            $this->error('更新失败');
+        }
+    }
 }

+ 26 - 0
application/api/controller/Staff.php

@@ -49,6 +49,8 @@ class Staff extends Api
         if (isset($params['u8_online'])){
             $where['U8在职'] = $params['u8_online'] > 1 ? '离职':'在职';
         }
+
+        $where['员工编号|员工姓名'] = array('like','%'.$params['search'].'%');
         $limit = $params['limit'];
         if (empty($limit)){
             $limit = 15;
@@ -109,4 +111,28 @@ class Staff extends Api
         $data = array_values($data);
         $this->success('请求成功',$data);
     }
+    /**
+     * 修改员工资料
+     *
+     * @ApiMethod POST
+     *
+    */
+    public function edit(){
+        if (Request::instance()->isPost() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->param();
+        if (empty($params['员工编号'])){
+            $this->error('参数不能为空');
+        }
+        $staffCode = $params['员工编号'];
+        unset($params['员工编号']);
+        $sql = Db::name('人事_基本资料')->where('员工编号',$staffCode)->fetchSql(true)->update($params);
+        $res = Db::query($sql);
+        if ($res !== false){
+            $this->success('更新成功');
+        }else{
+            $this->error('更新失败');
+        }
+    }
 }