海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
669 B

  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. class Guide extends BaseModel
  6. {
  7. use HasFactory, SoftDeletes;
  8. //密码修改
  9. public function setPasswordAttribute($value)
  10. {
  11. if (!empty($value)) {
  12. $this->attributes['password'] = password_hash($value, PASSWORD_BCRYPT);
  13. }
  14. }
  15. public function demand()
  16. {
  17. return $this->morphOne('App\Models\Demand', 'publisher');
  18. }
  19. public function demandUser()
  20. {
  21. return $this->morphOne('App\Models\Demand', 'biddingUser');
  22. }
  23. public function demandBidding()
  24. {
  25. return $this->morphOne('App\Models\DemandBidding', 'biddingUser');
  26. }
  27. }