...
|
...
|
@@ -122,16 +122,25 @@ class Activity extends Api |
|
|
if (empty($cid)) {
|
|
|
$this->error('参数错误', ['status' => 2]);
|
|
|
}
|
|
|
$data = db('ronda')
|
|
|
->where('campus_id',$cid)
|
|
|
->select();
|
|
|
foreach ($data as $k => $v){
|
|
|
$data[$k]['campus_title'] = db('campus')->where('id',$v['campus_id'])->value('title');
|
|
|
$data[$k]['ronda_title'] = $v['title'];
|
|
|
$data[$k]['ronda_holdtime'] = date('Y-m-d',$v['holdtime']);
|
|
|
$data[$k]['images'] = cdnurl($v['images'],true);
|
|
|
$data[$k]['details'] = strip_tags($v['details']);
|
|
|
}
|
|
|
$data = db('ronda r')
|
|
|
->join('campus c','c.id = r.campus_id')
|
|
|
->field('r.id as rid,c.title as campus_title,r.title as ronda_title,r.holdtime as ronda_holdtime')
|
|
|
->where('r.campus_id',$cid)
|
|
|
->paginate(10,false)
|
|
|
->each(function ($item,$key){
|
|
|
$item['holdtime'] = date('Y-m-d',$item['ronda_holdtime']);
|
|
|
return $item;
|
|
|
});
|
|
|
// $data = db('ronda')
|
|
|
// ->where('campus_id',$cid)
|
|
|
// ->select();
|
|
|
// foreach ($data as $k => $v){
|
|
|
// $data[$k]['campus_title'] = db('campus')->where('id',$v['campus_id'])->value('title');
|
|
|
// $data[$k]['ronda_title'] = $v['title'];
|
|
|
// $data[$k]['ronda_holdtime'] = date('Y-m-d',$v['holdtime']);
|
|
|
// $data[$k]['images'] = cdnurl($v['images'],true);
|
|
|
// $data[$k]['details'] = strip_tags($v['details']);
|
|
|
// }
|
|
|
$this->success('获取场次列表成功', $data);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -162,7 +171,7 @@ class Activity extends Api |
|
|
$list = $model->where('id',$rid)->value('item_ids');
|
|
|
$item = explode(',',$list);
|
|
|
foreach ($item as $k){
|
|
|
$data[] = db('item')->where('id',$k)->find();
|
|
|
$data[] = db('item')->where('id',$k)->field('id,title')->find();
|
|
|
}
|
|
|
$this->success('获取项目列表成功', $data);
|
|
|
}
|
...
|
...
|
|