1 | <?php |
||
24 | class Order extends \yii\db\ActiveRecord |
||
25 | { |
||
26 | const PAYMENT_METHOD_ALIPAY = 1; |
||
27 | const PAYMENT_METHOD_WECHATPAY = 2; |
||
28 | const PAYMENT_METHOD_QRCODE = 3; |
||
29 | |||
30 | const STATUS_RETURN_FAILED = -5; //退货失败 |
||
31 | const STATUS_RETURNED = -4;// 已退货 |
||
32 | const STATUS_RETURNING = -3; //退货中 |
||
33 | const STATUS_DELETED = -2; //已删除 |
||
34 | const STATUS_CANCELED = -1; //已取消 |
||
35 | const STATUS_UNPAID = 0; //未支付 |
||
36 | const STATUS_PAID = 1; //已支付 |
||
37 | const STATUS_CONSUMED = 2; //已消费 |
||
38 | |||
39 | /** |
||
40 | * @inheritdoc |
||
41 | */ |
||
42 | 1 | public static function tableName() |
|
46 | |||
47 | /** |
||
48 | * @inheritdoc |
||
49 | */ |
||
50 | 1 | public function rules() |
|
59 | |||
60 | /** |
||
61 | * @inheritdoc |
||
62 | */ |
||
63 | 1 | public function attributeLabels() |
|
80 | |||
81 | /** |
||
82 | * @inheritdoc |
||
83 | */ |
||
84 | 2 | public function behaviors() |
|
92 | |||
93 | 1 | public function beforeSave($insert) |
|
100 | |||
101 | /** |
||
102 | * 产生序列号 |
||
103 | * @param string $prefix 序列号前缀 |
||
104 | * @return string |
||
105 | * @link http://goo.gl/TZYwZo 参考说明 |
||
106 | */ |
||
107 | 1 | public function createSN($prefix = '') |
|
111 | |||
112 | 1 | public static function getStatusList() |
|
125 | |||
126 | 1 | public static function getPaymentMethodList() |
|
134 | |||
135 | /** |
||
136 | * @return \yii\db\ActiveQuery |
||
137 | */ |
||
138 | public function getOrderPaymentRecord() |
||
142 | } |
||
143 |