| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?php
- namespace addons\LuckyGroup\common\models;
- use Yii;
- /**
- * This is the model class for table "{{%addons_lucky_group_open_reward_log}}".
- *
- * @property int $id id
- * @property int $mall_id 商城ID
- * @property int $activity_id 活动ID
- * @property int $goods_id 商品ID
- * @property string $order_id 订单ID
- * @property string $win_order_ids 本次开奖拼中订单
- * @property int $group_require_num 开团需要人数
- * @property int $virtual_num 活动设置的虚拟人数
- * @property int $real_group_require_num 真实开团需要人数
- * @property int $attend_order_num 本次可开奖订单数(人数)
- * @property string $expend_type 消耗类型
- * @property float $expend_num 消耗量
- * @property float $win_reward_scores 拼中奖励积分
- * @property float $win_reward_balances 拼中奖励余额
- * @property float $distribute_bonus_pool_amounts 分配奖金池金额
- * @property float $attend_reward_amounts 成团金额
- * @property int $status 状态[-1:删除;0:禁用;1启用]
- * @property int $created_at 创建时间
- * @property int|null $updated_at
- */
- class LuckyGroupOpenRewardLog extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_lucky_group_open_reward_log}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'activity_id', 'goods_id', 'group_require_num', 'virtual_num', 'real_group_require_num', 'attend_order_num', 'status', 'created_at', 'updated_at'], 'integer'],
- [['expend_num', 'win_reward_scores', 'win_reward_balances', 'distribute_bonus_pool_amounts', 'attend_reward_amounts'], 'number'],
- [['order_id', 'win_order_ids'], 'string', 'max' => 1000],
- [['expend_type'], 'string', 'max' => 50],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'id',
- 'mall_id' => '商城ID',
- 'activity_id' => '活动ID',
- 'goods_id' => '商品ID',
- 'order_id' => '订单ID',
- 'win_order_ids' => '本次开奖拼中订单',
- 'group_require_num' => '开团需要人数',
- 'virtual_num' => '活动设置的虚拟人数',
- 'real_group_require_num' => '真实开团需要人数',
- 'attend_order_num' => '本次可开奖订单数(人数)',
- 'expend_type' => '消耗类型',
- 'expend_num' => '消耗量',
- 'win_reward_scores' => '拼中奖励积分',
- 'win_reward_balances' => '拼中奖励余额',
- 'distribute_bonus_pool_amounts' => '分配奖金池金额',
- 'attend_reward_amounts' => '成团金额',
- 'status' => '状态[-1:删除;0:禁用;1启用]',
- 'created_at' => '创建时间',
- 'updated_at' => 'Updated At',
- ];
- }
- public static function setData($params)
- {
- try {
- $model = new LuckyGroupOpenRewardLog();
- $model->loadDefaultValues();
- if (!$model->load($params, '') || !$model->save()) throw new \Exception($model->getErrorMessage());
- return $model;
- } catch (\Exception $e) {
- var_dump($e->getMessage().$e->getFile());
- self::$static_error = $e->getMessage();
- return false;
- }
- }
- }
|