Beispiel #1
0
 /**
  *功能:通过旧料号获取新料号资料
  *@para $oldSku 旧料号
  *@return  $new_sku 新料号
  * */
 public function showNewSku()
 {
     if (!$_GET['oldSku']) {
         self::$errCode = "002";
         self::$errMsg = "Miss param";
         return;
     }
     $oldSku = $_GET['oldSku'];
     $table = C("DB_PREFIX") . "sku_conversion ";
     $fields = "new_sku";
     $where = "old_sku = '{$oldSku}' AND is_delete = '0' LIMIT 1";
     $ret = PurchaseOrderModel::selectOneTable($table, $fields, $where);
     if ($ret) {
         $new_sku = $ret[0]['new_sku'];
         self::$errCode = "001";
         self::$errMsg = "success";
         return $new_sku;
     } else {
         self::$errCode = "003";
         self::$errMsg = "no this sku or delete";
         return;
     }
 }