diff --git a/app/taoguaninventory/model/inventory.php b/app/taoguaninventory/model/inventory.php index ce1e160c..112370d8 100644 --- a/app/taoguaninventory/model/inventory.php +++ b/app/taoguaninventory/model/inventory.php @@ -1,19 +1,4 @@ model('branch')->dump($post['branch_id']); @@ -797,6 +777,14 @@ class taoguaninventory_mdl_inventory extends dbeav_model{ } function getProductPos($product_id,$branch_id=0){ + if (is_array($product_id)) { + $product_id = reset($product_id); + } + $product_id = intval($product_id); + if (!$product_id) { + return array(); + } + $sql = 'select bp.store_position as pos_name, bp.pos_id, create_time from sdb_ome_branch_product_pos as bpp @@ -822,9 +810,9 @@ class taoguaninventory_mdl_inventory extends dbeav_model{ } /** - * 彻底删除盘点 - * - */ + *彻底删除盘点 + * + */ function batch_delete($data){ $db = kernel::database(); if($data){ @@ -855,7 +843,13 @@ class taoguaninventory_mdl_inventory extends dbeav_model{ #查询条形码对应的bm_id $bm_ids = $basicMaterialBarcode->getBmidListByBarcode($barcode); - + if (is_array($bm_ids)) { + $bm_ids = reset($bm_ids); + } + if (empty($bm_ids)) { + return false; + } + $basicMateriaItem = $basicMaterialLib->getBasicMaterialDetail($bm_ids); if ($basicMateriaItem) { @@ -916,8 +910,8 @@ class taoguaninventory_mdl_inventory extends dbeav_model{ } /** - * search 有两个值key 时是按键返回值 value时按值返回键 - */ + * search 有两个值key 时是按键返回值 value时按值返回键 + */ function get_inventory_type($inventory_type,$search){ $type = array ( '1' => '自定义', @@ -934,13 +928,6 @@ class taoguaninventory_mdl_inventory extends dbeav_model{ return $result; } } - /** - * _filter - * @param mixed $filter filter - * @param mixed $tableAlias tableAlias - * @param mixed $baseWhere baseWhere - * @return mixed 返回值 - */ public function _filter($filter, $tableAlias=null, $baseWhere=null) { @@ -1160,4 +1147,4 @@ class taoguaninventory_mdl_inventory extends dbeav_model{ return $content; } -} \ No newline at end of file +}