error('姓名不能为空'); // if ($where['phone'] == '') $this->error('电话不能为空'); // if ($where['address'] == '') $this->error('地址信息不能为空'); // if ($where['image'] == '') $this->error('照片不能为空'); // if ($where['birth'] == '') $this->error('生日不能为空'); $where['cid'] = $this->cid; $where['user_id'] = $this->auth->getUserinfo()['id']; if (VolunteerModel::where('user_id', $where['user_id'])->where('status', '>', -1)->find()) $this->error('已经存,不能重复申请'); try { if (!VolunteerModel::create($where)) { $this->error(VolunteerModel::getErrorInfo()); } $this->success('创建成功'); } catch (Exception $e) { $this->error($e->getMessage()); } } public function lst() { $this->success('获取成功', VolunteerModel::where('cid', $this->cid)->where('user_id', $this->auth->getUserinfo()['id'])->select()); } }