| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace common\models\order;
- use Exception;
- use Yii;
- /**
- * This is the model class for table "qimall_order_achievement_goods".
- *
- * @property int $id
- * @property int $order_id 订单id
- * @property string|null $goods_ids 订单满足业绩的商品
- * @property int $created_at
- * @property int $updated_at
- */
- class OrderAchievementGoods extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_order_achievement_goods';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['user_id', 'mall_id', 'order_id', 'created_at', 'updated_at'], 'integer'],
- [['goods_ids', 'order_details_ids'], 'safe'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'order_id' => 'Order ID',
- 'goods_ids' => 'Goods Ids',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- ];
- }
- public static function setData(array $params)
- {
- try {
- $model = new self();
- $model->loadDefaultValues();
- if (!$model->load($params, '') || !$model->save()) {
- throw new Exception($model->getErrorMessage());
- }
- return $model;
- } catch (\Exception $e) {
- self::setStaticError($e->getMessage());
- return false;
- }
- }
- }
|