當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CommonModel::errMsg方法代碼示例

本文整理匯總了PHP中CommonModel::errMsg方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonModel::errMsg方法的具體用法?PHP CommonModel::errMsg怎麽用?PHP CommonModel::errMsg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CommonModel的用法示例。


在下文中一共展示了CommonModel::errMsg方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: replaceData

 public function replaceData($id, $data, $column = 'id')
 {
     $id = intval($id);
     $column = addslashes($column);
     if ($id == 0) {
         return false;
     }
     $fdata = $this->formatUpdateField($this->getTableName(), $data);
     if ($fdata === false) {
         self::$errMsg = $this->validatemsg;
         return false;
     }
     if ($this->checkIsExists($fdata)) {
         return false;
     }
     $check = $this->sql("SELECT COUNT(*) AS count FROM {$this->getTableName()} WHERE {$column}={$id}")->count();
     if ($check == 0) {
         $fdata[$column] = $id;
         return $this->insertData($fdata);
     } else {
         return $this->sql("UPDATE " . $this->getTableName() . " SET " . array2sql($fdata) . " WHERE {$column}={$id}")->update();
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:23,代碼來源:common.model.php

示例2: getCategoryInfo

 /**
  * CommonAct::act_getCategoryInfo($pid)
  * 獲取產品本地某類別下的所有產品
  * @param string $pid 類別id
  * @return string
  * @author wxb
  * @date 2013/11/13
  */
 public static function getCategoryInfo($pid)
 {
     self::initDB();
     $sql = "SELECT id,name FROM " . C('DB_PREFIX') . "goods_category_pc WHERE is_delete=0 and pid={$pid} ";
     $query = self::$dbConn->query($sql);
     if ($query) {
         $ret = self::$dbConn->fetch_array_all($query);
         if (empty($ret[0])) {
             self::$errMsg = "無該類別列表";
             return false;
         }
         return $ret;
     }
     self::$errMsg = "獲取類別列表失敗";
     return false;
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:24,代碼來源:common.model.php

示例3: checkContent

 public static function checkContent($content)
 {
     self::initDB();
     $content = trim($content);
     $sql = "select id from " . self::$table . " where content = '{$content}' limit 1";
     //echo $sql;
     $query = self::$dbConn->query($sql);
     if ($query) {
         $ret = self::$dbConn->fetch_array_all($query);
         return (int) $ret[0]['id'];
         //count($ret);	//成功, 返回列表數據
     } else {
         self::$errCode = "003";
         self::$errMsg = "error";
         return false;
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:17,代碼來源:common.model.php

示例4: addIoRecores

 public static function addIoRecores($paraArr)
 {
     self::initDB();
     $ordersn = isset($paraArr['ordersn']) ? $paraArr['ordersn'] : '';
     //發貨單號或者是單據的ordersn
     $sku = $paraArr['sku'];
     //sku
     $amount = $paraArr['amount'];
     //數量
     $positionId = isset($paraArr['positionId']) ? $paraArr['positionId'] : 0;
     //倉位ID
     $purchaseId = $paraArr['purchaseId'];
     //采購員id
     $ioType = $paraArr['ioType'];
     //出/入庫,1為出庫,2為入庫
     $ioTypeId = $paraArr['ioTypeId'];
     //出入庫類型id,即出入庫類型表中對應的id
     $userId = $paraArr['userId'];
     //添加人id
     $reason = isset($paraArr['reason']) ? $paraArr['reason'] : '';
     //原因
     $storeId = isset($paraArr['storeId']) ? intval($paraArr['storeId']) : 1;
     //倉庫,默認為1
     $createdTime = time();
     $tName = 'wh_iorecords';
     $set = "SET ordersn='{$ordersn}',sku='{$sku}',amount='{$amount}',positionId='{$positionId}',purchaseId='{$purchaseId}',ioType='{$ioType}',ioTypeId='{$ioTypeId}',userId='{$userId}',reason='{$reason}',createdTime='{$createdTime}',storeId='{$storeId}'";
     $sql = "INSERT INTO {$tName} {$set}";
     $query = self::$dbConn->query($sql);
     if ($query) {
         $insertId = self::$dbConn->insert_id($query);
         return $insertId;
         //成功, 返回插入的id
     } else {
         self::$errCode = "002";
         self::$errMsg = "添加失敗";
         return false;
         //失敗則設置錯誤碼和錯誤信息, 返回false
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:39,代碼來源:common.model.php


注:本文中的CommonModel::errMsg方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。