edit-api-liche-apt

This commit is contained in:
lccsw
2021-08-27 22:14:00 +08:00
parent 0c019146e0
commit 0470ba2f88
+9 -2
View File
@@ -115,6 +115,7 @@ class Aptinfo extends Wxapp{
$cf_id = 1;
$this->load->model('receiver/receiver_clues_model','clues_model');
$this->load->model('auto/auto_brand_model');
$this->load->library('receiver/clues_entity');
$uid = $this->session['uid'];
$biz_id = $this->input_param('biz_id');
@@ -131,13 +132,20 @@ class Aptinfo extends Wxapp{
$cms_json['cfrom_id'] && $cf_id = $cms_json['cfrom_id'];
$brand_row = $this->auto_brand_model->get(['id'=>$cms_row['target_id']]);
}
$row = $this->clues_model->get(['cf_id'=>$cf_id,'cf_uid'=>$uid,'app_id'=>$this->app_id,'status'=>0]);
//$row = $this->clues_model->get(['cf_id'=>$cf_id,'cf_uid'=>$uid,'app_id'=>$this->app_id,'status'=>0]);
$row = $this->clues_model->get(['mobile'=>$this->session['mobile'],'app_id'=>$this->app_id]);
if($row){
$update = [
'en_time' => date('Y-m-d H:i:s')
];
$brand_row && $update['brand_id'] = $brand_row['id'];
$this->clues_model->update($update,['id'=>$row['id']]);
//增加日志
$uname = $this->session['nickname'] ? $this->session['nickname'] : '用户';
$cf_title = $this->clues_entity->cf_title($cf_id);
$log_msg = '用户报名';
$cf_title && $log_msg = "用户通过【{$cf_title}】报名";
$this->clues_entity->add_log($row['id'], $this->session['uid'], $uname, $log_msg);
throw new Exception('预约成功,不需要重复报名', API_CODE_FAIL);
}
@@ -166,7 +174,6 @@ class Aptinfo extends Wxapp{
$lng && $add_data['lng'] = $lng;
$id = $this->clues_model->add($add_data);
if($id){
$this->load->library('receiver/clues_entity');
$uname = $this->session['nickname'] ? $this->session['nickname'] : '用户';
$cf_title = $this->clues_entity->cf_title($cf_id);
$log_msg = '用户报名';