修改系统任务

This commit is contained in:
Anyon 2020-01-10 12:10:19 +08:00
parent 1b67dfc0a9
commit 254480a8bb
6 changed files with 19 additions and 199 deletions

View File

@ -47,16 +47,6 @@ class Index extends Controller
} }
} }
/**
* 后台环境信息
*/
public function main()
{
$this->think_ver = $this->app->version();
$this->mysql_ver = $this->app->db->query('select version() as ver')[0]['ver'];
$this->fetch();
}
/** /**
* 修改用户资料 * 修改用户资料
* @login true * @login true

View File

@ -1,176 +0,0 @@
{extend name='main'}
{block name='content'}
<div class="think-box-shadow portal-block-container notselect margin-bottom-20">
<div class="margin-bottom-15">商城统计</div>
<div class="layui-row layui-col-space15">
<div class="layui-col-sm6 layui-col-md3">
<div class="portal-block-item nowrap" style="background:linear-gradient(-125deg,#57bdbf,#2f9de2)">
<div>商品总量</div>
<div>63</div>
<div>当前商品总数量</div>
</div>
<i class="portal-block-icon layui-icon layui-icon-template-1"></i>
</div>
<div class="layui-col-sm6 layui-col-md3">
<div class="portal-block-item nowrap" style="background:linear-gradient(-125deg,#ff7d7d,#fb2c95)">
<div>用户总量</div>
<div>1,634</div>
<div>当前用户总数量</div>
</div>
<i class="portal-block-icon layui-icon layui-icon-user"></i>
</div>
<div class="layui-col-sm6 layui-col-md3">
<div class="portal-block-item nowrap" style="background:linear-gradient(-113deg,#c543d8,#925cc3)">
<div>订单总量</div>
<div>148</div>
<div>已付款订单总数量</div>
</div>
<i class="portal-block-icon layui-icon layui-icon-read"></i>
</div>
<div class="layui-col-sm6 layui-col-md3">
<div class="portal-block-item nowrap" style="background:linear-gradient(-141deg,#ecca1b,#f39526)">
<div>评价总量</div>
<div>0</div>
<div>订单评价总数量</div>
</div>
<i class="portal-block-icon layui-icon layui-icon-survey"></i>
</div>
</div>
</div>
<div class="think-box-shadow margin-bottom-20">
<div class="margin-bottom-15">实时概况</div>
<div class="layui-row layui-col-space15">
<div class="layui-col-md6 margin-bottom-15">
<div class="layui-row">
<div class="layui-col-xs3 text-center">
<i class="layui-icon color-blue" style="font-size:60px;line-height:72px">&#xe65e;</i>
</div>
<div class="layui-col-xs4">
<div class="font-s14">销售额(元)</div>
<div class="font-s16">1351.00</div>
<div class="font-s12 color-desc">昨日974.00</div>
</div>
<div class="layui-col-xs5">
<div class="font-s14">支付订单数</div>
<div class="font-s16">106</div>
<div class="font-s12 color-desc">昨日76</div>
</div>
</div>
</div>
<div class="layui-col-md6 margin-bottom-15">
<div class="layui-row">
<div class="layui-col-xs3 text-center">
<i class="layui-icon color-blue" style="font-size:60px;line-height:72px">&#xe663;</i>
</div>
<div class="layui-col-xs4">
<div class="font-s14">新增用户数</div>
<div class="font-s16">327</div>
<div class="font-s12 color-desc">昨日238</div>
</div>
<div class="layui-col-xs5">
<div class="font-s14">下单用户数</div>
<div class="font-s16">69</div>
<div class="font-s12 color-desc">昨日34</div>
</div>
</div>
</div>
</div>
</div>
<div class="layui-row layui-col-space15">
<div class="layui-col-md6">
<div class="think-box-shadow">
<table class="layui-table" lay-skin="line" lay-even>
<caption class="text-left margin-bottom-15 font-s14">系统信息</caption>
<colgroup>
<col width="30%">
</colgroup>
<tbody>
<tr>
<td>当前程序版本</td>
<td>{:sysconf('app_version')}</td>
</tr>
<tr>
<td>运行PHP版本</td>
<td>{$Think.PHP_VERSION}</td>
</tr>
<tr>
<td>ThinkPHP版本</td>
<td>{$think_ver}</td>
</tr>
<tr>
<td>MySQL数据库版本</td>
<td>{$mysql_ver}</td>
</tr>
<tr>
<td>服务器操作系统</td>
<td>{:php_uname('s')}</td>
</tr>
<tr>
<td>WEB运行环境</td>
<td>{:php_sapi_name()}</td>
</tr>
<tr>
<td>上传大小限制</td>
<td>{:ini_get('upload_max_filesize')}</td>
</tr>
<tr>
<td>POST大小限制</td>
<td>{:ini_get('post_max_size')}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="layui-col-md6">
<div class="think-box-shadow">
<table class="layui-table" lay-skin="line" lay-even>
<caption class="text-left margin-bottom-15 font-s14">产品团队</caption>
<colgroup>
<col width="30%">
</colgroup>
<tbody>
<tr>
<td>产品名称</td>
<td>ThinkAdmin</td>
</tr>
<tr>
<td>在线体验</td>
<td><a target="_blank" href="http://demo.thinkadmin.top">http://demo.thinkadmin.top</a></td>
</tr>
<tr>
<td>官方QQ群</td>
<td>
<a href="http://shang.qq.com/wpa/qunwpa?idkey=ae25cf789dafbef62e50a980ffc31242f150bc61a61164458216dd98c411832a">
<img src="//pub.idqqimg.com/wpa/images/group.png" style="height:18px;width:auto" target="_blank">
</a>
</td>
</tr>
<tr>
<td>项目地址</td>
<td><a target="_blank" href="https://github.com/zoujingli/ThinkAdmin">https://github.com/zoujingli/ThinkAdmin</a></td>
</tr>
<tr>
<td>BUG反馈</td>
<td><a target="_blank" href="https://github.com/zoujingli/ThinkAdmin/issues">https://github.com/zoujingli/ThinkAdmin/issues</a></td>
</tr>
<tr>
<td>开发团队</td>
<td><a href="http://www.cuci.cc" target="_blank">广州楚才信息科技有限公司</a></td>
</tr>
<tr>
<td>团队官网</td>
<td><a target="_blank" href="http://www.cuci.cc">http://www.cuci.cc</a></td>
</tr>
<tr>
<td>办公地址</td>
<td>广州市天河区东圃一横路东泷商贸中心G02</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
{/block}

8
composer.lock generated
View File

@ -909,12 +909,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "95cfaa9e2e93adf76a4e28f57157d8f779f55680" "reference": "a644ee8cd994cabbbdfae43ab43557bb91cf5705"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/95cfaa9e2e93adf76a4e28f57157d8f779f55680", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/a644ee8cd994cabbbdfae43ab43557bb91cf5705",
"reference": "95cfaa9e2e93adf76a4e28f57157d8f779f55680", "reference": "a644ee8cd994cabbbdfae43ab43557bb91cf5705",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -958,7 +958,7 @@
], ],
"description": "ThinkPHP v6.0 Development Library", "description": "ThinkPHP v6.0 Development Library",
"homepage": "http://framework.thinkadmin.top", "homepage": "http://framework.thinkadmin.top",
"time": "2020-01-10T02:43:12+00:00" "time": "2020-01-10T04:03:27+00:00"
}, },
{ {
"name": "zoujingli/wechat-developer", "name": "zoujingli/wechat-developer",

View File

@ -935,12 +935,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "95cfaa9e2e93adf76a4e28f57157d8f779f55680" "reference": "a644ee8cd994cabbbdfae43ab43557bb91cf5705"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/95cfaa9e2e93adf76a4e28f57157d8f779f55680", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/a644ee8cd994cabbbdfae43ab43557bb91cf5705",
"reference": "95cfaa9e2e93adf76a4e28f57157d8f779f55680", "reference": "a644ee8cd994cabbbdfae43ab43557bb91cf5705",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -956,7 +956,7 @@
"ext-json": "*", "ext-json": "*",
"topthink/framework": "^6.0" "topthink/framework": "^6.0"
}, },
"time": "2020-01-10T02:43:12+00:00", "time": "2020-01-10T04:03:27+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"think": { "think": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php <?php
// This file is automatically generated at:2020-01-10 10:45:43 // This file is automatically generated at:2020-01-10 12:09:43
declare (strict_types = 1); declare (strict_types = 1);
return array ( return array (
0 => 'think\\app\\Service', 0 => 'think\\app\\Service',

View File

@ -64,7 +64,10 @@ class QueueService extends Service
if (!empty($code)) { if (!empty($code)) {
$this->code = $code; $this->code = $code;
$this->queue = $this->app->db->name('SystemQueue')->where(['code' => $this->code])->find(); $this->queue = $this->app->db->name('SystemQueue')->where(['code' => $this->code])->find();
if (empty($this->queue)) throw new \think\Exception("Queue {$code} Not found."); if (empty($this->queue)) {
$this->app->log->error(__METHOD__ . " Qeueu initialize failed, Queue {$code} not found.");
throw new \think\Exception("Queue {$code} not found.");
}
$this->code = $this->queue['code']; $this->code = $this->queue['code'];
$this->title = $this->queue['title']; $this->title = $this->queue['title'];
$this->data = json_decode($this->queue['exec_data'], true) ?: []; $this->data = json_decode($this->queue['exec_data'], true) ?: [];
@ -92,9 +95,12 @@ class QueueService extends Service
*/ */
public function reset($wait = 0) public function reset($wait = 0)
{ {
if (empty($this->queue)) throw new \think\Exception('Queue data cannot be empty!'); if (empty($this->queue)) {
$this->app->db->name('SystemQueue')->where(['code' => $this->code])->failException(true)->update([ $this->app->log->error(__METHOD__ . " Qeueu reset failed, Queue {$this->code} data cannot be empty!");
'exec_time' => time() + $wait, 'attempts' => $this->queue['attempts'] + 1, 'status' => '1', throw new \think\Exception("Qeueu reset failed, Queue {$this->code} data cannot be empty!");
}
$this->app->db->name('SystemQueue')->where(['code' => $this->code])->strict(false)->failException(true)->update([
'exec_pid' => '0', 'exec_time' => time() + $wait, 'attempts' => $this->app->db->raw('attempts+1'), 'status' => '1',
]); ]);
return $this->initialize($this->code); return $this->initialize($this->code);
} }