| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- namespace addons\Happiness\common\models;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_happiness_voucher_express".
- *
- * @property int $id
- * @property int $order_id 提货订单ID
- * @property string $order_no 提货订单号
- * @property string $express_no 物流单号
- * @property string $express_company 物流公司
- * @property int $status
- * @property int $get_status 提货状态:0 未确认 1已确认
- * @property int $mall_id
- * @property int $created_at
- * @property int $updated_at
- */
- class HappinessVoucherExpress extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_addons_happiness_voucher_express';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['order_id', 'status', 'get_status', 'mall_id', 'created_at', 'updated_at'], 'integer'],
- [['order_no', 'express_no', 'express_company'], 'string', 'max' => 255],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'order_id' => 'Order ID',
- 'order_no' => 'Order No',
- 'express_no' => 'Express No',
- 'express_company' => 'Express Company',
- 'status' => 'Status',
- 'get_status' => 'Get Status',
- 'mall_id' => 'Mall ID',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- ];
- }
- public function getGoods()
- {
- return $this->hasMany(HappinessVoucherExpressGoods::className(), ['express_id' => 'id']);
- }
- public static function setData(array $params)
- {
- try {
- if(isset($params['id']) && !empty($params['id']))
- $model = self::findOne($params['id']);
- else {
- $model = new self();
- $model->loadDefaultValues();
- }
- if(!$model)
- {
- $model = new self();
- $model->loadDefaultValues();
- }
- if (!$model->load($params, '') || !$model->save()) {
- throw new \Exception($model->getErrorMessage());
- }
- return $model;
- } catch (\Exception $e) {
- self::$static_error = $e->getMessage();
- return false;
- }
- }
- }
|