<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    //
    protected $table = 'order';
    protected $primaryKey = 'id';

    //用户类型定义
//    const USER_TYPE_USER    = 1;

    //用户类型枚举
//    private static $_user_types = [
//        self::USER_TYPE_USER    => '会员',
//    ];

    //商品类型定义
    const GOODS_TYPE_COIN  = 1;
//    const GOODS_TYPE_COSUME   = 3;

    //商品类型枚举
    private static $_goods_types = [
        self::GOODS_TYPE_COIN    => '梦想币',
//        self::GOODS_TYPE_COSUME     => '续消现金',
    ];

    //支付类型定义
    const PAY_TYPE_ALIPAY     = 1;
    const PAY_TYPE_WECHATPAY  = 2;

    //支付类型枚举
    private static $_pay_types = [
        self::PAY_TYPE_ALIPAY       => '支付宝',
        self::PAY_TYPE_WECHATPAY    => '微信支付',
//        self::PAY_TYPE_UNIONPAY     => '银联支付',
    ];

    //苹果支付金额
    private static $_apple_products = [
        self::Apple_Product1      => 6,
        self::Apple_Product2      => 6,
        self::Apple_Product3      => 50,
        self::Apple_Product4      => 188,
        self::Apple_Product5      => 898,
    ];

    //苹果支付类型
    const Apple_Product1    = 'apple10000';
    const Apple_Product2    = 'apple10001';
    const Apple_Product3    = 'apple102';
    const Apple_Product4    = 'apple103';
    const Apple_Product5    = 'apple104';

    //订单状态定义
    const STATUS_PENDING    = 0;
    const STATUS_FINISHED   = 1;
    const STATUS_CANCELED   = 2;

    //订单状态枚举
    private static $_status = [
        self::STATUS_PENDING    => '待处理',
        self::STATUS_FINISHED   => '已完成',
        self::STATUS_CANCELED   => '已取消',
    ];


    public static function getAllGoodsTypes() {
        return self::$_goods_types;
    }

    public static function getAllStatus() {
        return self::$_status;
    }

    public static function getAllPayTypes() {
        return self::$_pay_types;
    }

    public static function getAllAppleProducts() {
        return self::$_apple_products;
    }
}