|
@@ -100,7 +100,7 @@ class Activity extends Api |
|
@@ -100,7 +100,7 @@ class Activity extends Api |
100
|
}
|
100
|
}
|
101
|
$data = db('ronda r')
|
101
|
$data = db('ronda r')
|
102
|
->join('campus c','c.id = r.campus_id')
|
102
|
->join('campus c','c.id = r.campus_id')
|
103
|
- ->field('c.title as campus_title,r.title as ronda_title,r.holdtime as ronda_holdtime')
|
103
|
+ ->field('c.title as campus_title,r.title as ronda_title,r.holdtime as ronda_holdtime,r.id')
|
104
|
->where('r.campus_id',$id)
|
104
|
->where('r.campus_id',$id)
|
105
|
->paginate(10,false);
|
105
|
->paginate(10,false);
|
106
|
$this->success('获取场次列表成功', $data);
|
106
|
$this->success('获取场次列表成功', $data);
|
|
@@ -109,8 +109,7 @@ class Activity extends Api |
|
@@ -109,8 +109,7 @@ class Activity extends Api |
109
|
/**
|
109
|
/**
|
110
|
* @ApiTitle (项目筛选)
|
110
|
* @ApiTitle (项目筛选)
|
111
|
* @ApiMethod (POST)
|
111
|
* @ApiMethod (POST)
|
112
|
- * @ApiParams (name="id", type="string", required=false, description="校区id")
|
|
|
113
|
- * @ApiParams (name="rid", type="string", required=false, description="场次id")
|
112
|
+ * @ApiParams (name="id", type="string", required=false, description="场次id")
|
114
|
* @ApiReturnParams (name="code", type="integer", required=true, description="状态码")
|
113
|
* @ApiReturnParams (name="code", type="integer", required=true, description="状态码")
|
115
|
* @ApiReturnParams (name="msg", type="string", required=true, description="提示语")
|
114
|
* @ApiReturnParams (name="msg", type="string", required=true, description="提示语")
|
116
|
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
|
115
|
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
|
|
@@ -127,17 +126,15 @@ class Activity extends Api |
|
@@ -127,17 +126,15 @@ class Activity extends Api |
127
|
public function getItem()
|
126
|
public function getItem()
|
128
|
{
|
127
|
{
|
129
|
$id = $this->request->param('id');
|
128
|
$id = $this->request->param('id');
|
130
|
- $rid = $this->request->param('rid');
|
|
|
131
|
if (empty($id)) {
|
129
|
if (empty($id)) {
|
132
|
$this->error('参数错误', ['status' => 2]);
|
130
|
$this->error('参数错误', ['status' => 2]);
|
133
|
}
|
131
|
}
|
134
|
$data = db('item i')
|
132
|
$data = db('item i')
|
135
|
- ->join('campus c','c.id = i.campus_id')
|
|
|
136
|
->join('ronda r','r.id = i.ronda_id')
|
133
|
->join('ronda r','r.id = i.ronda_id')
|
137
|
- ->field('i.*')
|
134
|
+ ->join('campus c','r.campus_id as c.id')
|
|
|
135
|
+ ->field('i.*,c.title as campus_title')
|
138
|
->where([
|
136
|
->where([
|
139
|
- 'i.campus_id' => $id,
|
|
|
140
|
- 'i.ronda_id' => $rid
|
137
|
+ 'i.ronda_id' => $id
|
141
|
])
|
138
|
])
|
142
|
->paginate(10,false);
|
139
|
->paginate(10,false);
|
143
|
$this->success('获取项目列表成功', $data);
|
140
|
$this->success('获取项目列表成功', $data);
|
|
@@ -171,7 +168,6 @@ class Activity extends Api |
|
@@ -171,7 +168,6 @@ class Activity extends Api |
171
|
/**
|
168
|
/**
|
172
|
* @ApiTitle (项目详情)
|
169
|
* @ApiTitle (项目详情)
|
173
|
* @ApiMethod (POST)
|
170
|
* @ApiMethod (POST)
|
174
|
- * @ApiParams (name="cid", type="string", required=false, description="校区id")
|
|
|
175
|
* @ApiParams (name="rid", type="string", required=false, description="场次id")
|
171
|
* @ApiParams (name="rid", type="string", required=false, description="场次id")
|
176
|
* @ApiParams (name="id", type="string", required=false, description="项目id")
|
172
|
* @ApiParams (name="id", type="string", required=false, description="项目id")
|
177
|
* @ApiReturnParams (name="code", type="integer", required=true, description="状态码")
|
173
|
* @ApiReturnParams (name="code", type="integer", required=true, description="状态码")
|
|
@@ -182,26 +178,27 @@ class Activity extends Api |
|
@@ -182,26 +178,27 @@ class Activity extends Api |
182
|
"msg": "提示消息",
|
178
|
"msg": "提示消息",
|
183
|
"data": {
|
179
|
"data": {
|
184
|
"campus_title": "校区名称",
|
180
|
"campus_title": "校区名称",
|
|
|
181
|
+ "ronda_title": "场次名称",
|
185
|
"images": "项目图片",
|
182
|
"images": "项目图片",
|
186
|
"details": "项目详情"
|
183
|
"details": "项目详情"
|
187
|
})
|
184
|
})
|
188
|
*/
|
185
|
*/
|
189
|
public function getItemDetails()
|
186
|
public function getItemDetails()
|
190
|
{
|
187
|
{
|
191
|
- $cid = $this->request->param('cid');
|
|
|
192
|
$rid = $this->request->param('rid');
|
188
|
$rid = $this->request->param('rid');
|
193
|
$id = $this->request->param('id');
|
189
|
$id = $this->request->param('id');
|
194
|
$data = db('item i')
|
190
|
$data = db('item i')
|
195
|
->join('item_details d','d.item_id = i.id')
|
191
|
->join('item_details d','d.item_id = i.id')
|
196
|
- ->join('campus c','c.id = i.campus_id')
|
|
|
197
|
- ->field('c.title as campus_title,d.images,i.details')
|
192
|
+ ->join('ronda r','i.ronda_id = r.id')
|
|
|
193
|
+ ->join('campus c','c.id = r.campus_id')
|
|
|
194
|
+ ->field('c.title as campus_title,r.title as ronda_title,r.holdtime,d.images,i.details')
|
198
|
->where([
|
195
|
->where([
|
199
|
- 'i.campus_id'=>$cid,
|
|
|
200
|
'i.ronda_id'=>$rid,
|
196
|
'i.ronda_id'=>$rid,
|
201
|
'i.id'=> $id,
|
197
|
'i.id'=> $id,
|
202
|
])
|
198
|
])
|
203
|
->find();
|
199
|
->find();
|
204
|
$data['images'] = cdnurl($data['images'], true);
|
200
|
$data['images'] = cdnurl($data['images'], true);
|
|
|
201
|
+ $data['holdtime'] = date('Ymd',$data['holdtime']);
|
205
|
$this->success('获取项目详情成功', $data);
|
202
|
$this->success('获取项目详情成功', $data);
|
206
|
}
|
203
|
}
|
207
|
} |
204
|
} |