<?php

namespace app\workerapi\validate\shops;

use app\common\validate\BaseValidate;

class ShopOrderValidate  extends BaseValidate
{

    protected $rule = [
        'sn'=>'require',
        'goods_specs_inventory_ids' => 'require|array',
        'pay_way' => 'require',
        'address_id' => 'require',
        'shop_cart_id'=>'require'
    ];


    protected $message = [
        'sn.require' => '订单编号错误',
        'pay_way.require' => '请选择支付方式',
        'goods_specs_inventory_ids.require' => '订单商品不存在',
        'shop_cart_id.require' => '请选择商品',
        'address_id.require' => '请选择收货地址',
    ];


    public function sceneDetail()
    {
        return $this->only(['sn']);
    }


    /**
     * @notes 删除场景
     * @return ShopGoodsValidate|ShopOrderValidate
     * @author likeadmin
     * @date 2024/08/04 11:07
     */
    public function sceneDelete()
    {
        return $this->only(['ids']);
    }

    public function sceneEdit()
    {
        return $this->only(['id', 'number']);
    }

    /**
     * @notes 订单提交场景
     * @return ShopGoodsValidate|ShopOrderValidate
     * @date 2024/08/04 11:07
     */
    public function sceneSubmit()
    {
        return $this->only(['shop_cart_id','mobile','real_name','address']);
    }
}