Exemplo n.º 1
0
 /**
  * ProductStockalarmAct::act_updateWarnOld()
  * 更新选择料号的预警信息
  * @param array skuArr 料号数组
  * @return bool 
  */
 public function act_updateWarnOld()
 {
     $skuArr = isset($_POST['skuList']) ? $_POST['skuList'] : "";
     $gid = isset($_SESSION[C('USER_AUTH_SYS_ID')]) ? $_SESSION[C('USER_AUTH_SYS_ID')] : 0;
     if (empty($skuArr) || !is_array($skuArr)) {
         self::$errCode = 10000;
         self::$errMsg = "料号参数非法!";
         return false;
     }
     if (!count($skuArr)) {
         self::$errCode = 10001;
         self::$errMsg = "料号不能为空数组!";
         return false;
     }
     if (empty($gid)) {
         self::$errCode = 10002;
         self::$errMsg = "您无权更新缓存!";
         return false;
     }
     $res = ProductStockalarmModel::updateWarn($gid, $skuArr);
     self::$errCode = ProductStockalarmModel::$errCode;
     self::$errMsg = ProductStockalarmModel::$errMsg;
     return $res;
 }
Exemplo n.º 2
0
 /**
  * ProductStockalarmModel::updateWarnInfo()
  * 更新选择料号的预警信息
  * @param array $dataarray 预警信息
  * @param string $sku 料号
  * @return bool 
  */
 public static function updateWarnInfo($sku, $dataarray)
 {
     self::initDB();
     $res = self::isWarnInfo($sku);
     if ($res) {
         $sql = array2sql($dataarray);
         $sql = "UPDATE `" . self::$prefix . self::$tab_skuInfo . "` SET " . $sql . " WHERE sku = '{$sku}'";
     } else {
         $dataarray['sku'] = $sku;
         $sql = array2sql($dataarray);
         $sql = "INSERT INTO `" . self::$prefix . self::$tab_skuInfo . "` SET " . $sql;
     }
     $query = self::$dbConn->query($sql);
     if ($query) {
         return true;
     } else {
         self::$errCode = 20000;
         self::$errMsg = "执行SQL语句出错";
         return false;
     }
 }