| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- namespace common\models\common;
- use PHPUnit\Util\Exception;
- use Yii;
- /**
- * This is the model class for table "{{%commission_increment_log}}".
- *
- * @property int $id
- * @property int $mall_id 商城id
- * @property string $wallet_type 类型[commission:佣金收益]
- * @property int|null $enable 是否开启
- * @property float $radio 比例
- * @property float $send_num 发放数量
- * @property int $send_user_num 发放人数
- * @property int|null $status 状态[-1:删除;0:禁用;1启用]
- * @property int $created_at 添加时间戳
- * @property int $updated_at 更新时间戳
- */
- class CommissionIncrementLog extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName(): string
- {
- return '{{%commission_increment_log}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules(): array
- {
- return [
- [['mall_id', 'enable', 'send_user_num', 'status', 'created_at', 'updated_at'], 'integer'],
- [['radio', 'send_num'], 'number'],
- [['wallet_type'], 'string', 'max' => 20],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels(): array
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'wallet_type' => 'Wallet Type',
- 'enable' => 'Enable',
- 'radio' => 'Radio',
- 'send_num' => 'Send Num',
- 'send_user_num' => 'Send User Num',
- 'status' => 'Status',
- '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::$static_error = $e->getMessage();
- return false;
- }
- }
- }
|