...
|
...
|
@@ -137,6 +137,8 @@ class Order extends Api |
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
*
|
|
|
* @ApiParams (name="type", type="int", required=false, description="类型(如果为空或者为1是进行中 2是已完成3是售后)")
|
|
|
* @ApiParams (name="page", type="inter", required=false, description="当前页(默认1)")
|
|
|
* @ApiParams (name="pageNum", type="inter", required=false, description="每页显示数据个数(默认10)")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
...
|
...
|
@@ -161,6 +163,8 @@ class Order extends Api |
|
|
{
|
|
|
$user_id = $this->getUserId();
|
|
|
$type = $this->request->param('type');
|
|
|
$page = $this->request->param('page', 1, 'intval');
|
|
|
$pageNum = $this->request->param('pageNum', 10, 'intval');
|
|
|
if($type == '' || $type == 1){
|
|
|
$data = Db::name('order')
|
|
|
->alias('a')
|
...
|
...
|
@@ -168,6 +172,7 @@ class Order extends Api |
|
|
->where('a.user_id',$user_id)
|
|
|
->where('a.finish_status',1)
|
|
|
->field('a.*,b.name,b.thumbnail')
|
|
|
->page($page,$pageNum)
|
|
|
->select();
|
|
|
}elseif ($type == 2){
|
|
|
$data = Db::name('order')
|
...
|
...
|
@@ -176,6 +181,7 @@ class Order extends Api |
|
|
->where('a.finish_status',2)
|
|
|
->where('a.user_id',$user_id)
|
|
|
->field('a.*,b.name,b.thumbnail')
|
|
|
->page($page,$pageNum)
|
|
|
->select();
|
|
|
}elseif ($type == 3){
|
|
|
$data = Db::name('order')
|
...
|
...
|
@@ -185,6 +191,7 @@ class Order extends Api |
|
|
->where('a.is_complaint',['=',1],['=',3],'or')
|
|
|
->where('a.user_id',$user_id)
|
|
|
->field('a.*,b.name,b.thumbnail')
|
|
|
->page($page,$pageNum)
|
|
|
->select();
|
|
|
}else{
|
|
|
$this->error('类型有误');
|
...
|
...
|
@@ -213,6 +220,8 @@ class Order extends Api |
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
*
|
|
|
* @ApiParams (name="type", type="int", required=false, description="类型(如果为空或者为1是进行中2待总结3是结算中4已完成5退款/投诉)")
|
|
|
* @ApiParams (name="page", type="inter", required=false, description="当前页(默认1)")
|
|
|
* @ApiParams (name="pageNum", type="inter", required=false, description="每页显示数据个数(默认10)")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
...
|
...
|
@@ -237,6 +246,8 @@ class Order extends Api |
|
|
{
|
|
|
$user_id = $this->getUserId();
|
|
|
$type = $this->request->param('type');
|
|
|
$page = $this->request->param('page', 1, 'intval');
|
|
|
$pageNum = $this->request->param('pageNum', 10, 'intval');
|
|
|
if($type == '' || $type == 1){
|
|
|
//进行中
|
|
|
$data = Db::name('order')
|
...
|
...
|
@@ -245,6 +256,7 @@ class Order extends Api |
|
|
->where('a.user_id',$user_id)
|
|
|
->where('a.finish_status',1)
|
|
|
->field('a.*,b.name,b.thumbnail')
|
|
|
->page($page,$pageNum)
|
|
|
->select();
|
|
|
}elseif ($type == 2){
|
|
|
//待总结
|
...
|
...
|
@@ -255,6 +267,7 @@ class Order extends Api |
|
|
->where('a.is_summarize',2)
|
|
|
->where('a.user_id',$user_id)
|
|
|
->field('a.*,b.name,b.thumbnail')
|
|
|
->page($page,$pageNum)
|
|
|
->select();
|
|
|
}elseif ($type == 3){
|
|
|
//结算中
|
...
|
...
|
@@ -266,6 +279,7 @@ class Order extends Api |
|
|
->where('a.user_id',$user_id)
|
|
|
->where('a.order_status',2)
|
|
|
->field('a.*,b.name,b.thumbnail')
|
|
|
->page($page,$pageNum)
|
|
|
->select();
|
|
|
}elseif ($type == 4){
|
|
|
//已完成
|
...
|
...
|
@@ -277,6 +291,7 @@ class Order extends Api |
|
|
->where('a.order_status',1)
|
|
|
->where('a.user_id',$user_id)
|
|
|
->field('a.*,b.name,b.thumbnail')
|
|
|
->page($page,$pageNum)
|
|
|
->select();
|
|
|
}elseif ($type == 5 ){
|
|
|
//退款/投诉
|
...
|
...
|
@@ -287,6 +302,7 @@ class Order extends Api |
|
|
->where('a.is_complaint',['=',1],['=',3],'or')
|
|
|
->where('a.user_id',$user_id)
|
|
|
->field('a.*,b.name,b.thumbnail')
|
|
|
->page($page,$pageNum)
|
|
|
->select();
|
|
|
}else{
|
|
|
$this->error('类型有误');
|
...
|
...
|
|