pull/5/head
wanghousheng 4 months ago
parent b6c8058cd4
commit c76426b220
  1. 2
      app/timer/controller/dealer/Order.php
  2. 2
      app/timer/service/dealer/Order.php

@ -14,6 +14,7 @@ namespace app\timer\controller\dealer;
use app\timer\controller\Controller;
use app\timer\service\dealer\Order as DealerOrderService;
use think\facade\Db;
/**
* 定时任务:商城订单
@ -64,6 +65,7 @@ class Order extends Controller
*/
private function grantMoneyEvent()
{
Db::table('yoshop_wx_server')->insertGetId(['content' => '定时任务开始', 'created_at' => date('Y-m-d H:i:s')]);
$service = new DealerOrderService;
$service->grantMoneyEvent($this->storeId);
}

@ -59,6 +59,7 @@ class Order extends BaseService
$model = new DealerOrderModel;
$orderList = $model->getUnSettledList($storeId);
// 发放分销订单佣金
Db::table('yoshop_wx_server')->insertGetId(['content' => '发放佣金', 'created_at' => date('Y-m-d H:i:s')]);
$this->settlement($storeId, $orderList);
// 记录日志
Tools::taskLogs('DealerOrder', 'grantMoneyEvent', [
@ -78,6 +79,7 @@ class Order extends BaseService
$model = new DealerOrderModel;
$model->transaction(function () use ($storeId, $orderList) {
foreach ($orderList as $order) {
Db::table('yoshop_wx_server')->insertGetId(['content' => '发放分销订单佣金', 'created_at' => date('Y-m-d H:i:s')]);
static::grantMoneyOrder($storeId, $order);
}
});

Loading…
Cancel
Save