mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-30 06:20:50 +00:00
Merge branch 'v4.7.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v4.7.0dev
This commit is contained in:
commit
edaf7526d7
@ -207,6 +207,7 @@ class ExportExcel extends AuthController
|
||||
['price_max', ''],
|
||||
['price_min', ''],
|
||||
['excel', '1'],
|
||||
['time', ''],
|
||||
]);
|
||||
$data = $services->getCommissionList($where, false);
|
||||
return app('json')->success($this->service->userCommission($data['list'] ?? []));
|
||||
|
||||
@ -591,7 +591,7 @@ class StoreOrder extends AuthController
|
||||
}
|
||||
$services->storeProductOrderRefundNo((int)$id, $refund_reason);
|
||||
//提醒推送
|
||||
event('notice.notice', [['orderInfo' => $orderInfo], 'send_order_refund_no_status']);
|
||||
event('NoticeListener', [['orderInfo' => $orderInfo], 'send_order_refund_no_status']);
|
||||
return app('json')->success(100010);
|
||||
}
|
||||
|
||||
|
||||
@ -3,12 +3,12 @@
|
||||
namespace app\adminapi\controller\v1\system;
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\system\timer\SystemTimerServices;
|
||||
use app\services\system\crontab\SystemCrontabServices;
|
||||
use think\facade\App;
|
||||
|
||||
class SystemTimer extends AuthController
|
||||
class SystemCrontab extends AuthController
|
||||
{
|
||||
public function __construct(App $app, SystemTimerServices $services)
|
||||
public function __construct(App $app, SystemCrontabServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $services;
|
||||
@ -99,17 +99,17 @@ Route::group('system', function () {
|
||||
|
||||
/** 定时任务 */
|
||||
//定时任务列表
|
||||
Route::get('timer/list', 'v1.system.SystemTimer/getTimerList')->option(['real_name' => '定时任务列表']);
|
||||
Route::get('crontab/list', 'v1.system.SystemCrontab/getTimerList')->option(['real_name' => '定时任务列表']);
|
||||
//定时任务类型
|
||||
Route::get('timer/mark', 'v1.system.SystemTimer/getMarkList')->option(['real_name' => '定时任务类型']);
|
||||
Route::get('crontab/mark', 'v1.system.SystemCrontab/getMarkList')->option(['real_name' => '定时任务类型']);
|
||||
//定时任务详情
|
||||
Route::get('timer/info/:id', 'v1.system.SystemTimer/getTimerInfo')->option(['real_name' => '定时任务详情']);
|
||||
Route::get('crontab/info/:id', 'v1.system.SystemCrontab/getTimerInfo')->option(['real_name' => '定时任务详情']);
|
||||
//定时任务添加编辑
|
||||
Route::post('timer/save', 'v1.system.SystemTimer/saveTimer')->option(['real_name' => '定时任务添加编辑']);
|
||||
Route::post('crontab/save', 'v1.system.SystemCrontab/saveTimer')->option(['real_name' => '定时任务添加编辑']);
|
||||
//删除定时任务
|
||||
Route::delete('timer/del/:id', 'v1.system.SystemTimer/delTimer')->option(['real_name' => '删除定时任务']);
|
||||
Route::delete('crontab/del/:id', 'v1.system.SystemCrontab/delTimer')->option(['real_name' => '删除定时任务']);
|
||||
//定时任务是否开启开关
|
||||
Route::get('timer/set_open/:id/:is_open', 'v1.system.SystemTimer/setTimerStatus')->option(['real_name' => '定时任务是否开启开关']);
|
||||
Route::get('crontab/set_open/:id/:is_open', 'v1.system.SystemCrontab/setTimerStatus')->option(['real_name' => '定时任务是否开启开关']);
|
||||
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
|
||||
@ -10,9 +10,15 @@ use app\services\order\StoreOrderServices;
|
||||
use app\services\order\StoreOrderTakeServices;
|
||||
use app\services\product\product\StoreProductServices;
|
||||
use app\services\system\attachment\SystemAttachmentServices;
|
||||
use app\services\system\timer\SystemTimerServices;
|
||||
use app\services\system\crontab\SystemCrontabServices;
|
||||
|
||||
class TimerController
|
||||
/**
|
||||
* 定时任务控制器
|
||||
* @author 吴汐
|
||||
* @email 442384644@qq.com
|
||||
* @date 2023/02/21
|
||||
*/
|
||||
class CrontabController
|
||||
{
|
||||
/**
|
||||
* 定时任务调用接口
|
||||
@ -20,15 +26,15 @@ class TimerController
|
||||
* @email 442384644@qq.com
|
||||
* @date 2023/02/17
|
||||
*/
|
||||
public function timerRun()
|
||||
public function crontabRun()
|
||||
{
|
||||
app()->make(SystemTimerServices::class)->timerRun();
|
||||
app()->make(SystemCrontabServices::class)->crontabRun();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测定时任务是否正常,必须6秒执行一次
|
||||
*/
|
||||
public function timerCheck()
|
||||
public function crontabCheck()
|
||||
{
|
||||
file_put_contents(root_path() . 'runtime/.timer', time());
|
||||
}
|
||||
@ -42,6 +42,7 @@ class DivisionController
|
||||
]);
|
||||
$verifyCode = CacheService::get('code_' . $data['phone']);
|
||||
if ($verifyCode != $data['code']) return app('json')->fail(410010);
|
||||
if ($data['division_invite'] == 0) return app('json')->fail(500028);
|
||||
$this->services->applyAgent($data, $id);
|
||||
return app('json')->success(100017);
|
||||
}
|
||||
|
||||
@ -391,27 +391,27 @@ Route::group(function () {
|
||||
|
||||
/** 定时任务接口 */
|
||||
//定时任务调用接口
|
||||
Route::get('timer/run', 'v1.TimerController/timerRun')->name('timerRun');
|
||||
Route::get('crontab/run', 'v1.CrontabController/crontabRun')->name('crontabRun');
|
||||
//检测定时任务接口
|
||||
Route::get('timer/check', 'v1.TimerController/timerCheck')->name('timerCheck');
|
||||
Route::get('crontab/check', 'v1.CrontabController/crontabCheck')->name('crontabCheck');
|
||||
//未支付自动取消订单
|
||||
Route::get('timer/order_cancel', 'v1.TimerController/orderUnpaidCancel')->name('orderUnpaidCancel');
|
||||
Route::get('crontab/order_cancel', 'v1.CrontabController/orderUnpaidCancel')->name('orderUnpaidCancel');
|
||||
//拼团到期订单处理
|
||||
Route::get('timer/pink_expiration', 'v1.TimerController/pinkExpiration')->name('pinkExpiration');
|
||||
Route::get('crontab/pink_expiration', 'v1.CrontabController/pinkExpiration')->name('pinkExpiration');
|
||||
//自动解绑上级绑定
|
||||
Route::get('timer/agent_unbind', 'v1.TimerController/agentUnbind')->name('agentUnbind');
|
||||
Route::get('crontab/agent_unbind', 'v1.CrontabController/agentUnbind')->name('agentUnbind');
|
||||
//更新直播商品状态
|
||||
Route::get('timer/live_product_status', 'v1.TimerController/syncGoodStatus')->name('syncGoodStatus');
|
||||
Route::get('crontab/live_product_status', 'v1.CrontabController/syncGoodStatus')->name('syncGoodStatus');
|
||||
//更新直播间状态
|
||||
Route::get('timer/live_room_status', 'v1.TimerController/syncRoomStatus')->name('syncRoomStatus');
|
||||
Route::get('crontab/live_room_status', 'v1.CrontabController/syncRoomStatus')->name('syncRoomStatus');
|
||||
//自动收货
|
||||
Route::get('timer/take_delivery', 'v1.TimerController/autoTakeOrder')->name('autoTakeOrder');
|
||||
Route::get('crontab/take_delivery', 'v1.CrontabController/autoTakeOrder')->name('autoTakeOrder');
|
||||
//查询预售到期商品自动下架
|
||||
Route::get('timer/advance_off', 'v1.TimerController/downAdvance')->name('downAdvance');
|
||||
Route::get('crontab/advance_off', 'v1.CrontabController/downAdvance')->name('downAdvance');
|
||||
//自动好评
|
||||
Route::get('timer/product_replay', 'v1.TimerController/autoComment')->name('autoComment');
|
||||
Route::get('crontab/product_replay', 'v1.CrontabController/autoComment')->name('autoComment');
|
||||
//清除昨日海报
|
||||
Route::get('timer/clear_poster', 'v1.TimerController/emptyYesterdayAttachment')->name('emptyYesterdayAttachment');
|
||||
Route::get('crontab/clear_poster', 'v1.CrontabController/emptyYesterdayAttachment')->name('emptyYesterdayAttachment');
|
||||
|
||||
|
||||
})->middleware(\app\http\middleware\AllowOriginMiddleware::class)->middleware(\app\api\middleware\StationOpenMiddleware::class)->middleware(\app\api\middleware\AuthTokenMiddleware::class, false);
|
||||
|
||||
18
crmeb/app/dao/system/crontab/SystemCrontabDao.php
Normal file
18
crmeb/app/dao/system/crontab/SystemCrontabDao.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace app\dao\system\crontab;
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\system\crontab\SystemCrontab;
|
||||
|
||||
class SystemCrontabDao extends BaseDao
|
||||
{
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return SystemCrontab::class;
|
||||
}
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace app\dao\system\timer;
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\system\timer\SystemTimer;
|
||||
|
||||
class SystemTimerDao extends BaseDao
|
||||
{
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return SystemTimer::class;
|
||||
}
|
||||
}
|
||||
@ -19,26 +19,26 @@ return [
|
||||
'listen' => [
|
||||
'AppInit' => [],
|
||||
'HttpRun' => [],
|
||||
'HttpEnd' => [\app\listener\http\HttpEnd::class], //HTTP请求结束回调事件
|
||||
'HttpEnd' => [\app\listener\http\HttpEndListener::class], //HTTP请求结束回调事件
|
||||
'LogLevel' => [],
|
||||
'LogWrite' => [],
|
||||
'queue.start' => [\app\listener\queue\QueueStart::class],
|
||||
'user.login' => [\app\listener\user\Login::class],
|
||||
'admin.login' => [\app\listener\admin\AdminLogin::class],//管理员登录
|
||||
'user.register' => [\app\listener\user\Register::class], //用户注册后置事件
|
||||
'wechat.auth' => [\app\listener\wechat\Auth::class], //用户授权后置事件
|
||||
'order.orderCreateAfter' => [\app\listener\order\OrderCreateAfter::class], //订单创建后置事件
|
||||
'order.orderPaySuccess' => [\app\listener\order\OrderPaySuccess::class], //订单支付成功后置事件
|
||||
'order.orderDelivery' => [\app\listener\order\OrderDelivery::class], //订单发货后置事件
|
||||
'order.orderTake' => [\app\listener\order\OrderTake::class], //订单收货后置事件
|
||||
'order.orderRefundCreateAfter' => [\app\listener\order\OrderRefundCreateAfter::class], //售后单生成后置事件
|
||||
'order.orderRefundCancelAfter' => [\app\listener\order\OrderRefundCancelAfter::class], //售后单取消后置事件
|
||||
'out.outPush' => [\app\listener\out\OutPush::class], //对外推送事件
|
||||
'user.userLevel' => [\app\listener\user\UserLevel::class], //用户升级事件
|
||||
'user.userVisit' => [\app\listener\user\UserVisit::class], //用户访问事件
|
||||
'notice.notice' => [\app\listener\notice\Notice::class], //通知->消息事件
|
||||
'pay.notify' => [\app\listener\pay\Notify::class],//支付异步回调
|
||||
'SystemTimer' => [\app\listener\timer\SystemTimer::class],//定时任务事件
|
||||
'QueueStartListener' => [\app\listener\queue\QueueStartListener::class],
|
||||
'UserLoginListener' => [\app\listener\user\LoginListener::class],
|
||||
'AdminLoginListener' => [\app\listener\admin\AdminLoginListener::class],//管理员登录
|
||||
'UserRegisterListener' => [\app\listener\user\RegisterListener::class], //用户注册后置事件
|
||||
'WechatAuthListener' => [\app\listener\wechat\AuthListener::class], //用户授权后置事件
|
||||
'OrderCreateAfterListener' => [\app\listener\order\OrderCreateAfterListener::class], //订单创建后置事件
|
||||
'OrderPaySuccessListener' => [\app\listener\order\OrderPaySuccessListener::class], //订单支付成功后置事件
|
||||
'OrderDeliveryListener' => [\app\listener\order\OrderDeliveryListener::class], //订单发货后置事件
|
||||
'OrderTakeListener' => [\app\listener\order\OrderTakeListener::class], //订单收货后置事件
|
||||
'OrderRefundCreateAfterListener' => [\app\listener\order\OrderRefundCreateAfterListener::class], //售后单生成后置事件
|
||||
'OrderRefundCancelAfterListener' => [\app\listener\order\OrderRefundCancelAfterListener::class], //售后单取消后置事件
|
||||
'OutPushListener' => [\app\listener\out\OutPushListener::class], //对外推送事件
|
||||
'UserLevelListener' => [\app\listener\user\UserLevelListener::class], //用户升级事件
|
||||
'UserVisitListener' => [\app\listener\user\UserVisitListener::class], //用户访问事件
|
||||
'NoticeListener' => [\app\listener\notice\NoticeListener::class], //通知->消息事件
|
||||
'NotifyListener' => [\app\listener\pay\NotifyListener::class],//支付异步回调
|
||||
'CrontabListener' => [\app\listener\crontab\SystemCrontabListener::class],//定时任务事件
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ class UnpaidOrderSend extends BaseJobs
|
||||
return true;
|
||||
}
|
||||
//收货给用户发送消息
|
||||
event('notice.notice', [['order' => $orderInfo], 'order_pay_false']);
|
||||
event('NoticeListener', [['order' => $orderInfo], 'order_pay_false']);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ namespace app\listener\admin;
|
||||
* Class AdminLogin
|
||||
* @package app\listener\admin
|
||||
*/
|
||||
class AdminLogin
|
||||
class AdminLoginListener
|
||||
{
|
||||
|
||||
public function handle($event)
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace app\listener\timer;
|
||||
namespace app\listener\crontab;
|
||||
|
||||
use app\services\activity\combination\StorePinkServices;
|
||||
use app\services\activity\live\LiveGoodsServices;
|
||||
@ -10,148 +10,148 @@ use app\services\order\StoreOrderServices;
|
||||
use app\services\order\StoreOrderTakeServices;
|
||||
use app\services\product\product\StoreProductServices;
|
||||
use app\services\system\attachment\SystemAttachmentServices;
|
||||
use app\services\system\timer\SystemTimerServices;
|
||||
use app\services\system\crontab\SystemCrontabServices;
|
||||
use crmeb\interfaces\ListenerInterface;
|
||||
use think\facade\Log;
|
||||
use Workerman\Crontab\Crontab;
|
||||
|
||||
class SystemTimer implements ListenerInterface
|
||||
/**
|
||||
* 系统定时任务
|
||||
*/
|
||||
class SystemCrontabListener implements ListenerInterface
|
||||
{
|
||||
public function handle($event): void
|
||||
{
|
||||
$time = time();
|
||||
$date = date('Y-m-d H:i:s', time());
|
||||
$timer_log_open = config("log.timer_log", false);
|
||||
|
||||
new Crontab('*/6 * * * * *', function () use ($time) {
|
||||
file_put_contents(root_path() . 'runtime/.timer', $time);
|
||||
//自动写入文件方便检测是否启动定时任务命令
|
||||
new Crontab('*/6 * * * * *', function () {
|
||||
file_put_contents(root_path() . 'runtime/.timer', time());
|
||||
});
|
||||
|
||||
/** @var SystemTimerServices $systemTimerServices */
|
||||
$systemTimerServices = app()->make(SystemTimerServices::class);
|
||||
$list = $systemTimerServices->selectList(['is_del' => 0, 'is_open' => 1])->toArray();
|
||||
/** @var SystemCrontabServices $systemTimerServices */
|
||||
$systemCrontabServices = app()->make(SystemCrontabServices::class);
|
||||
$list = $systemCrontabServices->selectList(['is_del' => 0, 'is_open' => 1])->toArray();
|
||||
foreach ($list as &$item) {
|
||||
//获取定时任务时间字符串
|
||||
$timeStr = $this->getTimerStr($item);
|
||||
//未支付自动取消订单
|
||||
if ($item['mark'] == 'order_cancel') {
|
||||
new Crontab($timeStr, function () use ($date, $timer_log_open) {
|
||||
new Crontab($timeStr, function () {
|
||||
try {
|
||||
/** @var StoreOrderServices $orderServices */
|
||||
$orderServices = app()->make(StoreOrderServices::class);
|
||||
$orderServices->orderUnpaidCancel();
|
||||
if ($timer_log_open) Log::notice($date . ' 执行未支付自动取消订单');
|
||||
app()->make(StoreOrderServices::class)->orderUnpaidCancel();
|
||||
$this->crontabLog(' 执行未支付自动取消订单');
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('自动取消订单失败,失败原因:' . $e->getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
//拼团到期订单处理
|
||||
if ($item['mark'] == 'pink_expiration') {
|
||||
new Crontab($timeStr, function () use ($date, $timer_log_open) {
|
||||
elseif ($item['mark'] == 'pink_expiration') {
|
||||
new Crontab($timeStr, function () {
|
||||
try {
|
||||
/** @var StorePinkServices $storePinkServices */
|
||||
$storePinkServices = app()->make(StorePinkServices::class);
|
||||
$storePinkServices->statusPink();
|
||||
if ($timer_log_open) Log::notice($date . ' 执行拼团到期订单处理');
|
||||
app()->make(StorePinkServices::class)->statusPink();
|
||||
$this->crontabLog(' 执行拼团到期订单处理');
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('拼团到期订单处理失败,失败原因:' . $e->getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
//自动解绑上级绑定
|
||||
if ($item['mark'] == 'agent_unbind') {
|
||||
new Crontab($timeStr, function () use ($date, $timer_log_open) {
|
||||
elseif ($item['mark'] == 'agent_unbind') {
|
||||
new Crontab($timeStr, function () {
|
||||
try {
|
||||
/** @var AgentManageServices $agentManage */
|
||||
$agentManage = app()->make(AgentManageServices::class);
|
||||
$agentManage->removeSpread();
|
||||
if ($timer_log_open) Log::notice($date . ' 执行自动解绑上级绑定');
|
||||
app()->make(AgentManageServices::class)->removeSpread();
|
||||
$this->crontabLog(' 执行自动解绑上级绑定');
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('自动解除上级绑定失败,失败原因:' . $e->getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
//更新直播商品状态
|
||||
if ($item['mark'] == 'live_product_status') {
|
||||
new Crontab($timeStr, function () use ($date, $timer_log_open) {
|
||||
elseif ($item['mark'] == 'live_product_status') {
|
||||
new Crontab($timeStr, function () {
|
||||
try {
|
||||
/** @var LiveGoodsServices $liveGoods */
|
||||
$liveGoods = app()->make(LiveGoodsServices::class);
|
||||
$liveGoods->syncGoodStatus();
|
||||
if ($timer_log_open) Log::notice($date . ' 执行更新直播商品状态');
|
||||
app()->make(LiveGoodsServices::class)->syncGoodStatus();
|
||||
$this->crontabLog(' 执行更新直播商品状态');
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('更新直播商品状态失败,失败原因:' . $e->getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
//更新直播间状态
|
||||
if ($item['mark'] == 'live_room_status') {
|
||||
new Crontab($timeStr, function () use ($date, $timer_log_open) {
|
||||
elseif ($item['mark'] == 'live_room_status') {
|
||||
new Crontab($timeStr, function () {
|
||||
try {
|
||||
/** @var LiveRoomServices $liveRoom */
|
||||
$liveRoom = app()->make(LiveRoomServices::class);
|
||||
$liveRoom->syncRoomStatus();
|
||||
if ($timer_log_open) Log::notice($date . ' 执行更新直播间状态');
|
||||
app()->make(LiveRoomServices::class)->syncRoomStatus();
|
||||
$this->crontabLog(' 执行更新直播间状态');
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('更新直播间状态失败,失败原因:' . $e->getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
//自动收货
|
||||
if ($item['mark'] == 'take_delivery') {
|
||||
new Crontab($timeStr, function () use ($date, $timer_log_open) {
|
||||
elseif ($item['mark'] == 'take_delivery') {
|
||||
new Crontab($timeStr, function () {
|
||||
try {
|
||||
/** @var StoreOrderTakeServices $services */
|
||||
$services = app()->make(StoreOrderTakeServices::class);
|
||||
$services->autoTakeOrder();
|
||||
if ($timer_log_open) Log::notice($date . ' 执行自动收货');
|
||||
app()->make(StoreOrderTakeServices::class)->autoTakeOrder();
|
||||
$this->crontabLog(' 执行自动收货');
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('自动收货失败,失败原因:' . $e->getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
//查询预售到期商品自动下架
|
||||
if ($item['mark'] == 'advance_off') {
|
||||
new Crontab($timeStr, function () use ($date, $timer_log_open) {
|
||||
elseif ($item['mark'] == 'advance_off') {
|
||||
new Crontab($timeStr, function () {
|
||||
try {
|
||||
/** @var StoreProductServices $product */
|
||||
$product = app()->make(StoreProductServices::class);
|
||||
$product->downAdvance();
|
||||
if ($timer_log_open) Log::notice($date . ' 执行预售到期商品自动下架');
|
||||
app()->make(StoreProductServices::class)->downAdvance();
|
||||
$this->crontabLog(' 执行预售到期商品自动下架');
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('预售到期商品自动下架失败,失败原因:' . $e->getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
//自动好评
|
||||
if ($item['mark'] == 'product_replay') {
|
||||
new Crontab($timeStr, function () use ($date, $timer_log_open) {
|
||||
elseif ($item['mark'] == 'product_replay') {
|
||||
new Crontab($timeStr, function () {
|
||||
try {
|
||||
/** @var StoreOrderServices $orderServices */
|
||||
$orderServices = app()->make(StoreOrderServices::class);
|
||||
$orderServices->autoComment();
|
||||
if ($timer_log_open) Log::notice($date . ' 执行自动好评');
|
||||
app()->make(StoreOrderServices::class)->autoComment();
|
||||
$this->crontabLog(' 执行自动好评');
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('自动好评失败,失败原因:' . $e->getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
//清除昨日海报
|
||||
if ($item['mark'] == 'clear_poster') {
|
||||
new Crontab($timeStr, function () use ($date, $timer_log_open) {
|
||||
elseif ($item['mark'] == 'clear_poster') {
|
||||
new Crontab($timeStr, function () {
|
||||
try {
|
||||
/** @var SystemAttachmentServices $attach */
|
||||
$attach = app()->make(SystemAttachmentServices::class);
|
||||
$attach->emptyYesterdayAttachment();
|
||||
if ($timer_log_open) Log::notice($date . ' 执行清除昨日海报');
|
||||
app()->make(SystemAttachmentServices::class)->emptyYesterdayAttachment();
|
||||
$this->crontabLog(' 执行清除昨日海报');
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('清除昨日海报失败,失败原因:' . $e->getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
//
|
||||
else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 定时任务日志
|
||||
* @param $msg
|
||||
*/
|
||||
public function crontabLog($msg)
|
||||
{
|
||||
$timer_log_open = config("log.timer_log", false);
|
||||
if ($timer_log_open){
|
||||
$date = date('Y-m-d H:i:s', time());
|
||||
Log::notice($date . $msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 0 1 2 3 4 5
|
||||
* | | | | | |
|
||||
@ -19,7 +19,7 @@ use think\Response;
|
||||
* Class Create
|
||||
* @package app\listener\http
|
||||
*/
|
||||
class HttpEnd
|
||||
class HttpEndListener
|
||||
{
|
||||
public function handle(Response $response):void
|
||||
{
|
||||
@ -31,7 +31,7 @@ use crmeb\utils\Str;
|
||||
* Class Create
|
||||
* @package app\listener\order
|
||||
*/
|
||||
class Notice implements ListenerInterface
|
||||
class NoticeListener implements ListenerInterface
|
||||
{
|
||||
public function handle($event): void
|
||||
{
|
||||
@ -18,10 +18,10 @@ use crmeb\utils\Arr;
|
||||
|
||||
/**
|
||||
* 订单创建后置事件
|
||||
* Class OrderCreateAfter
|
||||
* Class OrderCreateAfterListener
|
||||
* @package app\listener\order
|
||||
*/
|
||||
class OrderCreateAfter implements ListenerInterface
|
||||
class OrderCreateAfterListener implements ListenerInterface
|
||||
{
|
||||
public function handle($event): void
|
||||
{
|
||||
@ -9,10 +9,10 @@ use crmeb\interfaces\ListenerInterface;
|
||||
|
||||
/**
|
||||
* 订单到期自动收货
|
||||
* Class OrderDelivery
|
||||
* Class OrderDeliveryListener
|
||||
* @package app\listener\order
|
||||
*/
|
||||
class OrderDelivery implements ListenerInterface
|
||||
class OrderDeliveryListener implements ListenerInterface
|
||||
{
|
||||
public function handle($event): void
|
||||
{
|
||||
@ -27,10 +27,10 @@ use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 订单支付成功后
|
||||
* Class OrderPaySuccess
|
||||
* Class OrderPaySuccessListener
|
||||
* @package app\listener\order
|
||||
*/
|
||||
class OrderPaySuccess implements ListenerInterface
|
||||
class OrderPaySuccessListener implements ListenerInterface
|
||||
{
|
||||
public function handle($event): void
|
||||
{
|
||||
@ -7,10 +7,10 @@ use crmeb\interfaces\ListenerInterface;
|
||||
|
||||
/**
|
||||
* 售后单取消
|
||||
* Class OrderRefundCancelAfter
|
||||
* Class OrderRefundCancelAfterListener
|
||||
* @package app\listener\order
|
||||
*/
|
||||
class OrderRefundCancelAfter implements ListenerInterface
|
||||
class OrderRefundCancelAfterListener implements ListenerInterface
|
||||
{
|
||||
public function handle($event): void
|
||||
{
|
||||
@ -11,7 +11,7 @@ use crmeb\interfaces\ListenerInterface;
|
||||
* Class orderRefundCreateAfter
|
||||
* @package app\listener\order
|
||||
*/
|
||||
class OrderRefundCreateAfter implements ListenerInterface
|
||||
class OrderRefundCreateAfterListener implements ListenerInterface
|
||||
{
|
||||
public function handle($event): void
|
||||
{
|
||||
@ -11,10 +11,10 @@ use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 订单确认收货
|
||||
* Class OrderTake
|
||||
* Class OrderTakeListener
|
||||
* @package app\listener\order
|
||||
*/
|
||||
class OrderTake implements ListenerInterface
|
||||
class OrderTakeListener implements ListenerInterface
|
||||
{
|
||||
public function handle($event): void
|
||||
{
|
||||
@ -9,7 +9,7 @@ use crmeb\services\CacheService;
|
||||
use crmeb\services\HttpService;
|
||||
use think\facade\Log;
|
||||
|
||||
class OutPush implements ListenerInterface
|
||||
class OutPushListener implements ListenerInterface
|
||||
{
|
||||
public function handle($event): void
|
||||
{
|
||||
@ -18,10 +18,10 @@ use crmeb\utils\Hook;
|
||||
|
||||
/**
|
||||
* 支付异步回调
|
||||
* Class Notify
|
||||
* Class NotifyListener
|
||||
* @package app\listener\pay
|
||||
*/
|
||||
class Notify
|
||||
class NotifyListener
|
||||
{
|
||||
/**
|
||||
* @param $event
|
||||
@ -16,7 +16,7 @@ namespace app\listener\queue;
|
||||
|
||||
use think\console\Output;
|
||||
|
||||
class QueueStart
|
||||
class QueueStartListener
|
||||
{
|
||||
|
||||
public function handle(Output $output)
|
||||
@ -8,10 +8,10 @@ use crmeb\interfaces\ListenerInterface;
|
||||
|
||||
/**
|
||||
* 用户登录后置事件
|
||||
* Class Login
|
||||
* Class LoginListener
|
||||
* @package app\listener\user
|
||||
*/
|
||||
class Login implements ListenerInterface
|
||||
class LoginListener implements ListenerInterface
|
||||
{
|
||||
public function handle($event): void
|
||||
{
|
||||
@ -13,10 +13,10 @@ use crmeb\interfaces\ListenerInterface;
|
||||
|
||||
/**
|
||||
* 注册完成后置事件
|
||||
* Class Register
|
||||
* Class RegisterListener
|
||||
* @package app\listener\user
|
||||
*/
|
||||
class Register implements ListenerInterface
|
||||
class RegisterListener implements ListenerInterface
|
||||
{
|
||||
/**
|
||||
* 注册完成后置事件
|
||||
@ -9,10 +9,10 @@ use crmeb\interfaces\ListenerInterface;
|
||||
|
||||
/**
|
||||
* 用户升级事件
|
||||
* Class UserLevel
|
||||
* Class UserLevelListener
|
||||
* @package app\listener\user
|
||||
*/
|
||||
class UserLevel implements ListenerInterface
|
||||
class UserLevelListener implements ListenerInterface
|
||||
{
|
||||
public function handle($event): void
|
||||
{
|
||||
@ -9,10 +9,10 @@ use crmeb\interfaces\ListenerInterface;
|
||||
|
||||
/**
|
||||
* 写入用户访问
|
||||
* Class UserVisit
|
||||
* Class UserVisitListener
|
||||
* @package app\listener\user
|
||||
*/
|
||||
class UserVisit implements ListenerInterface
|
||||
class UserVisitListener implements ListenerInterface
|
||||
{
|
||||
public function handle($event): void
|
||||
{
|
||||
@ -8,10 +8,10 @@ use crmeb\interfaces\ListenerInterface;
|
||||
|
||||
/**
|
||||
* 用户授权后置事件
|
||||
* Class Auth
|
||||
* Class AuthListener
|
||||
* @package app\listener\wechat
|
||||
*/
|
||||
class Auth implements ListenerInterface
|
||||
class AuthListener implements ListenerInterface
|
||||
{
|
||||
public function handle($event): void
|
||||
{
|
||||
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace app\model\system\timer;
|
||||
namespace app\model\system\crontab;
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
|
||||
class SystemTimer extends BaseModel
|
||||
class SystemCrontab extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
@ -319,7 +319,7 @@ class StoreAdvanceServices extends BaseServices
|
||||
$data['productValue'] = $productValue;
|
||||
$data['routine_contact_type'] = sys_config('routine_contact_type', 0);
|
||||
//用户访问事件
|
||||
event('user.userVisit', [$uid, $id, 'advance', $storeInfo['product_id'], 'view']);
|
||||
event('UserVisitListener', [$uid, $id, 'advance', $storeInfo['product_id'], 'view']);
|
||||
//浏览记录
|
||||
ProductLogJob::dispatch(['visit', ['uid' => $uid, 'product_id' => $storeInfo['product_id']]]);
|
||||
return $data;
|
||||
|
||||
@ -505,7 +505,7 @@ class StoreBargainServices extends BaseServices
|
||||
$data['bargain']['price'] = bcsub($data['bargain']['price'], (string)$userBargainInfo['alreadyPrice'], 2);
|
||||
|
||||
//用户访问事件
|
||||
event('user.userVisit', [$user['uid'], $id, 'bargain', $bargain['product_id'], 'view']);
|
||||
event('UserVisitListener', [$user['uid'], $id, 'bargain', $bargain['product_id'], 'view']);
|
||||
|
||||
//浏览记录
|
||||
ProductLogJob::dispatch(['visit', ['uid' => $user['uid'], 'product_id' => $bargain['product_id']]]);
|
||||
@ -646,7 +646,7 @@ class StoreBargainServices extends BaseServices
|
||||
$price = $userHelpService->setBargainRecord($uid, $bargainUserInfo, $bargainInfo);
|
||||
if ($price) {
|
||||
if (!$bargainUserService->getSurplusPrice($bargainUserTableId, 1)) {
|
||||
event('notice.notice', [['uid' => $bargainUserUid, 'bargainInfo' => $bargainInfo, 'bargainUserInfo' => $bargainUserInfo,], 'bargain_success']);
|
||||
event('NoticeListener', [['uid' => $bargainUserUid, 'bargainInfo' => $bargainInfo, 'bargainUserInfo' => $bargainUserInfo,], 'bargain_success']);
|
||||
}
|
||||
}
|
||||
return ['bargainUserInfo' => $bargainUserInfo, 'price' => $price];
|
||||
|
||||
@ -425,7 +425,7 @@ class StoreCombinationServices extends BaseServices
|
||||
$data['routine_contact_type'] = sys_config('routine_contact_type', 0);
|
||||
|
||||
//用户访问事件
|
||||
event('user.userVisit', [$uid, $id, 'combination', $storeInfo['product_id'], 'view']);
|
||||
event('UserVisitListener', [$uid, $id, 'combination', $storeInfo['product_id'], 'view']);
|
||||
//浏览记录
|
||||
ProductLogJob::dispatch(['visit', ['uid' => $uid, 'product_id' => $storeInfo['product_id']]]);
|
||||
return $data;
|
||||
|
||||
@ -300,9 +300,9 @@ class StorePinkServices extends BaseServices
|
||||
{
|
||||
$pink = $this->dao->getOne([['id|k_id', '=', $pid], ['uid', '=', $uid]], '*', ['getProduct']);
|
||||
if ($isRemove) {
|
||||
event('notice.notice', [['uid' => $uid, 'pink' => $pink, 'user_type' => $channel], 'send_order_pink_clone']);
|
||||
event('NoticeListener', [['uid' => $uid, 'pink' => $pink, 'user_type' => $channel], 'send_order_pink_clone']);
|
||||
} else {
|
||||
event('notice.notice', [['uid' => $uid, 'pink' => $pink, 'user_type' => $channel], 'send_order_pink_fial']);
|
||||
event('NoticeListener', [['uid' => $uid, 'pink' => $pink, 'user_type' => $channel], 'send_order_pink_fial']);
|
||||
}
|
||||
$this->dao->update([['id|k_id', '=', $pid]], ['status' => 3, 'stop_time' => time()]);
|
||||
}
|
||||
@ -390,7 +390,7 @@ class StorePinkServices extends BaseServices
|
||||
foreach ($pinkList as $item) {
|
||||
$item['nickname'] = $pinkT_name;
|
||||
//用户发送消息
|
||||
event('notice.notice', [
|
||||
event('NoticeListener', [
|
||||
[
|
||||
'list' => $item,
|
||||
'title' => $title,
|
||||
@ -439,7 +439,7 @@ class StorePinkServices extends BaseServices
|
||||
$res = $this->save($pink);
|
||||
}
|
||||
// 拼团团成功发送模板消息
|
||||
event('notice.notice', [['orderInfo' => $orderInfo, 'title' => $product['title'], 'pink' => $pink], 'can_pink_success']);
|
||||
event('NoticeListener', [['orderInfo' => $orderInfo, 'title' => $product['title'], 'pink' => $pink], 'can_pink_success']);
|
||||
|
||||
//处理拼团完成
|
||||
list($pinkAll, $pinkT, $count, $idAll, $uidAll) = $this->getPinkMemberAndPinkK($pink);
|
||||
@ -483,7 +483,7 @@ class StorePinkServices extends BaseServices
|
||||
|
||||
PinkJob::dispatchSecs((int)(($product->effective_time * 3600) + 60), [$pink['id']]);
|
||||
// 开团成功发送模板消息
|
||||
event('notice.notice', [['orderInfo' => $orderInfo, 'title' => $product['title'], 'pink' => $pink], 'open_pink_success']);
|
||||
event('NoticeListener', [['orderInfo' => $orderInfo, 'title' => $product['title'], 'pink' => $pink], 'open_pink_success']);
|
||||
|
||||
if ($res) return true;
|
||||
else return false;
|
||||
|
||||
@ -569,7 +569,7 @@ class StoreSeckillServices extends BaseServices
|
||||
$data['routine_contact_type'] = sys_config('routine_contact_type', 0);
|
||||
|
||||
//用户访问事件
|
||||
event('user.userVisit', [$uid, $id, 'seckill', $storeInfo['product_id'], 'view']);
|
||||
event('UserVisitListener', [$uid, $id, 'seckill', $storeInfo['product_id'], 'view']);
|
||||
//浏览记录
|
||||
ProductLogJob::dispatch(['visit', ['uid' => $uid, 'product_id' => $storeInfo['product_id']]]);
|
||||
return $data;
|
||||
|
||||
@ -70,6 +70,12 @@ class StoreOrderCreateServices extends BaseServices
|
||||
} else {
|
||||
$id = $snowflake->setStartTimeStamp(strtotime('2022-01-01') * 1000)->id();
|
||||
}
|
||||
$replace = '';
|
||||
$chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
||||
for ($i = 0; $i < 3; $i++) {
|
||||
$replace .= $chars[mt_rand(0, strlen($chars) - 1)];
|
||||
}
|
||||
$id = substr_replace($id, $replace, -3);
|
||||
} else {
|
||||
$is_callable = function ($currentTime) {
|
||||
$redis = Cache::store('redis');
|
||||
@ -266,9 +272,9 @@ class StoreOrderCreateServices extends BaseServices
|
||||
});
|
||||
|
||||
// 订单创建成功后置事件
|
||||
event('order.orderCreateAfter', [$order, compact('cartInfo', 'priceData', 'addressId', 'cartIds', 'news'), $uid, $key, $combinationId, $seckillId, $bargainId]);
|
||||
event('OrderCreateAfterListener', [$order, compact('cartInfo', 'priceData', 'addressId', 'cartIds', 'news'), $uid, $key, $combinationId, $seckillId, $bargainId]);
|
||||
// 推送订单
|
||||
event('out.outPush', ['order_create_push', ['order_id' => (int)$order['id']]]);
|
||||
event('OutPushListener', ['order_create_push', ['order_id' => (int)$order['id']]]);
|
||||
return $order;
|
||||
}
|
||||
|
||||
|
||||
@ -364,6 +364,12 @@ class StoreOrderDeliveryServices extends BaseServices
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @return bool
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 吴汐
|
||||
* @email 442384644@qq.com
|
||||
* @date 2023/02/21
|
||||
*/
|
||||
public function splitDelivery(int $id, array $data)
|
||||
{
|
||||
@ -396,10 +402,8 @@ class StoreOrderDeliveryServices extends BaseServices
|
||||
}
|
||||
|
||||
$cart_ids = $data['cart_ids'];
|
||||
/** @var StoreOrderCartInfoServices $storeOrderCartInfoServices */
|
||||
$storeOrderCartInfoServices = app()->make(StoreOrderCartInfoServices::class);
|
||||
unset($data['cart_ids']);
|
||||
$this->transaction(function () use ($id, $cart_ids, $orderInfo, $data, $storeOrderCartInfoServices) {
|
||||
$this->transaction(function () use ($id, $cart_ids, $orderInfo, $data) {
|
||||
/** @var StoreOrderSplitServices $storeOrderSplitServices */
|
||||
$storeOrderSplitServices = app()->make(StoreOrderSplitServices::class);
|
||||
//订单拆单
|
||||
@ -440,11 +444,11 @@ class StoreOrderDeliveryServices extends BaseServices
|
||||
switch ($type) {
|
||||
case 1://快递发货
|
||||
$this->orderDeliverGoods($id, $data, $orderInfo, $storeName);
|
||||
event('notice.notice', [['orderInfo' => $orderInfo, 'storeName' => $storeName, 'data' => $data], 'order_postage_success']);
|
||||
event('NoticeListener', [['orderInfo' => $orderInfo, 'storeName' => $storeName, 'data' => $data], 'order_postage_success']);
|
||||
break;
|
||||
case 2://配送
|
||||
$this->orderDelivery($id, $data, $orderInfo, $storeName);
|
||||
event('notice.notice', [['orderInfo' => $orderInfo, 'storeName' => $storeName, 'data' => $data], 'order_deliver_success']);
|
||||
event('NoticeListener', [['orderInfo' => $orderInfo, 'storeName' => $storeName, 'data' => $data], 'order_deliver_success']);
|
||||
break;
|
||||
case 3://虚拟发货
|
||||
$this->orderVirtualDelivery($id, $data, $orderInfo, $storeName);
|
||||
@ -453,7 +457,7 @@ class StoreOrderDeliveryServices extends BaseServices
|
||||
throw new AdminException(400522);
|
||||
}
|
||||
//到期自动收货
|
||||
event('order.orderDelivery', [$orderInfo, $storeName, $data, $type]);
|
||||
event('OrderDeliveryListener', [$orderInfo, $storeName, $data, $type]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -278,7 +278,7 @@ class StoreOrderRefundServices extends BaseServices
|
||||
app()->make(StoreOrderInvoiceServices::class)->update(['order_id' => $order['id']], ['is_refund' => 1]);
|
||||
//订单退款记录
|
||||
ProductLogJob::dispatch(['refund', ['uid' => $order['uid'], 'order_id' => $order['id']]]);
|
||||
event('notice.notice', [['data' => $refundData, 'order' => $order], 'order_refund']);
|
||||
event('NoticeListener', [['data' => $refundData, 'order' => $order], 'order_refund']);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -599,7 +599,7 @@ class StoreOrderRefundServices extends BaseServices
|
||||
$capitalFlowServices->setFlow($order, 'refund');
|
||||
}
|
||||
|
||||
event('notice.notice', [['data' => $data, 'order' => $order], 'order_refund']);
|
||||
event('NoticeListener', [['data' => $data, 'order' => $order], 'order_refund']);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -693,7 +693,7 @@ class StoreOrderRefundServices extends BaseServices
|
||||
'change_time' => time()
|
||||
]);
|
||||
});
|
||||
event('notice.notice', [['orderInfo' => $orderRefundInfo], 'send_order_refund_no_status']);
|
||||
event('NoticeListener', [['orderInfo' => $orderRefundInfo], 'send_order_refund_no_status']);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -850,7 +850,7 @@ class StoreOrderRefundServices extends BaseServices
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
//提醒推送
|
||||
event('notice.notice', [['order' => $order], 'send_order_apply_refund']);
|
||||
event('NoticeListener', [['order' => $order], 'send_order_apply_refund']);
|
||||
|
||||
return true;
|
||||
|
||||
@ -1012,11 +1012,11 @@ class StoreOrderRefundServices extends BaseServices
|
||||
});
|
||||
$storeOrderCartInfoServices->clearOrderCartInfo($order['id']);
|
||||
//申请退款事件
|
||||
event('order.orderRefundCreateAfter', [$order]);
|
||||
event('OrderRefundCreateAfterListener', [$order]);
|
||||
//提醒推送
|
||||
event('notice.notice', [['order' => $order], 'send_order_apply_refund']);
|
||||
event('NoticeListener', [['order' => $order], 'send_order_apply_refund']);
|
||||
//推送订单
|
||||
event('out.outPush', ['refund_create_push', ['order_id' => (int)$order['id']]]);
|
||||
event('OutPushListener', ['refund_create_push', ['order_id' => (int)$order['id']]]);
|
||||
try {
|
||||
ChannelService::instance()->send('NEW_REFUND_ORDER', ['order_id' => $order['order_id']]);
|
||||
} catch (\Exception $e) {
|
||||
@ -1294,9 +1294,9 @@ class StoreOrderRefundServices extends BaseServices
|
||||
]);
|
||||
|
||||
//售后订单取消后置事件
|
||||
event('order.orderRefundCancelAfter', [$orderRefundInfo]);
|
||||
event('OrderRefundCancelAfterListener', [$orderRefundInfo]);
|
||||
// 推送订单
|
||||
event('out.outPush', ['refund_cancel_push', ['order_id' => (int)$orderRefundInfo['id']]]);
|
||||
event('OutPushListener', ['refund_cancel_push', ['order_id' => (int)$orderRefundInfo['id']]]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -782,7 +782,7 @@ HTML;
|
||||
if ($res) {
|
||||
$order = $this->dao->getOne(['id' => $id, 'is_del' => 0]);
|
||||
//改价短信提醒
|
||||
event('notice.notice', [['order' => $order, 'pay_price' => $data['pay_price']], 'price_revision']);
|
||||
event('NoticeListener', [['order' => $order, 'pay_price' => $data['pay_price']], 'price_revision']);
|
||||
return $data['order_id'];
|
||||
} else {
|
||||
throw new AdminException(100007);
|
||||
|
||||
@ -85,7 +85,7 @@ class StoreOrderSplitServices extends BaseServices
|
||||
if (empty($cart_ids_arr['other'])) return [$old_order, ['id' => 0]];
|
||||
return $this->transaction(function () use ($id, $cart_ids_arr, $orderInfo, $orderInfoOld, $cartInfo, $storeOrderCreateServices, $storeOrderCartInfoServices, $statusService) {
|
||||
$order = $otherOrder = [];
|
||||
$statusData = $statusService->getColumn(['oid' => $id], '*');
|
||||
$statusData = $statusService->selectList(['oid' => $id])->toArray();
|
||||
//订单实际支付金额
|
||||
$order_pay_price = bcsub((string)bcadd((string)$orderInfo['total_price'], (string)$orderInfo['pay_postage'], 2), (string)bcadd((string)$orderInfo['deduction_price'], (string)$orderInfo['coupon_price'], 2), 2);
|
||||
//有改价
|
||||
@ -106,6 +106,7 @@ class StoreOrderSplitServices extends BaseServices
|
||||
$allData = [];
|
||||
foreach ($statusData as $data) {
|
||||
$data['oid'] = $new_id;
|
||||
$data['change_time'] = strtotime($data['change_time']);
|
||||
$allData[] = $data;
|
||||
}
|
||||
if ($allData) {
|
||||
|
||||
@ -93,13 +93,13 @@ class StoreOrderSuccessServices extends BaseServices
|
||||
}
|
||||
$orderInfo['send_name'] = $orderInfo['real_name'];
|
||||
//订单支付成功后置事件
|
||||
event('order.orderPaySuccess', [$orderInfo]);
|
||||
event('OrderPaySuccessListener', [$orderInfo]);
|
||||
//用户推送消息事件
|
||||
event('notice.notice', [$orderInfo, 'order_pay_success']);
|
||||
event('NoticeListener', [$orderInfo, 'order_pay_success']);
|
||||
//支付成功给客服发送消息
|
||||
event('notice.notice', [$orderInfo, 'admin_pay_success_code']);
|
||||
event('NoticeListener', [$orderInfo, 'admin_pay_success_code']);
|
||||
// 推送订单
|
||||
event('out.outPush', ['order_pay_push', ['order_id' => (int)$orderInfo['id']]]);
|
||||
event('OutPushListener', ['order_pay_push', ['order_id' => (int)$orderInfo['id']]]);
|
||||
$res = $res1 && $resPink;
|
||||
return false !== $res;
|
||||
}
|
||||
|
||||
@ -106,11 +106,11 @@ class StoreOrderTakeServices extends BaseServices
|
||||
if ($res) {
|
||||
try {
|
||||
// 收货成功后置队列
|
||||
event('order.orderTake', [$order, $userInfo, $storeTitle]);
|
||||
event('OrderTakeListener', [$order, $userInfo, $storeTitle]);
|
||||
//收货给用户发送消息
|
||||
event('notice.notice', [['order' => $order, 'storeTitle' => $storeTitle], 'order_take']);
|
||||
event('NoticeListener', [['order' => $order, 'storeTitle' => $storeTitle], 'order_take']);
|
||||
//收货给客服发送消息
|
||||
event('notice.notice', [['order' => $order, 'storeTitle' => $storeTitle], 'send_admin_confirm_take_over']);
|
||||
event('NoticeListener', [['order' => $order, 'storeTitle' => $storeTitle], 'send_admin_confirm_take_over']);
|
||||
} catch (\Throwable $exception) {
|
||||
|
||||
}
|
||||
@ -182,7 +182,7 @@ class StoreOrderTakeServices extends BaseServices
|
||||
/** @var StoreOrderServices $orderServices */
|
||||
$orderServices = app()->make(StoreOrderServices::class);
|
||||
$orderServices->update($order['id'], ['gain_integral' => $give_integral], 'id');
|
||||
event('notice.notice', [['order' => $order, 'storeTitle' => $storeTitle, 'give_integral' => $give_integral, 'integral' => $integral], 'integral_accout']);
|
||||
event('NoticeListener', [['order' => $order, 'storeTitle' => $storeTitle, 'give_integral' => $give_integral, 'integral' => $integral], 'integral_accout']);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
@ -473,7 +473,7 @@ class StoreOrderTakeServices extends BaseServices
|
||||
$goodsPrice = $brokeragePrice;
|
||||
}
|
||||
//提醒推送
|
||||
event('notice.notice', [['spread_uid' => $spread_uid, 'userType' => $userType, 'brokeragePrice' => $brokeragePrice, 'goodsName' => $goodsName, 'goodsPrice' => $goodsPrice, 'add_time' => $orderInfo['add_time'] ?? time()], 'order_brokerage']);
|
||||
event('NoticeListener', [['spread_uid' => $spread_uid, 'userType' => $userType, 'brokeragePrice' => $brokeragePrice, 'goodsName' => $goodsName, 'goodsPrice' => $goodsPrice, 'add_time' => $orderInfo['add_time'] ?? time()], 'order_brokerage']);
|
||||
}
|
||||
|
||||
|
||||
@ -510,7 +510,7 @@ class StoreOrderTakeServices extends BaseServices
|
||||
}
|
||||
|
||||
//用户升级事件
|
||||
event('user.userLevel', [$order['uid']]);
|
||||
event('UserLevelListener', [$order['uid']]);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -193,6 +193,11 @@ class OrderPayServices
|
||||
if (request()->isWechat()) {
|
||||
$jsConfig['pay_url'] = AllinPay::UNITODER_H5UNIONPAY;
|
||||
}
|
||||
break;
|
||||
case PayServices::WEIXIN_PAY:
|
||||
if (isset($jsConfig['mweb_url'])) {
|
||||
$jsConfig['h5_url'] = $jsConfig['mweb_url'];
|
||||
}
|
||||
}
|
||||
|
||||
return ['jsConfig' => $jsConfig, 'order_id' => $order['order_id'], 'pay_key' => $payKey];
|
||||
|
||||
@ -1393,7 +1393,7 @@ class StoreProductServices extends BaseServices
|
||||
}
|
||||
$data['priceName'] = $this->getPacketPrice($storeInfo, $attrValue, $uid);
|
||||
//用户访问事件
|
||||
event('user.userVisit', [$uid, $id, 'product', $storeInfo['cate_id'], 'view']);
|
||||
event('UserVisitListener', [$uid, $id, 'product', $storeInfo['cate_id'], 'view']);
|
||||
}
|
||||
|
||||
/** @var StoreProductReplyServices $storeProductReplyService */
|
||||
|
||||
@ -52,7 +52,9 @@ class SystemMenusServices extends BaseServices
|
||||
$data = [];
|
||||
foreach ($menusList as $item) {
|
||||
$item = $item->getData();
|
||||
$item['menu_path'] = '/' . config('app.admin_prefix', 'admin') . $item['menu_path'];
|
||||
if (isset($item['menu_path'])) {
|
||||
$item['menu_path'] = '/' . config('app.admin_prefix', 'admin') . $item['menu_path'];
|
||||
}
|
||||
$data[] = $item;
|
||||
}
|
||||
|
||||
|
||||
@ -126,7 +126,7 @@ class SystemAdminServices extends BaseServices
|
||||
[$menus, $uniqueAuth] = $services->getMenusList($adminInfo->roles, (int)$adminInfo['level']);
|
||||
$remind = Config::get('app.console_remind', false);
|
||||
if ($remind) {
|
||||
[$queue, $timer] = Event::until('admin.login', [$key]);
|
||||
[$queue, $timer] = Event::until('AdminLoginListener', [$key]);
|
||||
}
|
||||
return [
|
||||
'token' => $tokenInfo['token'],
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace app\services\system\timer;
|
||||
namespace app\services\system\crontab;
|
||||
|
||||
use app\dao\system\timer\SystemTimerDao;
|
||||
use app\dao\system\crontab\SystemCrontabDao;
|
||||
use app\services\activity\combination\StorePinkServices;
|
||||
use app\services\activity\live\LiveGoodsServices;
|
||||
use app\services\activity\live\LiveRoomServices;
|
||||
@ -15,7 +15,7 @@ use app\services\system\attachment\SystemAttachmentServices;
|
||||
use crmeb\exceptions\AdminException;
|
||||
use think\facade\Log;
|
||||
|
||||
class SystemTimerServices extends BaseServices
|
||||
class SystemCrontabServices extends BaseServices
|
||||
{
|
||||
/**
|
||||
* 定时任务类型
|
||||
@ -33,7 +33,7 @@ class SystemTimerServices extends BaseServices
|
||||
'clear_poster' => '清除昨日海报',
|
||||
];
|
||||
|
||||
public function __construct(SystemTimerDao $dao)
|
||||
public function __construct(SystemCrontabDao $dao)
|
||||
{
|
||||
$this->dao = $dao;
|
||||
}
|
||||
@ -203,11 +203,9 @@ class SystemTimerServices extends BaseServices
|
||||
* @email 442384644@qq.com
|
||||
* @date 2023/02/17
|
||||
*/
|
||||
public function timerRun()
|
||||
public function crontabRun()
|
||||
{
|
||||
$time = time();
|
||||
$date = date('Y-m-d H:i:s', time());
|
||||
$timer_log_open = config("log.timer_log", false);
|
||||
file_put_contents(root_path() . 'runtime/.timer', $time); //检测定时任务是否正常
|
||||
$list = $this->dao->selectList(['is_open' => 1, 'is_del' => 0])->toArray();
|
||||
foreach ($list as $item) {
|
||||
@ -215,43 +213,59 @@ class SystemTimerServices extends BaseServices
|
||||
if ($item['mark'] == 'order_cancel') {
|
||||
//未支付自动取消订单
|
||||
app()->make(StoreOrderServices::class)->orderUnpaidCancel();
|
||||
if($timer_log_open) Log::notice($date . ' 执行未支付自动取消订单');
|
||||
$this->crontabLog(' 执行未支付自动取消订单');
|
||||
} elseif ($item['mark'] == 'pink_expiration') {
|
||||
//拼团到期订单处理
|
||||
app()->make(StorePinkServices::class)->statusPink();
|
||||
if($timer_log_open) Log::notice($date . ' 执行拼团到期订单处理');
|
||||
$this->crontabLog(' 执行拼团到期订单处理');
|
||||
} elseif ($item['mark'] == 'agent_unbind') {
|
||||
//自动解绑上级绑定
|
||||
app()->make(AgentManageServices::class)->removeSpread();
|
||||
if($timer_log_open) Log::notice($date . ' 执行自动解绑上级绑定');
|
||||
$this->crontabLog(' 执行自动解绑上级绑定');
|
||||
} elseif ($item['mark'] == 'live_product_status') {
|
||||
//更新直播商品状态
|
||||
app()->make(LiveGoodsServices::class)->syncGoodStatus();
|
||||
if($timer_log_open) Log::notice($date . ' 执行更新直播商品状态');
|
||||
$this->crontabLog(' 执行更新直播商品状态');
|
||||
} elseif ($item['mark'] == 'live_room_status') {
|
||||
//更新直播间状态
|
||||
app()->make(LiveRoomServices::class)->syncRoomStatus();
|
||||
if($timer_log_open) Log::notice($date . ' 执行更新直播间状态');
|
||||
$this->crontabLog(' 执行更新直播间状态');
|
||||
} elseif ($item['mark'] == 'take_delivery') {
|
||||
//自动收货
|
||||
app()->make(StoreOrderTakeServices::class)->autoTakeOrder();
|
||||
if($timer_log_open) Log::notice($date . ' 执行自动收货');
|
||||
$this->crontabLog(' 执行自动收货');
|
||||
} elseif ($item['mark'] == 'advance_off') {
|
||||
//查询预售到期商品自动下架
|
||||
app()->make(StoreProductServices::class)->downAdvance();
|
||||
if($timer_log_open) Log::notice($date . ' 执行预售到期商品自动下架');
|
||||
$this->crontabLog(' 执行预售到期商品自动下架');
|
||||
} elseif ($item['mark'] == 'product_replay') {
|
||||
//自动好评
|
||||
app()->make(StoreOrderServices::class)->autoComment();
|
||||
if($timer_log_open) Log::notice($date . ' 执行自动好评');
|
||||
$this->crontabLog(' 执行自动好评');
|
||||
} elseif ($item['mark'] == 'clear_poster') {
|
||||
//清除昨日海报
|
||||
app()->make(SystemAttachmentServices::class)->emptyYesterdayAttachment();
|
||||
if($timer_log_open) Log::notice($date . ' 执行清除昨日海报');
|
||||
$this->crontabLog(' 执行清除昨日海报');
|
||||
}
|
||||
//写入本次执行时间和下次执行时间
|
||||
$this->dao->update(['mark' => $item['mark']], ['last_execution_time' => $time, 'next_execution_time' => $this->getTimerCycleTime($item)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 定时任务日志
|
||||
* @param $msg
|
||||
* @author 吴汐
|
||||
* @email 442384644@qq.com
|
||||
* @date 2023/02/21
|
||||
*/
|
||||
public function crontabLog($msg)
|
||||
{
|
||||
$timer_log_open = config("log.timer_log", false);
|
||||
if ($timer_log_open) {
|
||||
$date = date('Y-m-d H:i:s', time());
|
||||
Log::notice($date . $msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -117,9 +117,9 @@ class LoginServices extends BaseServices
|
||||
$data['division_id'] = $spreadInfo->division_id;
|
||||
$data['staff_id'] = $spreadInfo->staff_id;
|
||||
//绑定用户后置事件
|
||||
event('user.register', [$spreadUid, $userInfo['user_type'], $userInfo['nickname'], $userInfo['uid'], 0]);
|
||||
event('UserRegisterListener', [$spreadUid, $userInfo['user_type'], $userInfo['nickname'], $userInfo['uid'], 0]);
|
||||
//推送消息
|
||||
event('notice.notice', [['spreadUid' => $spreadUid, 'user_type' => $userInfo['user_type'], 'nickname' => $userInfo['nickname']], 'bind_spread_uid']);
|
||||
event('NoticeListener', [['spreadUid' => $spreadUid, 'user_type' => $userInfo['user_type'], 'nickname' => $userInfo['nickname']], 'bind_spread_uid']);
|
||||
}
|
||||
} else {
|
||||
//永久绑定
|
||||
@ -141,9 +141,9 @@ class LoginServices extends BaseServices
|
||||
$data['division_id'] = $spreadInfo->division_id;
|
||||
$data['staff_id'] = $spreadInfo->staff_id;
|
||||
//绑定用户后置事件
|
||||
event('user.register', [$spreadUid, $userInfo['user_type'], $userInfo['nickname'], $userInfo['uid'], 0]);
|
||||
event('UserRegisterListener', [$spreadUid, $userInfo['user_type'], $userInfo['nickname'], $userInfo['uid'], 0]);
|
||||
//推送消息
|
||||
event('notice.notice', [['spreadUid' => $spreadUid, 'user_type' => $userInfo['user_type'], 'nickname' => $userInfo['nickname']], 'bind_spread_uid']);
|
||||
event('NoticeListener', [['spreadUid' => $spreadUid, 'user_type' => $userInfo['user_type'], 'nickname' => $userInfo['nickname']], 'bind_spread_uid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -234,9 +234,9 @@ class LoginServices extends BaseServices
|
||||
} else {
|
||||
$userServices->rewardNewUser((int)$re->uid);
|
||||
//用户生成后置事件
|
||||
event('user.register', [$spread, $user_type, $data['nickname'], $re->uid, 1]);
|
||||
event('UserRegisterListener', [$spread, $user_type, $data['nickname'], $re->uid, 1]);
|
||||
//推送消息
|
||||
event('notice.notice', [['spreadUid' => $spread, 'user_type' => $user_type, 'nickname' => $data['nickname']], 'bind_spread_uid']);
|
||||
event('NoticeListener', [['spreadUid' => $spread, 'user_type' => $user_type, 'nickname' => $data['nickname']], 'bind_spread_uid']);
|
||||
return $re;
|
||||
}
|
||||
}
|
||||
|
||||
@ -667,7 +667,7 @@ class UserBillServices extends BaseServices
|
||||
//检测会员等级
|
||||
try {
|
||||
//用户升级事件
|
||||
event('user.userLevel', [$spreadUid]);
|
||||
event('UserLevelListener', [$spreadUid]);
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('会员等级升级失败,失败原因:' . $e->getMessage());
|
||||
}
|
||||
@ -750,7 +750,7 @@ class UserBillServices extends BaseServices
|
||||
$where_data = [];
|
||||
$where_data['time'] = $where['time'];
|
||||
if (isset($where['nickname']) && $where['nickname']) {
|
||||
$where_data[] = ['u.account|u.nickname|u.uid|u.phone', 'LIKE', "%$where[nickname]%"];
|
||||
$where_data[] = ['u.nickname|u.uid', 'LIKE', "%$where[nickname]%"];
|
||||
}
|
||||
if (isset($where['price_max']) && isset($where['price_min'])) {
|
||||
if ($where['price_max'] != '' && $where['price_min'] != '') {
|
||||
|
||||
@ -142,7 +142,7 @@ class UserExtractServices extends BaseServices
|
||||
}
|
||||
});
|
||||
|
||||
event('notice.notice', [['uid' => $uid, 'userType' => strtolower($user['user_type']), 'extract_number' => $extract_number, 'nickname' => $user['nickname'], 'message' => $message], 'user_balance_change']);
|
||||
event('NoticeListener', [['uid' => $uid, 'userType' => strtolower($user['user_type']), 'extract_number' => $extract_number, 'nickname' => $user['nickname'], 'message' => $message], 'user_balance_change']);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ class UserExtractServices extends BaseServices
|
||||
$userType = $userServices->value(['uid' => $userExtract['uid']], 'user_type');
|
||||
$nickname = $userServices->value(['uid' => $userExtract['uid']], 'nickname');
|
||||
$phone = $userServices->value(['uid' => $userExtract['uid']], 'phone');
|
||||
event('notice.notice', [['uid' => $userExtract['uid'], 'userType' => strtolower($userType), 'extractNumber' => $extractNumber, 'nickname' => $nickname], 'user_extract']);
|
||||
event('NoticeListener', [['uid' => $userExtract['uid'], 'userType' => strtolower($userType), 'extractNumber' => $extractNumber, 'nickname' => $nickname], 'user_extract']);
|
||||
|
||||
if (!$this->dao->update($id, ['status' => 1])) {
|
||||
throw new AdminException(100007);
|
||||
@ -511,7 +511,7 @@ class UserExtractServices extends BaseServices
|
||||
$systemAdmin = app()->make(SystemAdminServices::class);
|
||||
$systemAdmin->adminNewPush();
|
||||
//消息
|
||||
event('notice.notice', [['nickname' => $user['nickname'], 'money' => $data['money']], 'kefu_send_extract_application']);
|
||||
event('NoticeListener', [['nickname' => $user['nickname'], 'money' => $data['money']], 'kefu_send_extract_application']);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -278,7 +278,7 @@ class UserRechargeServices extends BaseServices
|
||||
$userMoneyServices->income('user_recharge_refund', $UserRecharge['uid'], $number, $now_money, $id);
|
||||
|
||||
//提醒推送
|
||||
event('notice.notice', [['user_type' => strtolower($userInfo['user_type']), 'data' => $data, 'UserRecharge' => $UserRecharge, 'now_money' => $refund_price], 'recharge_order_refund_status']);
|
||||
event('NoticeListener', [['user_type' => strtolower($userInfo['user_type']), 'data' => $data, 'UserRecharge' => $UserRecharge, 'now_money' => $refund_price], 'recharge_order_refund_status']);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -471,7 +471,7 @@ class UserRechargeServices extends BaseServices
|
||||
$capitalFlowServices->setFlow($order, 'recharge');
|
||||
|
||||
//提醒推送
|
||||
event('notice.notice', [['order' => $order, 'now_money' => $now_money], 'recharge_success']);
|
||||
event('NoticeListener', [['order' => $order, 'now_money' => $now_money], 'recharge_success']);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -139,9 +139,9 @@ class UserServices extends BaseServices
|
||||
//新用户注册奖励
|
||||
$this->rewardNewUser((int)$res->uid);
|
||||
//用户生成后置事件
|
||||
event('user.register', [$spreadUid, $userType, $user['nickname'], $res->uid, 1]);
|
||||
event('UserRegisterListener', [$spreadUid, $userType, $user['nickname'], $res->uid, 1]);
|
||||
//推送消息
|
||||
event('notice.notice', [['spreadUid' => $spreadUid, 'user_type' => $userType, 'nickname' => $user['nickname']], 'bind_spread_uid']);
|
||||
event('NoticeListener', [['spreadUid' => $spreadUid, 'user_type' => $userType, 'nickname' => $user['nickname']], 'bind_spread_uid']);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -775,7 +775,7 @@ class UserServices extends BaseServices
|
||||
}
|
||||
$res1 = $userMoneyServices->income('system_sub', $user['uid'], $data['money'], $edit['now_money'], $data['adminId'] ?? 0);
|
||||
}
|
||||
event('out.outPush', ['user_update_push', ['uid' => $id, 'type' => 'money', 'value' => $data['money_status'] == 2 ? -floatval($data['money']) : $data['money']]]);
|
||||
event('OutPushListener', ['user_update_push', ['uid' => $id, 'type' => 'money', 'value' => $data['money_status'] == 2 ? -floatval($data['money']) : $data['money']]]);
|
||||
} else {
|
||||
$res1 = true;
|
||||
}
|
||||
@ -796,7 +796,7 @@ class UserServices extends BaseServices
|
||||
$integral_data['mark'] = '系统扣除了' . floatval($data['integration']) . '积分';
|
||||
$res2 = $userBill->expendIntegral($user['uid'], 'system_sub', $integral_data);
|
||||
}
|
||||
event('out.outPush', ['user_update_push', ['uid' => $id, 'type' => 'point', 'value' => $data['integration_status'] == 2 ? -intval($data['integration']) : $data['integration']]]);
|
||||
event('OutPushListener', ['user_update_push', ['uid' => $id, 'type' => 'point', 'value' => $data['integration_status'] == 2 ? -intval($data['integration']) : $data['integration']]]);
|
||||
} else {
|
||||
$res2 = true;
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ class UserSignServices extends BaseServices
|
||||
//检测会员等级
|
||||
try {
|
||||
//用户升级事件
|
||||
event('user.userLevel', [$uid]);
|
||||
event('UserLevelListener', [$uid]);
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('会员等级升级失败,失败原因:' . $e->getMessage());
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ class Timer extends Command
|
||||
date_default_timezone_set('PRC');
|
||||
$task->count = 1;
|
||||
$task->onWorkerStart = function () {
|
||||
event('SystemTimer');
|
||||
event('CrontabListener');
|
||||
};
|
||||
$task->runAll();
|
||||
}
|
||||
|
||||
@ -209,7 +209,7 @@ class AliPayService
|
||||
'transaction_id' => $notify->trade_no
|
||||
];
|
||||
|
||||
return Event::until('pay.notify', [$data, PayServices::ALIAPY_PAY]);
|
||||
return Event::until('NotifyListener', [$data, PayServices::ALIAPY_PAY]);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
@ -174,7 +174,7 @@ class WechatService
|
||||
$data['out_trade_no'] = $message['order_info']['trade_no'];
|
||||
$data['transaction_id'] = $message['order_info']['transaction_id'];
|
||||
$data['opneid'] = $message['FromUserName'];
|
||||
if (Event::until('pay.notify', [$data, PayServices::WEIXIN_PAY])) {
|
||||
if (Event::until('NotifyListener', [$data, PayServices::WEIXIN_PAY])) {
|
||||
$response = 'success';
|
||||
} else {
|
||||
$response = 'faild';
|
||||
@ -635,7 +635,7 @@ class WechatService
|
||||
'transaction_id' => $notify->transaction_id
|
||||
];
|
||||
|
||||
return Event::until('pay.notify', [$data, PayServices::WEIXIN_PAY]);
|
||||
return Event::until('NotifyListener', [$data, PayServices::WEIXIN_PAY]);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@ -147,7 +147,7 @@ class AllinPay extends BasePay implements PayInterface
|
||||
'transaction_id' => $notify['trxid']
|
||||
];
|
||||
|
||||
return Event::until('pay.notify', [$data, PayServices::ALLIN_PAY]);
|
||||
return Event::until('NotifyListener', [$data, PayServices::ALLIN_PAY]);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
@ -210,7 +210,7 @@ class V3WechatPay extends BasePay implements PayInterface
|
||||
'transaction_id' => $notify->transaction_id
|
||||
];
|
||||
|
||||
return Event::until('pay.notify', [$data, PayServices::WEIXIN_PAY]);
|
||||
return Event::until('NotifyListener', [$data, PayServices::WEIXIN_PAY]);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@ -26510,7 +26510,17 @@ INSERT INTO `eb_lang_code` (`id`, `type_id`, `code`, `remarks`, `lang_explain`,
|
||||
(24967, 7, '500027', '您有未付款订单,订单号为:{:order_id},商品数量有限,请及时付款。', '미결제 주문이 있습니다. 주문 번호: {:order_id}, 상품 수량이 제한되어 있습니다. 제시간에 결제하세요.', 1),
|
||||
(24968, 8, '500027', '您有未付款订单,订单号为:{:order_id},商品数量有限,请及时付款。', 'Танд төлөгдөөгүй захиалга байна, захиалгын дугаар: {:order_id}, барааны тоо хязгаартай тул цаг тухайд нь төлнө үү.', 1),
|
||||
(24969, 9, '500027', '您有未付款订单,订单号为:{:order_id},商品数量有限,请及时付款。', 'คุณมีคำสั่งซื้อที่ยังไม่ได้ชำระเงิน หมายเลขคำสั่งซื้อคือ: {:order_id} สินค้ามีจำนวนจำกัด โปรดชำระเงินให้ตรงเวลา', 1),
|
||||
(24970, 10, '500027', '您有未付款订单,订单号为:{:order_id},商品数量有限,请及时付款。', 'Bạn có đơn hàng chưa thanh toán, số đơn hàng là: {:order_id}, số lượng hàng có hạn, vui lòng thanh toán kịp thời.', 1);
|
||||
(24970, 10, '500027', '您有未付款订单,订单号为:{:order_id},商品数量有限,请及时付款。', 'Bạn có đơn hàng chưa thanh toán, số đơn hàng là: {:order_id}, số lượng hàng có hạn, vui lòng thanh toán kịp thời.', 1),
|
||||
(24971, 1, '500028', '请填写邀请码', '请填写邀请码', 1),
|
||||
(24972, 2, '500028', '请填写邀请码', 'Please fill in the invitation code', 1),
|
||||
(24973, 3, '500028', '请填写邀请码', '請填寫邀請碼', 1),
|
||||
(24974, 4, '500028', '请填写邀请码', 'Merci de remplir le code dinvitation', 1),
|
||||
(24975, 5, '500028', '请填写邀请码', 'Si prega di compilare il codice di invito', 1),
|
||||
(24976, 6, '500028', '请填写邀请码', '招待状を記入してください', 1),
|
||||
(24977, 7, '500028', '请填写邀请码', '초대 코드를 입력하십시오.', 1),
|
||||
(24978, 8, '500028', '请填写邀请码', 'Урилгын кодыг бөглөнө үү', 1),
|
||||
(24979, 9, '500028', '请填写邀请码', 'กรุณากรอกรหัสเชิญ', 1),
|
||||
(24980, 10, '500028', '请填写邀请码', 'Vui lòng điền mã mời', 1);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ class File extends Driver
|
||||
$content = gzuncompress($content);
|
||||
}
|
||||
|
||||
return ['content' => $content, 'expire' => $expire];
|
||||
return ['content' => (string)$content, 'expire' => $expire];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ class Listen extends Command
|
||||
$sleep = $input->getOption('sleep');
|
||||
$tries = $input->getOption('tries');
|
||||
|
||||
$this->app->event->trigger('queue.start', [$output]);
|
||||
$this->app->event->trigger('QueueStartListener', [$output]);
|
||||
|
||||
$this->listener->listen($connection, $queue, $delay, $sleep, $tries, $memory, $timeout);
|
||||
}
|
||||
|
||||
@ -723,7 +723,7 @@ export function upgradeableListApi(params) {
|
||||
*/
|
||||
export function timerIndex(params) {
|
||||
return request({
|
||||
url: `system/timer/list`,
|
||||
url: `system/crontab/list`,
|
||||
params,
|
||||
});
|
||||
}
|
||||
@ -735,7 +735,7 @@ export function timerIndex(params) {
|
||||
*/
|
||||
export function showTimer(id, is_open) {
|
||||
return request({
|
||||
url: `system/timer/set_open/${id}/${is_open}`,
|
||||
url: `system/crontab/set_open/${id}/${is_open}`,
|
||||
});
|
||||
}
|
||||
|
||||
@ -746,7 +746,7 @@ export function showTimer(id, is_open) {
|
||||
*/
|
||||
export function timerInfo(id) {
|
||||
return request({
|
||||
url: `system/timer/info/${id}`,
|
||||
url: `system/crontab/info/${id}`,
|
||||
});
|
||||
}
|
||||
|
||||
@ -757,7 +757,7 @@ export function timerInfo(id) {
|
||||
*/
|
||||
export function saveTimer(data) {
|
||||
return request({
|
||||
url: `system/timer/save`,
|
||||
url: `system/crontab/save`,
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
@ -771,7 +771,7 @@ export function saveTimer(data) {
|
||||
*/
|
||||
export function updateTimer(id, data) {
|
||||
return request({
|
||||
url: `system/timer/update/${id}`,
|
||||
url: `system/crontab/update/${id}`,
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
@ -783,6 +783,6 @@ export function updateTimer(id, data) {
|
||||
*/
|
||||
export function timerTask() {
|
||||
return request({
|
||||
url: `/system/timer/mark`,
|
||||
url: `system/crontab/mark`,
|
||||
});
|
||||
}
|
||||
|
||||
@ -231,7 +231,7 @@ export default {
|
||||
if (data.timer === false) {
|
||||
this.$Notice.warning({
|
||||
title: '温馨提示',
|
||||
desc: '您的【定时任务】未开启,没有开启会导致自动收货、未支付自动取消订单、订单自动好评、拼团到期退款等任务无法正常执行。请尽快执行命令开启!!<a href="https://doc.crmeb.com/single/crmeb_v4/6962" target="_blank">点击查看开启方法</a>',
|
||||
desc: '您的【定时任务】未开启,没有开启会导致自动收货、未支付自动取消订单、订单自动好评、拼团到期退款等任务无法正常执行。请尽快执行命令开启!!<a href="https://doc.crmeb.com/single/crmeb_v4/7211" target="_blank">点击查看开启方法</a>',
|
||||
duration: 30,
|
||||
});
|
||||
}
|
||||
|
||||
@ -51,11 +51,11 @@ export default {
|
||||
let pageId = this.$route.query.id;
|
||||
let defaultData = this.$store.state.moren.defaultConfig;
|
||||
this.pageId = parseInt(pageId);
|
||||
let moveLink = 'http://open.net';getCookies('moveLink');
|
||||
let moveLink = getCookies('moveLink');
|
||||
if (Number(this.$route.query.type) === 1) {
|
||||
this.iframeUrl = `http://open.net/pages/index/index?type=iframeWindow`;
|
||||
this.iframeUrl = `${moveLink}/pages/index/index?type=iframeWindow`;
|
||||
} else {
|
||||
this.iframeUrl = `http://open.net/pages/index/index?type=iframeWindow`;
|
||||
this.iframeUrl = `${location.origin}/pages/index/index?type=iframeWindow`;
|
||||
}
|
||||
diyGetInfo(parseInt(pageId)).then((datas) => {
|
||||
let data = datas.data.info.value;
|
||||
|
||||
@ -168,7 +168,8 @@
|
||||
let userData = await getUserInfo()
|
||||
this.uid = userData.data.uid
|
||||
let goods_img, mp_code, resData, arr, mpUrl
|
||||
// #ifdef MP
|
||||
// #ifdef MP
|
||||
|
||||
// #endif
|
||||
uni.showLoading({
|
||||
title: that.$t(`海报生成中`),
|
||||
@ -198,7 +199,8 @@
|
||||
let imgData = await this.imgToBase(resData.image, resData.url)
|
||||
arr = [this.posterBag, imgData.image, imgData.code || this.codeSrc]
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
// #ifdef MP
|
||||
resData.image = that.setDomain(resData.image);
|
||||
mpUrl = resData.url ? await this.downloadFilestoreImage(resData.url) : await this
|
||||
.downloadFilestoreImage(this.mpUrl)
|
||||
arr = [this.posterBag, await this.downloadFilestoreImage(resData.image), mpUrl]
|
||||
@ -235,7 +237,7 @@
|
||||
})
|
||||
},
|
||||
//替换安全域名
|
||||
setDomain: function(image, url) {
|
||||
setDomain: function(url) {
|
||||
url = url ? url.toString() : '';
|
||||
//本地调试打开,生产请注销
|
||||
if (url.indexOf('https://') > -1) return url;
|
||||
|
||||
@ -177,9 +177,6 @@
|
||||
},
|
||||
searchBut() {
|
||||
let that = this;
|
||||
if (!that.where.keywords.trim()) return this.$util.Tips({
|
||||
title: that.$t(`请输入要搜索的商品`)
|
||||
});
|
||||
that.focus = false;
|
||||
that.where.page = 1;
|
||||
that.loading = false;
|
||||
|
||||
@ -921,13 +921,14 @@
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
height: 85rpx;
|
||||
font-weight: 800;
|
||||
font-weight: 800;
|
||||
line-height: 40rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
text-align: left !important;
|
||||
text-align: left !important;
|
||||
}
|
||||
|
||||
.broadcast_details_pic {
|
||||
|
||||
@ -522,7 +522,8 @@
|
||||
}
|
||||
},
|
||||
})
|
||||
} else {
|
||||
} else {
|
||||
if(this.numberPic == '') this.numberPic = this.money;
|
||||
this.pay()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user