Skip to content

Commit

Permalink
更新开源v4.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
evoxwht committed May 9, 2022
1 parent bfec09d commit ab096dc
Show file tree
Hide file tree
Showing 747 changed files with 5,717 additions and 3,290 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
/.git
/.idea
/crmeb/.constant
/crmeb/runtime
/crmeb/runtime/cache
/crmeb/runtime/log
/crmeb/runtime/session
/crmeb/runtime/temp
/crmeb/public/uploads
*.log
/crmeb/public/install/install.lock
/crmeb/.env
#/crmeb/.env
/crmeb/timer.pid
/crmeb/workerman.pid
/docker-compose/mysql/data/
Expand Down
65 changes: 21 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

CRMEB打通版是一款全开源支持免费商用的PHP单商户商城系统;

CRMEB技术团队(官网:www.crmeb.com)历经4年时间匠心之作!系统采用前后端分离技术,基于TP6+Uni-app框架开发;客户移动端采用uni-app开发,管理后台前端使用iviewUI开发。系统支持微信公众号端、微信小程序端、H5端、PC端多端账号同步,可快速打包生成APP;
CRMEB技术团队(官网:www.crmeb.com)历经5年时间匠心之作!系统采用前后端分离技术,基于TP6+Uni-app框架开发;客户移动端采用uni-app开发,管理后台前端使用iviewUI开发。系统支持微信公众号端、微信小程序端、H5端、PC端多端账号同步,可快速打包生成APP;

赋能开发者,减少重复造轮子;系统支持自动检查安装环境一键安装部署,使用简单方便;围绕方便二次开发,系统内置强大灵活的权限管理,可以控制到每一个菜单;通过内置组合数据,管理碎片化数据,系统配置快速添加系统配置参数,所有用户操作地方都内置钩子,代码严格分控制层(中间件、路由)、Services层、Dao层、Model层;后台应用form-builder PHP快速生成现代化表单;并提供详细的使用文档、开发文档、接口文档、数据字典等相关文档;及十几个技术交流群、技术论坛答疑;让您二开无忧,帮助更多开发者快速上手,节省开发时间,提升开发效率;助力企业实现数字化经营!

Expand Down Expand Up @@ -52,12 +52,6 @@

技术交流社区:<a href="https://q.crmeb.com" target="_blank">https://q.crmeb.com

![](readme/images/gitee打通版-横.jpg)
[![](readme/images/1思维脑图功能清单.jpg)](http://s.crmeb.com/goods_detail/730)
[![](readme/images/2高清UI设计图.jpg)](http://s.crmeb.com/goods_detail/728)
[![](readme/images/3前后端接口文档.jpg)](http://s.crmeb.com/goods_detail/729)
[![](readme/images/4PC端前端模板.jpg)](http://s.crmeb.com/goods_detail/711)

#### 不懂服务器?不懂技术?无法解决高并发?想数据私有化?还想后期定制开发?

推荐云部署版一键解决以上所有问题,超低价格低至 :collision: 9.9元/年,点击了解 https://saas.crmeb.com/saas-home-software-detail-50042-s-y.html
Expand All @@ -79,12 +73,12 @@ Redis


### 官方技术交流群
![输入图片说明](readme/images/image.jpg)
![输入图片说明](readme/pic/image.jpg)
### CRMEB官方论坛:https://q.crmeb.com

技术交流、安装搭建问题、系统建议反馈 欢迎光临CRMEB官方论坛!

提交BUG、产品建议反馈 有奖悬赏 欢迎参与:https://q.crmeb.com/thread/7380
提交BUG、产品建议反馈 欢迎参与:https://q.crmeb.com/?categoryId=147


## 技术亮点
Expand All @@ -111,17 +105,17 @@ Redis

## 页面展示
(页面仅展示部分UI)
![输入图片说明](readme/images/gitee开源版详情_01.jpg)
![输入图片说明](readme/images/gitee开源版详情_02.jpg)
![输入图片说明](readme/images/gitee开源版详情_03.jpg)
![输入图片说明](readme/images/gitee开源版详情_04.jpg)
![输入图片说明](readme/images/gitee开源版详情_05.jpg)
## <a href='http://s.crmeb.com/goods_detail/728' target='_blank'>点击查看高清版全套UI设计图</a>
![输入图片说明](readme/pic/gitee开源版详情_01.jpg)
![输入图片说明](readme/pic/gitee开源版详情_02.jpg)
![输入图片说明](readme/pic/gitee开源版详情_03.jpg)
![输入图片说明](readme/pic/gitee开源版详情_04.jpg)
![输入图片说明](readme/pic/gitee开源版详情_05.jpg)
### <a href='http://s.crmeb.com/goods_detail/728' target='_blank'>点击查看高清版全套UI设计图</a>


## 系统演示

![输入图片说明](readme/images/20公众号.jpg)
![输入图片说明](readme/pic/20公众号.jpg)

演示站: http://v4.crmeb.net/admin

Expand All @@ -134,43 +128,19 @@ Redis

## 程序下载


老版本v3.2.9 下载(功能全,后台非前后端分离,适合新手二开)
```
老版本v3.2.9 下载(功能全,后台非前后端分离,适合二开)
git clone -b v3.2.9 https://gitee.com/ZhongBangKeJi/CRMEB.git
最新版 下载(当前开源版功能全,前后台分离版,适合二开)
git clone https://gitee.com/ZhongBangKeJi/CRMEB.git
精简版Min下载(基础商城框架,适合精简需求的客户,适合二开)
git clone https://gitee.com/ZhongBangKeJi/CRMEB-Min.git
```

## 相关项目
## 推荐项目

:star: CRMChat客服系统 https://gitee.com/ZhongBangKeJi/CRMChat

TP6+swoole4开源客服系统,支持微信网页、H5端、PC端客服接入,商家端有PC端管理、H5端、App端接待,支持用户添加标签、分组等功能
:star: CRMChat客服系统: https://gitee.com/ZhongBangKeJi/CRMChat

JAVA版商城:https://gitee.com/ZhongBangKeJi/crmeb_java

CRMEB商城JAVA版,SpringBoot + Maven + Swagger + Mybatis Plus + Redis + Uniapp +Vue+elementUI 包含移动端、小程序、PC后台、Api接口;有产品、用户、购物车、订单、积分、优惠券、营销、余额、权限、角色、系统设置、组合数据、可拖拉拽的form表单等模块,大量的减少了二开的成本。

知识付费:https://gitee.com/ZhongBangKeJi/crmeb_zzff_class

CRMEB知识付费系统是基于ThinkPhp5.0+Vue开发的全开源知识付费系统。功能包含直播课堂、付费视频、付费音频、付费阅读、会员系统、课程分销、课程拼团、直播带货、直播打赏、商城系统等。能够快速积学员、学员数据分析、智能转化客户、有效提高销售、吸引流量、网络营销、品牌推广的一款应用,且更适合企业二次开发

form-builder : https://github.com/xaboy/form-builder

tp PHP表单生成器,快速生成现代化的form表单。包含复选框、单选框、输入框、下拉选择框等元素以及,省市区三级联动,时间选择,日期选择,颜色选择,文件/图片上传等功能。

CRMEB Min版商城:https://gitee.com/ZhongBangKeJi/CRMEB-Min

CRMEB Min是一款轻量级、高性能开源电商商城系统,采用TP6+Mysql+Uniapp+iView+Redis等最流行热门技术语言,支持队列、表单生成、长链接、定时任务等,完善的权限管理、会员管理、产品订单管理、CMS管理、支持多端、一键开通短信、产品采集、物流查询等接口。快速简单高效!

## 特别鸣谢

Expand All @@ -188,7 +158,7 @@ CRMEB Min是一款轻量级、高性能开源电商商城系统,采用TP6+Mysq

## 开源版使用须知

1.允许用于个人学习、毕业设计、教学案例、公益事业;
1.允许用于个人学习、毕业设计、教学案例、公益事业、商业使用;

2.如果商用必须保留版权信息,请自觉遵守;

Expand All @@ -205,4 +175,11 @@ All rights reserved。

CRMEB® 商标和著作权所有者为西安众邦网络科技有限公司。

![](readme/pic/gitee打通版-横.jpg)
[![](readme/pic/1思维脑图功能清单.jpg)](http://s.crmeb.com/goods_detail/730)
[![](readme/pic/2高清UI设计图.jpg)](http://s.crmeb.com/goods_detail/728)
[![](readme/pic/3前后端接口文档.jpg)](http://s.crmeb.com/goods_detail/729)
[![](readme/pic/4PC端前端模板.jpg)](http://s.crmeb.com/goods_detail/711)

[返回顶部 :fa-arrow-circle-up: ](https://gitee.com/ZhongBangKeJi/CRMEB#%E9%A1%B9%E7%9B%AE%E4%BB%8B%E7%BB%8D)

4 changes: 3 additions & 1 deletion crmeb/app/adminapi/AdminApiExceptionHandle.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace app\adminapi;


use app\exceptions\CommonException;
use crmeb\exceptions\AdminException;
use crmeb\exceptions\ApiException;
use crmeb\exceptions\AuthException;
Expand All @@ -34,6 +35,7 @@ class AdminApiExceptionHandle extends Handle
AuthException::class,
AdminException::class,
ApiException::class,
CommonException::class,
];

/**
Expand Down Expand Up @@ -86,7 +88,7 @@ public function render($request, Throwable $e): Response
// 添加自定义异常处理机制
if ($e instanceof DbException) {
return app('json')->fail('数据获取失败', $massageData);
} elseif ($e instanceof AuthException || $e instanceof ValidateException || $e instanceof ApiException) {
} elseif ($e instanceof AuthException || $e instanceof ValidateException || $e instanceof ApiException || $e instanceof CommonException) {
return app('json')->make($e->getCode() ? : 400, $e->getMessage());
} elseif ($e instanceof AdminException) {
return app('json')->fail($e->getMessage(), $massageData);
Expand Down
92 changes: 38 additions & 54 deletions crmeb/app/adminapi/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ function setconfig($name, $pat, $rep)
$pats[$i] = '/\'' . $pat[$i] . '\'(.*?),/';
$reps[$i] = "'" . $pat[$i] . "'" . "=>" . "'" . $rep[$i] . "',";
}
$fileurl = app()->getConfigPath() . $name.".php";
$fileurl = app()->getConfigPath() . $name . ".php";
$string = file_get_contents($fileurl); //加载配置文件
$string = preg_replace($pats, $reps, $string); // 正则查找然后替换
@file_put_contents($fileurl, $string); // 写入配置文件
return true;
} else if(is_string($pat) && is_string($rep)){
} else if (is_string($pat) && is_string($rep)) {
$pats = '/\'' . $pat . '\'(.*?),/';
if(substr_count($rep,'[')){
$reps = "'" . $pat . "'" . "=>" . $rep . ",";
} else{
$rep = str_replace('\'',"",$rep);
if (substr_count($rep, '[')) {
$reps = "'" . $pat . "'" . "=>" . $rep . ",";
} else {
$rep = str_replace('\'', "", $rep);
$reps = "'" . $pat . "'" . "=>" . "'" . $rep . "',";
}
$fileurl = app()->getConfigPath() . $name.".php";
$fileurl = app()->getConfigPath() . $name . ".php";
$string = file_get_contents($fileurl); //加载配置文件
$string = preg_replace($pats, $reps, $string); // 正则查找然后替换
@file_put_contents($fileurl, $string); // 写入配置文件
Expand All @@ -81,26 +81,26 @@ function setconfig($name, $pat, $rep)
*/
function arrayToText($array)
{
$config = print_r($array,true);
$config = str_replace('[',"\"",$config);
$config = str_replace(']',"\"",$config);
$config = print_r($array, true);
$config = str_replace('[', "\"", $config);
$config = str_replace(']', "\"", $config);
$input = explode("\n", $config);
foreach ($input as $k=>$v){
if(empty($v) || strpos($v, 'Array')!==false || strpos($v, '(')!==false || strpos($v, ')')!==false){
foreach ($input as $k => $v) {
if (empty($v) || strpos($v, 'Array') !== false || strpos($v, '(') !== false || strpos($v, ')') !== false) {
continue;
}
$tmpValArr = explode('=>', $v);
if(count($tmpValArr) == 2){
$input[$k] = $tmpValArr[0] . '=> \'' .trim($tmpValArr[1]) . '\',';
if (count($tmpValArr) == 2) {
$input[$k] = $tmpValArr[0] . '=> \'' . trim($tmpValArr[1]) . '\',';
}
}
$config = implode("\n", $input);
$config = str_replace('Array',"",$config);
$config = str_replace('(',"[",$config);
$config = str_replace(')',"],",$config);
$config = rtrim($config,"\n");
$config = rtrim($config,",");
$config = "<?php \n return ".$config.';';
$config = str_replace('Array', "", $config);
$config = str_replace('(', "[", $config);
$config = str_replace(')', "],", $config);
$config = rtrim($config, "\n");
$config = rtrim($config, ",");
$config = "<?php \n return " . $config . ';';
// $fileurl = app()->getConfigPath() ."templates.php";
// @file_put_contents($fileurl, $config); // 写入配置文件
return $config;
Expand All @@ -112,47 +112,31 @@ function arrayToText($array)
* @param $arr
* @return array
*/
function attr_format($arr)
function attr_format($arr): array
{
$data = [];
$res = [];
$count = count($arr);
$arr = array_merge($arr);
if ($count > 1) {
for ($i = 0; $i < $count - 1; $i++) {
if ($i == 0) $data = $arr[$i]['detail'];
//替代变量1
$rep1 = $rep4 = [];
foreach ($data as $v) {
foreach ($arr[$i + 1]['detail'] as $g) {
//替代变量2
$rep2 = ($i != 0 ? '' : $arr[$i]['value'] . '_$_') . $v . '-$-' . $arr[$i + 1]['value'] . '_$_' . $g;
$tmp[] = $rep2;
// if ($i == $count - 2) {
foreach (explode('-$-', $rep2) as $k => $h) {
//替代变量3
$rep3 = explode('_$_', $h);
//替代变量4
$rep4['detail'][$rep3[0]] = $rep3[1] ?? '';
$len = count($arr);
$title = array_column($arr, 'value');
$result = [];

if ($len > 0) {
if ($len > 1) {
$result = $arr[0]['detail'];
for ($i = 0; $i < $len - 1; $i++) {
$temp = $result;
$result = [];
foreach ($temp as $item) {
foreach ($arr[$i + 1]['detail'] as $datum) {
$result[] = trim($item) . ',' . trim($datum);
}
if ($count == count($rep4['detail']))
$res[] = $rep4;
// }
}
}
$data = $tmp ?? [];
}
} else {
$dataArr = [];
foreach ($arr as $k => $v) {
foreach ($v['detail'] as $kk => $vv) {
$dataArr[$kk] = $v['value'] . '_' . $vv;
$res[$kk]['detail'][$v['value']] = $vv;
} else {
foreach ($arr[0]['detail'] as $item) {
$result[] = trim($item);
}
}
$data[] = implode('-', $dataArr);
}
return [$data, array_merge(array_unique($res, SORT_REGULAR))];
return [$result, $title];
}
}

Expand Down
54 changes: 54 additions & 0 deletions crmeb/app/adminapi/controller/v1/setting/SystemAgreement.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

namespace app\adminapi\controller\v1\setting;

use app\adminapi\controller\AuthController;
use app\services\other\AgreementServices;
use think\facade\App;

class SystemAgreement extends AuthController
{
/**
* 构造方法
* SystemCity constructor.
* @param App $app
* @param AgreementServices $services
*/
public function __construct(App $app, AgreementServices $services)
{
parent::__construct($app);
$this->services = $services;
}

/**
* 获取协议内容
* @param $type
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getAgreement($type)
{
if (!$type) return app('json')->fail('协议类型不存在');
$info = $this->services->getAgreementBytype($type);
return app('json')->success($info);
}

/**
* 保存协议内容
* @return mixed
*/
public function saveAgreement()
{
$data = $this->request->postMore([
['id', 0],
['type', 0],
['title', ''],
['content', ''],
]);
$data['status'] = 1;
$this->services->saveAgreement($data, $data['id']);
return app('json')->success('保存成功');
}
}
16 changes: 8 additions & 8 deletions crmeb/app/adminapi/controller/v1/setting/SystemConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,6 @@ public function save_basics(Request $request)
return app('json')->fail('提现最低金额只能为数字!');
}
}
foreach ($post as $k => $v) {
$config_one = $this->services->getOne(['menu_name' => $k]);
if ($config_one) {
$config_one['value'] = $v;
$this->services->valiDateValue($config_one);
$this->services->update($k, ['value' => json_encode($v)], 'menu_name');
}
}
if (isset($post['wss_open'])) {
$this->services->saveSslFilePath((int)$post['wss_open'], $post['wss_local_pk'] ?? '', $post['wss_local_cert'] ?? '');
}
Expand Down Expand Up @@ -314,6 +306,14 @@ public function save_basics(Request $request)
@copy($from, $toHome);
@copy($from, $toPublic);
}
foreach ($post as $k => $v) {
$config_one = $this->services->getOne(['menu_name' => $k]);
if ($config_one) {
$config_one['value'] = $v;
$this->services->valiDateValue($config_one);
$this->services->update($k, ['value' => json_encode($v)], 'menu_name');
}
}
\crmeb\services\CacheService::clear();
return app('json')->success('修改成功');

Expand Down
Loading

0 comments on commit ab096dc

Please sign in to comment.