<?php
/**
 * @author 林海涛
 * @date 2024/7/29 下午2:35
 */
namespace app\api\validate;
use app\common\model\user\User;
use app\common\validate\BaseValidate;

class FirmValidate extends BaseValidate
{
    protected $rule = [
        'nickname' => 'require',
        'avatar' => 'require',
        'account' => 'require',
        'sex' => 'require',
        'contact_people' => 'require',
        'firmRegister.address' => 'require',
        'firmRegister.firm_name' => 'require'
//        'firmRegister' => [
//            'address' => 'require',
//            'firm_name' => 'require'
//        ]

    ];


    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'nickname' => '昵称',
        'avatar' => '头像',
        'account' => '账户',
        'sex' => '性别',
        'firmRegister.address' => '公司地址',
        'firmRegister.firm_name' => '公司名称',
    ];
    public function sceneSaveUserInfo()
    {
        return $this->only(['nickname','avatar','account','sex','firmRegister.address','firmRegister.firm_name']);
    }
}