| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- namespace addons\CloudStock\common\models;
- use common\enums\StatusEnum;
- use common\models\base\BaseActiveRecord;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_cloud_stock_bonus_pool_log".
- *
- * @property int $id
- * @property int $mall_id 商城ID
- * @property int $level 分红池等级
- * @property int $start 开始时间
- * @property int $end 结束时间
- * @property float $money 当前分红池金额
- * @property float $dispatch_money 分出去金额
- * @property int $people 人数
- * @property int $is_upgrade_bag_give_goods_pool 开启云仓代理升级礼包赠送的商品计算补货盒数,关闭则不计算
- * @property int $is_superposition 分红池开关:每个分红池可以开启是否可以叠加分红,开启则进行叠加,关闭则不叠加
- * @property int $pool_settlement_type 结算类型:0:月;1:季度
- * @property int $status 状态[-1:删除;0:禁用;1启用]
- * @property int|null $created_at
- * @property int|null $updated_at
- */
- class CloudStockBonusPoolLog extends BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_cloud_stock_bonus_pool_log}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id'], 'required'],
- [['mall_id', 'level', 'start', 'end', 'people', 'is_upgrade_bag_give_goods_pool', 'is_superposition', 'pool_settlement_type', 'status', 'created_at', 'updated_at'], 'integer'],
- [['money', 'dispatch_money'], 'number'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => '商城ID',
- 'level' => 'level',
- 'start' => '开始时间',
- 'end' => '结束时间',
- 'money' => '当前分红池金额',
- 'dispatch_money' => '分出去金额',
- 'people' => '人数',
- 'is_upgrade_bag_give_goods_pool' => '开启云仓代理升级礼包赠送的商品计算补货盒数,关闭则不计算',
- 'is_superposition' => '分红池开关:每个分红池可以开启是否可以叠加分红,开启则进行叠加,关闭则不叠加',
- 'pool_settlement_type' => '结算类型:0:月;1:季度',
- 'status' => '状态[-1:删除;0:禁用;1启用]',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- ];
- }
- public static function create($params)
- {
- try {
- $model = new self();
- $model->loadDefaultValues();
- if (!$model->load($params, '') || !$model->save()) throw new \Exception($model->getErrorMessage());
- return $model->toArray();
- } catch (\Exception $e) {
- self::setStaticError($e->getMessage());
- return false;
- }
- }
- }
|