123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace App\Models;
- use DateTimeInterface;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\SoftDeletes;
- class User extends Model
- {
- use HasFactory,SoftDeletes;
- protected $table = 'user';
- public $timestamps = FALSE;
- const DELETED_AT = 'delete_time';
- protected $dateFormat = 'U';
- protected $hidden = [
- 'user_pass'
- ];
- protected function serializeDate(DateTimeInterface $date): string
- {
- return $date->format('Y-m-d H:i:s');
- }
- // 技师信息
- public function artificer()
- {
- return $this->hasOne(Artificer::class, 'user_id', 'id')->select('id', 'user_id', 'name', 'avatar', 'phone','apply_num','js_status','identity','certificates','pictures','work','jianjie');
- }
- // 分销等级
- public function distributor()
- {
- return $this->hasOne(Distributor::class, 'id', 'distributor_id');
- }
- }
|