1 | <?php |
||
26 | class Order extends \yii\db\ActiveRecord |
||
27 | { |
||
28 | const PAYMENT_METHOD_ALIPAY = 1; |
||
29 | const PAYMENT_METHOD_WECHATPAY = 2; |
||
30 | const PAYMENT_METHOD_QRCODE = 3; |
||
31 | |||
32 | const STATUS_RETURN_FAILED = -5; //退货失败 |
||
33 | const STATUS_RETURNED = -4;// 已退货 |
||
34 | const STATUS_RETURNING = -3; //退货中 |
||
35 | const STATUS_DELETED = -2; //已删除 |
||
36 | const STATUS_CANCELED = -1; //已取消 |
||
37 | const STATUS_UNPAID = 0; //未支付 |
||
38 | const STATUS_PAID = 1; //已支付 |
||
39 | const STATUS_UNSHIPPED = 2; //未发货 |
||
40 | const STATUS_SHIPPED = 3; //已发货 |
||
41 | const STATUS_DELIVERED = 4; //已签收 |
||
42 | const STATUS_CONSUMED = 5; //已消费 |
||
43 | |||
44 | /** |
||
45 | * @inheritdoc |
||
46 | */ |
||
47 | 1 | public static function tableName() |
|
51 | |||
52 | /** |
||
53 | * @inheritdoc |
||
54 | */ |
||
55 | 1 | public function rules() |
|
64 | |||
65 | /** |
||
66 | * @inheritdoc |
||
67 | */ |
||
68 | 1 | public function attributeLabels() |
|
87 | |||
88 | /** |
||
89 | * @inheritdoc |
||
90 | */ |
||
91 | 2 | public function behaviors() |
|
99 | |||
100 | public function beforeSave($insert) |
||
107 | |||
108 | /** |
||
109 | * 产生序列号 |
||
110 | * @param string $prefix 序列号前缀 |
||
111 | * @return string |
||
112 | * @link http://goo.gl/TZYwZo 参考说明 |
||
113 | */ |
||
114 | public function createSN($prefix = '') |
||
118 | |||
119 | 1 | public static function getStatusList() |
|
135 | |||
136 | 1 | public static function getPaymentMethodList() |
|
144 | |||
145 | /** |
||
146 | * @return \yii\db\ActiveQuery |
||
147 | */ |
||
148 | public function getOrderPaymentRecord() |
||
152 | } |
||
153 |