Skip to content

Commit ab096dc

Browse files
committed
更新开源v4.4.4
1 parent bfec09d commit ab096dc

File tree

747 files changed

+5717
-3290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

747 files changed

+5717
-3290
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
/.git
22
/.idea
33
/crmeb/.constant
4-
/crmeb/runtime
4+
/crmeb/runtime/cache
5+
/crmeb/runtime/log
6+
/crmeb/runtime/session
7+
/crmeb/runtime/temp
58
/crmeb/public/uploads
69
*.log
710
/crmeb/public/install/install.lock
8-
/crmeb/.env
11+
#/crmeb/.env
912
/crmeb/timer.pid
1013
/crmeb/workerman.pid
1114
/docker-compose/mysql/data/

README.md

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

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

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

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

@@ -52,12 +52,6 @@
5252

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

55-
![](readme/images/gitee打通版-横.jpg)
56-
[![](readme/images/1思维脑图功能清单.jpg)](http://s.crmeb.com/goods_detail/730)
57-
[![](readme/images/2高清UI设计图.jpg)](http://s.crmeb.com/goods_detail/728)
58-
[![](readme/images/3前后端接口文档.jpg)](http://s.crmeb.com/goods_detail/729)
59-
[![](readme/images/4PC端前端模板.jpg)](http://s.crmeb.com/goods_detail/711)
60-
6155
#### 不懂服务器?不懂技术?无法解决高并发?想数据私有化?还想后期定制开发?
6256

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

8074

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

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

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

8983

9084
## 技术亮点
@@ -111,17 +105,17 @@ Redis
111105

112106
## 页面展示
113107
(页面仅展示部分UI)
114-
![输入图片说明](readme/images/gitee开源版详情_01.jpg)
115-
![输入图片说明](readme/images/gitee开源版详情_02.jpg)
116-
![输入图片说明](readme/images/gitee开源版详情_03.jpg)
117-
![输入图片说明](readme/images/gitee开源版详情_04.jpg)
118-
![输入图片说明](readme/images/gitee开源版详情_05.jpg)
119-
## <a href='http://s.crmeb.com/goods_detail/728' target='_blank'>点击查看高清版全套UI设计图</a>
108+
![输入图片说明](readme/pic/gitee开源版详情_01.jpg)
109+
![输入图片说明](readme/pic/gitee开源版详情_02.jpg)
110+
![输入图片说明](readme/pic/gitee开源版详情_03.jpg)
111+
![输入图片说明](readme/pic/gitee开源版详情_04.jpg)
112+
![输入图片说明](readme/pic/gitee开源版详情_05.jpg)
113+
### <a href='http://s.crmeb.com/goods_detail/728' target='_blank'>点击查看高清版全套UI设计图</a>
120114

121115

122116
## 系统演示
123117

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

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

@@ -134,43 +128,19 @@ Redis
134128

135129
## 程序下载
136130

137-
131+
老版本v3.2.9 下载(功能全,后台非前后端分离,适合新手二开)
138132
```
139-
老版本v3.2.9 下载(功能全,后台非前后端分离,适合二开)
140-
141133
git clone -b v3.2.9 https://gitee.com/ZhongBangKeJi/CRMEB.git
142-
143-
最新版 下载(当前开源版功能全,前后台分离版,适合二开)
144-
145-
git clone https://gitee.com/ZhongBangKeJi/CRMEB.git
146-
147-
精简版Min下载(基础商城框架,适合精简需求的客户,适合二开)
148-
149-
git clone https://gitee.com/ZhongBangKeJi/CRMEB-Min.git
150-
151134
```
152135

153-
## 相关项目
136+
## 推荐项目
154137

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

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

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

165-
CRMEB知识付费系统是基于ThinkPhp5.0+Vue开发的全开源知识付费系统。功能包含直播课堂、付费视频、付费音频、付费阅读、会员系统、课程分销、课程拼团、直播带货、直播打赏、商城系统等。能够快速积学员、学员数据分析、智能转化客户、有效提高销售、吸引流量、网络营销、品牌推广的一款应用,且更适合企业二次开发
166-
167-
form-builder : https://github.com/xaboy/form-builder
168-
169-
tp PHP表单生成器,快速生成现代化的form表单。包含复选框、单选框、输入框、下拉选择框等元素以及,省市区三级联动,时间选择,日期选择,颜色选择,文件/图片上传等功能。
170-
171-
CRMEB Min版商城:https://gitee.com/ZhongBangKeJi/CRMEB-Min
172-
173-
CRMEB Min是一款轻量级、高性能开源电商商城系统,采用TP6+Mysql+Uniapp+iView+Redis等最流行热门技术语言,支持队列、表单生成、长链接、定时任务等,完善的权限管理、会员管理、产品订单管理、CMS管理、支持多端、一键开通短信、产品采集、物流查询等接口。快速简单高效!
174144

175145
## 特别鸣谢
176146

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

189159
## 开源版使用须知
190160

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

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

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

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

178+
![](readme/pic/gitee打通版-横.jpg)
179+
[![](readme/pic/1思维脑图功能清单.jpg)](http://s.crmeb.com/goods_detail/730)
180+
[![](readme/pic/2高清UI设计图.jpg)](http://s.crmeb.com/goods_detail/728)
181+
[![](readme/pic/3前后端接口文档.jpg)](http://s.crmeb.com/goods_detail/729)
182+
[![](readme/pic/4PC端前端模板.jpg)](http://s.crmeb.com/goods_detail/711)
183+
208184
[返回顶部 :fa-arrow-circle-up: ](https://gitee.com/ZhongBangKeJi/CRMEB#%E9%A1%B9%E7%9B%AE%E4%BB%8B%E7%BB%8D)
185+

crmeb/app/adminapi/AdminApiExceptionHandle.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace app\adminapi;
1313

1414

15+
use app\exceptions\CommonException;
1516
use crmeb\exceptions\AdminException;
1617
use crmeb\exceptions\ApiException;
1718
use crmeb\exceptions\AuthException;
@@ -34,6 +35,7 @@ class AdminApiExceptionHandle extends Handle
3435
AuthException::class,
3536
AdminException::class,
3637
ApiException::class,
38+
CommonException::class,
3739
];
3840

3941
/**
@@ -86,7 +88,7 @@ public function render($request, Throwable $e): Response
8688
// 添加自定义异常处理机制
8789
if ($e instanceof DbException) {
8890
return app('json')->fail('数据获取失败', $massageData);
89-
} elseif ($e instanceof AuthException || $e instanceof ValidateException || $e instanceof ApiException) {
91+
} elseif ($e instanceof AuthException || $e instanceof ValidateException || $e instanceof ApiException || $e instanceof CommonException) {
9092
return app('json')->make($e->getCode() ? : 400, $e->getMessage());
9193
} elseif ($e instanceof AdminException) {
9294
return app('json')->fail($e->getMessage(), $massageData);

crmeb/app/adminapi/common.php

Lines changed: 38 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,20 @@ function setconfig($name, $pat, $rep)
4949
$pats[$i] = '/\'' . $pat[$i] . '\'(.*?),/';
5050
$reps[$i] = "'" . $pat[$i] . "'" . "=>" . "'" . $rep[$i] . "',";
5151
}
52-
$fileurl = app()->getConfigPath() . $name.".php";
52+
$fileurl = app()->getConfigPath() . $name . ".php";
5353
$string = file_get_contents($fileurl); //加载配置文件
5454
$string = preg_replace($pats, $reps, $string); // 正则查找然后替换
5555
@file_put_contents($fileurl, $string); // 写入配置文件
5656
return true;
57-
} else if(is_string($pat) && is_string($rep)){
57+
} else if (is_string($pat) && is_string($rep)) {
5858
$pats = '/\'' . $pat . '\'(.*?),/';
59-
if(substr_count($rep,'[')){
60-
$reps = "'" . $pat . "'" . "=>" . $rep . ",";
61-
} else{
62-
$rep = str_replace('\'',"",$rep);
59+
if (substr_count($rep, '[')) {
60+
$reps = "'" . $pat . "'" . "=>" . $rep . ",";
61+
} else {
62+
$rep = str_replace('\'', "", $rep);
6363
$reps = "'" . $pat . "'" . "=>" . "'" . $rep . "',";
6464
}
65-
$fileurl = app()->getConfigPath() . $name.".php";
65+
$fileurl = app()->getConfigPath() . $name . ".php";
6666
$string = file_get_contents($fileurl); //加载配置文件
6767
$string = preg_replace($pats, $reps, $string); // 正则查找然后替换
6868
@file_put_contents($fileurl, $string); // 写入配置文件
@@ -81,26 +81,26 @@ function setconfig($name, $pat, $rep)
8181
*/
8282
function arrayToText($array)
8383
{
84-
$config = print_r($array,true);
85-
$config = str_replace('[',"\"",$config);
86-
$config = str_replace(']',"\"",$config);
84+
$config = print_r($array, true);
85+
$config = str_replace('[', "\"", $config);
86+
$config = str_replace(']', "\"", $config);
8787
$input = explode("\n", $config);
88-
foreach ($input as $k=>$v){
89-
if(empty($v) || strpos($v, 'Array')!==false || strpos($v, '(')!==false || strpos($v, ')')!==false){
88+
foreach ($input as $k => $v) {
89+
if (empty($v) || strpos($v, 'Array') !== false || strpos($v, '(') !== false || strpos($v, ')') !== false) {
9090
continue;
9191
}
9292
$tmpValArr = explode('=>', $v);
93-
if(count($tmpValArr) == 2){
94-
$input[$k] = $tmpValArr[0] . '=> \'' .trim($tmpValArr[1]) . '\',';
93+
if (count($tmpValArr) == 2) {
94+
$input[$k] = $tmpValArr[0] . '=> \'' . trim($tmpValArr[1]) . '\',';
9595
}
9696
}
9797
$config = implode("\n", $input);
98-
$config = str_replace('Array',"",$config);
99-
$config = str_replace('(',"[",$config);
100-
$config = str_replace(')',"],",$config);
101-
$config = rtrim($config,"\n");
102-
$config = rtrim($config,",");
103-
$config = "<?php \n return ".$config.';';
98+
$config = str_replace('Array', "", $config);
99+
$config = str_replace('(', "[", $config);
100+
$config = str_replace(')', "],", $config);
101+
$config = rtrim($config, "\n");
102+
$config = rtrim($config, ",");
103+
$config = "<?php \n return " . $config . ';';
104104
// $fileurl = app()->getConfigPath() ."templates.php";
105105
// @file_put_contents($fileurl, $config); // 写入配置文件
106106
return $config;
@@ -112,47 +112,31 @@ function arrayToText($array)
112112
* @param $arr
113113
* @return array
114114
*/
115-
function attr_format($arr)
115+
function attr_format($arr): array
116116
{
117-
$data = [];
118-
$res = [];
119-
$count = count($arr);
120-
$arr = array_merge($arr);
121-
if ($count > 1) {
122-
for ($i = 0; $i < $count - 1; $i++) {
123-
if ($i == 0) $data = $arr[$i]['detail'];
124-
//替代变量1
125-
$rep1 = $rep4 = [];
126-
foreach ($data as $v) {
127-
foreach ($arr[$i + 1]['detail'] as $g) {
128-
//替代变量2
129-
$rep2 = ($i != 0 ? '' : $arr[$i]['value'] . '_$_') . $v . '-$-' . $arr[$i + 1]['value'] . '_$_' . $g;
130-
$tmp[] = $rep2;
131-
// if ($i == $count - 2) {
132-
foreach (explode('-$-', $rep2) as $k => $h) {
133-
//替代变量3
134-
$rep3 = explode('_$_', $h);
135-
//替代变量4
136-
$rep4['detail'][$rep3[0]] = $rep3[1] ?? '';
117+
$len = count($arr);
118+
$title = array_column($arr, 'value');
119+
$result = [];
120+
121+
if ($len > 0) {
122+
if ($len > 1) {
123+
$result = $arr[0]['detail'];
124+
for ($i = 0; $i < $len - 1; $i++) {
125+
$temp = $result;
126+
$result = [];
127+
foreach ($temp as $item) {
128+
foreach ($arr[$i + 1]['detail'] as $datum) {
129+
$result[] = trim($item) . ',' . trim($datum);
137130
}
138-
if ($count == count($rep4['detail']))
139-
$res[] = $rep4;
140-
// }
141131
}
142132
}
143-
$data = $tmp ?? [];
144-
}
145-
} else {
146-
$dataArr = [];
147-
foreach ($arr as $k => $v) {
148-
foreach ($v['detail'] as $kk => $vv) {
149-
$dataArr[$kk] = $v['value'] . '_' . $vv;
150-
$res[$kk]['detail'][$v['value']] = $vv;
133+
} else {
134+
foreach ($arr[0]['detail'] as $item) {
135+
$result[] = trim($item);
151136
}
152137
}
153-
$data[] = implode('-', $dataArr);
154138
}
155-
return [$data, array_merge(array_unique($res, SORT_REGULAR))];
139+
return [$result, $title];
156140
}
157141
}
158142

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
namespace app\adminapi\controller\v1\setting;
4+
5+
use app\adminapi\controller\AuthController;
6+
use app\services\other\AgreementServices;
7+
use think\facade\App;
8+
9+
class SystemAgreement extends AuthController
10+
{
11+
/**
12+
* 构造方法
13+
* SystemCity constructor.
14+
* @param App $app
15+
* @param AgreementServices $services
16+
*/
17+
public function __construct(App $app, AgreementServices $services)
18+
{
19+
parent::__construct($app);
20+
$this->services = $services;
21+
}
22+
23+
/**
24+
* 获取协议内容
25+
* @param $type
26+
* @return mixed
27+
* @throws \think\db\exception\DataNotFoundException
28+
* @throws \think\db\exception\DbException
29+
* @throws \think\db\exception\ModelNotFoundException
30+
*/
31+
public function getAgreement($type)
32+
{
33+
if (!$type) return app('json')->fail('协议类型不存在');
34+
$info = $this->services->getAgreementBytype($type);
35+
return app('json')->success($info);
36+
}
37+
38+
/**
39+
* 保存协议内容
40+
* @return mixed
41+
*/
42+
public function saveAgreement()
43+
{
44+
$data = $this->request->postMore([
45+
['id', 0],
46+
['type', 0],
47+
['title', ''],
48+
['content', ''],
49+
]);
50+
$data['status'] = 1;
51+
$this->services->saveAgreement($data, $data['id']);
52+
return app('json')->success('保存成功');
53+
}
54+
}

crmeb/app/adminapi/controller/v1/setting/SystemConfig.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -276,14 +276,6 @@ public function save_basics(Request $request)
276276
return app('json')->fail('提现最低金额只能为数字!');
277277
}
278278
}
279-
foreach ($post as $k => $v) {
280-
$config_one = $this->services->getOne(['menu_name' => $k]);
281-
if ($config_one) {
282-
$config_one['value'] = $v;
283-
$this->services->valiDateValue($config_one);
284-
$this->services->update($k, ['value' => json_encode($v)], 'menu_name');
285-
}
286-
}
287279
if (isset($post['wss_open'])) {
288280
$this->services->saveSslFilePath((int)$post['wss_open'], $post['wss_local_pk'] ?? '', $post['wss_local_cert'] ?? '');
289281
}
@@ -314,6 +306,14 @@ public function save_basics(Request $request)
314306
@copy($from, $toHome);
315307
@copy($from, $toPublic);
316308
}
309+
foreach ($post as $k => $v) {
310+
$config_one = $this->services->getOne(['menu_name' => $k]);
311+
if ($config_one) {
312+
$config_one['value'] = $v;
313+
$this->services->valiDateValue($config_one);
314+
$this->services->update($k, ['value' => json_encode($v)], 'menu_name');
315+
}
316+
}
317317
\crmeb\services\CacheService::clear();
318318
return app('json')->success('修改成功');
319319

0 commit comments

Comments
 (0)