|
@@ -28,6 +28,7 @@ use app\common\service\{
|
|
|
};
|
|
};
|
|
|
use app\common\model\agricultural_machinery\UserService;
|
|
use app\common\model\agricultural_machinery\UserService;
|
|
|
use app\common\model\agricultural_machinery\ServiceCategory;
|
|
use app\common\model\agricultural_machinery\ServiceCategory;
|
|
|
|
|
+use app\common\model\supply_demand\SupplyDemandCate;
|
|
|
use app\common\model\ServiceCharge;
|
|
use app\common\model\ServiceCharge;
|
|
|
use app\common\model\asset\AssetArea;
|
|
use app\common\model\asset\AssetArea;
|
|
|
use app\common\model\recharge\RechargeOrder;
|
|
use app\common\model\recharge\RechargeOrder;
|
|
@@ -56,6 +57,7 @@ class SupplyDemandLogic extends BaseLogic
|
|
|
SupplyDemandInfo::create([
|
|
SupplyDemandInfo::create([
|
|
|
'user_id' => $params['user_id'],
|
|
'user_id' => $params['user_id'],
|
|
|
'type' => $params['type'] ?? 1,
|
|
'type' => $params['type'] ?? 1,
|
|
|
|
|
+ 'cate_id' => $params['cate_id'],
|
|
|
'title' => $params['title'],
|
|
'title' => $params['title'],
|
|
|
'mobile' => $params['mobile'],
|
|
'mobile' => $params['mobile'],
|
|
|
'content' =>$params['content'],
|
|
'content' =>$params['content'],
|
|
@@ -85,7 +87,7 @@ class SupplyDemandLogic extends BaseLogic
|
|
|
$where = [];
|
|
$where = [];
|
|
|
$where[]=['id','=',$params['id']];
|
|
$where[]=['id','=',$params['id']];
|
|
|
|
|
|
|
|
- $supplyDemandInfo = SupplyDemandInfo::where($where) ->append(['type_desc','images','user'])->findOrEmpty()->toArray();
|
|
|
|
|
|
|
+ $supplyDemandInfo = SupplyDemandInfo::where($where) ->append(['type_desc','cateInfo','images','user'])->findOrEmpty()->toArray();
|
|
|
|
|
|
|
|
return ['code'=>true,'data'=>$supplyDemandInfo];
|
|
return ['code'=>true,'data'=>$supplyDemandInfo];
|
|
|
} catch (\Exception $e) {
|
|
} catch (\Exception $e) {
|
|
@@ -420,4 +422,34 @@ class SupplyDemandLogic extends BaseLogic
|
|
|
'is_new_user' => YesNoEnum::NO
|
|
'is_new_user' => YesNoEnum::NO
|
|
|
]);
|
|
]);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @notes 供应分类列表
|
|
|
|
|
+ * @author 段誉
|
|
|
|
|
+ * @date 2022/9/16 17:56
|
|
|
|
|
+ */
|
|
|
|
|
+ public static function getCateList($get)
|
|
|
|
|
+ {
|
|
|
|
|
+ $where=[];
|
|
|
|
|
+ $where[]=['type','=',$get['type']];
|
|
|
|
|
+ $where[]=['status','=',1];
|
|
|
|
|
+ if(isset($get['name'])){
|
|
|
|
|
+ $where[]=['name','like','%'.$get['name'].'%'];
|
|
|
|
|
+ }
|
|
|
|
|
+ $cate_list = SupplyDemandCate::where($where)->field('id,name,pid')->order('sort desc,id asc')->select()->toArray();
|
|
|
|
|
+ if($get['is_tree'] == 1) {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ $treeList = linear_to_tree($cate_list, 'children');
|
|
|
|
|
+ if (empty($treeList) && !empty($cate_list)) {
|
|
|
|
|
+ foreach ($cate_list as &$v) {
|
|
|
|
|
+ $v['children'] = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ return $cate_list;
|
|
|
|
|
+ }
|
|
|
|
|
+ return $treeList;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ return $cate_list;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|