add-admin-finish_pay
This commit is contained in:
@@ -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']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,6 +97,11 @@
|
||||
<td>{{item.status_name}}</td>
|
||||
<td>{{item.payway_name}}</td>
|
||||
</tr>
|
||||
<tr v-if="item.opt.action">
|
||||
<td colspan="8" class="align-r">
|
||||
<a type="button" data-ajax="post" :data-action="item.opt.action" :data-params-sid="item.sid" class="am-btn am-btn-xs am-btn-primary">完成支付下一步</a>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user