-
-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branches 'dev' and 'master' of https://github.com/wisp-x/lsky-pro…
… into dev
- Loading branch information
Showing
173 changed files
with
4,723 additions
and
2,086 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,8 @@ | |
[](http://php.net) | ||
[](https://github.com/wisp-x/lsky-pro) | ||
|
||
> 下载稳定版请点击[这里](https://github.com/wisp-x/lsky-pro/releases),发现 bug 可发送邮件至邮箱:[email protected],或提交 [issues](https://github.com/wisp-x/lsky-pro/issues),确认 bug 后我会及时修复,谢谢! | ||
> 下载稳定版请点击[这里](https://github.com/wisp-x/lsky-pro/releases),发现 bug 可发送邮件至邮箱:[email protected],或提交 [issues](https://github.com/wisp-x/lsky-pro/issues) | ||
> 下载速度慢的可以移步 Coding https://dev.tencent.com/u/wispx/p/lsky-pro-releases/git | ||
 | ||
 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
/** | ||
* Created by WispX. | ||
* User: WispX <[email protected]> | ||
* Date: 2019/10/31 | ||
* Time: 11:10 上午 | ||
* Link: https://github.com/wisp-x | ||
*/ | ||
|
||
namespace app\api\controller; | ||
|
||
use app\common\model\Images; | ||
use app\index\controller\User; | ||
|
||
class Image extends Base | ||
{ | ||
private $model; | ||
|
||
public function initialize() | ||
{ | ||
parent::initialize(); | ||
$this->model = new Images(); | ||
$this->model = $this->model->where('user_id', $this->user->id)->field(['user_id', 'folder_id'], true); | ||
} | ||
|
||
public function find() | ||
{ | ||
$id = $this->param('id'); | ||
$image = $this->model->where(['id' => $id])->find(); | ||
$this->response('success', $this->parseData($image)); | ||
} | ||
|
||
public function items() | ||
{ | ||
$page = $this->param('page', 1); | ||
$rows = $this->param('rows', 20); | ||
$images = $this->model->paginate(null, false, [ | ||
'page' => $page, | ||
'list_rows' => $rows, | ||
])->each(function ($item) { | ||
$item = $this->parseData($item); | ||
unset($item['create_time']); | ||
return $item; | ||
}); | ||
$this->response('success', $images); | ||
} | ||
|
||
public function delete() | ||
{ | ||
$user = new User(); | ||
$data = str_replace(',', ',', $this->param('id')); | ||
if (strpos($data, ',') !== false) { | ||
$data = explode(',', $data); | ||
} | ||
if ($user->deleteImages($data)) { | ||
return $this->response('删除成功!'); | ||
} | ||
return $this->response('删除失败!', [], 500); | ||
} | ||
|
||
private function parseData($data) | ||
{ | ||
$data['upload_time'] = $data->getData('create_time'); | ||
$data['upload_date'] = $data->create_time; | ||
return $data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.