|
|
@@ -23,6 +23,7 @@ use app\common\model\user\User;
|
|
|
use app\common\model\agricultural_machinery\ServiceCategory as AgriculturalMachineryServiceCategory;
|
|
|
use app\common\model\recharge\RechargeOrder;
|
|
|
use app\common\model\supply_demand\SupplyDemandInfo;
|
|
|
+use app\common\model\supply_demand\SupplyDemandCate;
|
|
|
use app\common\model\ServiceCharge;
|
|
|
use think\facade\Db;
|
|
|
|
|
|
@@ -269,15 +270,27 @@ class UserServiceLogic extends BaseLogic
|
|
|
|
|
|
$cate_name_arr = array_column($SupplyInfo,'name');
|
|
|
$value_arr = array_column($SupplyInfo,'total_num');
|
|
|
-
|
|
|
+ $cate_id_arr = array_column($SupplyInfo,'cate_id');
|
|
|
foreach($SupplyInfo as &$siv){
|
|
|
unset($siv['cate_id']);
|
|
|
$siv['value'] = $siv['total_num'];
|
|
|
unset($siv['total_num']);
|
|
|
}
|
|
|
+
|
|
|
+ $cwhere=[];
|
|
|
+ $cwhere[]=['id','in',$cate_id_arr];
|
|
|
+ $cateList = SupplyDemandCate::where($cwhere)->field('id,pid')->select()->toArray();
|
|
|
+ $pcate_arr = array_column($cateList,'pid');
|
|
|
+ $pcate_arr = array_unique($pcate_arr);
|
|
|
+ $pwhere=[];
|
|
|
+ $pwhere[]=['id','in',$pcate_arr];
|
|
|
+ $pcateList = SupplyDemandCate::where($pwhere)->field('id,name')->select()->toArray();
|
|
|
+ $first_cate_name = [];
|
|
|
+ $first_cate_name =array($pcateList,'name');
|
|
|
$middle['SupplyDemandInfo'] = $SupplyInfo;
|
|
|
$middle['supply_cate_name'] = $cate_name_arr;
|
|
|
$middle['supply_cate_value'] = $value_arr;
|
|
|
+ $middle['supply_first_cate_name'] = $first_cate_name;
|
|
|
|
|
|
return $middle;
|
|
|
}
|