|
@@ -218,9 +218,7 @@ class UsersController extends HomeBaseController{ |
|
@@ -218,9 +218,7 @@ class UsersController extends HomeBaseController{ |
218
|
* @author 董瑞恩
|
218
|
* @author 董瑞恩
|
219
|
* @url /portal/users/getOrderById1
|
219
|
* @url /portal/users/getOrderById1
|
220
|
* @method GET
|
220
|
* @method GET
|
221
|
- *
|
|
|
222
|
* @param name:users_id type:String require:1 default:无 other: desc:用户id
|
221
|
* @param name:users_id type:String require:1 default:无 other: desc:用户id
|
223
|
- *
|
|
|
224
|
* @return order_no:订单号
|
222
|
* @return order_no:订单号
|
225
|
* @return users_id:用户id
|
223
|
* @return users_id:用户id
|
226
|
* @return start_time:开始使用时间
|
224
|
* @return start_time:开始使用时间
|
|
@@ -233,7 +231,12 @@ class UsersController extends HomeBaseController{ |
|
@@ -233,7 +231,12 @@ class UsersController extends HomeBaseController{ |
233
|
|
231
|
|
234
|
public function getOrderById1(){
|
232
|
public function getOrderById1(){
|
235
|
$users_id=$this->request->param('users_id');
|
233
|
$users_id=$this->request->param('users_id');
|
236
|
- $order= Db::name('order')->field('order_no,users_id,start_time')->where(['users_id'=>$users_id,'state'=>1,'type'=>1])->find();
|
234
|
+ $order= Db::name('order')
|
|
|
235
|
+ ->alias('o')
|
|
|
236
|
+ ->join('equipment e','o.eq_name=e.name')
|
|
|
237
|
+ ->field('o.order_no,o.users_id,o.start_time,e.serial_number')
|
|
|
238
|
+ ->where(['o.users_id'=>$users_id,'o.state'=>1,'o.type'=>1,'e.is_delete'=>0])
|
|
|
239
|
+ ->find();
|
237
|
if (empty($order)){
|
240
|
if (empty($order)){
|
238
|
$this->apiResponse(200,'没有未完成订单');
|
241
|
$this->apiResponse(200,'没有未完成订单');
|
239
|
}
|
242
|
}
|
|
@@ -270,7 +273,12 @@ class UsersController extends HomeBaseController{ |
|
@@ -270,7 +273,12 @@ class UsersController extends HomeBaseController{ |
270
|
|
273
|
|
271
|
public function getOrderById2(){
|
274
|
public function getOrderById2(){
|
272
|
$users_id=$this->request->param('users_id');
|
275
|
$users_id=$this->request->param('users_id');
|
273
|
- $order= Db::name('order')->where(['users_id'=>$users_id,'state'=>2,'type'=>'1'])->find();
|
276
|
+ $order= Db::name('order')
|
|
|
277
|
+ ->alias('o')
|
|
|
278
|
+ ->join('equipment e','o.eq_name=e.name')
|
|
|
279
|
+ ->where(['o.users_id'=>$users_id,'o.state'=>2,'o.type'=>'1','e.is_delete'=>0])
|
|
|
280
|
+ ->field('o.*,e.serial_number')
|
|
|
281
|
+ ->find();
|
274
|
if (empty($order)){
|
282
|
if (empty($order)){
|
275
|
$this->apiResponse(200,'没有未支付订单');
|
283
|
$this->apiResponse(200,'没有未支付订单');
|
276
|
}
|
284
|
}
|