【最新版】蕓眾商城獨立版源碼 425+插件 全新后臺框架

一.系統介紹

蕓眾商城系統最新版 已經更新425+全插件版,一套系統支持各種新零售、商城、模式,天天美麗鏈動商城。不要相信那些外面的舊版本。舊版本等于是廢品,無法小程序運營的,框架還是舊的!
蕓眾系統最新版 服務器可自備或托管,425+來個插件,包括小程序。后續新增插件可升級

源碼全開源可二次開發(包更新!)

二.搭建環境

系統環境:CentOS、

運行環境:寶塔 Linux

網站環境:Nginx 1.15.10 + MySQL 5.6.46 + PHP-7.4

常見插件:fileinfo ; redis

系統測試圖片

【最新版】蕓眾商城獨立版源碼 425+插件 全新后臺框架

【最新版】蕓眾商城獨立版源碼 425+插件 全新后臺框架

后端API-Yunshop.php 代碼:

<?phpuse app\frontend\modules\member\services\MemberAnchorAppService;
use app\frontend\modules\member\services\MemberCpsAppService;
use Illuminate\Support\Str;
use app\common\services\PermissionService;
use app\common\models\Menu;
use app\common\services\Session;
use app\common\exceptions\NotFoundException;//商城根目錄
define('SHOP_ROOT', dirname(__FILE__));class YunShop
{private static $_req;private static $_app;private static $_plugin;private static $_notice;public function __construct(){}/*** Configures an object with the initial property values.* @param object $object the object to be configured* @param array $properties the property initial values given in terms of name-value pairs.* @return object the object itself*/public static function configure($object, $properties){foreach ($properties as $name => $value) {$object->$name = $value;}return $object;}public static function getAppNamespace(){$rootName = 'app';if (self::isWeb()) {$rootName .= '\\backend';}if (self::isApp() || self::isApi()) {$rootName .= '\\frontend';}return $rootName;}public static function getAppPath(){$path = dirname(__FILE__);if (self::isWeb()) {$path .= '/backend';}if (self::isApp() || self::isApi()) {$path .= '/frontend';}return $path;}public static function isPHPUnit(){return strpos($_SERVER['PHP_SELF'], 'phpunit') !== false ? true : false;}public static function isWeb(){return request()->isBackend();}public static function isApp(){if (self::isPHPUnit()) {return true;}return strpos($_SERVER['PHP_SELF'], '/app/index.php') !== false ? true : false;}public static function isApi(){return (strpos($_SERVER['PHP_SELF'], '/addons/') !== false &&strpos($_SERVER['PHP_SELF'], '/api.php') !== false) ? true : false;}/**** @return bool*/public static function isWechatApi(){if (config('app.framework') == 'platform') {return (strpos($_SERVER['REQUEST_URI'], '/wechat') !== false &&strpos($_SERVER['REQUEST_URI'], '/api') !== false) ? true : false;} else {return (strpos($_SERVER['PHP_SELF'], '/addons/') === false &&strpos($_SERVER['PHP_SELF'], '/api.php') !== false) ? true : false;}}public static function isOutsideApi(){return strpos($_SERVER['REQUEST_URI'], '/outside') !== false ? true : false;}/*** 是否插件* @return bool*/public static function isPlugin(){if (config('app.framework') == 'platform') {return (strpos(request()->getRequestUri(), config('app.isWeb')) !== false &&strpos(request()->getRequestUri(), '/plugin') !== false) ? true : false;} else {return (strpos($_SERVER['PHP_SELF'], '/web/') !== false &&strpos($_SERVER['PHP_SELF'], '/plugin.php') !== false) ? true : false;}}/*** @name 驗證是否商城操作員* @return array|bool|null|stdClass* @author*/public static function isRole(){global $_W;if (app('plugins')->isEnabled('supplier')) {$res = \Illuminate\Support\Facades\DB::table('yz_supplier')->where('uid', $_W['uid'])->first();if (!$res) {return false;}return $res;}return false;}/*** @name 驗證是否文章營銷管理員* @author* @return array|bool|null|stdClass*/public static function isArticle(){global $_W;if (app('plugins')->isEnabled('article')) {if (!\Illuminate\Support\Facades\Schema::hasTable('yz_plugin_article_manager')) {return false;}$res = \Illuminate\Support\Facades\DB::table('yz_plugin_article_manager')->where('uid', $_W['uid'])->first();if (!$res) {return false;}return $res;}return false;}/*** @name 驗證是否商城操作員* @author* @return array|bool|null|stdClass*/public static function isAgencyCompany(){global $_W;if (app('plugins')->isEnabled('agency-statistics')) {$res = \Illuminate\Support\Facades\DB::table('yz_agency_company')->where('uid', $_W['uid'])->first();if (!$res) {return false;}return $res;}return false;}public static function cleanApp(){self::$_app = null;}/*** @name 驗證是否門店店長* @return array|bool|null|stdClass* @author*/public static function isStore(){global $_W;if (app('plugins')->isEnabled('store-cashier')) {$res = \Illuminate\Support\Facades\DB::table('yz_store')->where('user_uid', $_W['uid'])->first();if (!$res) {return false;}return $res;}return false;}public static function isPayment(){return strpos($_SERVER['PHP_SELF'], '/payment/') > 0 ? true : false;}public static function request(){if (self::$_req !== null) {return self::$_req;} else {self::$_req = new YunRequest();return self::$_req;}}/*** @return YunApp*/public static function app(){if (self::$_app !== null) {return self::$_app;} else {self::$_app = new YunApp();return self::$_app;}}/*** 解析路由** 后臺訪問  /web/index.php?c=site&a=entry&m=sz_yi&do=xxx&route=module.controller.action* 前臺      /app/index.php....** 多字母的路由用中劃線隔開 比如:*      TestCacheController*          function testClean()* 路由寫法為   test-cache.test-clean**/
//    public static function parseRoute($requestRoute)
//    {
//        try {
//            $vers = [];
//            $routes_params = explode('.', $requestRoute);
//
//            if (preg_match('/(v\d+)\./', $requestRoute, $vers)) {
//                foreach ($routes_params as $key => $item) {
//                    if ($item != $vers[1]) {
//                        $routes[] = $item;
//                    }
//                }
//            } else {
//                $routes = $routes_params;
//            }
//
//            $path = self::getAppPath();
//            $namespace = self::getAppNamespace();
//            $action = '';
//            $controllerName = '';
//            $currentRoutes = [];
//            $modules = [];
//
//            if ($routes) {
//                $length = count($routes);
//                $routeFirst = array_first($routes);
//                $countRoute = count($routes);
//                if ($routeFirst === 'plugin' || self::isPlugin()) {
//                    if (self::isPlugin()) {
//                        $currentRoutes[] = 'plugin';
//                        $countRoute += 1;
//                    } else {
//                        $currentRoutes[] = $routeFirst;
//                        array_shift($routes);
//                    }
//                    $namespace = 'Yunshop';
//                    $pluginName = array_shift($routes);
//                    if ($pluginName || plugin($pluginName)) {
//                        $currentRoutes[] = $pluginName;
//                        $namespace .= '\\' . ucfirst(Str::camel($pluginName));
//                        $path = base_path() . '/plugins/' . $pluginName . '/src';
//                        $length = $countRoute;
//
//                        self::findRouteFile($controllerName, $action, $routes, $namespace, $path, $length, $currentRoutes, $requestRoute, true, $vers);
//
//                        if (!app('plugins')->isEnabled($pluginName)) {
//                            throw new NotFoundException("{$pluginName}插件已禁用");
//
//                        }
//                    } else {
//                        throw new NotFoundException('無此插件');
//
//                    }
//                } else {
//
//                    self::findRouteFile($controllerName, $action, $routes, $namespace, $path, $length, $currentRoutes, $requestRoute, false, $vers);
//
//                }
//            }
//        } catch (Exception $exception) {dd($exception);exit;
//
//        }
//        //執行run
//        return static::run($namespace, $modules, $controllerName, $action, $currentRoutes);
//
//    }/*** 定位路由相關文件* @param $controllerName* @param $action* @param $routes* @param $namespace* @param $path* @param $length* @param $requestRoute* @param $isPlugin*/public static function findRouteFile(&$controllerName, &$action, $routes, &$namespace, &$path, $length, &$currentRoutes, $requestRoute, $isPlugin, $vers){foreach ($routes as $k => $r) {$ucFirstRoute = ucfirst(Str::camel($r));if (empty($vers)) {$controllerFile = $path . ($isPlugin ? '/' : '/controllers/') . $ucFirstRoute . 'Controller.php';} else {$controllerFile = $path . ($isPlugin ? '/' : '/controllers/') . 'vers/' . $vers[1] . '/' . $ucFirstRoute . 'Controller.php';}if (is_file($controllerFile)) {if (empty($vers)) {$namespace .= ($isPlugin ? '' : '\\controllers') . '\\' . $ucFirstRoute . 'Controller';} else {$namespace .= ($isPlugin ? '\\' : '\\controllers\\') . 'vers\\' . $vers[1] . '\\' . $ucFirstRoute . 'Controller';}$controllerName = $ucFirstRoute;$path = $controllerFile;$currentRoutes[] = $r;} elseif (is_dir($path .= ($isPlugin ? '' : '/modules') . '/' . $r)) {$namespace .= ($isPlugin ? '' : '\\modules') . '\\' . $r;$modules[] = $r;$currentRoutes[] = $r;} else {if ($length !== ($isPlugin ? $k + 3 : $k + 1)) {throw new NotFoundException('路由長度有誤:' . $requestRoute);}$action = strpos($r, '-') === false ? $r : Str::camel($r);$currentRoutes[] = $r;}}}public static function getUcfirstName($name){if (strpos($name, '-')) {$names = explode('-', $name);$name = '';foreach ($names as $v) {$name .= ucfirst($v);}}return ucfirst($name);}public static function plugin(){self::$_plugin = new YunPlugin();return self::$_plugin;}public static function notice(){self::$_notice = new YunNotice();return self::$_notice;}private static function getContent($controller, $action){return (new \Illuminate\Pipeline\Pipeline(new \Illuminate\Container\Container()))->send(Illuminate\Http\Request::capture())->through(collect($controller->getMiddleware())->pluck('middleware')->all())->then(function ($request) use ($controller, $action) {return $controller->$action($request);});}
}class YunComponent implements ArrayAccess
{protected $values = [];public function __set($name, $value){return $this->values[$name] = $value;}public function __get($name){if (!array_key_exists($name, $this->values)) {$this->values[$name] = null;}return $this->values[$name];}function __isset($name){return array_key_exists($name, $this->values);}public function set($name, $value){$this->values[$name] = $value;return $this;}public function get($key = null){if (isset($key)) {$result = json_decode(array_get($this->values, $key, null), true);if (@is_array($result)) {return $result;}return array_get($this->values, $key, null);}return $this->values;}public function offsetUnset($offset){unset($this->values[$offset]);}public function offsetSet($offset, $value){$this->values[$offset] = $value;}public function offsetGet($offset){if (isset($this->values[$offset])) {return $this->values[$offset];}return null;}public function offsetExists($offset){if (isset($this->values[$offset])) {return true;}return false;}
}class YunRequest extends YunComponent
{public function __construct(){$this->values = request()->input();}
}/*** Class YunApp* @property int uniacid* @property int uid*/
class YunApp extends YunComponent
{protected $values;public $currentItems = [];public function __construct(){global $_W;$this->values = !YunShop::isWeb() && !YunShop::isWechatApi() ? $this->getW() : (array)$_W;}public function getW(){$uniacid = intval(trim(request()->get('i')));$account = \app\common\models\AccountWechats::getAccountByUniacid($uniacid);return ['uniacid' => $uniacid,'weid'    => $uniacid,'acid'    => $uniacid,'account' => $account ? $account->toArray() : '',];}/*** @return int* @todo set member id from session*/public function getMemberId($get_type = 0){$member_id = 0;$type = \Yunshop::request()->type ?: '';$token = \Yunshop::request()->yz_token ?: '';if ($get_type == 0 && request()->is_shop_pos && app('plugins')->isEnabled('shop-pos') && ($pos_uid = \Yunshop\ShopPos\services\CustomerService::getPosUid())) {$member_id = $pos_uid;} elseif ($get_type == 0 && request()->is_store_pos && app('plugins')->isEnabled('store-pos') && ($pos_uid = \Yunshop\StorePos\services\BuyerService::getBuyerMemberId())) {$member_id = $pos_uid;} elseif ($get_type == 0 && request()->live_install_order_replace && app('plugins')->isEnabled('live-install') && ($pos_uid = \Yunshop\LiveInstall\services\SettingService::cacheUid())) {$member_id = $pos_uid;} elseif ($type == 9) {$native_app = new \app\frontend\modules\member\services\MemberNativeAppService();$member_id = $native_app->getMemberId($token);} elseif ($type == 14) {$anchor_app = new MemberAnchorAppService();$member_id = $anchor_app->getMemberId($token);} elseif ($type == 15 && app('plugins')->isEnabled('aggregation-cps') && (!request()->appid || \Yunshop\AggregationCps\services\SettingManageService::getTrueKey() == request()->appid)) {$cps_app = new MemberCpsAppService();$member_id = $cps_app->getMemberId($token);} elseif ($session_id = request()->input('min_token')) {$session_data = \Illuminate\Support\Facades\Redis::hgetall('PHPSESSID:' . $session_id);return $this->getSessionMemberId($session_data['data']);} elseif (Session::get('member_id')) {$member_id = Session::get('member_id');}return $member_id;}private function getSessionMemberId($read_data){$member_data = '';if (!empty($read_data)) {preg_match_all('/yunzshop_([\w]+[^|]*|)/', $read_data, $name_matches);preg_match_all('/(a:[\w]+[^}]*})/', $read_data, $value_matches);if (!empty($name_matches)) {foreach ($name_matches[0] as $key => $val) {if ($val == 'yunzshop_member_id') {$member_data = $val . '|' . $value_matches[0][$key];}}}}return unserialize(explode('|', $member_data)[1])['data'];}}class YunPlugin
{protected $values;public function __construct(){$this->values = false;}/*** @param null $key* @return bool*/public function get($key = null){if (isset($key)) {if (app('plugins')->isEnabled($key)) {return true;}}return $this->values;}}class YunNotice
{protected $key;protected $value;public function __construct(){$this->key = 'shop';}/*** @param null $key* @return bool*/public function getNotSend($routes = null){$this->value = $routes;$routesData = explode('.', $routes);if (count($routesData) > 1) {$this->key = $routesData[0];$this->value = $routesData[1];}$noticeConfig = Config::get('notice.' . $this->key);return in_array($this->value, $noticeConfig) ? 0 : 1;}}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/76141.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/76141.shtml
英文地址,請注明出處:http://en.pswp.cn/web/76141.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

java 設計模式之單例模式

簡介 單例模式&#xff1a;一個類有且僅有一個實例&#xff0c;該類負責創建自己的對象&#xff0c;同時確保只有一個對象被創建。 特點&#xff1a;類構造器私有、持有自己實例、對外提供獲取實例的靜態方法。 單例模式的實現方式 餓漢式 類被加載時&#xff0c;就會實例…

Milvus 索引如何選擇

以下是幾種索引類型的特點及適用場景&#xff0c;可據此選擇&#xff1a; AUTOINDEX 特點&#xff1a;數據庫自動選擇合適索引類型&#xff0c;無需深入了解索引細節。適用場景&#xff1a;對索引知識了解有限&#xff0c;或不確定哪種索引適合當前數據和查詢需求&#xff0c…

CentOS 7 安裝教程

準備&#xff1a; 軟件&#xff1a;VMware Workstation 鏡像文件&#xff1a;CentOS-7-x86_64-bin-DVD1.iso &#xff08;附&#xff1a;教程較為詳細&#xff0c;注釋較多&#xff0c;故將操作的選項進行了加粗字體顯示。&#xff09; 1、文件–新建虛擬機–自定義 2、硬盤…

TAS啟動與卸載

3. 啟動TAS&#xff08;Thin-Agent服務&#xff09; TAS在安裝完成后通常會自動啟動&#xff0c;并在系統重啟時自啟。如需手動啟動&#xff0c;請按以下步驟操作&#xff1a; &#xfffc; 3.1 在Windows上啟動TAS 1. 打開 Windows服務管理器&#xff1a; ? 按下 Win R&…

Redis面試——數據結構

一、SDS如何防止緩沖區溢出&#xff1f; Redis 的 String 類型通過 SDS&#xff08;Simple Dynamic String&#xff09;來防止緩沖區溢出&#xff0c;具體機制如下&#xff1a; Redis 的 String 類型底層采用 SDS 實現&#xff0c;即 Simple Dynamic StringSDS 底層維護的數據…

Doris的向量化執行如何支撐分布式架構和復雜查詢

Doris 的向量化執行能力與其 分布式架構 和 復雜查詢優化 深度結合&#xff0c;通過 批處理 列式計算 分布式調度 的協同設計&#xff0c;解決傳統分布式數據庫在復雜查詢場景下的性能瓶頸。以下是具體原理展開&#xff1a; 一、向量化如何適配分布式架構&#xff1f; Doris…

DataInputStream 終極解析與記憶指南

DataInputStream 終極解析與記憶指南 一、核心本質 DataInputStream 是 Java 提供的數據字節輸入流,繼承自 FilterInputStream,用于讀取基本數據類型和字符串的二進制數據。 作用:1.專門用來讀取使用DataOutputStream流寫入的文件 注意:讀取的順序要和寫入的順序一致(…

云轉型(cloud transformation)——不僅僅是簡單的基礎設施遷移

李升偉 編譯 云轉型不僅僅是遷移基礎設施&#xff0c;更是重塑企業運營、創新及價值交付的方式。它具有戰略性、持續性&#xff0c;并影響著人員、流程和平臺。 ?? 云轉型涉及以下內容&#xff1a; &#x1f504; 應用現代化——從單體架構轉向微服務架構。 ?? 運營自動…

Java HTTP Client API詳解

Java HTTP Client API詳解 Java的HTTP客戶端API經歷了多次演進&#xff0c;從早期的HttpURLConnection到第三方庫如Apache HttpClient&#xff0c;再到Java 11引入的標準HttpClient。本文將全面解析Java中主要的HTTP客戶端API&#xff0c;包括特性對比、使用方法和最佳實踐。 …

如何深入理解引用監視器,安全標識以及訪問控制模型與資產安全之間的關系

一、核心概念總結 安全標識(策略決策的 “信息載體) 是主體&#xff08;如用戶、進程&#xff09;和客體&#xff08;如文件、數據庫、設備&#xff09;的安全屬性&#xff0c;用于標記其安全等級、權限、訪問能力或受保護級別&#xff0c;即用于標識其安全等級、權限范圍或約束…

京東3D空間視頻生成技術探索與應用

1. 背景 近年來&#xff0c;隨著社交媒體、流媒體平臺以及XR設備的快速發展&#xff0c;沉浸式3D空間視頻的需求迅猛增長&#xff0c;尤其是在短視頻、直播和電影領域&#xff0c;正在重新定義觀眾的觀看體驗。2023年&#xff0c;蘋果公司發布的空間視頻技術為這一趨勢注入了新…

驚爆!Cursor 限制多設備登錄,網友瘋狂吐槽,退訂潮洶涌來襲,直呼:沒理由再給它掏錢!

大家好&#xff0c;我是小程程。 吃瓜吃瓜&#xff0c;知名 AI 編程工具 Cursor 惹事了&#xff01; ① 遭遇強制登出 前幾天有 Cursor 用戶發現&#xff0c;自己要是從多臺設備登錄&#xff0c;就會被強制下線。 比方說&#xff0c;你正在臺式電腦上干活&#xff0c;中途換到筆…

React JSX 語法深度解析與最佳實踐

本文系統梳理 JSX 語法的完整知識體系。通過原理剖析、代碼示例和開發警示&#xff0c;幫助開發者建立嚴謹的 JSX 使用認知。 一、JSX 本質解析 1.1 編譯機制 JSX 通過 Babel 轉換為 React.createElement 調用&#xff0c;以下為轉換對照&#xff1a; // 原始 JSX <MyCo…

若依改用EasyCaptcha驗證碼

若依自帶的驗證碼樣式比較單一&#xff0c;所以想改用EasyCaptcha驗證碼&#xff0c;另外EasyCaptcha算術驗證碼可能會有負數&#xff0c;輸入時需要寫負號&#xff0c;比較麻煩&#xff0c;所以使用一個簡單的方法過濾掉負數結果 原本的驗證碼依賴和代碼可刪可不刪&#xff0c…

趣味編程之go與rust的愛恨情仇

聲明:此篇文章利用deepseek生成。 第一章&#xff1a;出身之謎 Go&#xff08;江湖人稱"高小戈"&#xff09;是名門之后——谷歌家的三少爺。生來就帶著"簡單粗暴"的家族基因&#xff0c;口號是**“少寫代碼多搬磚&#xff0c;并發處理賽神仙”**。它爹Ro…

【cocos creator 3.x】速通3d模型導入, 模型創建,陰影,材質使用,模型貼圖綁定

1、右鍵創建平面&#xff0c;立方體 2、點擊場景根節點&#xff0c;shadows勾選enabled3、點擊燈光&#xff0c;shadow enabled勾選 4、點擊模型&#xff0c;勾選接收陰影&#xff0c;投射陰影&#xff08;按照需要勾選&#xff09; 5、材質創建 6、選中節點&#xff0c;找…

告別昂貴語音合成服務!用GPT-SoVITS生成你的個性化AI語音

文章目錄 前言1.GPT-SoVITS V2下載2.本地運行GPT-SoVITS V23.簡單使用演示4.安裝內網穿透工具4.1 創建遠程連接公網地址 5. 固定遠程訪問公網地址 前言 今天給大家介紹一款AI語音克隆工具——GPT-SoVITS。這款由花兒不哭大佬開發的工具是一款強大的訓練聲音模型與音頻生成工具…

Doris FE 常見問題與處理指南

在數據倉庫領域&#xff0c;Apache Doris 憑借其卓越性能與便捷性被廣泛應用。其中&#xff0c;FE&#xff08;Frontend&#xff09;作為核心組件&#xff0c;承擔著接收查詢請求、管理元數據等關鍵任務。然而&#xff0c;在實際使用中&#xff0c;FE 難免會遭遇各類問題&#…

Unity編輯器擴展之項目資源查找工具

一、需要實現的效果如下: 二、在項目的Asset目錄下新增Editor目錄,新增AssetSearchWindow和EditorDefine和EditorTools這三個C#腳本,并復制以下的代碼保存好之后,就可以實現上述功能啦。 -------------------------------------------EditorTools腳本Begin----------------…

《Java 泛型的作用與常見用法詳解》

大家好呀&#xff01;&#x1f44b; 今天我們要聊的是Java中一個超級重要但又讓很多初學者頭疼的概念——泛型(Generics)。帶你徹底搞懂它&#xff01;&#x1f4aa; 準備好你的小本本&#xff0c;我們開始啦&#xff5e;&#x1f4dd; 一、為什么需要泛型&#xff1f;&#x…