diff --git a/admin/controllers/order/Purchase.php b/admin/controllers/order/Purchase.php index 62096e18..ca7cbc2f 100644 --- a/admin/controllers/order/Purchase.php +++ b/admin/controllers/order/Purchase.php @@ -86,9 +86,13 @@ Class Purchase extends HD_Controller if($total){ $orderby = 'id desc'; $select = 'id,sid,item_title,item_num,item_price,total_price,pay_price, - uname,mobile,payway,status,status_detail,c_time'; + uname,mobile,payway,status,status_detail,c_time,type,app_id'; $rows = $this->order_purchase_model->select($where, $orderby, $params['page'], $params['size'], $select); foreach($rows as $v){ + $opt = []; + if($v['status']==1 && $v['status_detail']==11 && $v['app_id']==1 && $v['type']==4){ //定金未支付 + $opt['action'] = '/order/purchase/edit_topay'; + } $lists[] = array( 'id' => $v['id'], 'sid' => $v['sid'], @@ -100,6 +104,7 @@ Class Purchase extends HD_Controller 'pay_price_name' => "¥{$v['pay_price']}", 'status_name' => $statusDAry[$v['status']][$v['status_detail']], 'payway_name' => $paywayAry[$v['payway']], + 'opt' => $opt ); } } @@ -139,5 +144,19 @@ Class Purchase extends HD_Controller // TODO: Implement export() method. } - + //完成定金订单 + public function edit_topay(){ + $sid = $this->input->post('sid'); + $row = $this->order_purchase_model->get(['sid'=>$sid]); + if (!$row) { + return $this->show_json(SYS_CODE_FAIL, '订单不存在!'); + } + $this->load->service('apporder/payment_service', array('app_id' => $row['app_id'])); + $result = $this->payment_service->after_pay($sid); + if($result['code']){ + return $this->show_json(SYS_CODE_SUCCESS, '操作成功'); + }else{ + return $this->show_json(SYS_CODE_FAIL, $result['msg']); + } + } } diff --git a/admin/views/order/purchase/lists.php b/admin/views/order/purchase/lists.php index 45b14a3d..2790218e 100644 --- a/admin/views/order/purchase/lists.php +++ b/admin/views/order/purchase/lists.php @@ -97,6 +97,11 @@ {{item.status_name}} {{item.payway_name}} + + + 完成支付下一步 + +