|
|
@@ -56,7 +56,8 @@ class CfItem extends Backend |
|
|
|
$list = $this->model |
|
|
|
->alias("a") |
|
|
|
->join('hbp_admin c','a.create_id = c.id','left') |
|
|
|
->field("a.*,c.nickname") |
|
|
|
->join('hbp_admin d','a.purchase_user_id = d.id','left') |
|
|
|
->field("a.*,c.nickname,d.nickname as purchase_user_name") |
|
|
|
->where($where); |
|
|
|
if ($group_id){ |
|
|
|
$list = $list |
|
|
@@ -71,9 +72,12 @@ class CfItem extends Backend |
|
|
|
|
|
|
|
$config = \think\Config::get("site.item_category"); |
|
|
|
$config = json_decode($config,true); |
|
|
|
$config1 = \think\Config::get("site.item_unit"); |
|
|
|
$config1 = json_decode($config1,true); |
|
|
|
$res = $list->items(); |
|
|
|
foreach ($res as $key=>$val){ |
|
|
|
$res[$key]["item_type_name"]=$config[$val["item_type"]]; |
|
|
|
$res[$key]["item_unit"]=$config1[$val["item_unit"]]; |
|
|
|
} |
|
|
|
$result = array("total" => $list->total(), "rows" => $list->items()); |
|
|
|
return json($result); |
|
|
@@ -221,6 +225,11 @@ class CfItem extends Backend |
|
|
|
foreach ($result as $key=>$value){ |
|
|
|
$result[$key]["item_type_name"]= $config[$value["item_type"]]; |
|
|
|
} |
|
|
|
$config = \think\Config::get("site.item_unit"); |
|
|
|
$config = json_decode($config,true); |
|
|
|
foreach ($result as $key=>$value){ |
|
|
|
$result[$key]["item_unit"]= $config[$value["item_unit"]]; |
|
|
|
} |
|
|
|
if($keyValue){ |
|
|
|
return json(['list' => $result]); |
|
|
|
} |
|
|
|