This commit is contained in:
小鱼开发
2024-06-21 14:29:51 +08:00
parent 6345662836
commit 964d6b23df
2 changed files with 42 additions and 4 deletions
+30 -4
View File
@@ -20,6 +20,7 @@ class Cusorder extends Wxapp
$this->load->model('receiver/receiver_customers_model', 'customers_model');
$this->load->model('receiver/order/receiver_orders_model', 'orders_model');
$this->load->model('receiver/order/receiver_order_datas_model');
$this->load->model('receiver/order/receiver_order_oplogs_model');
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
@@ -220,11 +221,36 @@ class Cusorder extends Wxapp
}
$res = $this->orders_model->update(['status' => $status], ['id' => $id]);
if ($res) {
//数据提交汽车之家
$res = $this->orders_entity->post_auto($id);
if (!$res['code']) {
throw new Exception('网络错误,请联系管理员', ERR_PARAMS_ERROR);
//记日志
$uid = $this->session['uid'];
$user = $this->app_user_model->get(array('id' => $uid));
$log = array(
'order_id' => $id,
'uid' => $uid,
'uname' => $user['uname'],
'type' => 0,
'cf_platform' => '理车宝',
'c_time' => time(),
);
switch ($status){
case 1:
$log['log'] = '下定信息审核通过';
case 2:
$log['log'] = '开票信息审核通过';
case 3:
$log['log'] = '车辆交付审核通过';
}
$this->receiver_order_oplogs_model->add($log);
//数据提交汽车之家
// $res = $this->orders_entity->post_auto($id);
// if (!$res['code']) {
// throw new Exception('网络错误,请联系管理员', ERR_PARAMS_ERROR);
// }
throw new Exception('审核通过,操作成功', API_CODE_SUCCESS);
} else {
throw new Exception('操作失败,请联系管理员', ERR_PARAMS_ERROR);