1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-26 20:52:44 +08:00

Merge branch 'koogua/v1.6.5' into demo

This commit is contained in:
xiaochong0302 2023-07-05 17:01:49 +08:00
commit b3e3066f0a
12 changed files with 31 additions and 77 deletions

View File

@ -2,7 +2,10 @@
- 升级layui-v2.8.8
- 使用本地图像验证码
- 清理无用的计划任务
- 优化计划任务脚本
- 优化日志清理脚本
- 优化钉钉webhook
- 修正图文分享参数问题
### [v1.6.4](https://gitee.com/koogua/course-tencent-cloud/releases/v1.6.4)(2023-06-15)

View File

@ -19,7 +19,6 @@ class CleanLogTask extends Task
$this->cleanHttpLog();
$this->cleanSqlLog();
$this->cleanListenLog();
$this->cleanCaptchaLog();
$this->cleanWeChatLog();
$this->cleanMailLog();
$this->cleanSmsLog();
@ -96,18 +95,6 @@ class CleanLogTask extends Task
$this->whitelist[] = $type;
}
/**
* 清理验证码服务日志
*/
protected function cleanCaptchaLog()
{
$type = 'captcha';
$this->cleanLog($type, 7);
$this->whitelist[] = $type;
}
/**
* 清理点播服务日志
*/
@ -268,13 +255,12 @@ class CleanLogTask extends Task
* 清理其它日志
*
* @param int $keepDays
* @return mixed
*/
protected function cleanOtherLog($keepDays = 7)
{
$files = glob(log_path() . "/*.log");
if (!$files) return false;
if (!$files) return;
foreach ($files as $file) {
$name = str_replace(log_path() . '/', '', $file);
@ -287,9 +273,9 @@ class CleanLogTask extends Task
if (strtotime($today) - strtotime($date) >= $keepDays * 86400) {
$deleted = unlink($file);
if ($deleted) {
echo "delete {$file} success" . PHP_EOL;
$this->successPrint("remove {$file} success");
} else {
echo "delete {$file} failed" . PHP_EOL;
$this->errorPrint("remove {$file} failed");
}
}
}
@ -300,13 +286,12 @@ class CleanLogTask extends Task
*
* @param string $prefix
* @param int $keepDays 保留天数
* @return mixed
*/
protected function cleanLog($prefix, $keepDays)
{
$files = glob(log_path() . "/{$prefix}-*.log");
if (!$files) return false;
if (!$files) return;
foreach ($files as $file) {
$date = substr($file, -14, 10);
@ -314,9 +299,9 @@ class CleanLogTask extends Task
if (strtotime($today) - strtotime($date) >= $keepDays * 86400) {
$deleted = unlink($file);
if ($deleted) {
echo "------ delete {$file} success ------" . PHP_EOL;
$this->successPrint("remove {$file} success");
} else {
echo "------ delete {$file} failed -------" . PHP_EOL;
$this->errorPrint("remove {$file} failed");
}
}
}

View File

@ -11,5 +11,17 @@ use App\Traits\Service as ServiceTrait;
class Task extends \Phalcon\Cli\Task
{
use ServiceTrait;
protected function successPrint($text)
{
echo "\033[32m {$text} \033[0m" . PHP_EOL;
}
protected function errorPrint($text)
{
echo "\033[31m {$text} \033[0m" . PHP_EOL;
}
}

View File

@ -12,22 +12,4 @@
{% elseif value == 6 %}
已失败
{% endif %}
{%- endmacro %}
{%- macro refund_status_history(items) %}
{% for item in items %}
{% if item.status == 1 %}
<p>创建时间:{{ date('Y-m-d H:i:s',item.create_time) }}</p>
{% elseif item.status == 2 %}
<p>取消时间:{{ date('Y-m-d H:i:s',item.create_time) }}</p>
{% elseif item.status == 3 %}
<p>过审时间:{{ date('Y-m-d H:i:s',item.create_time) }}</p>
{% elseif item.status == 4 %}
<p>拒绝时间:{{ date('Y-m-d H:i:s',item.create_time) }}</p>
{% elseif item.status == 5 %}
<p>完成时间:{{ date('Y-m-d H:i:s',item.create_time) }}</p>
{% elseif item.status == 6 %}
<p>失败时间:{{ date('Y-m-d H:i:s',item.create_time) }}</p>
{% endif %}
{% endfor %}
{%- endmacro %}

View File

@ -16,18 +16,4 @@
{% elseif value == 4 %}
已退款
{% endif %}
{%- endmacro %}
{%- macro trade_status_history(items) %}
{% for item in items %}
{% if item.status == 1 %}
<p>创建时间:{{ date('Y-m-d H:i:s',item.create_time) }}</p>
{% elseif item.status == 2 %}
<p>完成时间:{{ date('Y-m-d H:i:s',item.create_time) }}</p>
{% elseif item.status == 3 %}
<p>关闭时间:{{ date('Y-m-d H:i:s',item.create_time) }}</p>
{% elseif item.status == 4 %}
<p>退款时间:{{ date('Y-m-d H:i:s',item.create_time) }}</p>
{% endif %}
{% endfor %}
{%- endmacro %}

View File

@ -76,20 +76,6 @@ class PublicController extends Controller
return $this->jsonSuccess(['site' => $site]);
}
/**
* @Get("/captcha/info", name="api.public.captcha_info")
*/
public function captchaInfoAction()
{
$service = new AppService();
$captcha = $service->getSettings('captcha');
unset($captcha['secret_key']);
return $this->jsonSuccess(['captcha' => $captcha]);
}
/**
* @Get("/payment/info", name="api.public.payment_info")
*/

View File

@ -65,7 +65,7 @@
<span class="key">市场价格</span>
<span class="value price">{{ '¥%0.2f'|format(course.market_price) }}</span>
{% else %}
<span class="key">优惠价格</span>
<span class="key">市场价格</span>
<span class="value free">免费</span>
{% endif %}
{% if course.vip_price > 0 %}

View File

@ -4,7 +4,7 @@
<div class="order-item">
<p>课程名称:{{ course.title }}</p>
<p>
<span>优惠价格:<em class="price">{{ '¥%0.2f'|format(course.market_price) }}</em></span>
<span>市场价格:<em class="price">{{ '¥%0.2f'|format(course.market_price) }}</em></span>
<span>会员价格:<em class="price">{{ '¥%0.2f'|format(course.vip_price) }}</em></span>
</p>
{% if course.model in [1,2,3] %}
@ -23,7 +23,7 @@
<div class="order-item">
<p>课程名称:{{ course.title }}</p>
<p>
<span>优惠价格:{{ '¥%0.2f'|format(course.market_price) }}</span>
<span>市场价格:{{ '¥%0.2f'|format(course.market_price) }}</span>
<span>会员价格:<em class="price">{{ '¥%0.2f'|format(course.vip_price) }}</em></span>
</p>
{% if course.model in [1,2,3] %}

View File

@ -99,7 +99,7 @@ class Redis extends \Phalcon\Cache\Backend\Redis
if ($lifetime === null) {
$tmp = $this->_lastLifetime;
$ttl = $tmp ? $tmp : $frontend->getLifetime();
$ttl = $tmp ?: $frontend->getLifetime();
} else {
$ttl = $lifetime;
}
@ -157,7 +157,7 @@ class Redis extends \Phalcon\Cache\Backend\Redis
$redis = $this->getRedis();
$pattern = "{$this->_prefix}" . ($prefix ? $prefix : '') . '*';
$pattern = "{$this->_prefix}" . ($prefix ?: '') . '*';
$redis->setOption(\Redis::OPT_SCAN, \Redis::SCAN_RETRY);
@ -255,7 +255,7 @@ class Redis extends \Phalcon\Cache\Backend\Redis
*/
public function flush(): bool
{
return true;
}
/**

View File

@ -258,7 +258,7 @@ class Order extends Model
if (!$order) return $sn;
$this->getOrderSn();
return $this->getOrderSn();
}
}

View File

@ -182,7 +182,7 @@ class Refund extends Model
if (!$order) return $sn;
$this->getRefundSn();
return $this->getRefundSn();
}
}

View File

@ -185,7 +185,7 @@ class Trade extends Model
if (!$order) return $sn;
$this->getTradeSn();
return $this->getTradeSn();
}
}