// +---------------------------------------------------------------------- namespace App\Http\Controllers\Admin; use App\Services\Common\OrderService; /** * 积分订单管理-控制器 * @author laravel开发员 * @since 2020/11/11 * Class OrderController * @package App\Http\Controllers */ class OrderController extends Backend { /** * 构造函数 * @author laravel开发员 * @since 2020/11/11 * OrderController constructor. */ public function __construct() { parent::__construct(); $this->service = new OrderService(); } public function index() { $params = request()->all(); $pageSize = isset($params['pageSize'])? $params['pageSize'] : 10; $list = OrderService::make()->getDataList($params, $pageSize); $message = array( "msg" => '操作成功', "code" => 0, "data" => isset($list['list'])? $list['list']:[], "count" => isset($list['total'])? $list['total']:0, ); return $message; } /** * 取消订单 * @return array */ public function cancel() { if(OrderService::make()->cancel()){ return message(OrderService::make()->getError(), true); }else{ return message(OrderService::make()->getError(), false); } } /** * 异常订单 * @return array */ public function exception() { if(OrderService::make()->exception()){ return message(OrderService::make()->getError(), true); }else{ return message(OrderService::make()->getError(), false); } } /** * 完成订单 * @return array */ public function complete() { if(OrderService::make()->complete()){ return message(OrderService::make()->getError(), true); }else{ return message(OrderService::make()->getError(), false); } } /** * 统计 * @return array */ public function count() { $result = OrderService::make()->countByWait(); return message(1010, true, $result); } }