Exemplo n.º 1
0
 public static function updateApplyApi($newApplyApi = array(), $where = '0')
 {
     $tableName = $this->getTableName();
     $newApplyApi = $this->formatUpdateField($tableName, $newApplyApi);
     if (!$newApplyApi) {
         self::$errMsg = $this->validatemsg;
         return false;
     }
     $updateApplyApi = '';
     foreach ($newApplyApi as $k => $v) {
         $updateApplyApi .= $k . '="' . $v . '",';
     }
     $updateApplyApi = rtrim($updateApplyApi, ',');
     $sql = 'UPDATE `' . C("DB_PREFIX") . 'call_api` SET ' . $updateApplyApi . ' WHERE ' . $where;
     return $this->sql($sql)->update();
 }
Exemplo n.º 2
0
 /**
  * ApiModel::getSkuByPurids($purIds)
  *通过采购id获取sku
  * @return  array
  */
 public static function getSkuByPurids($purIds)
 {
     self::initDB();
     $sql = "SELECT sku FROM pc_goods WHERE purchaseId IN ({$purIds})";
     $query = self::$dbConn->query($sql);
     if ($query) {
         $res = self::$dbConn->fetch_array_all($query);
         if (empty($res)) {
             self::$errMsg = "result empty ---{$sql}";
             return false;
         }
         return $res;
     }
     self::$errMsg = "query error ---{$sql}";
     return false;
 }