| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- namespace addons\ScoreExpansion\common\models;
- use common\enums\StatusEnum;
- use Exception;
- use RuntimeException;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_score_expansion_recommend_reward_details".
- *
- * @property int $id
- * @property int $mall_id
- * @property int $recommend_reward_order_id 推荐奖励订单记录表id
- * @property int $user_id 发放用户ID
- * @property int $date 奖励日期
- * @property float $reward_frozen_score 奖励的冻结积分
- * @property int $loop_num 第几轮的奖励
- * @property int $current_reward_person_index 奖励第几人
- * @property int $status 状态[-1:删除;0:禁用;1启用]
- * @property int $created_at
- * @property int $updated_at
- */
- class ScoreExpansionRecommendRewardDetails extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_addons_score_expansion_recommend_reward_details';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'recommend_reward_order_id', 'user_id', 'date', 'loop_num', 'current_reward_person_index', 'status', 'created_at', 'updated_at'], 'integer'],
- [['reward_frozen_score'], 'number'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'recommend_reward_order_id' => 'Recommend Reward Order ID',
- 'user_id' => 'User ID',
- 'date' => 'Date',
- 'reward_frozen_score' => 'Reward Frozen Score',
- 'loop_num' => 'Loop Num',
- 'current_reward_person_index' => 'Current Reward Person Index',
- 'status' => 'Status',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- ];
- }
- /**
- * @param array $params
- *
- * @return bool|self
- */
- public static function setData(array $params)
- {
- try {
- $model = new static();
- $model->loadDefaultValues();
- if (!$model->load($params, '')) {
- throw new RuntimeException($model->getErrorMessage());
- }
- if (!$model->save()) {
- throw new RuntimeException($model->getErrorMessage());
- }
- return $model;
- } catch (Exception $e) {
- static::$static_error = $e->getMessage();
- return false;
- }
- }
- }
|