diff --git a/admin/controllers/items/goods/Goods.php b/admin/controllers/items/goods/Goods.php index 7f7bdefd..be71d9dc 100644 --- a/admin/controllers/items/goods/Goods.php +++ b/admin/controllers/items/goods/Goods.php @@ -243,12 +243,12 @@ class Goods extends HD_Controller if ($count) { switch ($search_type) { case 1://精品筛选 - $fileds = 'id,brand_id,s_id,vin,v_id,cor_id,incor_id,in_time,bill_time,biz_id,addr_id,count(type_id) as fine_num'; + $fileds = 'id,brand_id,s_id,vin,v_id,cor_id,incor_id,in_time,bill_time,biz_id,addr_id,count(type_id) as fine_num,company_id'; $orderby = "{$order} {$sort}"; $rows = $this->mdItems->select_fine($where_1, $orderby, $page, $size, $fileds); break; case 2://订单筛选 - $fileds = 'm.id, m.brand_id, m.s_id, m.vin, m.v_id, m.cor_id, m.incor_id, m.in_time, m.bill_time, m.biz_id, m.addr_id'; + $fileds = 'm.id, m.brand_id, m.s_id, m.vin, m.v_id, m.cor_id, m.incor_id, m.in_time, m.bill_time, m.biz_id, m.addr_id,m.company_id'; if (in_array($order, array('admin_id', 'mobile'))) { $orderby = "j.{$order} {$sort}"; } else if ('uname' == $order) { @@ -259,7 +259,7 @@ class Goods extends HD_Controller $rows = $this->mdItems->select_order($where_2, $orderby, $page, $size, $fileds); break; case 3://精品+订单筛选 - $fileds = 'm.id, m.brand_id, m.s_id, m.vin, m.v_id, m.cor_id, m.incor_id, m.in_time, m.bill_time, m.biz_id,m.addr_id, count(j2.type_id) as fine_num'; + $fileds = 'm.id, m.brand_id, m.s_id, m.vin, m.v_id, m.cor_id, m.incor_id, m.in_time, m.bill_time, m.biz_id,m.addr_id, count(j2.type_id) as fine_num,m.company_id'; if (in_array($order, array('admin_id', 'mobile'))) { $orderby = "j.{$order} {$sort}"; } else if ('uname' == $order) { @@ -270,12 +270,12 @@ class Goods extends HD_Controller $rows = $this->mdItems->select_order_fine($where_3, $orderby, $page, $size, $fileds); break; default: - $fileds = 'id,brand_id,s_id,vin,v_id,cor_id,incor_id,in_time,bill_time,biz_id,addr_id'; + $fileds = 'id,brand_id,s_id,vin,v_id,cor_id,incor_id,in_time,bill_time,biz_id,addr_id,company_id'; $orderby = "{$order} {$sort}"; $rows = $this->mdItems->select($where, $orderby, $page, $size, $fileds); } - $brand_ids = $s_ids = $attr_vids = $attr_corids = $attr_incorids = $biz_ids = $addr_ids = array(); + $company_ids = $brand_ids = $s_ids = $attr_vids = $attr_corids = $attr_incorids = $biz_ids = $addr_ids = array(); $ids = array(); foreach ($rows as $v) { $ids[] = $v['id']; @@ -286,8 +286,9 @@ class Goods extends HD_Controller $v['v_id'] && !in_array($v['v_id'], $attr_vids) && $attr_vids[] = $v['v_id']; $v['cor_id'] && !in_array($v['cor_id'], $attr_corids) && $attr_corids[] = $v['cor_id']; $v['incor_id'] && !in_array($v['incor_id'], $attr_incorids) && $attr_incorids[] = $v['incor_id']; + $v['company_id'] && !in_array($v['company_id'], $company_ids) && $company_ids[] = $v['company_id']; } - $map_brand = $map_sery = $map_vid = $map_corid = $map_incorid = $map_biz = $map_addr = array(); + $map_company = $map_brand = $map_sery = $map_vid = $map_corid = $map_incorid = $map_biz = $map_addr = array(); if ($brand_ids) { $str_ids = implode(',', $brand_ids); $where = array("id in ({$str_ids})" => null); @@ -328,6 +329,11 @@ class Goods extends HD_Controller $map_addr[$v['id']] = "{$v['city_name']} {$v['county_name']} 其它 {$v['title']}"; } } + if ($company_ids) { + $str_ids = implode(',', $company_ids); + $where = array("id in ({$str_ids})" => null); + $map_company = $this->sys_company_model->map('id', 'short', $where); + } $map_item_fine = array(); $map_order = array(); @@ -423,6 +429,7 @@ class Goods extends HD_Controller 'in_time' => '0000-00-00 00:00:00' == $v['in_time'] ? '' : substr($v['in_time'], 0, 10), 'sold_time' => '0000-00-00 00:00:00' == $v['bill_time'] ? '' : substr($v['bill_time'], 0, 10), 'fine_ids' => $map_item_fine[$v['id']] ? $map_item_fine[$v['id']] : array(), + 'company_name' => $map_company[$v['company_id']] ? $map_company[$v['company_id']] : '', 'admin_name' => $order ? $order['admin_name'] : '', 'uname' => $order ? $order['uname'] : '', 'mobile' => $order ? (SUPER_ADMIN == $this->role ? $order['mobile'] : substr_replace($order['mobile'], '*****', 0, 5)) : '', @@ -906,7 +913,6 @@ class Goods extends HD_Controller $params['cor_id'] = ''; } - //地址筛选 //地址筛选 if ($params['biz_id']) { $where['biz_id'] = $params['biz_id']; @@ -1077,6 +1083,7 @@ class Goods extends HD_Controller 'stdard_num' => '合格证号', 'bill_num' => '开票号', 'auto_fine' => '精品加装', + 'company_name' => '公司归属', 'status' => '状态', 'in_time' => '入库时间', 'out_time' => '出库时间', @@ -1113,7 +1120,7 @@ class Goods extends HD_Controller } $lists[] = $indexs; - $brand_ids = $s_ids = $attr_vids = $attr_corids = $attr_incorids = $biz_ids = $addr_ids = array(); + $company_ids = $brand_ids = $s_ids = $attr_vids = $attr_corids = $attr_incorids = $biz_ids = $addr_ids = array(); $ids = array(); foreach ($rows as $v) { $ids[] = $v['id']; @@ -1124,9 +1131,10 @@ class Goods extends HD_Controller $v['v_id'] && !in_array($v['v_id'], $attr_vids) && $attr_vids[] = $v['v_id']; $v['cor_id'] && !in_array($v['cor_id'], $attr_corids) && $attr_corids[] = $v['cor_id']; $v['incor_id'] && !in_array($v['incor_id'], $attr_incorids) && $attr_incorids[] = $v['incor_id']; + $v['company_id'] && !in_array($v['company_id'], $company_ids) && $company_ids[] = $v['company_id']; } - $map_brand = $map_sery = $map_vid = $map_corid = $map_incorid = $map_biz = $map_addr = array(); + $map_company = $map_brand = $map_sery = $map_vid = $map_corid = $map_incorid = $map_biz = $map_addr = array(); if ($brand_ids) { $str_ids = implode(',', $brand_ids); $where = array("id in ({$str_ids})" => null); @@ -1164,7 +1172,11 @@ class Goods extends HD_Controller $select = 'id, title, city_name, county_name'; $map_addr = $this->addr_model->map('id', '*', $where, $orderby, 0, 0, $select); } - + if ($company_ids) { + $str_ids = implode(',', $company_ids); + $where = array("id in ({$str_ids})" => null); + $map_company = $this->sys_company_model->map('id', 'short', $where); + } //获取精品加装 $str_ids = implode(',', $ids); $where = array("item_id in ({$str_ids})" => null, 'type' => 1, 'status' => 1); @@ -1231,6 +1243,7 @@ class Goods extends HD_Controller 'stdard_num' => $v['stdard_num'], 'bill_num' => $v['bill_num'], 'auto_fine' => $auto_fine, + 'company_name' => $map_company[$v['company_id']], 'status' => $this->statusAry[$v['status']], 'in_time' => '0000-00-00 00:00:00' == $v['in_time'] ? '' : $v['in_time'], 'out_time' => '0000-00-00 00:00:00' == $v['out_time'] ? '' : $v['out_time'], diff --git a/admin/views/items/goods/lists.php b/admin/views/items/goods/lists.php index 5568cc09..8a0e61ee 100644 --- a/admin/views/items/goods/lists.php +++ b/admin/views/items/goods/lists.php @@ -162,7 +162,7 @@ - - - + @@ -221,6 +224,7 @@ +
+ 车辆 @@ -180,7 +180,7 @@ + 存放地 @@ -189,7 +189,7 @@ + 入库日期 @@ -207,6 +207,9 @@ + 公司归属 + 操作
{{v.address}} {{v.in_time}} {{v.auto_fine}}{{v.company_name}} 轨迹