Beispiel #1
0
 /**
  * WhWaveAreaInfoModel::get_area_info()
  * 获取区域信息
  * @param mixed $select  查询字段 多个字段数组,单个字符串即可
  * @param array $area_ids 区域ID 多个字段数组,单个字符串即可
  * @param array $areaName 区域名称 多个字段数组,单个字符串即可
  * @return
  */
 public static function get_area_info($select, $area_ids = '', $areaName = '')
 {
     self::initDB();
     $tableName = self::$tablename;
     $select = array2select($select);
     $sql = "select {$select} from {$tableName} where ";
     if ($area_ids) {
         $area_ids = is_array($area_ids) ? array_unique($area_ids) : $area_ids;
         //$area_ids   =   array2select($area_ids);
         //$area_ids   =   str_replace('`', "'", $area_ids);
         $area_ids = is_array($area_ids) ? implode("','", $area_ids) : $area_ids;
         $sql .= "id in ('{$area_ids}') and ";
     }
     if ($areaName) {
         $areaName = is_array($areaName) ? array_unique($areaName) : $areaName;
         //$areaName   =   array2select($areaName);
         //$areaName   =   str_replace('`', "'", $areaName);
         $areaName = is_array($areaName) ? implode("','", $areaName) : $areaName;
         $sql .= "areaName in ('{$areaName}') and ";
     }
     //echo $sql;
     $sql .= 'is_delete = 0';
     $sql = self::$dbConn->query($sql);
     $res = self::$dbConn->fetch_array_all($sql);
     return $res;
 }
 /**
  * whWaveMultiShipAreaRecordModel::get_multi_ship_records()
  * 获取多料号订单区域临时信息 
  * @param array $select 查询字段 多个数组,单个字符串
  * @param array $where 数组
  * @author Gary
  * @return $res
  */
 public static function get_multi_ship_records($select, $where)
 {
     self::initDB();
     $select = array2select($select);
     $where = array2where($where);
     $sql = "select {$select} from " . self::$tablename . " where {$where}";
     //echo $sql;exit;
     $sql = self::$dbConn->query($sql);
     $res = self::$dbConn->fetch_array_all($sql);
     return $res;
 }
 /**
  * WhShippingOrderModel::get_order_info()
  * 获取发货单信息
  * @param array $select 多个数组,单个字符
  * @param array $where 条件数组
  * @param bool $fetch_one  是否只获取一条记录
  * @author Gary
  * @return void
  */
 public static function get_order_info($select, $where, $fetch_one = FALSE)
 {
     self::initDB();
     $select = array2select($select);
     $where = array2where($where);
     $sql = "select {$select} from " . self::$tablename . " where {$where} and is_delete = 0";
     $sql = self::$dbConn->query($sql);
     $func = $fetch_one ? 'fetch_array' : 'fetch_array_all';
     $res = self::$dbConn->{$func}($sql);
     return $res;
 }
 /**
  * WhWaveAreaUserRelationModel::get_user_by_areaName()
  * 
  * @param mixed $areas
  * @return void
  */
 public static function get_user_by_areaName($areas)
 {
     self::initDB();
     $areas = array2select($areas);
     $areas = str_replace(',', "','", $areas);
     $sql = "select a.areaName as area,c.global_user_name as user from wh_wave_area_info a left join wh_wave_area_user_relation b\n                        on a.id = b.areaId left join power_global_user c on c.global_user_id = b.userId where a.areaName in ('{$areas}')";
     //echo $sql;exit;
     $sql = self::$dbConn->query($sql);
     $res = self::$dbConn->fetch_array_all($sql);
     return $res;
 }
 /**
  * WhOrderPartionPrintDHLModel::get_packageInfo()
  * 获取新加坡DHL口袋信息
  * @param mixed $select
  * @param mixed $where
  * @param bool $fetch_row
  * @return void
  */
 public static function get_packageInfo($select, $where, $fetch_row = FALSE)
 {
     self::initDB();
     $select = array2select($select);
     $where = array2where($where);
     $sql = "select {$select} from " . self::$tablename . ' where ' . $where;
     $sql = self::$dbConn->query($sql);
     $fetch = $fetch_row ? 'fetch_array' : 'fetch_array_all';
     $res = self::$dbConn->{$fetch}($sql);
     return $res;
 }
Beispiel #6
0
 /**
  * WhWaveInfoModel::get_wave_info_by_union_table()
  * 联表查询配货单信息(配货单管理界面查询功能)
  * @param mixed $select
  * @param array $where
  * @return void
  */
 public static function get_wave_info_by_union_table($select, $where)
 {
     self::initDB();
     $select = array2select($select);
     $where = array2where($where);
     $sql = 'select ' . $select . ' from wh_wave_info a left join wh_wave_receive_record c on c.waveId = a.id
                     left join wh_wave_area_info b on b.areaName = c.area left join wh_wave_area_user_relation d
                     on d.areaId = b.id where ' . $where;
     //echo $sql;
     $sql = self::$dbConn->query($sql);
     $res = self::$dbConn->fetch_array_all($sql);
     return $res;
 }
Beispiel #7
0
 /**
  * PcGoodsModel::get_sku_info()
  * 查询料号信息
  * @param array|string $select 查询字段
  * @param array $skuArr 查询的料号集合
  * @return
  */
 public static function get_sku_info($select, $skuArr)
 {
     self::initDB();
     $select = trim(array2select($select));
     //$skuArr     =   trim(array2select($skuArr));
     //$skuArr     =   str_replace('`', '\'', $skuArr);
     $skuArr = implode("','", $skuArr);
     if (!$select || !$skuArr) {
         return FALSE;
     }
     $sql = "select {$select} from pc_goods where sku in ('{$skuArr}') and is_delete = 0";
     //echo $sql;exit;
     $sql = self::$dbConn->query($sql);
     $res = self::$dbConn->fetch_array_all($sql);
     return $res;
 }
 /**
  * WhPositionDistributionModel::get_position_info()
  * 获取仓位信息
  * @param $select 查询字段 数组
  * @param array $position_ids 仓位id集合 多个数组 单个string
  * @param $pName 字符串
  * @return void
  */
 public static function get_position_info($select, $position_ids = '', $pName = '')
 {
     self::initDB();
     $tableName = self::$tablename;
     $select = array2select($select);
     $sql = "select {$select} from {$tableName} where ";
     if (!empty($position_ids)) {
         $position_ids = is_array($position_ids) ? array_unique($position_ids) : $position_ids;
         $position_ids = array2select($position_ids);
         $position_ids = str_replace('`', "'", $position_ids);
         $sql .= "id in ({$position_ids}) and ";
     }
     if ($pName) {
         $sql .= "pName = '{$pName}' and ";
     }
     $sql .= 'id > 0';
     //echo $sql;exit;
     $sql = self::$dbConn->query($sql);
     $res = self::$dbConn->fetch_array_all($sql);
     return $res;
 }
Beispiel #9
0
 /**
  * whShelfModel::selectTallyingList()
  * 获取点货信息
  * @param array or string $seelct
  * @param array $where
  */
 public static function selectTallyingList($select, $where)
 {
     self::initDB();
     $select = array2select($select);
     $where = array2where($where);
     $where .= $where ? ' and is_delete = 0' : ' is_delete = 0';
     $sql = "select {$select} from wh_tallying_list where " . $where;
     $sql = self::$dbConn->query($sql);
     $res = self::$dbConn->fetch_array_all($sql);
     return $res;
 }
Beispiel #10
0
 public static function select($where = '1=1', $fields = '*')
 {
     self::initDB();
     //$wheresql[] = ' where';
     //		if(!$where){
     //			$where = "1=1";
     //		}
     //if(is_numeric($where)){
     //			$wheresql[] = 'id='.$where;
     //		}else if(is_array($where)){
     //			foreach($where as $key => $val){
     //				$whereArr[] = $key."='".$val."'";
     //			}
     //			$wheresql[] = implode(' AND ', $whereArr);
     //		}else{
     //			$wheresql[] = $where;
     //		}
     $where = array2where($where);
     $fields = array2select($fields);
     $sql = "select {$fields} from " . self::$tablename . ' where ' . $where;
     //echo $sql;exit;
     $query = self::$dbConn->query($sql);
     if ($query) {
         $ret = self::$dbConn->fetch_array_all($query);
         return $ret;
         //成功, 返回数据
     } else {
         self::$errCode = "001";
         self::$errMsg = "获取数据失败";
         return false;
         //失败则设置错误码和错误信息, 返回false
     }
 }
Beispiel #11
0
 /**
  * WhIoRecordsModel::selectIoRecords()
  * 获取出入库表记录
  * @author Gary
  * @return void
  */
 public static function selectIoRecords($select, $where)
 {
     self::initDB();
     $select = array2select($select);
     $where = array2where($where);
     $sql = 'SELECT ' . $select . ' from wh_iorecords where ' . $where;
     //echo $sql;exit;
     $sql = self::$dbConn->query($sql);
     $res = self::$dbConn->fetch_array_all($sql);
     return $res;
 }