12345678910111213141516171819202122 |
- <?php
- namespace app\common\model;
- use think\Model;
- // 活动报名明细
- class ActivityApply extends Model
- {
- // 验证会员是否报名某个活动
- public static function checkApply($user_id,$act_id)
- {
- $id = static::where(['user_id'=>$user_id,'act_id'=>$act_id,'is_deleted'=>0,'status'=>1])->count('id');
- return $id ? 1: 0;
- }
- // 获取报名详情
- public static function getApplyInfo($user_id,$act_id)
- {
- $detail = static::where(['user_id'=>$user_id,'act_id'=>$act_id,'is_deleted'=>0,'status'=>1])->find();
- return $detail ? $detail->toArray() : null;
- }
- }
|