'ID', 'mall_id' => '商城ID', 'level' => '等级(权重)', 'order_detail_id' => '订单详情ID', 'money' => '插入金额,单位:元', 'status' => '状态[-1:删除;0:禁用;1启用]', 'created_at' => '创建时间', 'updated_at' => '更新时间', ]; } public static function setData($params) { try { $model = self::findOne(['id' => $params['id'], 'status' => StatusEnum::ENABLED]); if (empty($model)) { $model = new self(); $model->loadDefaultValues(); } else { } if (!$model->load($params, '') || !$model->save()) throw new \Exception($model->getErrorMessage()); return $model->toArray(); } catch (\Exception $e) { self::setStaticError($e->getMessage()); return false; } } }