diff --git a/application/common/model/Images.php b/application/common/model/Images.php index 5b1afa06..79d94032 100644 --- a/application/common/model/Images.php +++ b/application/common/model/Images.php @@ -38,4 +38,4 @@ class Images extends Model { return format_time($data['create_time']); } -} \ No newline at end of file +} diff --git a/application/index/controller/User.php b/application/index/controller/User.php index 707634bf..8500b0d3 100644 --- a/application/index/controller/User.php +++ b/application/index/controller/User.php @@ -20,6 +20,7 @@ class User extends Base { public function images($keyword = '', $folderId = 0, $limit = 60) { + $images = $folders = []; if ($this->request->isPost()) { try { $model = $this->user->images()->order('create_time', 'desc'); @@ -30,11 +31,7 @@ class User extends Base if (is_numeric($folderId)) { $model = $model->where('folder_id', $folderId); } - $images = $model->paginate($limit)->each(function ($item) { - $item->url = $item->url; - // TODO 生成缩略图 - return $item; - }); + $images = $model->paginate($limit); } catch (Exception $e) { $this->error($e->getMessage()); } @@ -97,9 +94,15 @@ class User extends Base Db::commit(); } catch (Exception $e) { Db::rollback(); - return $deleteId ? false : $this->error($e->getMessage()); + if ($deleteId) { + return false; + } + $this->error($e->getMessage()); } - return $deleteId ? true : $this->success('删除成功'); + if ($deleteId) { + return true; + } + $this->success('删除成功'); } public function createFolder()