作者 sgj
1 个管道 的构建 通过 耗费 1 秒

添加城市和对应的活动类型

... ... @@ -59,8 +59,9 @@ class ActivityModel extends Model
public function selectCityData($city_id){
$order = "create_time desc";
$where['a.delete_time'] = ['eq',0];
$where['a.position_id'] = $city_id;
$where['is_up'] = ['eq',1];
if (!empty($city_id)){
$where['a.position_id'] = $city_id;
}
$data = $this->alias('a')
->field('a.*,p.province_name,act.type_name')
->join('activity_type act','act.id=a.activity_type','LEFT')
... ... @@ -74,8 +75,11 @@ class ActivityModel extends Model
public function selectTypeData($type_id){
$order = "create_time desc";
$where['a.delete_time'] = ['eq',0];
$where['a.activity_type'] = $type_id;
$where['is_up'] = ['eq',1];
if (!empty($type_id)){
$where['a.activity_type'] = $type_id;
}
$data = $this->alias('a')
->field('a.*,p.province_name,act.type_name')
->join('activity_type act','act.id=a.activity_type','LEFT')
... ...
... ... @@ -56,6 +56,7 @@ class JoinModel extends Model
$where['j.user_id']=$userId;
$where['j.status']=['>',1];
$info=$this->alias('j')
->field('a.*,at.type_name,pp.*')
->join('cmf_activity a','a.id=j.activity_id')
->join('cmf_activity_type at','a.activity_type=at.id')
->join('cmf_position_province pp','a.position_id=pp.id')
... ...