feature/main20240421
郭嘉 8 months ago
parent faf254b49a
commit 4bbc9ef582
  1. 16
      app/api/controller/Category.php
  2. 7
      app/common/model/Category.php

@ -61,20 +61,8 @@ class Category extends Controller
if (!empty($arr)) { if (!empty($arr)) {
$arr1 = ['cataIds' => $arr]; $arr1 = ['cataIds' => $arr];
} }
$list = $model->getListPublic($this->request->param(), $arr1);
$tmplist = [];
foreach ($list as $kl => $l) {
$tmplist[$kl] = $this->listcata($list, $hasGoods);
}
return $this->renderSuccess(compact('tmplist'));
}
public function listcata($list, $hasGoods) {
foreach ($list as $kl => $l) {
}
$list = $model->getListPublic($this->request->param(), $arr1);
return $this->renderSuccess(compact('list'));
} }
} }

@ -114,13 +114,14 @@ class Category extends BaseModel
$filter[] = ['parent_id', '=', $params['category_id']]; $filter[] = ['parent_id', '=', $params['category_id']];
} }
if (isset($param['merchantId']) && $param['merchantId'] != "") { /* if (isset($param['merchantId']) && $param['merchantId'] != "") {
$filter[] = ['merchant_id', '=', $params['merchantId']]; $filter[] = ['merchant_id', '=', $params['merchantId']];
} }*/
if (isset($param['cataIds']) && $param['cataIds'] != "") { if (isset($param['cataIds']) && !empty($param['cataIds'])) {
$filter[] = ['category_id', 'in', $param['cataIds']]; $filter[] = ['category_id', 'in', $param['cataIds']];
} }
//print_r($filter);die;
// 查询列表数据 // 查询列表数据
return $this->with(['image','rankimage']) return $this->with(['image','rankimage'])

Loading…
Cancel
Save