Commit a57c0755 authored by 杨培's avatar 杨培

Merge remote-tracking branch 'origin/dev' into dev

parents 94d7c0c4 4bad8618
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"light/yii2-xmlparser": "*", "light/yii2-xmlparser": "*",
"2amigos/yii2-qrcode-helper": "*", "2amigos/yii2-qrcode-helper": "*",
"mobiledetect/mobiledetectlib": "^2.8", "mobiledetect/mobiledetectlib": "^2.8",
"hellogerard/jobby": "^3.2" "hellogerard/jobby": "3.0.3"
}, },
"require-dev": { "require-dev": {
"yiisoft/yii2-codeception": "*", "yiisoft/yii2-codeception": "*",
...@@ -37,6 +37,10 @@ ...@@ -37,6 +37,10 @@
} }
}, },
"repositories": { "repositories": {
"0": {
"type": "vcs",
"url": "https://github.com/xiabin/jobby"
},
"packagist": { "packagist": {
"type": "composer", "type": "composer",
"url": "https://packagist.phpcomposer.com" "url": "https://packagist.phpcomposer.com"
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "98389e30accec6e0214a5c62f63fa0c7", "hash": "17e02f1f07eb6d2fc16836b687cf5b9a",
"content-hash": "6e4bc99038d76cec792f6922d0ec044b", "content-hash": "0e835b46915328a107628b0a6e87c672",
"packages": [ "packages": [
{ {
"name": "2amigos/yii2-qrcode-helper", "name": "2amigos/yii2-qrcode-helper",
...@@ -528,16 +528,16 @@ ...@@ -528,16 +528,16 @@
}, },
{ {
"name": "hellogerard/jobby", "name": "hellogerard/jobby",
"version": "v3.2.1", "version": "v3.0.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/jobbyphp/jobby.git", "url": "https://github.com/xiabin/jobby.git",
"reference": "9cb65663d35f6abba7e2d28347d74d501ce94861" "reference": "4701b60aeb36f7b90052d17dcd998171d11448c4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://packagist.phpcomposer.com/files/jobbyphp/jobby/9cb65663d35f6abba7e2d28347d74d501ce94861.zip", "url": "https://api.github.com/repos/xiabin/jobby/zipball/4701b60aeb36f7b90052d17dcd998171d11448c4",
"reference": "9cb65663d35f6abba7e2d28347d74d501ce94861", "reference": "4701b60aeb36f7b90052d17dcd998171d11448c4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -557,7 +557,11 @@ ...@@ -557,7 +557,11 @@
"Jobby\\": "src" "Jobby\\": "src"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "autoload-dev": {
"psr-4": {
"Jobby\\Tests\\": "tests"
}
},
"license": [ "license": [
"MIT" "MIT"
], ],
...@@ -574,7 +578,10 @@ ...@@ -574,7 +578,10 @@
], ],
"description": "Manage all your cron jobs without modifying crontab. Handles locking, logging, error emails, and more.", "description": "Manage all your cron jobs without modifying crontab. Handles locking, logging, error emails, and more.",
"homepage": "https://github.com/jobbyphp/jobby", "homepage": "https://github.com/jobbyphp/jobby",
"time": "2016-09-15 20:29:16" "support": {
"source": "https://github.com/xiabin/jobby/tree/v3.0.3"
},
"time": "2016-07-11 13:54:34"
}, },
{ {
"name": "jeremeamia/SuperClosure", "name": "jeremeamia/SuperClosure",
...@@ -881,16 +888,16 @@ ...@@ -881,16 +888,16 @@
}, },
{ {
"name": "qiniu/php-sdk", "name": "qiniu/php-sdk",
"version": "v7.0.8", "version": "v7.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/qiniu/php-sdk.git", "url": "https://github.com/qiniu/php-sdk.git",
"reference": "d1bca450b56d85beb7ba21f374a47bfeb59c288b" "reference": "e9cdc254c95188c8d13e0f04fab9648d790c42f9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://packagist.phpcomposer.com/files/qiniu/php-sdk/d1bca450b56d85beb7ba21f374a47bfeb59c288b.zip", "url": "https://packagist.phpcomposer.com/files/qiniu/php-sdk/e9cdc254c95188c8d13e0f04fab9648d790c42f9.zip",
"reference": "d1bca450b56d85beb7ba21f374a47bfeb59c288b", "reference": "e9cdc254c95188c8d13e0f04fab9648d790c42f9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -928,7 +935,7 @@ ...@@ -928,7 +935,7 @@
"sdk", "sdk",
"storage" "storage"
], ],
"time": "2016-07-19 06:18:08" "time": "2016-11-02 03:10:06"
}, },
{ {
"name": "swiftmailer/swiftmailer", "name": "swiftmailer/swiftmailer",
...@@ -1142,16 +1149,16 @@ ...@@ -1142,16 +1149,16 @@
}, },
{ {
"name": "yiisoft/yii2", "name": "yiisoft/yii2",
"version": "2.0.9", "version": "2.0.10",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/yiisoft/yii2-framework.git", "url": "https://github.com/yiisoft/yii2-framework.git",
"reference": "2b75151ea60e1fd820046416eee2e89c3dda1133" "reference": "5bfcb7a6dfa9771e2248eb8c4448613330f343ff"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://packagist.phpcomposer.com/files/yiisoft/yii2-framework/2b75151ea60e1fd820046416eee2e89c3dda1133.zip", "url": "https://packagist.phpcomposer.com/files/yiisoft/yii2-framework/5bfcb7a6dfa9771e2248eb8c4448613330f343ff.zip",
"reference": "2b75151ea60e1fd820046416eee2e89c3dda1133", "reference": "5bfcb7a6dfa9771e2248eb8c4448613330f343ff",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -1232,7 +1239,7 @@ ...@@ -1232,7 +1239,7 @@
"framework", "framework",
"yii2" "yii2"
], ],
"time": "2016-07-11 13:36:42" "time": "2016-10-20 12:02:50"
}, },
{ {
"name": "yiisoft/yii2-bootstrap", "name": "yiisoft/yii2-bootstrap",
...@@ -1587,6 +1594,7 @@ ...@@ -1587,6 +1594,7 @@
"codeception", "codeception",
"yii2" "yii2"
], ],
"abandoned": "codeception/codeception",
"time": "2016-03-17 03:41:26" "time": "2016-03-17 03:41:26"
}, },
{ {
......
...@@ -16,11 +16,20 @@ class TaskController extends Controller ...@@ -16,11 +16,20 @@ class TaskController extends Controller
{ {
public function actionIndex() public function actionIndex()
{ {
$jobby = new Jobby(); if (YII_ENV_DEV) {
$yiiCommand = $_SERVER['SCRIPT_FILENAME']; $phpBin = 'php ';
} else {
$phpBin = '/usr/local/webserver/php537/bin/php -c /usr/local/webserver/php537/etc/crontab.ini ';
}
$jobby = new Jobby(
[
'phpBinary' => $phpBin
]
);
$yiiCommand = realpath($_SERVER['SCRIPT_FILENAME']);
$output = Yii::getAlias('@runtime') . "/logs/jobs-" . date('Y-m-d') . ".log"; $output = Yii::getAlias('@runtime') . "/logs/jobs-" . date('Y-m-d') . ".log";
if(YII_DEBUG){ if (YII_ENV_DEV) {
$time = date('Y-m-d H:i:s'); $time = date('Y-m-d H:i:s');
$jobby->add('CommandExample', [ $jobby->add('CommandExample', [
...@@ -43,17 +52,17 @@ class TaskController extends Controller ...@@ -43,17 +52,17 @@ class TaskController extends Controller
//minute hour mday month wday [year] //minute hour mday month wday [year]
$jobby->add('WithdrawSettle', [ $jobby->add('WithdrawSettle', [
'command' => "$yiiCommand withdraw/settle", 'command' => "$phpBin $yiiCommand withdraw/settle",
'schedule' => '30 8 * * 1-5', //每周一到周五上午8:30 'schedule' => '30 8 * * 1-5', //每周一到周五上午8:30
'output' => $output, 'output' => $output,
'enabled' => true 'enabled' => TRUE
]); ]);
$jobby->add('ClearUploadPool', [ $jobby->add('ClearUploadPool', [
'command' => "$yiiCommand maintain/clear-upload-pool", 'command' => "$phpBin $yiiCommand maintain/clear-upload-pool",
'schedule' => '15 */2 * * *', //每隔两小时的第15分钟 'schedule' => '15 */2 * * *', //每隔两小时的第15分钟
'output' => $output, 'output' => $output,
'enabled' => true 'enabled' => TRUE
]); ]);
$jobby->run(); $jobby->run();
......
...@@ -10,25 +10,12 @@ namespace console\controllers; ...@@ -10,25 +10,12 @@ namespace console\controllers;
use yii\console\Controller; use yii\console\Controller;
use yii\log\Logger;
class TestController extends Controller class TestController extends Controller
{ {
public function actionIndex(){ public function actionIndex(){
$t=mktime(); \Yii::getLogger()->log('test/index',Logger::LEVEL_INFO);
set_time_limit(1000);
$myFile="./insert.sql";
$fhandler=fopen($myFile,'wb');
if($fhandler){
$sql="268\t2\t'0,262,268,'\t0\t '2342'\t'423423'\t'123123'\t'23423423'\t'2012-01-09 09:55:43'\t'upload/product/20111205153432_53211.jpg'\t'upload/product/thumb_20111205153432_53211.jpg'\tNULL\tNULL\t38\t'件'\t''\t123\t123\t0";
$i=0;
while($i<10)//1,000,000
{
$i++;
fwrite($fhandler,$sql."\r\n");
}
echo"写入成功,耗时:",mktime()-$t;
}
} }
} }
\ No newline at end of file
...@@ -43,7 +43,9 @@ AppAsset::addScript($this, '@web/assets/my_income.js'); ...@@ -43,7 +43,9 @@ AppAsset::addScript($this, '@web/assets/my_income.js');
<ul class="user-list-main" id="userList"> <ul class="user-list-main" id="userList">
<?php foreach ($data as $row) { ?> <?php foreach ($data as $row) { ?>
<li> <li>
<div class="reg-time"><a href="<?=\common\models\Course::url($row['order']['course_id'])?>" target="_blank"></a>课程:<?=$row['order']['course']['name']?><span>价格 ¥<?=$row['order']['credit']?></span></div> <div class="reg-time">
<a href="<?=\common\models\Course::url($row['order']['course_id'])?>" target="_blank"></a>课程:<?=$row['order']['course']['name']?>
<span>价格 ¥<?=$row['order']['credit']?></span></div>
<div class="user-detail-box"> <div class="user-detail-box">
<div class="txt"> <div class="txt">
<p>用户:<?=$row['order']['user']['username']?> / <?=$row['order']['user']['telephone']?></p> <p>用户:<?=$row['order']['user']['username']?> / <?=$row['order']['user']['telephone']?></p>
...@@ -60,18 +62,19 @@ AppAsset::addScript($this, '@web/assets/my_income.js'); ...@@ -60,18 +62,19 @@ AppAsset::addScript($this, '@web/assets/my_income.js');
<?php } ?> <?php } ?>
</ul> </ul>
<script type='text/javascript'>
$("#userList li .reg-time").click(function(){
var activeindex = $("#userList li").find(".reg-time").index(this);
$("#userList li").find(".user-detail-box").eq(activeindex).toggle();
$("#userList li").find(".reg-time span").eq(activeindex).toggle();
});
</script>
<div class="text-center"> <div class="text-center">
<?=\yii\widgets\LinkPager::widget(['pagination'=>$pagination])?> <?=\yii\widgets\LinkPager::widget(['pagination'=>$pagination])?>
</div> </div>
</div> </div>
<?php } else { ?> <?php } else { ?>
<div class="empty-data" style="margin-top:80px;">您还没有卖出课程的记录!</div> <div class="empty-data" style="margin-top:80px;">您还没有卖出课程的记录!</div>
<?php } ?> <?php } ?>
\ No newline at end of file
<script type='text/javascript'>
$("#userList li .reg-time").click(function(){
var activeindex = $("#userList li").find(".reg-time").index(this);
$("#userList li").find(".user-detail-box").eq(activeindex).toggle();
$("#userList li").find(".reg-time span").eq(activeindex).toggle();
$("#userList li").find(".reg-time b").eq(activeindex).toggle();
});
</script>
...@@ -38,8 +38,13 @@ $this->title = '我的会员'; ...@@ -38,8 +38,13 @@ $this->title = '我的会员';
<div class="txt"> <div class="txt">
<p>来自:推广</p> <p>来自:推广</p>
<p>时间:<?=date('Y年m月d日', $row['user']['created_at'])?></p> <p>时间:<?=date('Y年m月d日', $row['user']['created_at'])?></p>
<?php if (!empty($row['first_order'])) { ?>
<p>首次购买:<a target="_blank" href="<?=\common\models\Course::url($row['first_order']['course_id'],true)?>">《<?=$row['first_order']['course']['name']?>》</a></p>
<?php } else { ?>
<p>首次购买:无</p>
<?php } ?>
</div> </div>
<div class="consume"> <div class="consume" style="padding-top: 20px;">
累计消费 <br/> 累计消费 <br/>
<?=$row['credit_total']?> <?=$row['credit_total']?>
</div> </div>
...@@ -48,13 +53,7 @@ $this->title = '我的会员'; ...@@ -48,13 +53,7 @@ $this->title = '我的会员';
<?php } ?> <?php } ?>
</ul> </ul>
<?php } ?> <?php } ?>
<script type='text/javascript'>
$("#userList li .reg-time").click(function(){
var activeindex = $("#userList li").find(".reg-time").index(this);
$("#userList li").find(".user-detail-box").eq(activeindex).toggle();
$("#userList li").find(".reg-time span").eq(activeindex).toggle();
});
</script>
<div class="text-center hide"> <div class="text-center hide">
<?=\yii\widgets\LinkPager::widget(['pagination'=>$pagination])?> <?=\yii\widgets\LinkPager::widget(['pagination'=>$pagination])?>
...@@ -62,4 +61,12 @@ $this->title = '我的会员'; ...@@ -62,4 +61,12 @@ $this->title = '我的会员';
</div> </div>
<?php } else { ?> <?php } else { ?>
<div class="empty-data" style="margin-top:80px;">您还没有会员!</div> <div class="empty-data" style="margin-top:80px;">您还没有会员!</div>
<?php } ?> <?php } ?>
\ No newline at end of file
<script type='text/javascript'>
$("#userList li .reg-time").click(function(){
var activeindex = $("#userList li").find(".reg-time").index(this);
$("#userList li").find(".user-detail-box").eq(activeindex).toggle();
$("#userList li").find(".reg-time span").eq(activeindex).toggle();
});
</script>
...@@ -1610,7 +1610,12 @@ textarea.input-r-control { ...@@ -1610,7 +1610,12 @@ textarea.input-r-control {
right: 0; right: 0;
top: 0; top: 0;
padding: 0 20px; padding: 0 20px;
color: red; }
.user-list-main li div.reg-time b {
font-weight: normal;
}
.user-list-main li div.reg-time b i {
padding-left: 10px;
} }
.user-list-main li div.user-detail-box { .user-list-main li div.user-detail-box {
...@@ -1770,6 +1775,9 @@ textarea.input-r-control { ...@@ -1770,6 +1775,9 @@ textarea.input-r-control {
.buy-recode-top .col-md-4 { .buy-recode-top .col-md-4 {
border-bottom: 1px solid #f3f3f3; border-bottom: 1px solid #f3f3f3;
} }
.buy-recode-top .col-md-4:last-child {
border-bottom: none;
}
} }
.menu-mask { .menu-mask {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment