$languageId, 'status' => 0, ]; if (isset($data['join_type_id']) && $data['join_type_id'] != 0) { $where['join_type_id'] = $data['join_type_id']; } return $this->where($where)->order('sort','desc')->select()->toArray(); } /** * 获取品牌矩阵分类 * @param $languageId * @param $data * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function getJoinTypeList($languageId,$data):array { $result = JoinType::where('site_id',$languageId)->select()->toArray(); if (!empty($result)) { foreach ($result as $key => $item) { $result[$key]['is_display'] = !empty($data) ? isset($data['join_type_id']) && $data['join_type_id'] == $item['id'] : $item['id'] == 0; } return $result; } return []; } /** * @param $languageId * @param $data * @return array|string[] * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function getJoinBanner($languageId,$data):array { $space = AdvertiseSpace::where('name',$data)->select()->toArray(); if (!empty($space)) { return $this->getBanner($languageId,$space[0]['id']); } return ['image' => '']; } }