ActivityApply.php 621 B

12345678910111213141516171819202122
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. // 活动报名明细
  5. class ActivityApply extends Model
  6. {
  7. // 验证会员是否报名某个活动
  8. public static function checkApply($user_id,$act_id)
  9. {
  10. $id = static::where(['user_id'=>$user_id,'act_id'=>$act_id,'is_deleted'=>0,'status'=>1])->count('id');
  11. return $id ? 1: 0;
  12. }
  13. // 获取报名详情
  14. public static function getApplyInfo($user_id,$act_id)
  15. {
  16. $detail = static::where(['user_id'=>$user_id,'act_id'=>$act_id,'is_deleted'=>0,'status'=>1])->find();
  17. return $detail ? $detail->toArray() : null;
  18. }
  19. }