1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-27 13:00:23 +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 - 升级layui-v2.8.8
- 使用本地图像验证码 - 使用本地图像验证码
- 清理无用的计划任务 - 优化计划任务脚本
- 优化日志清理脚本
- 优化钉钉webhook
- 修正图文分享参数问题
### [v1.6.4](https://gitee.com/koogua/course-tencent-cloud/releases/v1.6.4)(2023-06-15) ### [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->cleanHttpLog();
$this->cleanSqlLog(); $this->cleanSqlLog();
$this->cleanListenLog(); $this->cleanListenLog();
$this->cleanCaptchaLog();
$this->cleanWeChatLog(); $this->cleanWeChatLog();
$this->cleanMailLog(); $this->cleanMailLog();
$this->cleanSmsLog(); $this->cleanSmsLog();
@ -96,18 +95,6 @@ class CleanLogTask extends Task
$this->whitelist[] = $type; $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 * @param int $keepDays
* @return mixed
*/ */
protected function cleanOtherLog($keepDays = 7) protected function cleanOtherLog($keepDays = 7)
{ {
$files = glob(log_path() . "/*.log"); $files = glob(log_path() . "/*.log");
if (!$files) return false; if (!$files) return;
foreach ($files as $file) { foreach ($files as $file) {
$name = str_replace(log_path() . '/', '', $file); $name = str_replace(log_path() . '/', '', $file);
@ -287,9 +273,9 @@ class CleanLogTask extends Task
if (strtotime($today) - strtotime($date) >= $keepDays * 86400) { if (strtotime($today) - strtotime($date) >= $keepDays * 86400) {
$deleted = unlink($file); $deleted = unlink($file);
if ($deleted) { if ($deleted) {
echo "delete {$file} success" . PHP_EOL; $this->successPrint("remove {$file} success");
} else { } else {
echo "delete {$file} failed" . PHP_EOL; $this->errorPrint("remove {$file} failed");
} }
} }
} }
@ -300,13 +286,12 @@ class CleanLogTask extends Task
* *
* @param string $prefix * @param string $prefix
* @param int $keepDays 保留天数 * @param int $keepDays 保留天数
* @return mixed
*/ */
protected function cleanLog($prefix, $keepDays) protected function cleanLog($prefix, $keepDays)
{ {
$files = glob(log_path() . "/{$prefix}-*.log"); $files = glob(log_path() . "/{$prefix}-*.log");
if (!$files) return false; if (!$files) return;
foreach ($files as $file) { foreach ($files as $file) {
$date = substr($file, -14, 10); $date = substr($file, -14, 10);
@ -314,9 +299,9 @@ class CleanLogTask extends Task
if (strtotime($today) - strtotime($date) >= $keepDays * 86400) { if (strtotime($today) - strtotime($date) >= $keepDays * 86400) {
$deleted = unlink($file); $deleted = unlink($file);
if ($deleted) { if ($deleted) {
echo "------ delete {$file} success ------" . PHP_EOL; $this->successPrint("remove {$file} success");
} else { } 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 class Task extends \Phalcon\Cli\Task
{ {
use ServiceTrait; 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

@ -13,21 +13,3 @@
已失败 已失败
{% endif %} {% endif %}
{%- endmacro %} {%- 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

@ -17,17 +17,3 @@
已退款 已退款
{% endif %} {% endif %}
{%- endmacro %} {%- 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]); 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") * @Get("/payment/info", name="api.public.payment_info")
*/ */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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