<?php

namespace App\Models\Deed;

use App\Models\User\UserModel;
use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Deed\PaintModel
 *
 * @property int $id
 * @property int $uid
 * @property string $name
 * @property string $pic_url 图片地址
 * @property string $actions
 * @property int $partner_id
 * @property \Illuminate\Support\Carbon $created_at
 * @property \Illuminate\Support\Carbon $updated_at
 * @property-read \App\Models\User\UserModel $user
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Deed\PaintModel newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Deed\PaintModel newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Deed\PaintModel query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Deed\PaintModel whereActions($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Deed\PaintModel whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Deed\PaintModel whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Deed\PaintModel whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Deed\PaintModel wherePartnerId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Deed\PaintModel wherePicUrl($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Deed\PaintModel whereUid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Deed\PaintModel whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class PaintModel extends Model
{
    //
    protected $table = 'kdgx_fpdx_deed_paints';

    public $dateFormat = 'U';

    protected $fillable = ['uid', 'name', 'actions', 'pic_url'];


    public function user()
    {
        return $this->belongsTo(UserModel::class, 'uid', 'uid')
            ->select('uid', 'nickname', 'headimgurl', 'sex');
    }
}
