123456789101112131415161718192021222324252627282930 |
- <?php
- namespace app\model;
- use think\Model;
- class LotteryActivity extends Model
- {
- public function good()
- {
- return $this->hasMany(LotteryActivityGoods::class, 'actid','id');
- }
- public function company(){
- return $this->hasOne(Company::class, 'root_id','root_id');
- }
- public function lotteryuser(){
- return $this->hasMany(LotteryUser::class, 'actid','id');
- }
- public function lotteryluckyuser(){
- return $this->hasMany(LotteryLuckyUser::class, 'actid','id');
- }
- public function employee(){
- return $this->hasOne(Employee::class, 'id','employee_id')->bind(['opt_name']);
- }
- public function getShareimgAttr($value)
- {
- if(!empty($value)) $value = 'http://' . config('app.ali_oss_bindurl') . '/' . $value;
- return $value;
- }
- }
|