...
|
...
|
@@ -56,6 +56,36 @@ class ActivityModel extends Model |
|
|
->toArray();
|
|
|
return $data;
|
|
|
}
|
|
|
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];
|
|
|
$data = $this->alias('a')
|
|
|
->field('a.*,p.province_name,act.type_name')
|
|
|
->join('activity_type act','act.id=a.activity_type','LEFT')
|
|
|
->join('position_province p','p.id=a.position_id','LEFT')
|
|
|
->where($where)
|
|
|
->order($order)
|
|
|
->select()
|
|
|
->toArray();
|
|
|
return $data;
|
|
|
}
|
|
|
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];
|
|
|
$data = $this->alias('a')
|
|
|
->field('a.*,p.province_name,act.type_name')
|
|
|
->join('activity_type act','act.id=a.activity_type','LEFT')
|
|
|
->join('position_province p','p.id=a.position_id','LEFT')
|
|
|
->where($where)
|
|
|
->order($order)
|
|
|
->select()
|
|
|
->toArray();
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
public function findData($where){
|
|
|
$data = $this->where($where)->find();
|
...
|
...
|
|