【最新版】芸众商城独立版源码 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.mzph.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…