You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
111 lines
3.1 KiB
111 lines
3.1 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\adminapi\controller\order_table;
|
|
|
|
use core\base\BaseAdminController;
|
|
use app\service\admin\order_table\OrderTableService;
|
|
|
|
|
|
/**
|
|
* 订单控制器
|
|
* Class OrderTable
|
|
* @package app\adminapi\controller\order_table
|
|
*/
|
|
class OrderTable extends BaseAdminController
|
|
{
|
|
/**
|
|
* 获取订单列表
|
|
* @return \think\Response
|
|
*/
|
|
public function lists(){
|
|
$data = $this->request->params([
|
|
["order_status",""],
|
|
["payment_type",""],
|
|
["resource_id",""]
|
|
]);
|
|
return success((new OrderTableService())->getPage($data));
|
|
}
|
|
|
|
/**
|
|
* 订单详情
|
|
* @param int $id
|
|
* @return \think\Response
|
|
*/
|
|
public function info(int $id){
|
|
return success((new OrderTableService())->getInfo($id));
|
|
}
|
|
|
|
/**
|
|
* 添加订单
|
|
* @return \think\Response
|
|
*/
|
|
public function add(){
|
|
$data = $this->request->params([
|
|
["resource_id",0],
|
|
// ["order_status",""],
|
|
["payment_type",""],
|
|
["order_amount",0.00],
|
|
["course_id",0],
|
|
["class_id",0],
|
|
|
|
]);
|
|
$this->validate($data, 'app\validate\order_table\OrderTable.add');
|
|
return (new OrderTableService())->add($data);
|
|
}
|
|
|
|
/**
|
|
* 订单编辑
|
|
* @param $id 订单id
|
|
* @return \think\Response
|
|
*/
|
|
public function edit(int $id){
|
|
$data = $this->request->params([
|
|
["resource_id",0],
|
|
// ["order_status",""],
|
|
["payment_type",""],
|
|
["order_amount",0.00],
|
|
["course_id",0],
|
|
["class_id",0],
|
|
|
|
]);
|
|
$this->validate($data, 'app\validate\order_table\OrderTable.edit');
|
|
(new OrderTableService())->edit($id, $data);
|
|
return success('EDIT_SUCCESS');
|
|
}
|
|
|
|
/**
|
|
* 订单删除
|
|
* @param $id 订单id
|
|
* @return \think\Response
|
|
*/
|
|
public function del(int $id){
|
|
(new OrderTableService())->del($id);
|
|
return success('DELETE_SUCCESS');
|
|
}
|
|
|
|
|
|
public function getCustomerResourcesAll(){
|
|
return success(( new OrderTableService())->getCustomerResourcesAll());
|
|
}
|
|
|
|
public function getCourseAll(){
|
|
return success(( new OrderTableService())->getCourseAll());
|
|
}
|
|
|
|
public function getClassGradeAll(){
|
|
return success(( new OrderTableService())->getClassGradeAll());
|
|
}
|
|
|
|
public function getPersonnelAll(){
|
|
return success(( new OrderTableService())->getPersonnelAll());
|
|
}
|
|
}
|
|
|