update
This commit is contained in:
parent
ba26f89ed8
commit
ad0b0fc6a4
@ -26,7 +26,8 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
public function setSearch(): array
|
public function setSearch(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'=' => ['pid', 'name', 'data', 'pic', 'sort'],
|
'=' => ['pid', 'pic', 'sort'],
|
||||||
|
'%like%' => ['name','data']
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ namespace app\admin\lists\user;
|
|||||||
|
|
||||||
use app\admin\lists\BaseAdminDataLists;
|
use app\admin\lists\BaseAdminDataLists;
|
||||||
use app\common\lists\ListsSearchInterface;
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
use app\common\model\user\User;
|
||||||
use app\common\model\user\UserFeedback;
|
use app\common\model\user\UserFeedback;
|
||||||
|
|
||||||
|
|
||||||
@ -47,7 +48,10 @@ class UserFeedbackLists extends BaseAdminDataLists implements ListsSearchInterfa
|
|||||||
->field(['id', 'uid', 'content', 'images', 'name', 'contact'])
|
->field(['id', 'uid', 'content', 'images', 'name', 'contact'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()
|
->select()->each(function($data){
|
||||||
|
$user = User::field('nickname')->where('id',$data['uid'])->findOrEmpty();
|
||||||
|
$data['user_name'] = !$user->isEmpty() ? $user['nickname'] : '';
|
||||||
|
})
|
||||||
->toArray();
|
->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,10 @@
|
|||||||
public function add()
|
public function add()
|
||||||
{
|
{
|
||||||
$params = (new UserFeedbackValidate())->post()->goCheck('add');
|
$params = (new UserFeedbackValidate())->post()->goCheck('add');
|
||||||
|
$user = $this->request->userInfo;
|
||||||
|
if($params['uid'] != $user['user_id']){
|
||||||
|
return $this->fail('用户信息错误');
|
||||||
|
}
|
||||||
$result = UserFeedbackLogic::add($params);
|
$result = UserFeedbackLogic::add($params);
|
||||||
if (true === $result) {
|
if (true === $result) {
|
||||||
return $this->success('添加成功', [], 1, 1);
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
@ -48,13 +48,13 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
->where('pid', 0)
|
->where('pid', 0)
|
||||||
->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])
|
->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['sort' => 'desc','id' => 'desc'])
|
||||||
->select()->toArray();
|
->select()->toArray();
|
||||||
}else{
|
}else{
|
||||||
$lists = Goodsclass::where($this->searchWhere)
|
$lists = Goodsclass::where($this->searchWhere)
|
||||||
->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])
|
->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['sort' => 'desc','id' => 'desc'])
|
||||||
->select()->toArray();
|
->select()->toArray();
|
||||||
}
|
}
|
||||||
// ->each(function ($item) {
|
// ->each(function ($item) {
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
use app\admin\lists\BaseAdminDataLists;
|
use app\admin\lists\BaseAdminDataLists;
|
||||||
use app\common\lists\ListsSearchInterface;
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
use app\common\model\user\User;
|
||||||
use app\common\model\user\UserFeedback;
|
use app\common\model\user\UserFeedback;
|
||||||
|
|
||||||
class UserFeedbackLists extends BaseAdminDataLists implements ListsSearchInterface
|
class UserFeedbackLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
@ -38,10 +39,13 @@
|
|||||||
{
|
{
|
||||||
$uid = $this->request->userInfo['user_id'];
|
$uid = $this->request->userInfo['user_id'];
|
||||||
return UserFeedback::where($this->searchWhere)->where('uid',$uid)
|
return UserFeedback::where($this->searchWhere)->where('uid',$uid)
|
||||||
->field(['id', 'uid', 'content', 'images', 'name', 'contact'])
|
->field(['id', 'uid', 'content', 'images', 'name', 'contact','create_time'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()
|
->select()->each(function($data){
|
||||||
|
$user = User::field('nickname')->where('id',$data['uid'])->findOrEmpty();
|
||||||
|
$data['user_name'] = !$user->isEmpty() ? $user['nickname'] : '';
|
||||||
|
})
|
||||||
->toArray();
|
->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,9 +41,9 @@ abstract class Server
|
|||||||
if (empty($this->file)) {
|
if (empty($this->file)) {
|
||||||
throw new Exception('未找到上传文件的信息');
|
throw new Exception('未找到上传文件的信息');
|
||||||
}
|
}
|
||||||
$this->file->extension = pathinfo($this->file->getUploadName(), PATHINFO_EXTENSION);
|
@$this->file->extension = pathinfo($this->file->getUploadName(), PATHINFO_EXTENSION);
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||||
$this->file->getMime = finfo_file($finfo, $this->file->getPathname());
|
@$this->file->getMime = finfo_file($finfo, $this->file->getPathname());
|
||||||
// 校验上传文件后缀
|
// 校验上传文件后缀
|
||||||
$limit = array_merge(config('project.file_image'), config('project.file_video'));
|
$limit = array_merge(config('project.file_image'), config('project.file_video'));
|
||||||
if (!in_array(strtolower($this->file->extension), $limit)) {
|
if (!in_array(strtolower($this->file->extension), $limit)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user