作者 xwp
1 个管道 的构建 通过 耗费 0 秒

推送调试

... ... @@ -545,10 +545,14 @@ class Course extends Api
//开课人数够了
$sign = new \app\admin\model\CourseSign();
$signCount = $sign->where(['course_store_id'=>$course_store_id])->count();
echo '提醒人数:'.$courseStore['notify_count'];
echo '已报名人数:'.$signCount;
if($signCount >= $courseStore['notify_count']){
echo '开始推送环节';
$template = new Newtmpl(Config::get('weChat'));
$sign = new \app\admin\model\CourseSign();
$sign_data = $sign->with(['user','CourseStore'])->where(['course_store_id'=>$course_store_id,'notify'=>false])->select();
echo '推送人数组:'.json_encode($sign_data);
$notice = new \app\admin\model\UserNotice();
foreach ($sign_data as $k){
... ...