|
@@ -23,15 +23,6 @@ class Index extends Api
|
|
|
{
|
|
|
$this->success('请求成功');
|
|
|
}
|
|
|
-
|
|
|
- //轮播图
|
|
|
- public function banner()
|
|
|
- {
|
|
|
- $list = Db::name('banner')->field('id, title, image, url')->order('weigh', 'desc')->select();
|
|
|
-
|
|
|
- $list = list_domain_image($list, ['image']);
|
|
|
- $this->success('轮播图', $list);
|
|
|
- }
|
|
|
|
|
|
//接线员
|
|
|
public function operator()
|
|
@@ -359,9 +350,71 @@ class Index extends Api
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //轮播图
|
|
|
+ public function banner()
|
|
|
+ {
|
|
|
+ $list = Db::name('banner')->field('id, title, image, url')->order('weigh', 'desc')->select();
|
|
|
+
|
|
|
+ $this->success('轮播图', $list);
|
|
|
+ }
|
|
|
+
|
|
|
+ //活动列表
|
|
|
+ public function activelist() {
|
|
|
+ $type = input('type', 0, 'intval'); //分类:1=休闲,2=中度
|
|
|
+ $keyword = input('keyword', '', 'trim'); //关键字
|
|
|
+
|
|
|
+ $where['signupendtime'] = ['gt', time()];
|
|
|
+ $where['status'] = 0;
|
|
|
+ if ($type) {
|
|
|
+ $where['type'] = $type;
|
|
|
+ }
|
|
|
+ if ($keyword !== '') {
|
|
|
+ $where['title|desc|remark|collectionplace|leader'] = ['like', '%'.$keyword.'%'];
|
|
|
+ }
|
|
|
+
|
|
|
+ $list = Db::name('active')->field('id, type, title, desc, remark, image, price, maxperson, currentperson')
|
|
|
+ ->where($where)->page($this->page, $this->pagenum)->order('createtime', 'desc')->select();
|
|
|
+
|
|
|
+ foreach ($list as &$v) {
|
|
|
+ if ($v['maxperson'] <= $v['currentperson']) {
|
|
|
+ $v['is_full'] = 1;
|
|
|
+ } else {
|
|
|
+ $v['is_full'] = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->success('活动列表', $list);
|
|
|
+ }
|
|
|
+
|
|
|
+ //活动详情
|
|
|
+ public function activeinfo() {
|
|
|
+ $id = input('id', 0, 'intval');
|
|
|
+ if (!$id) {
|
|
|
+ $this->error('参数缺失');
|
|
|
+ }
|
|
|
+
|
|
|
+ $info = Db::name('active')->find($id);
|
|
|
+ if (!$info) {
|
|
|
+ $this->error('数据不存在');
|
|
|
+ }
|
|
|
|
|
|
+ $info['starttime'] = date('Y-m-d H:i', $info['starttime']);
|
|
|
+ $info['endtime'] = date('Y-m-d H:i', $info['endtime']);
|
|
|
+ $info['collectiontime'] = date('Y-m-d H:i', $info['collectiontime']);
|
|
|
+ $info['signupendtime'] = date('Y-m-d H:i', $info['signupendtime']);
|
|
|
+ $info['refundendtime'] = date('Y-m-d H:i', $info['refundendtime']);
|
|
|
+ //查询已报名列表
|
|
|
+ $active_people = Db::name('active_people')->where(['active_id' => $id])->field('user_id, name, createtime')->select();
|
|
|
+ $user = Db::name('user');
|
|
|
+ foreach ($active_people as &$v) {
|
|
|
+ $v['avatar'] = $user->where(['id' => $v['user_id']])->value('avatar');
|
|
|
+ $v['createtime'] = date('Y-m-d H:i:s', $v['createtime']);
|
|
|
+ }
|
|
|
|
|
|
+ $info['active_people'] = $active_people;
|
|
|
|
|
|
+ $this->success('招标详情', $info);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|