Exemplo n.º 1
0
 /**
  *功能:编辑料号
  *@param array  $_GET['data']   包含新旧料号 和添加者 id
  *@return  null
  * */
 public function edit_sku_conversion()
 {
     if (!$_GET['data']) {
         self::$errCode = "003";
         self::$errMsg = "传参有误";
         return;
     }
     $data = $_GET['data'];
     $data = array_filter($data, trim);
     $id = $data['id'];
     $old_sku = $data['old_sku'];
     $new_sku = $data['new_sku'];
     $modifiedtime = time();
     $user = $data['user'];
     $table = C("DB_PREFIX") . "sku_conversion ";
     $set = "old_sku =  '{$old_sku}' , new_sku = '{$new_sku}',modifiedtime = '{$modifiedtime}'";
     $set .= "  ,user = '******'";
     $where = "id = '{$id}' AND is_delete = '0'";
     $ret = PurchaseOrderModel::updateOneTable($table, $set, $where);
     if ($ret) {
         self::$errCode = "001";
         self::$errMsg = "ok!修改成功";
         return;
     }
     self::$errCode = "002";
     self::$errMsg = "sorry!修改失败";
     return;
 }