<?php
namespace app\api\validate;

use app\common\validate\BaseValidate;

/**
 * 拼团订单验证器
 * Class GroupOrderValidate
 * @package app\api\validate
 */
class GroupOrderValidate extends BaseValidate
{

    protected $rule = [
        'id'=>'require',
        'order_id'=>'require',
        'pay_way' => 'require',
        'group_activity_id' => 'require',
        'area' => 'require',
        'address' =>'require',
        'category_id' => 'require',
        'mobile' => 'require',
    ];


    protected $field = [
        'id' => '活动ID',
        'order_id' => '订单ID',
        'pay_way' => '支付方式',
        'group_activity_id' => '拼团活动ID',
        'area' => '小区',
        'address' => '详细地址',
        'category_id' => '分类ID',
        'mobile' => '手机号',
    ];


    public function sceneAdd()
    {
        return $this->only(['pay_way','group_activity_id','remark','area','address','mobile']);
    }

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

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

    /**
     * @notes 支付方式场景
     * @return ShopPayValidate
     */
    public function scenePay()
    {
        return $this->only(['pay_way' ,'order_id']);
    }

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

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

    public function sceneQrcode()
    {
        return $this->only(['id','order_id','category_id']);
    }

}