123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- declare (strict_types=1);
- namespace app\model\activity\lottery;
- use crmeb\basic\BaseModel;
- use crmeb\traits\ModelTrait;
- use think\Model;
- class LuckPrize extends BaseModel
- {
- use ModelTrait;
-
- protected $pk = 'id';
-
- protected $name = 'luck_prize';
-
- public function lottery()
- {
- return $this->hasOne(LuckLottery::class, 'id', 'lottery_id');
- }
-
- public function searchLotteryIdAttr($query, $value)
- {
- if ($value) $query->where('lottery_id', $value);
- }
-
- public function searchTypeAttr($query, $value)
- {
- if ($value) $query->where('type', $value);
- }
-
- public function searchStatusAttr($query, $value)
- {
- if ($value !== '') $query->where('status', $value);
- }
-
- public function searchIsDelAttr($query, $value)
- {
- if ($value !== '') $query->where('is_del', $value);
- }
- }
|