12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- namespace App\Models;
- use App\Models\BaseModel;
- /**
- * @description dfghfdhfgfghfg
- * @author system;
- * @version 1.0
- * @date 2017-06-01 05:20:51
- *
- */
- class DreamInfoModel extends BaseModel
- {
- /**
- * 数据表名
- *
- * @var string
- *
- */
- protected $table = 'dream_info';
- /**
- 主键
- */
- protected $primaryKey = 'id';
- //分页
- protected $perPage = PAGE_NUMS;
- /**
- * 可以被集体附值的表的字段
- *
- * @var string
- */
- protected $fillable = [
- 'name',
- 'about',
- 'coin',
- 'time',
- 'get_coin',
- 'mark',
- 'parameter',
- 'code',
- 'add_care_number',
- 'status'
- ];
- protected $hidden = ['deleted_at'];
- public function user()
- {
- return $this->hasOne('App\Models\UserInfoModel','id','user_id');
- }
- public function imgs()
- {
- return $this->hasMany('App\Models\DreamImages','dream_id');
- }
- public function img()
- {
- return $this->hasOne('App\Models\DreamImages','dream_id','id');
- }
- // 系统消息
- public function systemInfo()
- {
- return $this->hasMany('App\Models\SystemInfoModel','other_id','id');
- }
- public function interactions()
- {
- return $this->hasMany('App\Models\InteractionInfo','dream_id');
- }
- public function allInteraction()
- {
- return $this->hasManyThrough('App\Models\CommentInfoModel', 'App\Models\InteractionInfo','dream_id','interaction_id');
- }
- public function meet()
- {
- return $this->hasOne('App\Models\MeetInfoModel','dream_id');
- }
- }
|