2024-07-01 15:57:07 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace app\service;
|
|
|
|
|
|
|
|
use app\exception\LogicException;
|
|
|
|
use app\model\Order;
|
|
|
|
use app\model\Product;
|
|
|
|
use app\model\Sign;
|
|
|
|
use app\util\StringUtil;
|
|
|
|
use BlueBrothers\Openapi\Notify\Notify;
|
|
|
|
use BlueBrothers\Openapi\Util;
|
|
|
|
|
|
|
|
class OrderService extends BaseService
|
|
|
|
{
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->model = app()->make(Order::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生成订单
|
|
|
|
* @param array $data
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function list($params)
|
|
|
|
{
|
2024-07-08 15:26:18 +08:00
|
|
|
return $this->model->searchPages(['order_number', 'type', 'status', 'create_at', 'user_id', 'is_retry'], $params)->toArray();
|
2024-07-01 15:57:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取一个月内订单数量
|
|
|
|
* @return array
|
|
|
|
* @throws \think\db\exception\DbException
|
|
|
|
*/
|
2024-07-05 15:22:57 +08:00
|
|
|
public function getMonthSale(): array
|
2024-07-01 15:57:07 +08:00
|
|
|
{
|
2024-07-05 15:22:57 +08:00
|
|
|
$count = $this->model->getCountLastMonth();
|
|
|
|
return ['count' => $count];
|
2024-07-01 15:57:07 +08:00
|
|
|
}
|
|
|
|
}
|