Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

semour / semour_web

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Find file
BlameHistoryPermalink
Switch branch/tag
  • semour_web
  • app
  • Models
  • OrderModel.php
  • SUDPTDUBLXEROFX\Administrator's avatar
    订单生成 · 189f6785
    SUDPTDUBLXEROFX\Administrator committed 2 years ago
    189f6785
OrderModel.php 1.53 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class OrderModel extends Model
{
    protected $table      = 'order';
    protected $primaryKey = 'order_id';
    public $timestamps    = false;

    //已取消 -1 Cancelled
    //待审核 1  Waiting for approval
    //待付款  2  Waiting for payment
    //待付尾款 3
    //待发货  4  Waiting for dispatch
    //部分发货 7
    //待收货 8  Waiting for delivery
    //已完成  10 Transaction Complete
    const status_cancel = -1;
    const status_waiting_approval = 1;
    const status_waiting_pay =2 ;
    const status_waiting_end_pay =3 ;
    const status_waiting_send =4 ;
    const status_waiting_half_send =7 ;
    const status_waiting_delivery =8 ;
    const status_complete =10 ;
    static $status = [
        self::status_cancel => "Cancelled",
        self::status_waiting_approval => "Waiting for approval",
        self::status_waiting_pay => "Waiting for payment",
        //self::status_waiting_end_pay => "",
        self::status_waiting_send => " Waiting for dispatch",
      //  self::status_waiting_half_send => "",
        self::status_waiting_delivery => "Waiting for delivery",
        self::status_complete => "Transaction Complete",
    ];

    public function order_items()
    {
        return $this->hasMany(OrderItemsModel::class, 'order_id', 'order_id');
    }

    //获取订单详情
    public static function getOrderInfo($where)
    {
        $res = self::where($where)->first();
        return ($res) ? $res->toArray() : [];
    }




}