60 lines
1.3 KiB
PHP
60 lines
1.3 KiB
PHP
![]() |
<?php
|
||
|
|
||
|
namespace app\api\lists\user;
|
||
|
|
||
|
use app\admin\lists\BaseAdminDataLists;
|
||
|
use app\common\lists\ListsSearchInterface;
|
||
|
use app\common\model\user\UserFeedback;
|
||
|
|
||
|
class UserFeedbackLists extends BaseAdminDataLists implements ListsSearchInterface
|
||
|
{
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @notes 设置搜索条件
|
||
|
* @return \string[][]
|
||
|
* @author likeadmin
|
||
|
* @date 2024/05/13 16:56
|
||
|
*/
|
||
|
public function setSearch(): array
|
||
|
{
|
||
|
return [
|
||
|
'=' => ['uid'],
|
||
|
'%like%' => ['name', 'contact'],
|
||
|
];
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @notes 获取用户反馈表列表
|
||
|
* @return array
|
||
|
* @throws \think\db\exception\DataNotFoundException
|
||
|
* @throws \think\db\exception\DbException
|
||
|
* @throws \think\db\exception\ModelNotFoundException
|
||
|
* @author likeadmin
|
||
|
* @date 2024/05/13 16:56
|
||
|
*/
|
||
|
public function lists(): array
|
||
|
{
|
||
|
$uid = $this->request->userInfo['user_id'];
|
||
|
return UserFeedback::where($this->searchWhere)->where('uid',$uid)
|
||
|
->field(['id', 'uid', 'content', 'images', 'name', 'contact'])
|
||
|
->limit($this->limitOffset, $this->limitLength)
|
||
|
->order(['id' => 'desc'])
|
||
|
->select()
|
||
|
->toArray();
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @notes 获取用户反馈表数量
|
||
|
* @return int
|
||
|
* @author likeadmin
|
||
|
* @date 2024/05/13 16:56
|
||
|
*/
|
||
|
public function count(): int
|
||
|
{
|
||
|
return UserFeedback::where($this->searchWhere)->count();
|
||
|
}
|
||
|
|
||
|
}
|