|
...
|
...
|
@@ -25,16 +25,24 @@ class DetailController extends BaseController |
|
|
|
* @method :post
|
|
|
|
* @time :2024/11/13 9:53
|
|
|
|
*/
|
|
|
|
public function getDetail(Detail $detail){
|
|
|
|
public function getDetail(Detail $detail,Column $column){
|
|
|
|
$this->request->validate([
|
|
|
|
'product_id'=>'required',
|
|
|
|
'column_id'=>'required'
|
|
|
|
],[
|
|
|
|
'product_id.required' => '产品id不能为空',
|
|
|
|
'column_id.required' => '栏目id不能为空',
|
|
|
|
]);
|
|
|
|
$data = $detail->list($this->map,'sort',['*'],'asc');
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
$data_column = $column->list([],'id',['*'],'asc');
|
|
|
|
if(!empty($data_column) && !empty($data)){
|
|
|
|
foreach ($data_column as $k => $v){
|
|
|
|
foreach ($data as $k1 => $v1){
|
|
|
|
if($v['id'] == $v1['column_id']){
|
|
|
|
$data_column[$k]['data'][] = $v1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$data_column);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|