| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- namespace addons\CardSecret\common\models;
- use Yii;
- /**
- * This is the model class for table "{{%addons_CardSecret_import_fail_log}}".
- *
- * @property int $id
- * @property int|null $mall_id 商城ID
- * @property string|null $name 卡号名称
- * @property string|null $password 卡号密码
- * @property int|null $use_status 使用状态 (1.未领取,2.待领取,3.已失效)
- * @property int|null $status 状态(-1是已删除,0是禁用,1是正常)
- * @property int|null $import_id 导入ID
- * @property int|null $created_at 创建时间
- * @property int|null $updated_at 更新时间
- * @property int|null $cate_id 分类ID
- */
- class CardSecretImportFailLog extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_card_secret_import_fail_log}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'use_status', 'status', 'import_id', 'created_at', 'updated_at', 'cate_id'], 'integer'],
- [['name', 'password'], 'string', 'max' => 255],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => '商城ID',
- 'name' => '卡号名称',
- 'password' => '卡号密码',
- 'use_status' => '使用状态 (1.未领取,2.待领取,3.已失效)',
- 'status' => '状态(-1是已删除,0是禁用,1是正常)',
- 'import_id' => '导入ID',
- 'created_at' => '创建时间',
- 'updated_at' => '更新时间',
- 'cate_id' => '分类ID',
- ];
- }
- /**
- * 保存数据
- * @Author: ltm
- * @DateTime: 2022/5/6 0022 17:13
- * @Copyright: copyright (c) 2021 广东七件事集团
- * @param array $params
- * @return string
- */
- public static function setData(array $params){
- try{
- $model = new self();
- $model->loadDefaultValues();
- $model->mall_id = $params['mall_id'];
- if(!$model->load($params,'') || !$model->save()){
- throw new Exception($model->getErrorMessage());
- }
- return $model;
- }catch(\Exception $e){
- self::$static_error = $e->getMessage();
- return false;
- }
- }
- }
|