作者 金洪杰

签名

@@ -383,21 +383,24 @@ class Ajax extends TeacherBase @@ -383,21 +383,24 @@ class Ajax extends TeacherBase
383 $log['memo'] = $opinion; 383 $log['memo'] = $opinion;
384 Db::table("fa_register_log")->insert($log); 384 Db::table("fa_register_log")->insert($log);
385 $open_id = Db::table('fa_user')->where('id',$detail['user_id'])->value('open_id'); 385 $open_id = Db::table('fa_user')->where('id',$detail['user_id'])->value('open_id');
386 - $config = Config::get('officialAccount');  
387 - $app = Factory::officialAccount($config);  
388 - $app->template_message->send([  
389 - 'touser' => $open_id,  
390 - 'template_id' => 'QUWHawyGohboStMgzZ4B4vQbqeFGWEnd-6MPh7jM8QQ',  
391 - 'data' => array(  
392 - 'first' => array('value' => "项目审核结果通知", 'color' => ''),  
393 - 'keyword1' => array('value' => $project_type_name, 'color' => ''),  
394 - 'keyword2' => array('value' => $detail['project_name'], 'color' => ''),  
395 - 'keyword3' => array('value' => $msg, 'color' => ''),  
396 - 'keyword4' => array('value' => $teacher_name, 'color' => ''),  
397 - 'keyword5' => array('value' => $opinion, 'color' => ''),  
398 - 'remark' => array('value' => '【您报名参加的' . $detail['project_name'] . '】被' . $msg, 'color' => ''),  
399 - ),  
400 - ]); 386 + if ($open_id){
  387 + $config = Config::get('officialAccount');
  388 + $app = Factory::officialAccount($config);
  389 + $app->template_message->send([
  390 + 'touser' => $open_id,
  391 + 'template_id' => 'QUWHawyGohboStMgzZ4B4vQbqeFGWEnd-6MPh7jM8QQ',
  392 + 'data' => array(
  393 + 'first' => array('value' => "项目审核结果通知", 'color' => ''),
  394 + 'keyword1' => array('value' => $project_type_name, 'color' => ''),
  395 + 'keyword2' => array('value' => $detail['project_name'], 'color' => ''),
  396 + 'keyword3' => array('value' => $msg, 'color' => ''),
  397 + 'keyword4' => array('value' => $teacher_name, 'color' => ''),
  398 + 'keyword5' => array('value' => $opinion, 'color' => ''),
  399 + 'remark' => array('value' => '【您报名参加的' . $detail['project_name'] . '】被' . $msg, 'color' => ''),
  400 + ),
  401 + ]);
  402 + }
  403 +
401 404
402 $this->success('操作成功',$file_url); 405 $this->success('操作成功',$file_url);
403 } 406 }