作者 sgj
1 个管道 的构建 通过 耗费 3 秒

修改预约提交逻辑

@@ -314,7 +314,6 @@ class YuyueController extends UserBaseController @@ -314,7 +314,6 @@ class YuyueController extends UserBaseController
314 314
315 $res = Db::name('yuyue')->insert($data); 315 $res = Db::name('yuyue')->insert($data);
316 if ($res) { 316 if ($res) {
317 -  
318 $stu_info = Db::name('user')->where(['id' => $data['uid']])->find(); 317 $stu_info = Db::name('user')->where(['id' => $data['uid']])->find();
319 $tea_info = Db::name('user')->where(['id' => $data['teach_id']])->find(); 318 $tea_info = Db::name('user')->where(['id' => $data['teach_id']])->find();
320 $msg = "您好!您已成功预约:{$data['yuyue_day']}/{$data['yuyue_begin']}:00 - {$data['yuyue_end']}:00 时间段{$tea_info['user_nickname']}的课程,请按时上课,教练电话:{$tea_info['mobile']},如有问题可直接与教练或您的学车顾问进行联系。【悠乐驾】"; 319 $msg = "您好!您已成功预约:{$data['yuyue_day']}/{$data['yuyue_begin']}:00 - {$data['yuyue_end']}:00 时间段{$tea_info['user_nickname']}的课程,请按时上课,教练电话:{$tea_info['mobile']},如有问题可直接与教练或您的学车顾问进行联系。【悠乐驾】";
@@ -353,9 +352,6 @@ class YuyueController extends UserBaseController @@ -353,9 +352,6 @@ class YuyueController extends UserBaseController
353 $res = $tool->wxtemsg_send($param1); 352 $res = $tool->wxtemsg_send($param1);
354 $res = $tool->wxtemsg_send($param2); 353 $res = $tool->wxtemsg_send($param2);
355 354
356 -  
357 -  
358 -  
359 return json(['code' => '1', 'msg' => '预约成功']); 355 return json(['code' => '1', 'msg' => '预约成功']);
360 } else { 356 } else {
361 return json(['code' => '0', 'msg' => '抱歉,预约失败']); 357 return json(['code' => '0', 'msg' => '抱歉,预约失败']);
@@ -204,7 +204,7 @@ @@ -204,7 +204,7 @@
204 204
205 <!--弹跳框--> 205 <!--弹跳框-->
206 <div class="full_bg"></div> 206 <div class="full_bg"></div>
207 -<div class="yu_tan"> 207 +<div class="yu_tan" data-qr="1">
208 <div class="yu_tan_box"> 208 <div class="yu_tan_box">
209 <img src="/static/image/tan_car1.png" class="tan_car"/> 209 <img src="/static/image/tan_car1.png" class="tan_car"/>
210 <h1 class="tan_text">您确定要预约08:00~09:00张教练的课程吗</h1> 210 <h1 class="tan_text">您确定要预约08:00~09:00张教练的课程吗</h1>
@@ -354,6 +354,9 @@ @@ -354,6 +354,9 @@
354 } 354 }
355 }); 355 });
356 $("#btn_yuyue").click(function () { 356 $("#btn_yuyue").click(function () {
  357 +
  358 + var data_qr = $('.yu_tan').attr("data-qr");
  359 + if (data_qr == 1) {
357 var list = $('.time_bg_icon'); 360 var list = $('.time_bg_icon');
358 var day1 = $('.day_bg i').text(); 361 var day1 = $('.day_bg i').text();
359 var week = $('.day_bg b').text(); 362 var week = $('.day_bg b').text();
@@ -374,11 +377,14 @@ @@ -374,11 +377,14 @@
374 }, success: function (res) { 377 }, success: function (res) {
375 console.log(res); 378 console.log(res);
376 if (res.code == "1") { 379 if (res.code == "1") {
  380 + $('.yu_tan').attr("data-qr", "2");
  381 + tankuang();
377 window.location.href = "/user/yuyue/coach_list"; 382 window.location.href = "/user/yuyue/coach_list";
378 } 383 }
379 } 384 }
380 }) 385 })
381 } 386 }
  387 + }
382 }); 388 });
383 }); 389 });
384 </script> 390 </script>