| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- namespace addons\Happiness\common\models;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_happiness_voucher_express_goods".
- *
- * @property int $id
- * @property int $express_id 物流ID
- * @property string $order_no 提货订单号
- * @property int $order_id 提货订单ID
- * @property int $goods_id 商品ID
- * @property int $attr_id 规格ID
- * @property int $num 提货数量
- * @property int $mall_id 商城ID
- * @property int $status
- * @property int $created_at
- * @property int $updated_at
- */
- class HappinessVoucherExpressGoods extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_addons_happiness_voucher_express_goods';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['express_id', 'order_id', 'goods_id','create_date', 'expire_date', 'save_day', 'attr_id', 'num', 'mall_id', 'status', 'created_at', 'updated_at'], 'integer'],
- [['order_no'], 'string', 'max' => 255],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'express_id' => 'Express ID',
- 'order_no' => 'Order No',
- 'order_id' => 'Order ID',
- 'goods_id' => 'Goods ID',
- 'attr_id' => 'Attr ID',
- 'num' => 'Num',
- 'mall_id' => 'Mall ID',
- 'status' => 'Status',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- ];
- }
- 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;
- }
- }
- }
|