<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    public $classify1 = "";
    public $classify2 = "";
    public $order_type = "";

    function __construct($classify1 = "", $classify2 = "", $order_type = "") {
        $this->classify1 = $classify1;
        $this->classify2 = $classify2;
        $this->order_type = $order_type;
    }

    protected $fillable = [
        'wechat_id', // 微信号id(open_id)
        'address', // 服务地址
        'contact', // 联系人
        'phone',	//联系电话
        'status', // 订单状态, 0.待处理 1.待支付 2.已支付
        'price', // 订单价格
        'photo', // 显示的图片
        'comment_id', // 评论id
        'paid_at',  // 支付时间
    ];

    public function setFillable($fillable) {
        $this->fillable = $fillable;
    }

    public function getFillable() {
        return $this->fillable;
    }

    public function mergeFillable($fillable) {
        $this->fillable = array_merge($this->fillable, $fillable);
    }
}
