add-admin-complete_order
This commit is contained in:
@@ -143,6 +143,12 @@ class Order extends HD_Controller
|
||||
$this->load->service('apporder/payment_service', array('app_id' => 1));
|
||||
$descrip = '后台确认线下交款';
|
||||
$p_row = $this->app_liche_orders_model->get(['id'=>$row['pid']]);
|
||||
if($row['type']==3){
|
||||
$srv_pay = $this->app_liche_orders_model->count(['type'=>2,'status'=>0,'o_id'=>$row['o_id']]);
|
||||
if($srv_pay){
|
||||
return $this->show_json(SYS_CODE_FAIL, '请先完成服务费订单');
|
||||
}
|
||||
}
|
||||
if($row['type']==3 && !$p_row['pid']){ //尾款
|
||||
//是否存在未支付订单
|
||||
$un_pay = $this->app_liche_orders_model->count(['type'=>3,'o_id'=>$row['o_id'],'id!='=>$row['id'],'status'=>0]);
|
||||
|
||||
@@ -748,35 +748,40 @@ class Orders extends HD_Controller
|
||||
//支付列表
|
||||
public function get_paylog()
|
||||
{
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$params = $this->input->post();
|
||||
$params = $this->input->get();
|
||||
if ($params['d_type'] == 'ajax') {
|
||||
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
|
||||
$size = $params['size'] = $params['size'] ? intval($params['size']) : 10;
|
||||
$list = [];
|
||||
$p_row = $this->app_liche_orders_model->get(['o_id'=>$params['id'],'pid'=>0],'id');
|
||||
$where = [
|
||||
'o_id' => $params['id'],
|
||||
'status' => 1,
|
||||
'pay_price!=' => 0
|
||||
'status>=' => 0,
|
||||
'((pid>0 and type!=5) or (pid=0 and type=5))' => null
|
||||
];
|
||||
$count = $this->app_liche_orders_model->count($where);
|
||||
if ($count) {
|
||||
$rows = $this->app_liche_orders_model->select($where, 'id desc', $page, $size, 'id,total_price,type,pay_time,mch_id,descrip');
|
||||
$rows = $this->app_liche_orders_model->select($where, 'type asc', $page, $size, 'id,total_price,type,pay_time,mch_id,descrip,status,pid');
|
||||
$type_arr = $this->app_liche_orders_model->get_type_arr();
|
||||
foreach ($rows as $item) {
|
||||
$company = '';
|
||||
if ($item['mch_id']) {
|
||||
$company = $this->sys_company_model->get(['wx_mchid' => $item['mch_id']], 'short');
|
||||
}
|
||||
$type_cn = $item['type']==3 && $item['pid']==$p_row['id'] ? '尾款-主订单' : $type_arr[$item['type']];
|
||||
$list[] = [
|
||||
'id'=> $item['id'],
|
||||
'money' => $item['total_price'],
|
||||
'type_cn' => $type_arr[$item['type']],
|
||||
'type_cn' => $type_cn,
|
||||
'pay_time' => $item['pay_time'],
|
||||
'status' => $item['status'],
|
||||
'company' => $company ? $company['short'] : '',
|
||||
'descrip' => $item['descrip']
|
||||
'descrip' => $item['descrip'],
|
||||
'status_cn' => $item['status'] ? '已支付' : '未支付',
|
||||
];
|
||||
}
|
||||
}
|
||||
$sum = $this->app_liche_orders_model->sum('total_price', $where);
|
||||
$sum = $this->app_liche_orders_model->sum('total_price', ['o_id'=>$params['id'],'status'=>1,'pay_price!='=>0]);
|
||||
$this->data['pay_price'] = $sum['total_price'];
|
||||
$this->data['need_price'] = $this->orders_entity->recevable_price($params['id']);
|
||||
$this->data['list'] = $list;
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
<th>收款公司</th>
|
||||
<th>备注</th>
|
||||
<th>付款时间</th>
|
||||
<th>支付状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -20,6 +22,12 @@
|
||||
<td>{{item.company}}</td>
|
||||
<td>{{item.descrip}}</td>
|
||||
<td>{{item.pay_time}}</td>
|
||||
<td>{{item.status_cn}}</td>
|
||||
<td>
|
||||
<button v-if="item.status==0" class="am-btn am-btn-primary am-btn-sm fl ml10" data-ajax="post" data-action="/app/liche/order/edit_pay" :data-params-id="item.id">
|
||||
确认线下收款
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -61,7 +69,7 @@
|
||||
methods: {
|
||||
getData: function(page){
|
||||
var that = this;
|
||||
$.post('/receiver/orders/get_paylog',{id:that.id,page:page},function(result){
|
||||
$.get('/receiver/orders/get_paylog',{id:that.id,page:page,'d_type':'ajax'},function(result){
|
||||
if(result.code){
|
||||
that.list = result.data.list;
|
||||
that.page = result.data.commonPage;
|
||||
|
||||
Reference in New Issue
Block a user