41 lines
		
	
	
		
			880 B
		
	
	
	
		
			PHP
		
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			880 B
		
	
	
	
		
			PHP
		
	
	
	
| <?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)
 | |
|     {
 | |
|         return $this->model->searchPages(['order_number', 'type', 'status', 'create_at', 'user_id'], $params)->toArray();
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * 获取一个月内订单数量
 | |
|      * @return array
 | |
|      * @throws \think\db\exception\DbException
 | |
|      */
 | |
|     public  function getMonthSale(): array
 | |
|     {
 | |
|       $count =  $this->model->getCountLastMonth();
 | |
|       return ['count' => $count];
 | |
|     }
 | |
| } |