全栈小学生 abaa4201fb add shop
2026-01-13 09:16:43 +08:00

68 lines
1.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace addon\shop\app\job\stat;
use addon\shop\app\model\order\Order;
use app\service\core\stat\CoreStatService;
use core\base\BaseJob;
/**
* 订单自动关闭
*/
class ShopStatJob extends BaseJob
{
/**
* 消费
* @return true
*/
public function doJob($key, $addon)
{
if (method_exists($this, $key)) $this->$key($addon);
return true;
}
/**
* 订单统计
* @param $addon
* @return void
*/
public function shopOrder($addon)
{
// ['addon' =>, 'date' => ['year' => , 'month'=> , 'day' => , 'hour' => ], 'data' => ['shop_order_money' => 12, 'member' => 12]]
$orderModel = new Order();
$order_money = $orderModel->where([ [ 'status', '>', 0 ] ])->sum('order_money');
$param = [
'addon' => $addon,
'date' => [
'year' => date('Y'),
'month' => date('m'),
'day' => date('d'),
'hour' => date('H'),
],
'data' => [
'order_money' => $order_money
]
];
( new CoreStatService() )->add($param);
}
/**
* @param $addon
* @return void
*/
public function shopRechargeOrder($addon)
{
}
}