admin_orders_1118

This commit is contained in:
dengbw
2021-11-18 14:16:00 +08:00
committed by lccsw
parent d091cd665d
commit 833e16fe63
+12 -11
View File
@@ -106,8 +106,8 @@ class Orders extends HD_Controller
$deposit = $row['deposit'];
$jsondata = $row['jsondata'] ? json_decode($row['jsondata'], true) : array();
$row['price_discount'] = $money_json['price_discount'];
$sale_price = $money_json['price_discount'] ? $row['price']-$money_json['price_discount'] : $row['price'];
$row['sale_price'] = number_format($sale_price,2);
$sale_price = $money_json['price_discount'] ? $row['price'] - $money_json['price_discount'] : $row['price'];
$row['sale_price'] = number_format($sale_price, 2);
$row['info_json'] = json_decode($row['info_json'], true);
$row['status'] = intval($row['status']);
$row['price'] = number_format($row['price'], 2);
@@ -483,9 +483,9 @@ class Orders extends HD_Controller
$this->order_ckcars_model->replace($replace);
} elseif ($params['status'] == 3) { //设置完成按揭
$order_row = $this->orders_model->get(['id' => $row['o_id']], 'status');
if ($order_row['status'] > 2) {
$agent_rows = $this->order_agents_model->get(['o_id'=>$oid]); //判断是否代办完成
if($agent_rows && $agent_rows['status']){
if ($order_row['status'] > 2) {
$agent_rows = $this->order_agents_model->get(['o_id' => $oid]); //判断是否代办完成
if ($agent_rows && $agent_rows['status']) {
$this->orders_model->update(['status' => 5], ['id' => $oid]);
if (!$this->order_deliverys_model->count(['o_id' => $oid])) {
$this->order_deliverys_model->add(['o_id' => $oid, 'c_time' => time]);
@@ -592,11 +592,12 @@ class Orders extends HD_Controller
$ret = $this->items_model->update($upd, $where);
if ($ret) { //添加开票日志
$this->load->library('entity/items_entity');
$params = array('item_id' => $id, 'type' => 3, 'uid' => $this->uid, 'uname' => $this->username
, 'com_time' => $bill_time, 'biz_id' => $row_order['biz_id'], 'addr_id' => $row_order['addr_id']);
$re_i = $this->items_model->get(['id' => $row_order['item_id']]);
$params = array('item_id' => $row_order['item_id'], 'type' => 3, 'uid' => $this->uid, 'uname' => $this->username
, 'com_time' => $bill_time, 'biz_id' => $re_i['biz_id'], 'addr_id' => $re_i['addr_id']);
$this->items_entity->add_log($params);
}
$this->orders_model->update(['bill_time'=>$bill_time],['id'=>$row['o_id']]);
$this->orders_model->update(['bill_time' => $bill_time], ['id' => $row['o_id']]);
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
} else {
@@ -683,13 +684,13 @@ class Orders extends HD_Controller
return $this->show_json(SYS_CODE_FAIL, '修改失败,该订单不处于代办阶段');
}
$loan = $this->order_loans_model->get(['o_id' => $oid]);
if (!$row['payway'] && $loan['status']!=3) { //分期且分期未完成
if (!$row['payway'] && $loan['status'] != 3) { //分期且分期未完成
return $this->show_json(SYS_CODE_FAIL, '修改失败,请先完成按揭');
}
$this->order_agents_model->update(['status' => 1], ['o_id' => $oid]);
$row['status']==4 && $this->orders_model->update(['status' => 5], ['id' => $oid]);
$row['status'] == 4 && $this->orders_model->update(['status' => 5], ['id' => $oid]);
if (!$this->order_deliverys_model->count(['o_id' => $oid])) {
$this->order_deliverys_model->add(['o_id' => $oid, 'c_time' => time]);
}
@@ -753,7 +754,7 @@ class Orders extends HD_Controller
];
}
}
$sum = $this->app_liche_orders_model->sum('total_price',$where);
$sum = $this->app_liche_orders_model->sum('total_price', $where);
$this->data['total_price'] = $sum['total_price'];
$this->data['list'] = $list;
$hasNext = ceil($count / $size) > $page ? 1 : 0;