200], [['operator_name'], 'string', 'max' => 100], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'cate_id' => '卡密分类ID', 'mall_id' => '商城ID', 'file' => '导入文件路径', 'operator_name' => '操作人昵称', 'operator_id' => '操作人ID', 'export_count' => '总导入数量', 'export_success_count' => '导入成功数量', 'export_fail_count' => '导入失败数量', 'status' => '0是禁用,1是正常,-1是删除', 'created_at' => '创建时间', 'updated_at' => '修改时间', 'export_status' => '0是正在处理中,1是导入完成', ]; } /** * @Author: ltm * @DateTime: 2022/5/6 0007 11:31 * @Copyright: copyright (c) 2021 广东七件事集团 * @param $data * @return string */ public static function setData(array $params){ try{ if (!empty($params['id'])) { $model = self::findOne(['id'=>$params['id'],'mall_id'=>$params['mall_id']]); if (empty($model)) throw new Exception('记录不存在或已删除'); }else{ $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; } } }