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]; } }