...
|
...
|
@@ -95,23 +95,19 @@ class Activity extends Api |
|
|
*/
|
|
|
public function getItemRonda()
|
|
|
{
|
|
|
$row = $this->request->param('row');
|
|
|
$page = $this->request->param('page');
|
|
|
$row = $row ? $row : 10;
|
|
|
$page = $page ? $page : 1;
|
|
|
$id = $this->request->param('id');
|
|
|
if (empty($id)) {
|
|
|
$this->error('参数错误', ['status' => 2]);
|
|
|
}
|
|
|
$data = db('item_ronda_rel')
|
|
|
->field('campus_id,ronda_id,item_id')
|
|
|
->where('campus_id',$id)
|
|
|
->paginate($row,false,['page'=>$page])
|
|
|
$data = db('item i')
|
|
|
->join('item_details d','d.item_id = i.id')
|
|
|
->join('ronda r','i.ronda_id = r.id')
|
|
|
->join('campus c','c.id = i.campus_id')
|
|
|
->field('c.title as campus_title,i.campus_id,i.ronda_id,i.title,i.details,d.images,r.title as ronda_title,r.holdtime as ronda_holdtime')
|
|
|
->where('i.campus_id',$id)
|
|
|
->paginate(10)
|
|
|
->each(function ($item,$key){
|
|
|
$item['ronda'] = db('ronda')->where('id',$item['ronda_id'])->field('title,holdtime')->find();
|
|
|
$item['item'] = db('item')->where('id',$item['item_id'])->value('title');
|
|
|
$item['item_details'] = db('item_details')->where('item_id',$item['item_id'])->field('images,details')->find();
|
|
|
$item['item_details']['images'] = cdnurl($item['item_details']['images'], true);
|
|
|
$item['images'] = cdnurl($item['images'],true);
|
|
|
return $item;
|
|
|
});
|
|
|
$this->success('项目场次日期', $data);
|
...
|
...
|
@@ -138,8 +134,11 @@ class Activity extends Api |
|
|
public function getItemDetails()
|
|
|
{
|
|
|
$id = $this->request->param('id');
|
|
|
$data = db('item_details')
|
|
|
->where('item_id', $id)
|
|
|
$data = db('item i')
|
|
|
->join('item_details d','d.item_id = i.id')
|
|
|
->join('campus c','c.id = i.campus_id')
|
|
|
->field('c.title as campus_title,d.images,i.details')
|
|
|
->where('i.id', $id)
|
|
|
->find();
|
|
|
$data['images'] = cdnurl($data['images'], true);
|
|
|
$this->success('', $data);
|
...
|
...
|
|