Browse Source

课程取消,通知教练,whatapp发送

lizhen_gitee 5 tháng trước cách đây
mục cha
commit
4c31b93e3a
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      application/index/controller/Plantask.php

+ 5 - 1
application/index/controller/Plantask.php

@@ -145,10 +145,10 @@ class Plantask extends Controller
             $coach_sender = [
                 'firstname'  => $slot['coach_nickname'],
                 'lastname'   => '',
-                'name_en'    => $slot['lesson_name_en'],
                 'email'      => $slot['coach_email'],
                 'whatsapp'   => $slot['coach_whatsapp'],
             ];
+            $order_list[] = $coach_sender;
 
             if(empty($order_list)){
                 continue;
@@ -171,11 +171,13 @@ class Plantask extends Controller
                     <img src="'.config('website_url').'/assets/img/logo3.png" style="width:136px;height:115px">
                     ';
 
+                    if(!empty($order['email'])){
                     $result = $obj
                         ->to($order['email'])
                         ->subject('Class is Cancelled!')
                         ->message($message)
                         ->send();
+                    }
 
                     //$coach_name = Db::name('coach')->where('id',$slot['coach_ids'])->value('nickname');
 
@@ -198,7 +200,9 @@ class Plantask extends Controller
                             'text' => date('D l Y',$slot['starttime']) .' at '.date('H:i a',$slot['starttime']),
                         ],
                     ];
+                    if(!empty($order['whatsapp'])){
                     $this->whatapp($order['whatsapp'],'class_cancelled','en_US',$parameters);
+                    }
                 }
             } catch (Exception $e) {