'json']; //密码修改 public function setPasswordAttribute($value) { if (!empty($value)) { $this->attributes['password'] = password_hash($value, PASSWORD_BCRYPT); } } public function demand() { return $this->morphOne('App\Models\Demand', 'publisher'); } public function demandUser() { return $this->morphOne('App\Models\Demand', 'biddingUser'); } public function demandBidding() { return $this->morphOne('App\Models\DemandBidding', 'biddingUser'); } public function workoorder() { return $this->morphOne('App\Models\Workorder', 'publisher'); } public function workoorderitem() { return $this->morphOne('App\Models\WorkorderItem', 'publisher'); } public function statement() { return $this->morphMany('App\Models\Statement', 'user'); } public function withdrawal() { return $this->morphOne('App\Models\Withdrawal', 'user'); } public function settledOrder() { return $this->hasOne(SettledOrder::class, 'username', 'username')->where('user_type', 3); } }