selectRaw($select) ->first(); if ($set) { $set = $set->toArray(); } else { $set = []; } return $set; } /** * 设置插件数据 * @param $setData * @return bool * @throws \Exception */ public static function setData($setData) { if (empty($setData)){ throw new \Exception('参数错误'); } $setModel = PointMallSetModel::uniacid()->first(); if (!$setModel) { $setModel = new PointMallSetModel(['uniacid' => \YunShop::app()->uniacid]); } $setModel->fill($setData); if ($setModel->save()){ return true; } throw new \Exception('设置失败'); } /** * 获取插件开启状态 * @return bool|mixed */ public static function getPluginStatus() { if (!app('plugins')->isEnabled('point-mall')){ return false; } $setModel = PointMallSetModel::uniacid()->first(); if (!$setModel) { return false; } return $setModel->is_open; } }