From 4a8ab12a45ed6638e8564c86ebf385a08a371ce5 Mon Sep 17 00:00:00 2001 From: dengbw Date: Tue, 22 Mar 2022 17:49:59 +0800 Subject: [PATCH] introduce_322_2 --- admin/controllers/auto/Introduce.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/admin/controllers/auto/Introduce.php b/admin/controllers/auto/Introduce.php index e51ac745..08eaed82 100644 --- a/admin/controllers/auto/Introduce.php +++ b/admin/controllers/auto/Introduce.php @@ -97,8 +97,9 @@ class Introduce extends HD_Controller $s_name = $map_series[$value['s_id']]; $title = "{$brand_name}-{$s_name}"; $scene = "{$value['id']}_{$params['biz_id']}"; - $page = 'pages/storeInfo/index';//pages/modelShow/index + $page = 'pages/modelShow/index'; $name = $params['biz_name'] . '_' . $title; + //$name && $name = preg_replace('# #', '', $name);//正则去除所有空格 $qr_code = $this->qrcode($scene, $page, '1280px', $name); $list[] = [ 'title' => $title, @@ -168,14 +169,15 @@ class Introduce extends HD_Controller if (!$info['brand_id'] || !$info['s_id']) { return $this->show_json(SYS_CODE_FAIL, '请选择车型!'); } - if (!$info['video_file_url']) { + if (!$info['video_file_url'] && !$info['video']) { return $this->show_json(SYS_CODE_FAIL, '请上传视频!'); } $re = $this->mdAutoIntroduce->get(array('brand_id' => $info['brand_id'], 's_id' => $info['s_id'])); if ($re) { return $this->show_json(SYS_CODE_FAIL, '车型已存在了!'); } - $this->mdAutoIntroduce->add(['brand_id' => $info['brand_id'], 's_id' => $info['s_id'], 'video' => $info['video_file_url'] + $video = $info['video_file_url'] ? $info['video_file_url'] : $info['video']; + $this->mdAutoIntroduce->add(['brand_id' => $info['brand_id'], 's_id' => $info['s_id'], 'video' => $video , 'content' => $info['content'], 'c_time' => time()]); return $this->show_json(SYS_CODE_SUCCESS, '新增成功', '/auto/introduce'); }