...
|
...
|
@@ -35,7 +35,7 @@ use addons\epay\library\Service; |
|
|
*/
|
|
|
class User extends Api
|
|
|
{
|
|
|
protected $noNeedLogin = ['registerUser','agreementUser','registerCompany','agreementCompany','login','resetpwd','exam','noLogin'];
|
|
|
protected $noNeedLogin = ['registerUser','agreementUser','registerCompany','agreementCompany','login','resetpwd','exam','noLogin','problemList','problemInfo'];
|
|
|
protected $noNeedRight = ['*'];
|
|
|
|
|
|
public function _initialize()
|
...
|
...
|
@@ -1687,30 +1687,28 @@ class User extends Api |
|
|
* @ApiSummary (常见问题)
|
|
|
* @ApiMethod (POST)
|
|
|
*
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="page", type="inter", required=false, description="当前页(默认1)")
|
|
|
* @ApiParams (name="page_num", type="inter", required=false, description="每页显示数据个数(默认10)")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1600167138",
|
|
|
"data": {
|
|
|
"total": 1, //数据总数
|
|
|
"list": [{
|
|
|
"id": 7, //消息ID
|
|
|
"title": "这是个消息", //消息标题
|
|
|
"createtime": "2020.09.12 20:45" //发送时间
|
|
|
}]
|
|
|
}
|
|
|
})
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1602814874",
|
|
|
"data": {
|
|
|
"total": 1, //数据总数
|
|
|
"list": [{
|
|
|
"id": 7, //问题ID
|
|
|
"title": "常见问题测试", //标题
|
|
|
"createtime": "2020.09.12 20:45" //发布时间
|
|
|
}]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function problemList()
|
|
|
{
|
|
|
$page = $this->request->param('page', 1, 'intval');
|
|
|
$page_num = $this->request->param('page_num', 10, 'intval');
|
|
|
$data = Problem::where('user_id',$this->auth->id)
|
|
|
->order('createtime desc')
|
|
|
$data = Problem::order('createtime desc')
|
|
|
->paginate($page_num,false,['page'=>$page])
|
|
|
->each(function($v){
|
|
|
$v['createtime'] = date('Y.m.d H:i',$v['createtime']);
|
...
|
...
|
@@ -1725,23 +1723,20 @@ class User extends Api |
|
|
* @ApiSummary (常见问题-详情)
|
|
|
* @ApiMethod (POST)
|
|
|
*
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="problem_id", type="inter", required=true, description="问题ID")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1600167441",
|
|
|
"data": {
|
|
|
"id": 7, //消息ID
|
|
|
"user_id": 16, //用户ID
|
|
|
"title": "这是个消息", //消息标题
|
|
|
"content": "这个消息还不错Q", //消息内容
|
|
|
"is_read": "1", //是否已读:0=否,1=是
|
|
|
"createtime": 1599914736,
|
|
|
"updatetime": 1600167441
|
|
|
}
|
|
|
})
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1602815306",
|
|
|
"data": {
|
|
|
"id": 7, //问题ID
|
|
|
"title": "常见问题测试", //问题标题
|
|
|
"content": "<p>常见问题测试内容</p>", //问题内容
|
|
|
"createtime": 1599914736,
|
|
|
"updatetime": 1599914736
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function problemInfo()
|
|
|
{
|
...
|
...
|
|