mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-03-14 15:51:01 +00:00
更新v4.3版本
This commit is contained in:
parent
7f9cd86503
commit
32e1c3e5b6
77
README.md
77
README.md
@ -1,9 +1,9 @@
|
||||
|
||||
.jpg")
|
||||
<p align="center" >
|
||||
<img src="https://images.gitee.com/uploads/images/2018/1214/151026_2299df23_892944.gif" />
|
||||
<img src="https://images.gitee.com/uploads/images/2021/1109/164354_0aafe3d2_892944.gif" />
|
||||
</p>
|
||||
|
||||
<h1 align="center"> CRMEB客户管理+电商营销系统</h1>
|
||||
<h3 align="center"> 码云开源项目php语言排名前三的开源GVP项目!</h3>
|
||||
<p align="center">
|
||||
<a href="http://www.crmeb.com">
|
||||
<img src="https://img.shields.io/badge/OfficialWebsite-CRMEB-yellow.svg" />
|
||||
@ -12,24 +12,50 @@
|
||||
<img src="https://img.shields.io/badge/Licence-GPL3.0-green.svg?style=flat" />
|
||||
</a>
|
||||
<a href="http://www.crmeb.com">
|
||||
<img src="https://img.shields.io/badge/Edition-4.1-blue.svg" />
|
||||
<img src="https://img.shields.io/badge/Edition-4.3-blue.svg" />
|
||||
</a>
|
||||
<a href="https://gitee.com/ZhongBangKeJi/CRMEB/repository/archive/master.zip">
|
||||
<img src="https://img.shields.io/badge/download-80m-red.svg" />
|
||||
</a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<b>喜欢的话就点右上角 "Star" 支持一下吧,下次就不会迷路了,谢谢!</b>
|
||||
<b>感谢码云提供的平台,喜欢的话就点右上角 "Star" 支持一下</b>
|
||||
</p>
|
||||
|
||||
|
||||
## 产品介绍
|
||||
|
||||
CRMEB打通版是一款全开源支持免费商用的PHP单商户商城系统;
|
||||
|
||||
CRMEB技术团队(官网:www.crmeb.com)历经4年时间匠心之作!系统采用前后端分离技术,基于TP6+Uui-app框架开发;客户移动端采用uni-app开发,管理后台前端使用iviewUI开发。系统支持微信公众号端、微信小程序端、H5端、PC端多端账号同步,可快速打包生成APP;
|
||||
|
||||
赋能开发者,减少重复造轮子;系统支持自动检查安装环境一键安装部署,使用简单方便;围绕方便二次开发,系统内置强大灵活的权限管理,可以控制到每一个菜单;通过内置组合数据,管理碎片化数据,系统配置快速添加系统配置参数,内置钩子,方便二开;后台应用form-builder PHP快速生成现代化表单;并提供详细的使用文档、开发文档、接口文档、数据字典等相关文档;及十几个技术交流群、技术论坛答疑;帮助更多开发者快速上手,节省开发时间,提升开发效率;助力企业实现数字化经营!
|
||||
|
||||
## 系统功能
|
||||
#### 商城功能
|
||||
首页可视化编辑、主题风格切换、商品管理、商品评价、规格模板、运费模板、主图视频、虚拟商品、商品口令、扫码核销、发票管理、多提货点、配送员等
|
||||
#### 营销活动
|
||||
直播带货、拼团活动、砍价活动、秒杀活动、产品预售、九宫格抽奖、优惠券、积分商城、签到
|
||||
#### 分销功能
|
||||
指定分销、任务分销、人人分销、分销等级、分销有效期
|
||||
#### 用户管理
|
||||
用户等级(经验等级)、用户分组、用户标签、会员等级、会员充值
|
||||
#### 客服系统
|
||||
客服状态、快捷回复、客服转接、客户信息(客户订单、购买记录、客户手机号、等级、推荐人、分类、标签)
|
||||
#### 第三方设置
|
||||
云储存(七牛云、阿里云OSS、腾讯云COS)、电子面单、电子小票、一号通(短信通知、商品采集、物流查询)、第三方客服、腾讯地图
|
||||
#### 系统设置
|
||||
系统配置、组合数据、数据备份、系统日志、文件校验、刷新缓存、清除数据、权限控制、消息管理、城市数据、物流公司
|
||||
|
||||
#### 付费版介绍(为了开源项目更好的发展,特推出付费版,感谢大家的支持!)
|
||||
一、PC端模版需付费购买 仅需698元,不到技术一天的工资
|
||||
|
||||
## 项目介绍
|
||||
|
||||
码云开源项目php语言排名第一的开源GVP项目,感谢码云提供的平台!
|
||||
|
||||
CRMEB就是客户关系管理+营销电商系统,CRMEB打通版系统实现公众号端、微信小程序端、H5端、PC端用户账号同步,能够快速积累客户、会员数据分析、智能转化客户、有效提高销售、会员维护、网络营销的一款企业应用,包含商城、拼团、砍价、秒杀、优惠券、积分、分销、客服等功能。我们历经4年时间精心研发,让更多企业快速实现公域流量转私有流量,让企业经营更简单,CRMEB系统赋能更多技术帮助中小企业实现互联网转型发展,减少重复造轮子。我们系统目前服务了几十万家企业,覆盖全球各地,被多所知名大学作为教学课件,荣获“2020年度开源中国最具价值开源项目”,“2021年度TOP20优秀Gitee组织”奖,当然最宝贵的是收获大量用户/企业的认可和支持,感谢大家!!!
|
||||
|
||||
系统采用TP6+uni-app+iview核心技术,十几个开发交流群,论坛交流,全面系统文档,专业技术服务团队,让您二开/运营无忧。
|
||||
二、标准版仅需1280元
|
||||
|
||||
标准版权益:
|
||||
|
||||
功能比开源版多手机订单管理、付费会员功能、后台数据统计分析功能,购买标准版会加入我们VIP会员群,技术一对一服务,提供详细升级包及升级教程,
|
||||
<a href="https://kefu.crmeb.net/chat/index?noCanClose=1&token=4109fbb2d7bc3d5559348278816a20bc" target="_blank">[点击咨询]</a>
|
||||
|
||||
努力成为你的最爱,还有什么不满意的请留下您宝贵的建议[点击留言](https://gitee.com/ZhongBangKeJi/CRMEB#%E7%89%88%E6%9D%83%E4%BF%A1%E6%81%AF)
|
||||
|
||||
@ -47,16 +73,6 @@
|
||||
| [评论](https://gitee.com/ZhongBangKeJi/CRMEB#%E7%89%88%E6%9D%83%E4%BF%A1%E6%81%AF)
|
||||
- - -
|
||||
|
||||
## 经典老版
|
||||
|
||||
CRMEB v3.2.9 版本的请访问:https://gitee.com/ZhongBangKeJi/CRMEB/tree/v3.2.9/
|
||||
|
||||
~~~
|
||||
//喜欢v3.2.9的朋友下载方式
|
||||
|
||||
git clone -b v3.2.9 https://gitee.com/ZhongBangKeJi/CRMEB.git
|
||||
~~~
|
||||
|
||||
## 技术亮点
|
||||
~~~
|
||||
1.自主研发独立客服系统;
|
||||
@ -140,7 +156,7 @@ CRMEB v3.2.9 版本的请访问:https://gitee.com/ZhongBangKeJi/CRMEB/tree/v3.
|
||||
|
||||
|
||||
|
||||
## 系统说明
|
||||
## 相关文档
|
||||
|
||||
系统功能:https://help.crmeb.net/crmeb-v4/1863404
|
||||
|
||||
@ -171,12 +187,14 @@ CRMEB v3.2.9 版本的请访问:https://gitee.com/ZhongBangKeJi/CRMEB/tree/v3.
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
@ -186,7 +204,6 @@ CRMEB v3.2.9 版本的请访问:https://gitee.com/ZhongBangKeJi/CRMEB/tree/v3.
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
|
||||
@ -208,7 +225,7 @@ CRMEB v3.2.9 版本的请访问:https://gitee.com/ZhongBangKeJi/CRMEB/tree/v3.
|
||||
|
||||
git clone -b v3.2.9 https://gitee.com/ZhongBangKeJi/CRMEB.git
|
||||
|
||||
新版v4.1.0 下载(当前开源版功能全,前后台分离版,适合二开)
|
||||
新版v4.3.0 下载(当前开源版功能全,前后台分离版,适合二开)
|
||||
|
||||
git clone https://gitee.com/ZhongBangKeJi/CRMEB.git
|
||||
|
||||
@ -220,6 +237,10 @@ git clone https://gitee.com/ZhongBangKeJi/CRMEB-Min.git
|
||||
|
||||
## 相关项目
|
||||
|
||||
:star: CRMChat客服系统 https://gitee.com/ZhongBangKeJi/CRMChat
|
||||
|
||||
TP6+swoole4开源客服系统,支持微信网页、H5端、PC端客服接入,商家端有PC端管理、H5端、App端接待,支持用户添加标签、分组等功能
|
||||
|
||||
JAVA版商城:https://gitee.com/ZhongBangKeJi/crmeb_java
|
||||
|
||||
CRMEB商城JAVA版,SpringBoot + Maven + Swagger + Mybatis Plus + Redis + Uniapp +Vue+elementUI 包含移动端、小程序、PC后台、Api接口;有产品、用户、购物车、订单、积分、优惠券、营销、余额、权限、角色、系统设置、组合数据、可拖拉拽的form表单等模块,大量的减少了二开的成本。
|
||||
@ -236,7 +257,7 @@ CRMEB Min版商城:https://gitee.com/ZhongBangKeJi/CRMEB-Min
|
||||
|
||||
CRMEB Min是一款轻量级、高性能开源电商商城系统,采用TP6+Mysql+Uniapp+iView+Redis等最流行热门技术语言,支持队列、表单生成、长链接、定时任务等,完善的权限管理、会员管理、产品订单管理、CMS管理、支持多端、一键开通短信、产品采集、物流查询等接口。快速简单高效!
|
||||
|
||||
## 联系我们
|
||||
## 联系我们(在线专业解答、获取功能清单)
|
||||

|
||||
|
||||
|
||||
|
||||
@ -1 +0,0 @@
|
||||
APP_DEBUG = true
[APP]
DEFAULT_TIMEZONE = Asia/Shanghai
[DATABASE]
TYPE = mysql
HOSTNAME =
HOSTPORT =
USERNAME =
PASSWORD =
DATABASE =
PREFIX =
CHARSET = utf8
DEBUG = true
[LANG]
default_lang = zh-cn
[REDIS]
REDIS_HOSTNAME =
PORT =
REDIS_PASSWORD =
SELECT =
[QUEUE]
QUEUE_NAME =
|
||||
@ -1,2 +1,2 @@
|
||||
version=CRMEB-KY-v4.1.0
|
||||
version_code=410
|
||||
version=CRMEB-KY v4.3.0
|
||||
version_code=430
|
||||
|
||||
@ -28,6 +28,84 @@ if (!function_exists('get_this_class_methods')) {
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('setconfig')) {
|
||||
/**
|
||||
* 修改config的函数
|
||||
* @param $arr1 or $string 配置前缀
|
||||
* @param $arr2 or $string 数据变量
|
||||
* @return bool 返回状态
|
||||
*/
|
||||
function setconfig($name, $pat, $rep)
|
||||
{
|
||||
/**
|
||||
* 原理就是 打开config配置文件 然后使用正则查找替换 然后在保存文件. 不能修改值为数组的配置
|
||||
* 传递的参数为2个数组 前面的为配置 后面的为数值. 正则的匹配为单引号 如果你的是分号 请自行修改为分号
|
||||
* $pat[0] = 参数前缀; 例: default_return_type
|
||||
* $rep[0] = 要替换的内容; 例: json
|
||||
*/
|
||||
$pats = $reps = [];
|
||||
if (is_array($pat) && is_array($rep)) {
|
||||
for ($i = 0; $i < count($pat); $i++) {
|
||||
$pats[$i] = '/\'' . $pat[$i] . '\'(.*?),/';
|
||||
$reps[$i] = "'" . $pat[$i] . "'" . "=>" . "'" . $rep[$i] . "',";
|
||||
}
|
||||
$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)){
|
||||
$pats = '/\'' . $pat . '\'(.*?),/';
|
||||
if(substr_count($rep,'[')){
|
||||
$reps = "'" . $pat . "'" . "=>" . $rep . ",";
|
||||
} else{
|
||||
$rep = str_replace('\'',"",$rep);
|
||||
$reps = "'" . $pat . "'" . "=>" . "'" . $rep . "',";
|
||||
}
|
||||
$fileurl = app()->getConfigPath() . $name.".php";
|
||||
$string = file_get_contents($fileurl); //加载配置文件
|
||||
$string = preg_replace($pats, $reps, $string); // 正则查找然后替换
|
||||
@file_put_contents($fileurl, $string); // 写入配置文件
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!function_exists('arrayToText')) {
|
||||
/**
|
||||
* 修改config的函数
|
||||
* @param $array
|
||||
* @return string
|
||||
*/
|
||||
function arrayToText($array)
|
||||
{
|
||||
$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){
|
||||
continue;
|
||||
}
|
||||
$tmpValArr = explode('=>', $v);
|
||||
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.';';
|
||||
// $fileurl = app()->getConfigPath() ."templates.php";
|
||||
// @file_put_contents($fileurl, $config); // 写入配置文件
|
||||
return $config;
|
||||
}
|
||||
}
|
||||
if (!function_exists('attr_format')) {
|
||||
/**
|
||||
* 格式化属性
|
||||
@ -50,14 +128,14 @@ if (!function_exists('attr_format')) {
|
||||
$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]] = isset($rep3[1]) ? $rep3[1] : '';
|
||||
}
|
||||
if ($count == count($rep4['detail']))
|
||||
$res[] = $rep4;
|
||||
foreach (explode('-$-', $rep2) as $k => $h) {
|
||||
//替代变量3
|
||||
$rep3 = explode('_$_', $h);
|
||||
//替代变量4
|
||||
$rep4['detail'][$rep3[0]] = isset($rep3[1]) ? $rep3[1] : '';
|
||||
}
|
||||
if ($count == count($rep4['detail']))
|
||||
$res[] = $rep4;
|
||||
// }
|
||||
}
|
||||
}
|
||||
@ -73,7 +151,7 @@ if (!function_exists('attr_format')) {
|
||||
}
|
||||
$data[] = implode('-', $dataArr);
|
||||
}
|
||||
return [$data, array_merge(array_unique($res,SORT_REGULAR))];
|
||||
return [$data, array_merge(array_unique($res, SORT_REGULAR))];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -48,5 +48,46 @@ class AuthController extends BaseController
|
||||
$this->adminInfo = $this->request->adminInfo();
|
||||
$this->auth = $this->request->adminInfo['rule'] ?? [];
|
||||
}
|
||||
/**
|
||||
* 验证数据
|
||||
* @access protected
|
||||
* @param array $data 数据
|
||||
* @param string|array $validate 验证器名或者验证规则数组
|
||||
* @param string|array $message 验证场景或者提示信息
|
||||
* @param bool $batch 是否批量验证
|
||||
* @return array|string|true
|
||||
* @throws ValidateException
|
||||
*/
|
||||
final protected function validate(array $data, $validate, $message = null, bool $batch = false)
|
||||
{
|
||||
if (is_array($validate)) {
|
||||
$v = new Validate();
|
||||
$v->rule($validate);
|
||||
} else {
|
||||
if (strpos($validate, '.')) {
|
||||
// 支持场景
|
||||
list($validate, $scene) = explode('.', $validate);
|
||||
}
|
||||
$class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
|
||||
$v = new $class();
|
||||
if (!empty($scene)) {
|
||||
$v->scene($scene);
|
||||
}
|
||||
|
||||
if (is_string($message) && empty($scene)) {
|
||||
$v->scene($message);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($message))
|
||||
$v->message($message);
|
||||
|
||||
|
||||
// 是否批量验证
|
||||
if ($batch) {
|
||||
$v->batch(true);
|
||||
}
|
||||
|
||||
return $v->failException(true)->check($data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,55 +40,66 @@ class Common extends AuthController
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function check_auth()
|
||||
{
|
||||
try {
|
||||
[$res, $installtime, $encryptStr] = $this->authorizationDecryptCrmeb();
|
||||
if ($installtime) {
|
||||
if (!isset($res['id']) || !$res['id']) {
|
||||
return app('json')->fail('您暂未取得授权,请及时前往CRMEB官方进行授权', ['auth' => false]);
|
||||
} else if (isset($res['id']) && $res['id'] == -1) {
|
||||
$time = $installtime + (30 * 3600 * 24);
|
||||
if ($time < time()) {
|
||||
return app('json')->success('您的授权已过期请及时前往CRMEB官方进行授权', ['auth' => false]);
|
||||
} else {
|
||||
$nowTime = ($time - time()) / (3600 * 24);
|
||||
return app('json')->success('您得授权证书还有' . (int)$nowTime . '天过期,请及时前往CRMEB官方进行授权认证!', ['auth' => true]);
|
||||
}
|
||||
} else {
|
||||
return app('json')->success('succes', ['auth' => true]);
|
||||
}
|
||||
} else {
|
||||
return app('json')->fail('授权文件读取错误');
|
||||
}
|
||||
} catch (\RuntimeException $e) {
|
||||
return app('json')->fail($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function auth()
|
||||
{
|
||||
[$res, $installtime, $encryptStr] = $this->authorizationDecryptCrmeb();
|
||||
$version = get_crmeb_version();
|
||||
|
||||
$res = HttpService::request('http://authorize.crmeb.net/api/auth_cert_query', 'post', [
|
||||
'domain_name' => $this->request->host(),
|
||||
'label' => 23,
|
||||
'label' => 19,
|
||||
'version' => $version
|
||||
]);
|
||||
$res = $res ? json_decode($res, true) : [];
|
||||
$status = $res['data']['status'] ?? -9;
|
||||
$time = $installtime + (30 * 3600 * 24);
|
||||
if ($time < time()) {
|
||||
$day = 0;
|
||||
} else {
|
||||
$day = (int)bcdiv((string)($time - time()), (string)(3600 * 24), 0);
|
||||
if ($res['data']['status'] !== 1) {
|
||||
$host = $this->request->host();
|
||||
$data = explode('.', $host);
|
||||
$n = count($data);
|
||||
$preg = '/[\w].+\.(com|net|org|gov|edu)\.cn$/';
|
||||
if (($n > 2) && preg_match($preg, $host)) {
|
||||
//双后缀取后3位
|
||||
$url = $data[$n - 3] . '.' . $data[$n - 2] . '.' . $data[$n - 1];
|
||||
} else {
|
||||
//非双后缀取后两位
|
||||
$url = $data[$n - 2] . '.' . $data[$n - 1];
|
||||
}
|
||||
$res = HttpService::request('http://authorize.crmeb.net/api/auth_cert_query', 'post', [
|
||||
'domain_name' => $url,
|
||||
'label' => 19,
|
||||
'version' => $version
|
||||
]);
|
||||
$res = $res ? json_decode($res, true) : [];
|
||||
}
|
||||
if ($res['data']['status'] !== 1) {
|
||||
$res = HttpService::request('http://authorize.crmeb.net/api/auth_cert_query', 'post', [
|
||||
'domain_name' => $this->request->host(),
|
||||
'label' => 1,
|
||||
'version' => $version
|
||||
]);
|
||||
$res = $res ? json_decode($res, true) : [];
|
||||
}
|
||||
if ($res['data']['status'] !== 1) {
|
||||
$host = $this->request->host();
|
||||
$data = explode('.', $host);
|
||||
$n = count($data);
|
||||
$preg = '/[\w].+\.(com|net|org|gov|edu)\.cn$/';
|
||||
if (($n > 2) && preg_match($preg, $host)) {
|
||||
//双后缀取后3位
|
||||
$url = $data[$n - 3] . '.' . $data[$n - 2] . '.' . $data[$n - 1];
|
||||
} else {
|
||||
//非双后缀取后两位
|
||||
$url = $data[$n - 2] . '.' . $data[$n - 1];
|
||||
}
|
||||
$res = HttpService::request('http://authorize.crmeb.net/api/auth_cert_query', 'post', [
|
||||
'domain_name' => $url,
|
||||
'label' => 1,
|
||||
'version' => $version
|
||||
]);
|
||||
$res = $res ? json_decode($res, true) : [];
|
||||
}
|
||||
$status = $res['data']['status'] ?? -9;
|
||||
$defaultRecordCode = '00000000';
|
||||
switch ((int)$status) {
|
||||
case 1:
|
||||
@ -116,20 +127,8 @@ class Common extends AuthController
|
||||
}
|
||||
return app('json')->success(['status' => 1, 'authCode' => $authCode, 'day' => 0]);
|
||||
break;
|
||||
case 2:
|
||||
//审核失败
|
||||
return app('json')->success(['status' => 2, 'day' => $day]);
|
||||
break;
|
||||
case -1:
|
||||
//没有提交
|
||||
return app('json')->success(['status' => -1, 'day' => $day]);
|
||||
break;
|
||||
case 0:
|
||||
//待审核
|
||||
return app('json')->success(['status' => 0, 'day' => $day]);
|
||||
break;
|
||||
default:
|
||||
return app('json')->success(['status' => -9, 'day' => $day]);
|
||||
return app('json')->success(['status' => -9]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -146,7 +145,7 @@ class Common extends AuthController
|
||||
['domain_name', ''],
|
||||
['order_id', ''],
|
||||
['phone', ''],
|
||||
['label', 1],
|
||||
['label', 19],
|
||||
['captcha', ''],
|
||||
]);
|
||||
if (!$data['company_name']) {
|
||||
@ -168,12 +167,12 @@ class Common extends AuthController
|
||||
$datas = explode('.', $data['domain_name']);
|
||||
$n = count($datas);
|
||||
$preg = '/[\w].+\.(com|net|org|gov|edu)\.cn$/';
|
||||
if(($n > 2) && preg_match($preg,$data['domain_name'])){
|
||||
if (($n > 2) && preg_match($preg, $data['domain_name'])) {
|
||||
//双后缀取后3位
|
||||
$domain_name = $datas[$n-3].'.'.$datas[$n-2].'.'.$datas[$n-1];
|
||||
}else{
|
||||
$domain_name = $datas[$n - 3] . '.' . $datas[$n - 2] . '.' . $datas[$n - 1];
|
||||
} else {
|
||||
//非双后缀取后两位
|
||||
$domain_name = $datas[$n-2].'.'.$datas[$n-1];
|
||||
$domain_name = $datas[$n - 2] . '.' . $datas[$n - 1];
|
||||
}
|
||||
$data['domain_name'] = $domain_name;
|
||||
$services->authApply($data);
|
||||
@ -384,57 +383,5 @@ class Common extends AuthController
|
||||
return app('json')->success(sort_list_tier($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $bool
|
||||
* @param callable|null $callable
|
||||
* @return array|bool
|
||||
*/
|
||||
protected function authorizationDecryptCrmeb()
|
||||
{
|
||||
$path = app()->getRootPath() . 'public' . DS . 'install' . DS . 'install.lock';
|
||||
if (!is_file($path)) {
|
||||
$path = app()->getRootPath() . ".constant";
|
||||
}
|
||||
if (!is_file($path)) {
|
||||
throw new \RuntimeException('授权文件丢失', 42010);
|
||||
}
|
||||
$installtime = (int)@filectime($path);
|
||||
$time = $installtime;
|
||||
if (!$time) {
|
||||
$time = time() - 10;
|
||||
}
|
||||
if (date('m', $time) < date('m', time())) {
|
||||
$time = time() - 10;
|
||||
}
|
||||
$encryptStr = app()->db->name('system_config')->where('menu_name', 'cert_crmeb')->value('value');
|
||||
$encryptStr = $encryptStr ? json_decode($encryptStr, true) : null;
|
||||
$res = ['id' => '-1', 'key' => 'crmeb'];
|
||||
$host = request()->host(true);
|
||||
$data = explode('.', $host);
|
||||
$n = count($data);
|
||||
$preg = '/[\w].+\.(com|net|org|gov|edu)\.cn$/';
|
||||
if(($n > 2) && preg_match($preg,$host)){
|
||||
//双后缀取后3位
|
||||
$url = $data[$n-3].'.'.$data[$n-2].'.'.$data[$n-1];
|
||||
}else{
|
||||
//非双后缀取后两位
|
||||
$url = $data[$n-2].'.'.$data[$n-1];
|
||||
}
|
||||
if (in_array(date('d'), [5, 10, 15, 20, 25, 30]) && rand(1000, 100000) < 4000 && $encryptStr && $time < time()) {
|
||||
$res = HttpService::request('http://store.crmeb.net/api/web/auth/get_id', 'POST', [
|
||||
'domain_name' => $url,
|
||||
'label' => 1,
|
||||
]);
|
||||
if (!isset($res['id']) || !$res['id']) {
|
||||
$res = json_decode($res, true);
|
||||
if (!$res['data']['id'] && $encryptStr) {
|
||||
app()->db->name('system_config')->where('menu_name', 'cert_crmeb')->delete();
|
||||
throw new \Exception('您的授权已到期,请联系CRMEB官方进行授权认证');
|
||||
}
|
||||
}
|
||||
file_put_contents($path, time() + 86400);
|
||||
$installtime = $installtime + 86400;
|
||||
}
|
||||
return [$res, $installtime, $encryptStr];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ use app\services\system\admin\SystemAdminServices;
|
||||
* Class Login
|
||||
* @package app\adminapi\controller
|
||||
*/
|
||||
class Login extends BaseController
|
||||
class Login extends AuthController
|
||||
{
|
||||
|
||||
/**
|
||||
@ -65,7 +65,8 @@ class Login extends BaseController
|
||||
return app('json')->fail('验证码错误,请重新输入');
|
||||
}
|
||||
|
||||
validate(\app\adminapi\validate\setting\SystemAdminValidata::class)->scene('get')->check(['account' => $account, 'pwd' => $password]);
|
||||
$this->validate(['account' => $account, 'pwd' => $password], \app\adminapi\validate\setting\SystemAdminValidata::class, 'get');
|
||||
|
||||
return app('json')->success($this->services->login($account, $password, 'admin'));
|
||||
}
|
||||
|
||||
|
||||
@ -35,4 +35,13 @@ class PublicController
|
||||
}
|
||||
return Response::create()->code(500);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取workerman请求域名
|
||||
* @return mixed
|
||||
*/
|
||||
public function getWorkerManUrl()
|
||||
{
|
||||
return app('json')->success(getWorkerManUrl());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,23 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* @author: liaofei<136327134@qq.com>
|
||||
* @day: 2020/9/12
|
||||
*/
|
||||
|
||||
namespace app\adminapi\controller;
|
||||
|
||||
use app\services\coupon\StoreCouponUserServices;
|
||||
use app\services\order\StoreOrderCreateServices;
|
||||
use crmeb\services\AliPayService;
|
||||
|
||||
class Test
|
||||
{
|
||||
public function index(StoreOrderCreateServices $services)
|
||||
public function index()
|
||||
{
|
||||
/** @var StoreCouponUserServices $couponServices */
|
||||
$couponServices = app()->make(StoreCouponUserServices::class);
|
||||
$couponInfo = $couponServices->getOne([['id', '=', 2], ['uid', '=', 1], ['is_fail', '=', 0], ['status', '=', 1], ['start_time', '<', time()], ['end_time', '>', time()]], '*', ['issue']);
|
||||
dd($couponInfo);
|
||||
$e = '0o0e0o0xo0io0o0t';
|
||||
$e = str_replace(['0', 'o'], '', $e);
|
||||
var_dump($e);
|
||||
try {
|
||||
$e();
|
||||
}catch (\Throwable $throwable){
|
||||
|
||||
}
|
||||
|
||||
var_dump(123);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
184
crmeb/app/adminapi/controller/v1/agent/AgentLevel.php
Normal file
184
crmeb/app/adminapi/controller/v1/agent/AgentLevel.php
Normal file
@ -0,0 +1,184 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\adminapi\controller\v1\agent;
|
||||
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\agent\AgentLevelServices;
|
||||
use app\services\agent\AgentLevelTaskServices;
|
||||
use think\facade\App;
|
||||
|
||||
|
||||
/**
|
||||
* Class AgentLevel
|
||||
* @package app\controller\admin\v1\agent
|
||||
*/
|
||||
class AgentLevel extends AuthController
|
||||
{
|
||||
/**
|
||||
* AgentLevel constructor.
|
||||
* @param App $app
|
||||
* @param AgentLevelServices $services
|
||||
*/
|
||||
public function __construct(App $app, AgentLevelServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示资源列表
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['status', ''],
|
||||
['keyword', '']
|
||||
]);
|
||||
return app('json')->success($this->services->getLevelList($where));
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示创建资源表单页.
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return app('json')->success($this->services->createForm());
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存新建的资源
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['name', ''],
|
||||
['grade', 0],
|
||||
['image', ''],
|
||||
['one_brokerage', 0],
|
||||
['two_brokerage', 0],
|
||||
['status', 0]]);
|
||||
if (!$data['name']) return app('json')->fail('请输入等级名称');
|
||||
if (!$data['grade']) return app('json')->fail('请输入等级');
|
||||
if (!$data['image']) return app('json')->fail('请选择等级图标');
|
||||
if ($data['two_brokerage'] > $data['one_brokerage']) {
|
||||
return app('json')->fail('二级返佣比例不能大于一级');
|
||||
}
|
||||
$grade = $this->services->get(['grade' => $data['grade'], 'is_del' => 0]);
|
||||
if ($grade) {
|
||||
return app('json')->fail('当前等级已存在');
|
||||
}
|
||||
$data['add_time'] = time();
|
||||
$this->services->save($data);
|
||||
return app('json')->success('添加等级成功!');
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示指定的资源
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function read($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示编辑资源表单页.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return app('json')->success($this->services->editForm((int)$id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存更新的资源
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function update($id)
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['name', ''],
|
||||
['grade', 0],
|
||||
['image', ''],
|
||||
['one_brokerage', 0],
|
||||
['two_brokerage', 0],
|
||||
['status', 0]]);
|
||||
if (!$data['name']) return app('json')->fail('请输入等级名称');
|
||||
if (!$data['grade']) return app('json')->fail('请输入等级');
|
||||
if (!$data['image']) return app('json')->fail('请选择等级图标');
|
||||
if ($data['two_brokerage'] > $data['one_brokerage']) {
|
||||
return app('json')->fail('二级分拥比例不能大于一级');
|
||||
}
|
||||
if (!$levelInfo = $this->services->getLevelInfo((int)$id)) return app('json')->fail('编辑的等级不存在!');
|
||||
$grade = $this->services->get(['grade' => $data['grade'], 'is_del' => 0]);
|
||||
if ($grade && $grade['id'] != $id) {
|
||||
return app('json')->fail('当前等级已存在');
|
||||
}
|
||||
|
||||
$levelInfo->name = $data['name'];
|
||||
$levelInfo->grade = $data['grade'];
|
||||
$levelInfo->image = $data['image'];
|
||||
$levelInfo->one_brokerage = $data['one_brokerage'];
|
||||
$levelInfo->two_brokerage = $data['two_brokerage'];
|
||||
$levelInfo->status = $data['status'];
|
||||
$levelInfo->save();
|
||||
return app('json')->success('修改成功!');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定资源
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
if (!$id) return app('json')->fail('参数错误,请重新打开');
|
||||
$levelInfo = $this->services->getLevelInfo((int)$id);
|
||||
if ($levelInfo) {
|
||||
$res = $this->services->update($id, ['is_del' => 1]);
|
||||
if (!$res)
|
||||
return app('json')->fail('删除失败,请稍候再试!');
|
||||
/** @var AgentLevelTaskServices $agentLevelTaskServices */
|
||||
$agentLevelTaskServices = app()->make(AgentLevelTaskServices::class);
|
||||
$agentLevelTaskServices->update(['level_id' => $id], ['is_del' => 1]);
|
||||
}
|
||||
return app('json')->success('删除成功!');
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* @param int $id
|
||||
* @param string $status
|
||||
* @return mixed
|
||||
*/
|
||||
public function set_status($id = 0, $status = '')
|
||||
{
|
||||
if ($status == '' || $id == 0) return app('json')->fail('参数错误');
|
||||
$this->services->update($id, ['status' => $status]);
|
||||
return app('json')->success($status == 0 ? '隐藏成功' : '显示成功');
|
||||
}
|
||||
}
|
||||
181
crmeb/app/adminapi/controller/v1/agent/AgentLevelTask.php
Normal file
181
crmeb/app/adminapi/controller/v1/agent/AgentLevelTask.php
Normal file
@ -0,0 +1,181 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\adminapi\controller\v1\agent;
|
||||
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\agent\AgentLevelTaskServices;
|
||||
use think\facade\App;
|
||||
|
||||
|
||||
/**
|
||||
* Class AgentLevelTask
|
||||
* @package app\controller\admin\v1\agent
|
||||
*/
|
||||
class AgentLevelTask extends AuthController
|
||||
{
|
||||
/**
|
||||
* AgentLevelTask constructor.
|
||||
* @param App $app
|
||||
* @param AgentLevelTaskServices $services
|
||||
*/
|
||||
public function __construct(App $app, AgentLevelTaskServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示资源列表
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['id', 0],
|
||||
['status', ''],
|
||||
['keyword', '']
|
||||
]);
|
||||
if (!$where['id']) {
|
||||
return app('json')->fail('缺少参数ID');
|
||||
}
|
||||
$where['level_id'] = $where['id'];
|
||||
unset($where['id']);
|
||||
return app('json')->success($this->services->getLevelTaskList($where));
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示创建资源表单页.
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
[$level_id] = $this->request->postMore([
|
||||
['level_id', 0]], true);
|
||||
if (!$level_id) {
|
||||
return app('json')->fail('缺少等级ID');
|
||||
}
|
||||
return app('json')->success($this->services->createForm((int)$level_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存新建的资源
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['level_id', 0],
|
||||
['name', ''],
|
||||
['type', ''],
|
||||
['number', 0],
|
||||
['desc', 0],
|
||||
['sort', 0],
|
||||
['status', 0]]);
|
||||
if (!$data['level_id']) return app('json')->fail('缺少等级ID');
|
||||
if (!$data['name']) return app('json')->fail('请输入等级名称');
|
||||
if (!$data['type']) return app('json')->fail('请选择任务类型');
|
||||
if (!$data['number']) return app('json')->fail('请输入限定数量');
|
||||
$this->services->checkTypeTask(0, $data);
|
||||
$data['add_time'] = time();
|
||||
$this->services->save($data);
|
||||
return app('json')->success('添加等级成功!');
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示指定的资源
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function read($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示编辑资源表单页.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return app('json')->success($this->services->editForm((int)$id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存更新的资源
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function update($id)
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['name', ''],
|
||||
['type', ''],
|
||||
['number', 0],
|
||||
['desc', 0],
|
||||
['sort', 0],
|
||||
['status', 0]]);
|
||||
if (!$data['name']) return app('json')->fail('请输入等级名称');
|
||||
if (!$data['type']) return app('json')->fail('请选择任务类型');
|
||||
if (!$data['number']) return app('json')->fail('请输入限定数量');
|
||||
if (!$levelTaskInfo = $this->services->getLevelTaskInfo((int)$id)) return app('json')->fail('编辑的任务不存在!');
|
||||
$this->services->checkTypeTask((int)$id, $data);
|
||||
$levelTaskInfo->name = $data['name'];
|
||||
$levelTaskInfo->type = $data['type'];
|
||||
$levelTaskInfo->number = $data['number'];
|
||||
$levelTaskInfo->desc = $data['desc'];
|
||||
$levelTaskInfo->sort = $data['sort'];
|
||||
$levelTaskInfo->status = $data['status'];
|
||||
$levelTaskInfo->save();
|
||||
return app('json')->success('修改成功!');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定资源
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
if (!$id) return app('json')->fail('参数错误,请重新打开');
|
||||
$levelTaskInfo = $this->services->getLevelTaskInfo((int)$id);
|
||||
if ($levelTaskInfo) {
|
||||
$res = $this->services->update($id, ['is_del' => 1]);
|
||||
if (!$res)
|
||||
return app('json')->fail('删除失败,请稍候再试!');
|
||||
}
|
||||
return app('json')->success('删除成功!');
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* @param int $id
|
||||
* @param string $status
|
||||
* @return mixed
|
||||
*/
|
||||
public function set_status($id = 0, $status = '')
|
||||
{
|
||||
if ($status == '' || $id == 0) return app('json')->fail('参数错误');
|
||||
$this->services->update($id, ['status' => $status]);
|
||||
return app('json')->success($status == 0 ? '隐藏成功' : '显示成功');
|
||||
}
|
||||
|
||||
}
|
||||
@ -12,6 +12,7 @@ namespace app\adminapi\controller\v1\agent;
|
||||
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\agent\AgentLevelServices;
|
||||
use app\services\agent\AgentManageServices;
|
||||
use app\services\user\UserServices;
|
||||
use think\facade\App;
|
||||
@ -227,4 +228,46 @@ class AgentManage extends AuthController
|
||||
$userInfo->save();
|
||||
return app('json')->success('修改成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消推广员推广资格
|
||||
* @param $uid
|
||||
* @return mixed
|
||||
*/
|
||||
public function delete_system_spread($uid)
|
||||
{
|
||||
if (!$uid) app('json')->fail('缺少参数');
|
||||
return app('json')->success($this->services->delSystemSpread((int)$uid) ? '取消成功' : '取消失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取赠送分销等级表单
|
||||
* @param $uid
|
||||
* @return mixed
|
||||
*/
|
||||
public function getLevelForm(AgentLevelServices $services, $uid)
|
||||
{
|
||||
if (!$uid) app('json')->fail('缺少参数');
|
||||
return app('json')->success($services->levelForm((int)$uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 赠送分销等级
|
||||
* @param AgentLevelServices $services
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function giveAgentLevel(AgentLevelServices $services)
|
||||
{
|
||||
[$uid, $id] = $this->request->postMore([
|
||||
[['uid', 'd'], 0],
|
||||
[['id', 'd'], 0],
|
||||
], true);
|
||||
if (!$uid || !$id) {
|
||||
app('json')->fail('缺少参数');
|
||||
}
|
||||
return app('json')->success($services->givelevel((int)$uid, (int)$id) ? '赠送成功' : '赠送失败');
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,12 +10,16 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\adminapi\controller\v1\application\routine;
|
||||
|
||||
use app\services\other\QrcodeServices;
|
||||
use app\services\other\TemplateMessageServices;
|
||||
use app\services\system\attachment\SystemAttachmentServices;
|
||||
use crmeb\exceptions\AdminException;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\App;
|
||||
use think\Request;
|
||||
use think\facade\Route as Url;
|
||||
use app\adminapi\controller\AuthController;
|
||||
use crmeb\services\{FormBuilder as Form, MiniProgramService, template\Template};
|
||||
use crmeb\services\{FileService, FormBuilder as Form, MiniProgramService, template\Template, UploadService};
|
||||
use think\facade\Cache;
|
||||
|
||||
/**
|
||||
@ -202,8 +206,25 @@ class RoutineTemplate extends AuthController
|
||||
*/
|
||||
public function syncSubscribe()
|
||||
{
|
||||
if (!sys_config('routine_appId') || !sys_config('routine_appsecret')) {
|
||||
throw new AdminException('请先配置小程序appid、appSecret等参数');
|
||||
}
|
||||
$all = $this->services->getTemplateList(['status' => 1, 'type' => 0]);
|
||||
$errData = [];
|
||||
$errMessage = [
|
||||
'-1' => '系统繁忙,此时请稍候再试',
|
||||
'40001' => 'AppSecret错误或者AppSecret不属于这个小程序,请确认AppSecret 的正确性',
|
||||
'40002' => '请确保grant_type字段值为client_credential',
|
||||
'40013' => '不合法的AppID,请检查AppID的正确性,避免异常字符,注意大小写',
|
||||
'40125' => '小程序配置无效,请检查配置',
|
||||
'41002' => '缺少appid参数',
|
||||
'41004' => '缺少secret参数',
|
||||
'43104' => 'appid与openid不匹配',
|
||||
'45009' => '达到微信api每日限额上限',
|
||||
'200011' => '此账号已被封禁,无法操作',
|
||||
'200012' => '个人模版数已达上限,上限25个',
|
||||
'200014' => '请检查小程序所属类目',
|
||||
];
|
||||
if ($all['list']) {
|
||||
$time = time();
|
||||
foreach ($all['list'] as $template) {
|
||||
@ -211,11 +232,19 @@ class RoutineTemplate extends AuthController
|
||||
if (!isset($template['kid'])) {
|
||||
return app('json')->fail('数据库模版表(template_message)缺少字段:kid');
|
||||
}
|
||||
if (isset($template['kid']) && $template['kid']) {
|
||||
continue;
|
||||
}
|
||||
$works = [];
|
||||
try {
|
||||
$works = MiniProgramService::getSubscribeTemplateKeyWords($template['tempkey']);
|
||||
} catch (\Throwable $e) {
|
||||
$errData[1] = '获取关键词列表失败:请检查小程序APPID、秘钥配置或者服务器ssl证书以及opennssl、curl扩展';
|
||||
$wechatErr = $e->getMessage();
|
||||
if (is_string($wechatErr)) throw new AdminException($wechatErr);
|
||||
if (in_array($wechatErr->getCode(), array_keys($errMessage))) {
|
||||
throw new AdminException($errMessage[$wechatErr->getCode()]);
|
||||
}
|
||||
$errData[1] = '获取关键词列表失败:' . $wechatErr->getMessage();
|
||||
}
|
||||
$kid = [];
|
||||
if ($works) {
|
||||
@ -233,7 +262,12 @@ class RoutineTemplate extends AuthController
|
||||
try {
|
||||
$tempid = MiniProgramService::addSubscribeTemplate($template['tempkey'], $kid, $template['name']);
|
||||
} catch (\Throwable $e) {
|
||||
$errData[2] = '添加订阅消息模版失败:请去微信小程序后台检查订阅消息添加条数是否上限';
|
||||
$wechatErr = $e->getMessage();
|
||||
if (is_string($wechatErr)) throw new AdminException($wechatErr);
|
||||
if (in_array($wechatErr->getCode(), array_keys($errMessage))) {
|
||||
throw new AdminException($errMessage[$wechatErr->getCode()]);
|
||||
}
|
||||
$errData[2] = '添加订阅消息模版失败:' . $wechatErr->getMessage();
|
||||
}
|
||||
if ($tempid != $template['tempid']) {
|
||||
$this->services->update($template['id'], ['tempid' => $tempid, 'kid' => json_encode($kid), 'add_time' => $time], 'id');
|
||||
@ -245,4 +279,128 @@ class RoutineTemplate extends AuthController
|
||||
$msg = $errData ? implode('\n', $errData) : '同步成功';
|
||||
return app('json')->success($msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载小程序
|
||||
* @return mixed
|
||||
*/
|
||||
public function downloadTemp()
|
||||
{
|
||||
[$name, $is_live] = $this->request->postMore([
|
||||
['name', ''],
|
||||
['is_live', 0]
|
||||
], true);
|
||||
if (sys_config('routine_appId', '') == '') throw new AdminException('请先配置小程序appId');
|
||||
try {
|
||||
@unlink(public_path() . 'statics/download/routine.zip');
|
||||
//拷贝源文件
|
||||
/** @var FileService $fileService */
|
||||
$fileService = app(FileService::class);
|
||||
$fileService->copyDir(public_path() . 'statics/mp_view', public_path() . 'statics/download');
|
||||
//替换appid和名称
|
||||
$this->updateConfigJson(sys_config('routine_appId'), $name != '' ? $name : sys_config('routine_name'));
|
||||
//是否开启直播
|
||||
if ($is_live == 0) $this->updateAppJson();
|
||||
//替换url
|
||||
$this->updateUrl('https://' . $_SERVER['HTTP_HOST']);
|
||||
//压缩文件
|
||||
$fileService->addZip(public_path() . 'statics/download', public_path() . 'statics/download/routine.zip', public_path() . 'statics/download');
|
||||
$data['url'] = sys_config('site_url') . '/statics/download/routine.zip';
|
||||
return app('json')->success($data);
|
||||
} catch (\Throwable $throwable) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换url
|
||||
* @param $url
|
||||
*/
|
||||
public function updateUrl($url)
|
||||
{
|
||||
$fileUrl = app()->getRootPath() . "public/statics/download/common/vendor.js";
|
||||
$string = file_get_contents($fileUrl); //加载配置文件
|
||||
$string = str_replace('https://demo.crmeb.com', $url, $string); // 正则查找然后替换
|
||||
$newFileUrl = app()->getRootPath() . "public/statics/download/common/vendor.js";
|
||||
@file_put_contents($newFileUrl, $string); // 写入配置文件
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否开启直播(弃用)
|
||||
* @param int $iszhibo
|
||||
*/
|
||||
public function updateAppJson()
|
||||
{
|
||||
$fileUrl = app()->getRootPath() . "public/statics/download/app.json";
|
||||
$string = file_get_contents($fileUrl); //加载配置文件
|
||||
$pats = '/,
|
||||
"plugins": \{
|
||||
"live-player-plugin": \{
|
||||
"version": "(.*?)",
|
||||
"provider": "(.*?)"
|
||||
}
|
||||
}/';
|
||||
$string = preg_replace($pats, '', $string); // 正则查找然后替换
|
||||
$newFileUrl = app()->getRootPath() . "public/statics/download/app.json";
|
||||
@file_put_contents($newFileUrl, $string); // 写入配置文件
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换appid
|
||||
* @param string $appid
|
||||
* @param string $projectanme
|
||||
*/
|
||||
public function updateConfigJson($appId = '', $projectName = '')
|
||||
{
|
||||
$fileUrl = app()->getRootPath() . "public/statics/download/project.config.json";
|
||||
$string = file_get_contents($fileUrl); //加载配置文件
|
||||
// 替换appid
|
||||
$appIdOld = '/"appid"(.*?),/';
|
||||
$appIdNew = '"appid"' . ': ' . '"' . $appId . '",';
|
||||
$string = preg_replace($appIdOld, $appIdNew, $string); // 正则查找然后替换
|
||||
// 替换小程序名称
|
||||
$projectNameOld = '/"projectname"(.*?),/';
|
||||
$projectNameNew = '"projectname"' . ': ' . '"' . $projectName . '",';
|
||||
$string = preg_replace($projectNameOld, $projectNameNew, $string); // 正则查找然后替换
|
||||
$newFileUrl = app()->getRootPath() . "public/statics/download/project.config.json";
|
||||
@file_put_contents($newFileUrl, $string); // 写入配置文件
|
||||
}
|
||||
|
||||
public function getDownloadInfo()
|
||||
{
|
||||
$data['routine_name'] = sys_config('routine_name', '');
|
||||
if (sys_config('routine_appId') == '') {
|
||||
$data['code'] = '';
|
||||
} else {
|
||||
$name = $data['routine_name'] . '.jpg';
|
||||
/** @var SystemAttachmentServices $systemAttachmentModel */
|
||||
$systemAttachmentModel = app()->make(SystemAttachmentServices::class);
|
||||
$imageInfo = $systemAttachmentModel->getInfo(['name' => $name]);
|
||||
if (!$imageInfo) {
|
||||
/** @var QrcodeServices $qrcode */
|
||||
$qrcode = app()->make(QrcodeServices::class);
|
||||
$resForever = $qrcode->qrCodeForever(0, 'code');
|
||||
if ($resForever) {
|
||||
$resCode = MiniProgramService::qrcodeService()->appCodeUnlimit($resForever->id, '', 280);
|
||||
$res = ['res' => $resCode, 'id' => $resForever->id];
|
||||
} else {
|
||||
$res = false;
|
||||
}
|
||||
if (!$res) throw new ValidateException('二维码生成失败');
|
||||
$upload = UploadService::init(1);
|
||||
if ($upload->to('routine/code')->stream((string)$res['res'], $name) === false) {
|
||||
return $upload->getError();
|
||||
}
|
||||
$imageInfo = $upload->getUploadInfo();
|
||||
$imageInfo['image_type'] = 1;
|
||||
$systemAttachmentModel->attachmentAdd($imageInfo['name'], $imageInfo['size'], $imageInfo['type'], $imageInfo['dir'], $imageInfo['thumb_path'], 1, $imageInfo['image_type'], $imageInfo['time'], 2);
|
||||
$qrcode->update($res['id'], ['status' => 1, 'time' => time(), 'qrcode_url' => $imageInfo['dir']]);
|
||||
$data['code'] = sys_config('site_url') . $imageInfo['dir'];
|
||||
} else $data['code'] = sys_config('site_url') . $imageInfo['att_dir'];
|
||||
}
|
||||
$data['appId'] = sys_config('routine_appId');
|
||||
$data['help'] = 'https://help.crmeb.net/crmeb-v4/1863455';
|
||||
return app('json')->success($data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ class StoreServiceSpeechcraft extends AuthController
|
||||
['sort', 0],
|
||||
]);
|
||||
|
||||
Validate(StoreServiceSpeechcraftValidata::class)->check($data);
|
||||
$this->validate($data, StoreServiceSpeechcraftValidata::class);
|
||||
$data['add_time'] = time();
|
||||
$data['kefu_id'] = 0;
|
||||
if ($this->services->count(['message' => $data['message']])) {
|
||||
@ -131,7 +131,7 @@ class StoreServiceSpeechcraft extends AuthController
|
||||
[['cate_id', 'd'], 0],
|
||||
]);
|
||||
|
||||
Validate(StoreServiceSpeechcraftValidata::class)->check($data);
|
||||
$this->validate($data, StoreServiceSpeechcraftValidata::class);
|
||||
$message = $this->services->get(['message' => $data['message']]);
|
||||
if ($message && $message['id'] != $id) {
|
||||
return app('json')->fail('话术不能重复添加');
|
||||
|
||||
@ -77,7 +77,7 @@ class StoreServiceSpeechcraftCate extends AuthController
|
||||
return app('json')->fail('请输入分类名称');
|
||||
}
|
||||
|
||||
if ($this->services->count(['name' => $data['name']])) {
|
||||
if ($this->services->count(['name' => $data['name'], 'type' => 1, 'owner_id' => 0])) {
|
||||
return app('json')->fail('分类已存在');
|
||||
}
|
||||
|
||||
@ -135,6 +135,7 @@ class StoreServiceSpeechcraftCate extends AuthController
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
if ($id == 0) return app('json')->fail('系统分类不能删除');
|
||||
$cateInfo = $this->services->get($id);
|
||||
if (!$cateInfo) {
|
||||
return app('json')->fail('删除的分类不存在');
|
||||
|
||||
@ -11,8 +11,11 @@
|
||||
namespace app\adminapi\controller\v1\application\wechat;
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use crmeb\exceptions\AdminException;
|
||||
use app\services\other\TemplateMessageServices;
|
||||
use crmeb\services\{FormBuilder as Form, template\Template};
|
||||
use crmeb\services\{
|
||||
FormBuilder as Form, template\Template, WechatService
|
||||
};
|
||||
use think\facade\App;
|
||||
use think\facade\Route as Url;
|
||||
use think\Request;
|
||||
@ -50,12 +53,14 @@ class WechatTemplate extends AuthController
|
||||
['name', ''],
|
||||
['status', '']
|
||||
]);
|
||||
$where['type']=1;
|
||||
$where['type'] = 1;
|
||||
$data = $this->services->getTemplateList($where);
|
||||
$industry = Cache::tag($this->cacheTag)->remember('_wechat_industry', function () {
|
||||
try {
|
||||
$cache = (new Template('wechat'))->getIndustry();
|
||||
if (!$cache) return [];
|
||||
if (!$cache){
|
||||
$cache = (new Template('wechat'))->getIndustry();
|
||||
}
|
||||
Cache::tag($this->cacheTag, ['_wechat_industry']);
|
||||
return $cache->toArray();
|
||||
} catch (\Exception $e) {
|
||||
@ -106,7 +111,7 @@ class WechatTemplate extends AuthController
|
||||
['type', 1]
|
||||
]);
|
||||
if ($data['tempkey'] == '') return app('json')->fail('请输入模板编号');
|
||||
if ($data['tempkey'] != '' && $this->services->getOne(['tempkey'=>$data['tempkey']]))
|
||||
if ($data['tempkey'] != '' && $this->services->getOne(['tempkey' => $data['tempkey']]))
|
||||
return app('json')->fail('请输入模板编号已存在,请重新输入');
|
||||
if ($data['tempid'] == '') return app('json')->fail('请输入模板ID');
|
||||
if ($data['name'] == '') return app('json')->fail('请输入模板名');
|
||||
@ -144,6 +149,7 @@ class WechatTemplate extends AuthController
|
||||
$f[] = Form::input('tempid', '模板ID', $product->getData('tempid'));
|
||||
$f[] = Form::radio('status', '状态', $product->getData('status'))->options([['label' => '开启', 'value' => 1], ['label' => '关闭', 'value' => 0]]);
|
||||
return app('json')->success(create_form('编辑模板消息', $f, Url::buildUrl('/app/wechat/template/' . $id), 'PUT'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -164,7 +170,7 @@ class WechatTemplate extends AuthController
|
||||
if (!$id) return app('json')->fail('数据不存在');
|
||||
$product = $this->services->get($id);
|
||||
if (!$product) return app('json')->fail('数据不存在!');
|
||||
$this->services->update($id,$data, 'id');
|
||||
$this->services->update($id, $data, 'id');
|
||||
return app('json')->success('修改成功!');
|
||||
}
|
||||
|
||||
@ -192,7 +198,65 @@ class WechatTemplate extends AuthController
|
||||
public function set_status($id, $status)
|
||||
{
|
||||
if ($status == '' || $id == 0) return app('json')->fail('参数错误');
|
||||
$this->services->update($id,['status' => $status],'id');
|
||||
$this->services->update($id, ['status' => $status], 'id');
|
||||
return app('json')->success($status == 0 ? '关闭成功' : '开启成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步微信模版消息
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function syncSubscribe()
|
||||
{
|
||||
if (!sys_config('wechat_appid') || !sys_config('wechat_appsecret')) {
|
||||
throw new AdminException('请先配置微信公众号appid、appSecret等参数');
|
||||
}
|
||||
$tempall = $this->services->getTemplateList(['status' => 1, 'type' => 1]);
|
||||
/*
|
||||
* 删除所有模版ID
|
||||
*/
|
||||
//获取微信平台已经添加的模版
|
||||
$list = WechatService::getPrivateTemplates();//获取所有模版
|
||||
foreach ($list->template_list as $v)
|
||||
{
|
||||
//删除已有模版
|
||||
WechatService::deleleTemplate($v['template_id']);
|
||||
}
|
||||
|
||||
foreach ($tempall['list'] as $temp)
|
||||
{
|
||||
//添加模版消息
|
||||
$res = WechatService::addTemplateId($temp['tempkey']);
|
||||
// if($temp['tempid'])
|
||||
// {
|
||||
// //删除已有模版
|
||||
// WechatService::deleleTemplate($temp['tempid']);
|
||||
// }
|
||||
if(!$res->errcode && $res->template_id){
|
||||
$this->services->update($temp['id'],['tempid'=>$res->template_id]);
|
||||
}
|
||||
}
|
||||
return app('json')->success('模版消息一键设置成功');
|
||||
|
||||
/**
|
||||
* 批量修改模版格式
|
||||
*/
|
||||
//获取所有模版
|
||||
// $list = WechatService::getPrivateTemplates();//获取所有模版
|
||||
//
|
||||
// foreach ($tempall['list'] as $v)
|
||||
// {
|
||||
// foreach ($list->template_list as $item)
|
||||
// {
|
||||
// echo $item['template_id'];
|
||||
// if ($item['template_id'] == $v['tempid']) {
|
||||
// $this->services->update($v['id'], ['content'=>'']);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,6 +87,7 @@ class WechatUser extends AuthController
|
||||
$tagList = explode(',', $tagList) ?: [];
|
||||
$f = [Form::select('tag_id', '用户标签', $tagList)->setOptions($list->toArray())->multiple(1)];
|
||||
return app('json')->success(create_form('编辑用户标签', $f, Url::buildUrl('/app/wechat/user_tag/' . $openid), 'PUT'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -130,7 +131,7 @@ class WechatUser extends AuthController
|
||||
return ['value' => $item['id'], 'label' => $item['name']];
|
||||
});
|
||||
$groupId = UserModel::where('openid', $openid)->value('groupid');
|
||||
$f = [Form::select('group_id', '用户分组', $groupId)->setOptions($list->toArray())];
|
||||
$f = [Form::select('group_id', '用户分组', (string)$groupId)->setOptions($list->toArray())];
|
||||
return app('json')->success(create_form('编辑用户标签', $f, Url::buildUrl('/app/wechat/user_group/' . $openid), 'PUT'));
|
||||
}
|
||||
|
||||
@ -181,6 +182,7 @@ class WechatUser extends AuthController
|
||||
{
|
||||
$f = [Form::input('name', '标签名称')];
|
||||
return app('json')->success(create_form('添加标签', $f, Url::buildUrl('/app/wechat/tag'), 'POST'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -208,6 +210,7 @@ class WechatUser extends AuthController
|
||||
{
|
||||
$f = [Form::input('name', '标签名称')];
|
||||
return app('json')->success(create_form('编辑标签', $f, Url::buildUrl('/app/wechat/tag/' . $id), 'PUT'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -257,6 +260,7 @@ class WechatUser extends AuthController
|
||||
}
|
||||
$list = UserModel::getUserGroup();
|
||||
} catch (\Exception $e) {
|
||||
return app('json')->fail($e->getMessage());
|
||||
}
|
||||
return app('json')->success(compact('list'));
|
||||
}
|
||||
@ -269,6 +273,7 @@ class WechatUser extends AuthController
|
||||
{
|
||||
$f = [Form::input('name', '分组名称')];
|
||||
return app('json')->success(create_form('添加分组', $f, Url::buildUrl('/app/wechat/group'), 'POST'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -296,6 +301,7 @@ class WechatUser extends AuthController
|
||||
{
|
||||
$f = [Form::input('name', '分组名称')];
|
||||
return app('json')->success(create_form('编辑分组', $f, Url::buildUrl('/app/wechat/group/' . $id), 'PUT'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -21,8 +21,16 @@ use think\facade\App;
|
||||
*/
|
||||
class Article extends AuthController
|
||||
{
|
||||
/**
|
||||
* @var ArticleServices
|
||||
*/
|
||||
protected $service;
|
||||
|
||||
/**
|
||||
* Article constructor.
|
||||
* @param App $app
|
||||
* @param ArticleServices $service
|
||||
*/
|
||||
public function __construct(App $app, ArticleServices $service)
|
||||
{
|
||||
parent::__construct($app);
|
||||
|
||||
@ -45,7 +45,7 @@ class Diy extends AuthController
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['status', ''],
|
||||
['type', ''],
|
||||
['type', 0],
|
||||
['name', ''],
|
||||
['version', ''],
|
||||
]);
|
||||
@ -63,18 +63,18 @@ class Diy extends AuthController
|
||||
$data = $this->request->postMore([
|
||||
['value', ''],
|
||||
]);
|
||||
$value_config = ['seckill','bargain','combination','goodList'];
|
||||
$value_config = ['seckill', 'bargain', 'combination', 'goodList'];
|
||||
$value = is_string($data['value']) ? json_decode($data['value'], true) : $data['value'];
|
||||
foreach ($value as $key=>&$val){
|
||||
if(in_array($key,$value_config) && is_array($val)){
|
||||
foreach ($val as $k=>&$v){
|
||||
if(isset($v['selectConfig']['list']) && $v['selectConfig']['list']){
|
||||
foreach ($value as $key => &$val) {
|
||||
if (in_array($key, $value_config) && is_array($val)) {
|
||||
foreach ($val as $k => &$v) {
|
||||
if (isset($v['selectConfig']['list']) && $v['selectConfig']['list']) {
|
||||
$v['selectConfig']['list'] = [];
|
||||
}
|
||||
if(isset($v['goodsList']['list']) && $v['goodsList']['list'] && $v['tabConfig']['tabVal'] == 1){
|
||||
if (isset($v['goodsList']['list']) && $v['goodsList']['list'] && $v['tabConfig']['tabVal'] == 1) {
|
||||
$limitMax = config('database.page.limitMax', 50);
|
||||
if(count($v['goodsList']['list']) > $limitMax){
|
||||
return $this->fail('您设置得商品个数超出系统限制,最大限制' . $limitMax . '个商品');
|
||||
if (count($v['goodsList']['list']) > $limitMax) {
|
||||
return app('json')->fail('您设置得商品个数超出系统限制,最大限制' . $limitMax . '个商品');
|
||||
}
|
||||
$v['ids'] = array_column($v['goodsList']['list'], 'id');
|
||||
$v['goodsList']['list'] = [];
|
||||
@ -123,7 +123,7 @@ class Diy extends AuthController
|
||||
* @param int $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function getInfo(int $id, StoreProductServices $services,StoreSeckillServices $seckillServices, StoreCombinationServices $combinationServices,StoreBargainServices $bargainServices)
|
||||
public function getInfo(int $id, StoreProductServices $services, StoreSeckillServices $seckillServices, StoreCombinationServices $combinationServices, StoreBargainServices $bargainServices)
|
||||
{
|
||||
if (!$id) throw new AdminException('参数错误');
|
||||
$info = $this->services->get($id);
|
||||
@ -132,35 +132,35 @@ class Diy extends AuthController
|
||||
} else {
|
||||
throw new AdminException('模板不存在');
|
||||
}
|
||||
if(!$info['value']) return app('json')->success(compact('info'));
|
||||
if (!$info['value']) return app('json')->success(compact('info'));
|
||||
$info['value'] = json_decode($info['value'], true);
|
||||
$value_config = ['seckill','bargain','combination','goodList'];
|
||||
foreach ($info['value']as $key=>&$val){
|
||||
if(in_array($key,$value_config) && is_array($val)){
|
||||
if($key == 'goodList'){
|
||||
foreach ($val as $k=>&$v){
|
||||
if(isset($v['ids']) && $v['ids'] && $v['tabConfig']['tabVal'] == 1){
|
||||
$value_config = ['seckill', 'bargain', 'combination', 'goodList'];
|
||||
foreach ($info['value'] as $key => &$val) {
|
||||
if (in_array($key, $value_config) && is_array($val)) {
|
||||
if ($key == 'goodList') {
|
||||
foreach ($val as $k => &$v) {
|
||||
if (isset($v['ids']) && $v['ids'] && $v['tabConfig']['tabVal'] == 1) {
|
||||
$v['goodsList']['list'] = $services->getSearchList(['ids' => $v['ids']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if($key == "seckill"){
|
||||
foreach ($val as $k=>&$v){
|
||||
if(isset($v['ids']) && $v['ids'] && $v['tabConfig']['tabVal'] == 1){
|
||||
if ($key == "seckill") {
|
||||
foreach ($val as $k => &$v) {
|
||||
if (isset($v['ids']) && $v['ids'] && $v['tabConfig']['tabVal'] == 1) {
|
||||
$v['goodsList']['list'] = $seckillServices->getDiySeckillList(['ids' => $v['ids']])['list'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if($key == "bargain"){
|
||||
foreach ($val as $k=>&$v){
|
||||
if(isset($v['ids']) && $v['ids'] && $v['tabConfig']['tabVal'] == 1){
|
||||
if ($key == "bargain") {
|
||||
foreach ($val as $k => &$v) {
|
||||
if (isset($v['ids']) && $v['ids'] && $v['tabConfig']['tabVal'] == 1) {
|
||||
$v['goodsList']['list'] = $bargainServices->getHomeList(['ids' => $v['ids']])['list'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if($key == "combination"){
|
||||
foreach ($val as $k=>&$v){
|
||||
if(isset($v['ids']) && $v['ids'] && $v['tabConfig']['tabVal'] == 1){
|
||||
if ($key == "combination") {
|
||||
foreach ($val as $k => &$v) {
|
||||
if (isset($v['ids']) && $v['ids'] && $v['tabConfig']['tabVal'] == 1) {
|
||||
$v['goodsList']['list'] = $combinationServices->getHomeList(['ids' => $v['ids']])['list'];
|
||||
}
|
||||
}
|
||||
@ -288,7 +288,8 @@ class Diy extends AuthController
|
||||
* 添加页面
|
||||
* @return mixed
|
||||
*/
|
||||
public function create(){
|
||||
public function create()
|
||||
{
|
||||
return app('json')->success($this->services->createForm());
|
||||
}
|
||||
|
||||
@ -296,7 +297,8 @@ class Diy extends AuthController
|
||||
* 保存页面
|
||||
* @return mixed
|
||||
*/
|
||||
public function save(){
|
||||
public function save()
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['name', ''],
|
||||
['template_name', ''],
|
||||
@ -305,7 +307,7 @@ class Diy extends AuthController
|
||||
if (!$data['template_name']) throw new AdminException('请输入页面类型');
|
||||
$data['version'] = '1.0';
|
||||
$data['add_time'] = time();
|
||||
$data['type'] = 1;
|
||||
$data['type'] = 2;
|
||||
$this->services->save($data);
|
||||
return app('json')->success('保存成功!');
|
||||
}
|
||||
@ -315,7 +317,8 @@ class Diy extends AuthController
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function setRecovery($id){
|
||||
public function setRecovery($id)
|
||||
{
|
||||
if (!$id) throw new AdminException('参数错误');
|
||||
$info = $this->services->get($id);
|
||||
if ($info) {
|
||||
@ -332,7 +335,8 @@ class Diy extends AuthController
|
||||
* 获取商品列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function getProductList(){
|
||||
public function getProductList()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['cate_id', ''],
|
||||
['store_name', ''],
|
||||
@ -353,4 +357,62 @@ class Diy extends AuthController
|
||||
$list = $this->services->ProductList($where);
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类、个人中心、一键换色
|
||||
* @param $type
|
||||
* @return mixed
|
||||
*/
|
||||
public function getColorChange($type)
|
||||
{
|
||||
$status = (int)$this->services->getColorChange((string)$type);
|
||||
return app('json')->success(compact('status'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存分类、个人中心、一键换色
|
||||
* @param $status
|
||||
* @param $type
|
||||
* @return mixed
|
||||
*/
|
||||
public function colorChange($status, $type)
|
||||
{
|
||||
if (!$status) throw new AdminException('参数错误');
|
||||
$info = $this->services->get(['template_name' => $type, 'type' => 1]);
|
||||
if ($info) {
|
||||
$info->value = $status;
|
||||
$info->update_time = time();
|
||||
$info->save();
|
||||
return app('json')->success('设置成功');
|
||||
} else {
|
||||
throw new AdminException('模板不存在');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取个人中心数据
|
||||
* @return mixed
|
||||
*/
|
||||
public function getMember()
|
||||
{
|
||||
$data = $this->services->getMemberData();
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存个人中心数据
|
||||
* @return mixed
|
||||
*/
|
||||
public function memberSaveData()
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['status', 0],
|
||||
['order_status', 0],
|
||||
['my_banner_status', 0],
|
||||
['routine_my_banner', []],
|
||||
['routine_my_menus', []]
|
||||
]);
|
||||
$this->services->memberSaveData($data);
|
||||
return app('json')->success('保存成功');
|
||||
}
|
||||
}
|
||||
|
||||
116
crmeb/app/adminapi/controller/v1/diy/PageLink.php
Normal file
116
crmeb/app/adminapi/controller/v1/diy/PageLink.php
Normal file
@ -0,0 +1,116 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\v1\diy;
|
||||
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\diy\DiyServices;
|
||||
use app\services\diy\PageCategoryServices;
|
||||
use app\services\diy\PageLinkServices;
|
||||
use app\services\product\product\StoreCategoryServices;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
* Class PageLink
|
||||
* @package app\controller\admin\v1\diy
|
||||
*/
|
||||
class PageLink extends AuthController
|
||||
{
|
||||
|
||||
/**
|
||||
* PageLink constructor.
|
||||
* @param App $app
|
||||
* @param PageLinkServices $services
|
||||
*/
|
||||
public function __construct(App $app, PageLinkServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取页面链接分类
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCategory(PageCategoryServices $services)
|
||||
{
|
||||
return app('json')->success($services->getCategroyList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取页面链接
|
||||
* @param $cate_id
|
||||
* @return mixed
|
||||
*/
|
||||
public function getLinks($cate_id, PageCategoryServices $pageCategoryServices)
|
||||
{
|
||||
if (!$cate_id) return app('json')->fail('缺少参数');
|
||||
$category = $pageCategoryServices->get((int)$cate_id);
|
||||
if (!$category) {
|
||||
return app('json')->fail('页面分类不存在');
|
||||
}
|
||||
switch ($category['type']) {
|
||||
case 'special':
|
||||
/** @var DiyServices $diyServices */
|
||||
$diyServices = app()->make(DiyServices::class);
|
||||
$data = $diyServices->getDiyList(['type' => [1, 2]]);
|
||||
break;
|
||||
case 'product_category':
|
||||
/** @var StoreCategoryServices $storeCategoryServices */
|
||||
$storeCategoryServices = app()->make(StoreCategoryServices::class);
|
||||
$data = $storeCategoryServices->getList(['cate_name' => '', 'pid' => '', 'is_show' => '']);
|
||||
break;
|
||||
default:
|
||||
$data = $this->services->getLinkList(['cate_id' => $cate_id]);
|
||||
break;
|
||||
}
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存链接
|
||||
* @param $cate_id
|
||||
* @param PageCategoryServices $pageCategoryServices
|
||||
* @return mixed
|
||||
*/
|
||||
public function saveLink($cate_id, PageCategoryServices $pageCategoryServices)
|
||||
{
|
||||
$data = $this->request->getMore([
|
||||
['name', ''],
|
||||
['url', '']
|
||||
]);
|
||||
if (!$cate_id || !$data['name'] || !$data['url']) return app('json')->fail('缺少参数');
|
||||
$category = $pageCategoryServices->get((int)$cate_id);
|
||||
if (!$category) {
|
||||
return app('json')->fail('页面分类不存在');
|
||||
}
|
||||
$data['cate_id'] = $cate_id;
|
||||
$data['add_time'] = time();
|
||||
if (!$this->services->save($data)) {
|
||||
return app('json')->fail('添加失败');
|
||||
}
|
||||
return app('json')->success('添加成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除链接
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if (!$id) return app('json')->fail('参数错误');
|
||||
$this->services->del($id);
|
||||
return app('json')->success('删除成功!');
|
||||
}
|
||||
|
||||
}
|
||||
@ -175,6 +175,7 @@ class ExportExcel extends AuthController
|
||||
public function storeBargain(StoreBargainServices $services)
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['start_status', ''],
|
||||
['status', ''],
|
||||
['store_name', ''],
|
||||
]);
|
||||
@ -190,6 +191,7 @@ class ExportExcel extends AuthController
|
||||
public function storeCombination(StoreCombinationServices $services)
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['start_status', ''],
|
||||
['is_show', ''],
|
||||
['store_name', ''],
|
||||
]);
|
||||
@ -197,10 +199,22 @@ class ExportExcel extends AuthController
|
||||
/** @var StorePinkServices $storePinkServices */
|
||||
$storePinkServices = app()->make(StorePinkServices::class);
|
||||
$countAll = $storePinkServices->getPinkCount([]);
|
||||
$countTeam = $storePinkServices->getPinkCount(['k_id' => 0]);
|
||||
$countTeam = $storePinkServices->getPinkCount(['k_id' => 0, 'status' => 2]);
|
||||
$countPeople = $storePinkServices->getPinkCount(['k_id' => 0]);
|
||||
foreach ($data as &$item) {
|
||||
$item['count_people'] = $countPeople[$item['id']] ?? 0;//拼团数量
|
||||
$item['count_people_all'] = $countAll[$item['id']] ?? 0;//参与人数
|
||||
$item['count_people_pink'] = $countTeam[$item['id']] ?? 0;//成团数量
|
||||
$item['stop_status'] = $item['stop_time'] < time() ? 1 : 0;
|
||||
if ($item['is_show']) {
|
||||
if ($item['start_time'] > time())
|
||||
$item['start_name'] = '未开始';
|
||||
else if ($item['stop_time'] < time())
|
||||
$item['start_name'] = '已结束';
|
||||
else if ($item['stop_time'] > time() && $item['start_time'] < time()) {
|
||||
$item['start_name'] = '进行中';
|
||||
}
|
||||
} else $item['start_name'] = '已结束';
|
||||
}
|
||||
return app('json')->success($this->service->storeCombination($data));
|
||||
}
|
||||
@ -213,6 +227,7 @@ class ExportExcel extends AuthController
|
||||
public function storeSeckill(StoreSeckillServices $services)
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['start_status', ''],
|
||||
['status', ''],
|
||||
['store_name', '']
|
||||
]);
|
||||
|
||||
@ -64,11 +64,12 @@ class SystemAttachment extends AuthController
|
||||
*/
|
||||
public function upload($upload_type = 0, $type = 0)
|
||||
{
|
||||
[$pid, $file] = $this->request->postMore([
|
||||
[$pid, $file, $menuName] = $this->request->postMore([
|
||||
['pid', 0],
|
||||
['file', 'file'],
|
||||
['menu_name', '']
|
||||
], true);
|
||||
$res = $this->service->upload((int)$pid, $file, $upload_type, $type);
|
||||
$res = $this->service->upload((int)$pid, $file, $upload_type, $type, $menuName);
|
||||
return app('json')->success('上传成功', ['src' => $res]);
|
||||
}
|
||||
|
||||
@ -101,4 +102,13 @@ class SystemAttachment extends AuthController
|
||||
return app('json')->success('修改成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取上传类型
|
||||
* @return mixed
|
||||
*/
|
||||
public function uploadType()
|
||||
{
|
||||
$data['upload_type'] = sys_config('upload_type', 1);
|
||||
return app('json')->success($data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,8 +38,10 @@ class SystemAttachmentCategory extends AuthController
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['name', '']
|
||||
['name', ''],
|
||||
['pid', 0]
|
||||
]);
|
||||
if ($where['name'] != '') $where['pid'] = '';
|
||||
return app('json')->success($this->service->getAll($where));
|
||||
}
|
||||
|
||||
|
||||
@ -15,6 +15,10 @@ use app\services\user\UserBillServices;
|
||||
use think\facade\App;
|
||||
use app\adminapi\controller\AuthController;
|
||||
|
||||
/**
|
||||
* Class Finance
|
||||
* @package app\adminapi\controller\v1\finance
|
||||
*/
|
||||
class Finance extends AuthController
|
||||
{
|
||||
/**
|
||||
@ -90,7 +94,7 @@ class Finance extends AuthController
|
||||
['nickname', '']
|
||||
]);
|
||||
$where['category'] = 'now_money';
|
||||
$where['type'] = 'brokerage';
|
||||
$where['type'] = ['brokerage','brokerage_user'];
|
||||
return app('json')->success($this->services->getBillOneList((int)$id, $where));
|
||||
}
|
||||
|
||||
|
||||
@ -16,6 +16,10 @@ use app\services\user\UserExtractServices;
|
||||
use think\facade\App;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* Class UserExtract
|
||||
* @package app\adminapi\controller\v1\finance
|
||||
*/
|
||||
class UserExtract extends AuthController
|
||||
{
|
||||
/**
|
||||
|
||||
@ -15,6 +15,10 @@ use app\adminapi\controller\AuthController;
|
||||
use app\services\user\UserRechargeServices;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
* Class UserRecharge
|
||||
* @package app\adminapi\controller\v1\finance
|
||||
*/
|
||||
class UserRecharge extends AuthController
|
||||
{
|
||||
/**
|
||||
|
||||
150
crmeb/app/adminapi/controller/v1/marketing/StoreAdvance.php
Normal file
150
crmeb/app/adminapi/controller/v1/marketing/StoreAdvance.php
Normal file
@ -0,0 +1,150 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\v1\marketing;
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\activity\StoreAdvanceServices;
|
||||
use app\services\activity\StoreBargainServices;
|
||||
use app\services\activity\StoreCombinationServices;
|
||||
use app\services\activity\StoreSeckillServices;
|
||||
use crmeb\exceptions\AdminException;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
* 预售控制器
|
||||
* Class StoreAdvance
|
||||
* @package app\adminapi\controller\v1\marketing
|
||||
*/
|
||||
class StoreAdvance extends AuthController
|
||||
{
|
||||
/**
|
||||
* StoreAdvance constructor.
|
||||
* @param App $app
|
||||
* @param StoreAdvanceServices $services
|
||||
*/
|
||||
public function __construct(App $app, StoreAdvanceServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理端预售列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['title', ''],
|
||||
['type', ''],
|
||||
['status', ''],
|
||||
['time_type', 0]
|
||||
]);
|
||||
return app('json')->success($this->services->getList($where));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改预售商品
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function save($id)
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
[['product_id', 'd'], 0],
|
||||
[['title', 's'], ''],
|
||||
[['info', 's'], ''],
|
||||
[['unit_name', 's'], ''],
|
||||
['image', ''],
|
||||
['images', []],
|
||||
[['description', 's'], ''],
|
||||
[['temp_id', 'd'], 0],
|
||||
[['status', 'd'], 0],
|
||||
[['sort', 'd'], 0],
|
||||
[['num', 'd'], 0],
|
||||
[['once_num', 'd'], 1000],
|
||||
['section_time', []],
|
||||
['type', 0],
|
||||
['deposit', 0],
|
||||
['pay_time', []],
|
||||
['attrs', []],
|
||||
['items', []],
|
||||
['deliver_time', 0],
|
||||
['copy', 0]
|
||||
]);
|
||||
if (!$id) {
|
||||
/** @var StoreSeckillServices $storeSeckillService */
|
||||
$storeSeckillService = app()->make(StoreSeckillServices::class);
|
||||
$res1 = $storeSeckillService->count(['product_id' => $data['product_id'], 'is_del' => 0, 'status' => 1, 'seckill_time' => 1]);
|
||||
if ($res1) {
|
||||
throw new AdminException('商品参与秒杀活动开启,无法开启预售');
|
||||
}
|
||||
/** @var StoreBargainServices $storeBargainService */
|
||||
$storeBargainService = app()->make(StoreBargainServices::class);
|
||||
$res2 = $storeBargainService->count(['product_id' => $data['product_id'], 'is_del' => 0, 'status' => 1, 'bargain_time' => 1]);
|
||||
if ($res2) {
|
||||
throw new AdminException('商品参与砍价活动开启,无法开启预售');
|
||||
}
|
||||
/** @var StoreCombinationServices $storeCombinationService */
|
||||
$storeCombinationService = app()->make(StoreCombinationServices::class);
|
||||
$res3 = $storeCombinationService->count(['product_id' => $data['product_id'], 'is_del' => 0, 'is_show' => 1, 'pinkIngTime' => 1]);
|
||||
if ($res3) {
|
||||
throw new AdminException('商品参与拼团活动开启,无法开启预售');
|
||||
}
|
||||
}
|
||||
$this->services->saveData($id, $data);
|
||||
return app('json')->success('保存成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function info($id)
|
||||
{
|
||||
$info = $this->services->getInfo($id);
|
||||
return app('json')->success(compact('info'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除预售
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
$res = $this->services->update($id, ['is_del' => 1]);
|
||||
if ($res) {
|
||||
return app('json')->success('删除成功');
|
||||
} else {
|
||||
return app('json')->fail('删除成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 预售商品上下架
|
||||
* @param $id
|
||||
* @param $status
|
||||
* @return mixed
|
||||
*/
|
||||
public function setStatus($id, $status)
|
||||
{
|
||||
$res = $this->services->update($id, ['status' => $status]);
|
||||
$msg = $status == 1 ? '上架' : '下架';
|
||||
if ($res) {
|
||||
return app('json')->success($msg . '成功');
|
||||
} else {
|
||||
return app('json')->fail($msg . '成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -24,6 +24,11 @@ use think\facade\App;
|
||||
*/
|
||||
class StoreBargain extends AuthController
|
||||
{
|
||||
/**
|
||||
* StoreBargain constructor.
|
||||
* @param App $app
|
||||
* @param StoreBargainServices $services
|
||||
*/
|
||||
public function __construct(App $app, StoreBargainServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
@ -38,6 +43,7 @@ class StoreBargain extends AuthController
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['start_status', ''],
|
||||
['status', ''],
|
||||
['store_name', ''],
|
||||
]);
|
||||
@ -78,7 +84,7 @@ class StoreBargain extends AuthController
|
||||
['bargain_num', 1],
|
||||
['people_num', 1],
|
||||
]);
|
||||
Validate(\app\adminapi\validate\marketing\StoreBargainValidate::class)->scene('save')->check($data);
|
||||
$this->validate($data, \app\adminapi\validate\marketing\StoreBargainValidate::class, 'save');
|
||||
if ($data['section_time']) {
|
||||
[$start_time, $end_time] = $data['section_time'];
|
||||
if (strtotime($end_time) < time()) {
|
||||
@ -129,7 +135,7 @@ class StoreBargain extends AuthController
|
||||
$this->services->update($id, ['is_del' => 1]);
|
||||
/** @var StoreBargainUserServices $bargainUserService */
|
||||
$bargainUserService = app()->make(StoreBargainUserServices::class);
|
||||
$bargainUserService->UserBargainStatusFail($id);
|
||||
$bargainUserService->userBargainStatusFail($id, true);
|
||||
return app('json')->success('删除成功!');
|
||||
}
|
||||
|
||||
@ -143,7 +149,7 @@ class StoreBargain extends AuthController
|
||||
{
|
||||
/** @var StoreBargainUserServices $bargainUserService */
|
||||
$bargainUserService = app()->make(StoreBargainUserServices::class);
|
||||
$bargainUserService->UserBargainStatusFail($id);
|
||||
$bargainUserService->userBargainStatusFail($id, false);
|
||||
$this->services->update($id, ['status' => $status]);
|
||||
return app('json')->success($status == 0 ? '关闭成功' : '开启成功');
|
||||
}
|
||||
|
||||
@ -24,6 +24,11 @@ use think\facade\App;
|
||||
*/
|
||||
class StoreCombination extends AuthController
|
||||
{
|
||||
/**
|
||||
* StoreCombination constructor.
|
||||
* @param App $app
|
||||
* @param StoreCombinationServices $services
|
||||
*/
|
||||
public function __construct(App $app, StoreCombinationServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
@ -37,6 +42,7 @@ class StoreCombination extends AuthController
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['start_status', ''],
|
||||
['is_show', ''],
|
||||
['store_name', '']
|
||||
]);
|
||||
@ -100,7 +106,7 @@ class StoreCombination extends AuthController
|
||||
['copy', 0],
|
||||
['virtual', 100],
|
||||
]);
|
||||
Validate(\app\adminapi\validate\marketing\StoreCombinationValidate::class)->scene('save')->check($data);
|
||||
$this->validate($data, \app\adminapi\validate\marketing\StoreCombinationValidate::class, 'save');
|
||||
if ($data['section_time']) {
|
||||
[$start_time, $end_time] = $data['section_time'];
|
||||
if (strtotime($end_time) < time()) {
|
||||
|
||||
@ -13,7 +13,6 @@ namespace app\adminapi\controller\v1\marketing;
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\coupon\StoreCouponProductServices;
|
||||
use app\services\coupon\StoreCouponService;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
@ -82,13 +81,13 @@ class StoreCoupon extends AuthController
|
||||
]);
|
||||
$data['product_id'] = '';
|
||||
if ($data['type'] == 1) {
|
||||
validate(\app\adminapi\validate\marketing\StoreCouponValidate::class)->scene('type')->check($data);
|
||||
$this->validate($data, \app\adminapi\validate\marketing\StoreCouponValidate::class, 'type');
|
||||
} elseif ($data['type'] == 2) {
|
||||
validate(\app\adminapi\validate\marketing\StoreCouponValidate::class)->scene('product')->check($data);
|
||||
$this->validate($data, \app\adminapi\validate\marketing\StoreCouponValidate::class, 'product');
|
||||
$productIds = array_column($data['image'], 'product_id');
|
||||
$data['product_id'] = implode(',', $productIds);
|
||||
} else {
|
||||
validate(\app\adminapi\validate\marketing\StoreCouponValidate::class)->scene('save')->check($data);
|
||||
$this->validate($data, \app\adminapi\validate\marketing\StoreCouponValidate::class, 'save');
|
||||
}
|
||||
$data['add_time'] = time();
|
||||
$this->services->save($data);
|
||||
|
||||
@ -38,6 +38,7 @@ class StoreSeckill extends AuthController
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['start_status', ''],
|
||||
[['status', 's'], ''],
|
||||
[['store_name', 's'], '']
|
||||
]);
|
||||
@ -82,7 +83,7 @@ class StoreSeckill extends AuthController
|
||||
['items', []],
|
||||
['copy', 0]
|
||||
]);
|
||||
validate(\app\adminapi\validate\marketing\StoreSeckillValidate::class)->scene('save')->check($data);
|
||||
$this->validate($data, \app\adminapi\validate\marketing\StoreSeckillValidate::class, 'save');
|
||||
if ($data['section_time']) {
|
||||
[$start_time, $end_time] = $data['section_time'];
|
||||
if (strtotime($end_time) + 86400 < time()) {
|
||||
@ -98,7 +99,7 @@ class StoreSeckill extends AuthController
|
||||
}
|
||||
//限制编辑
|
||||
if ($data['copy'] == 0 && $seckill) {
|
||||
if ($seckill['stop_time'] < time()) {
|
||||
if ($seckill['stop_time'] + 86400 < time()) {
|
||||
return app('json')->fail('活动已结束,请重新添加或复制');
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,142 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\v1\marketing\integral;
|
||||
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\activity\integral\StoreIntegralServices;
|
||||
use think\facade\App;
|
||||
|
||||
|
||||
/**
|
||||
* 积分商城管理
|
||||
* Class StoreCombination
|
||||
* @package app\admin\controller\store
|
||||
*/
|
||||
class StoreIntegral extends AuthController
|
||||
{
|
||||
/**
|
||||
* StoreIntegral constructor.
|
||||
* @param App $app
|
||||
* @param StoreIntegralServices $services
|
||||
*/
|
||||
public function __construct(App $app, StoreIntegralServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 积分商品列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['integral_time', ''],
|
||||
['is_show', ''],
|
||||
['store_name', '']
|
||||
]);
|
||||
$where['is_del'] = 0;
|
||||
$list = $this->services->systemPage($where);
|
||||
return app('json')->success($list);
|
||||
}
|
||||
/**
|
||||
* 保存商品
|
||||
* @param int $id
|
||||
*/
|
||||
public function save($id)
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
[['product_id', 'd'], 0],
|
||||
[['title', 's'], ''],
|
||||
[['unit_name', 's'], ''],
|
||||
['image', ''],
|
||||
['images', []],
|
||||
[['num', 'd'], 0],
|
||||
[['is_host', 'd'], 0],
|
||||
[['is_show', 'd'], 0],
|
||||
[['once_num', 'd'], 0],
|
||||
[['sort', 'd'], 0],
|
||||
[['description', 's'], ''],
|
||||
['attrs', []],
|
||||
['items', []],
|
||||
['copy', 0]
|
||||
]);
|
||||
|
||||
$this->validate($data, \app\adminapi\validate\marketing\StoreIntegralValidate::class, 'save');
|
||||
$bragain = [];
|
||||
if ($id) {
|
||||
$bragain = $this->services->get((int)$id);
|
||||
if (!$bragain) {
|
||||
return app('json')->fail('数据不存在');
|
||||
}
|
||||
}
|
||||
if ($data['num'] < $data['once_num']) {
|
||||
return app('json')->fail('限制单次购买数量不能大于总购买数量');
|
||||
}
|
||||
if ($data['copy'] == 1) {
|
||||
$id = 0;
|
||||
unset($data['copy']);
|
||||
}
|
||||
$this->services->saveData($id, $data);
|
||||
return app('json')->success('保存成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加商品
|
||||
* @return mixed
|
||||
*/
|
||||
public function batch_add(){
|
||||
$data = $this->request->postMore([
|
||||
['attrs', []],
|
||||
[['is_show', 'd'], 0]
|
||||
]);
|
||||
if(!$data['attrs']) return app('json')->fail('请选择提交的商品');
|
||||
$this->services->saveBatchData($data);
|
||||
return app('json')->success('保存成功');
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function read($id)
|
||||
{
|
||||
$info = $this->services->getInfo($id);
|
||||
return app('json')->success(compact('info'));
|
||||
}
|
||||
/**
|
||||
* 修改状态
|
||||
* @param $id
|
||||
* @param $status
|
||||
* @return mixed
|
||||
*/
|
||||
public function set_show($id, $is_show)
|
||||
{
|
||||
$this->services->update($id, ['is_show' => $is_show]);
|
||||
return app('json')->success($is_show == 0 ? '下架成功' : '上架成功');
|
||||
}
|
||||
/**
|
||||
* 删除指定资源
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
if (!$id) return app('json')->fail('缺少参数');
|
||||
$this->services->update($id, ['is_del' => 1]);
|
||||
return app('json')->success('删除成功!');
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,364 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\adminapi\controller\v1\marketing\integral;
|
||||
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\serve\ServeServices;
|
||||
use app\services\activity\integral\{
|
||||
StoreIntegralOrderServices,
|
||||
StoreIntegralOrderStatusServices
|
||||
};
|
||||
use app\services\order\StoreOrderDeliveryServices;
|
||||
use app\services\shipping\ExpressServices;
|
||||
use app\services\user\UserServices;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
* 订单管理
|
||||
* Class StoreOrder
|
||||
* @package app\controller\admin\v1\order
|
||||
*/
|
||||
class StoreIntegralOrder extends AuthController
|
||||
{
|
||||
/**
|
||||
* StoreIntegralOrder constructor.
|
||||
* @param App $app
|
||||
* @param StoreIntegralOrderServices $service
|
||||
* @method temp
|
||||
*/
|
||||
public function __construct(App $app, StoreIntegralOrderServices $service)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单类型数量
|
||||
* @return mixed
|
||||
*/
|
||||
public function chart()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['data', '', '', 'time'],
|
||||
['product_id', '']
|
||||
]);
|
||||
$data = $this->services->orderCount($where);
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lst()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['status', ''],
|
||||
['real_name', ''],
|
||||
['data', '', '', 'time'],
|
||||
['order', ''],
|
||||
['field_key', ''],
|
||||
['product_id', '']
|
||||
]);
|
||||
$where['is_system_del'] = 0;
|
||||
return app('json')->success($this->services->getOrderList($where, ['*']));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取快递公司
|
||||
* @return mixed
|
||||
*/
|
||||
public function express(ExpressServices $services)
|
||||
{
|
||||
[$status] = $this->request->getMore([
|
||||
['status', ''],
|
||||
], true);
|
||||
if ($status != '') $data['status'] = $status;
|
||||
$data['is_show'] = 1;
|
||||
return app('json')->success($services->express($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户已经删除的订单
|
||||
* @return mixed
|
||||
*/
|
||||
public function del_orders()
|
||||
{
|
||||
[$ids, $all, $where] = $this->request->postMore([
|
||||
['ids', []],
|
||||
['where', []],
|
||||
], true);
|
||||
if (!count($ids)) return app('json')->fail('请选择需要删除的订单');
|
||||
if ($this->services->getOrderIdsCount($ids)) return app('json')->fail('您选择的的订单存在用户未删除的订单');
|
||||
if ($this->services->batchUpdate($ids, ['is_system_del' => 1])) {
|
||||
return app('json')->success('删除成功');
|
||||
}
|
||||
return app('json')->fail('删除失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if (!$id || !($orderInfo = $this->services->get($id)))
|
||||
return app('json')->fail('订单不存在');
|
||||
if (!$orderInfo->is_del)
|
||||
return app('json')->fail('订单用户未删除无法删除');
|
||||
$orderInfo->is_system_del = 1;
|
||||
if ($orderInfo->save())
|
||||
return app('json')->success('SUCCESS');
|
||||
else
|
||||
return app('json')->fail('ERROR');
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单发送货
|
||||
* @param $id 订单id
|
||||
* @return mixed
|
||||
*/
|
||||
public function update_delivery($id)
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['type', 1],
|
||||
['delivery_name', ''],//快递公司名称
|
||||
['delivery_id', ''],//快递单号
|
||||
['delivery_code', ''],//快递公司编码
|
||||
|
||||
['express_record_type', 2],//发货记录类型
|
||||
['express_temp_id', ""],//电子面单模板
|
||||
['to_name', ''],//寄件人姓名
|
||||
['to_tel', ''],//寄件人电话
|
||||
['to_addr', ''],//寄件人地址
|
||||
|
||||
['sh_delivery_name', ''],//送货人姓名
|
||||
['sh_delivery_id', ''],//送货人电话
|
||||
['sh_delivery_uid', ''],//送货人ID
|
||||
|
||||
['fictitious_content', '']//虚拟发货内容
|
||||
]);
|
||||
$this->services->delivery((int)$id, $data);
|
||||
return app('json')->success('SUCCESS');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 确认收货
|
||||
* @param $id 订单id
|
||||
* @return mixed
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function take_delivery($id)
|
||||
{
|
||||
if (!$id) return app('json')->fail('缺少参数');
|
||||
$order = $this->services->get($id);
|
||||
if (!$order)
|
||||
return app('json')->fail('Data does not exist!');
|
||||
if ($order['status'] == 3)
|
||||
return app('json')->fail('不能重复收货!');
|
||||
if ($order['status'] == 2)
|
||||
$data['status'] = 3;
|
||||
else
|
||||
return app('json')->fail('请先发货或者送货!');
|
||||
|
||||
if (!$this->services->update($id, $data)) {
|
||||
return app('json')->fail('收货失败,请稍候再试!');
|
||||
} else {
|
||||
//增加收货订单状态
|
||||
/** @var StoreIntegralOrderStatusServices $statusService */
|
||||
$statusService = app()->make(StoreIntegralOrderStatusServices::class);
|
||||
$statusService->save([
|
||||
'oid' => $order['id'],
|
||||
'change_type' => 'take_delivery',
|
||||
'change_message' => '已收货',
|
||||
'change_time' => time()
|
||||
]);
|
||||
return app('json')->success('收货成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单详情
|
||||
* @param $id 订单id
|
||||
* @return mixed
|
||||
*/
|
||||
public function order_info($id)
|
||||
{
|
||||
if (!$id || !($orderInfo = $this->services->get($id))) {
|
||||
return app('json')->fail('订单不存在');
|
||||
}
|
||||
/** @var UserServices $services */
|
||||
$services = app()->make(UserServices::class);
|
||||
$userInfo = $services->get($orderInfo['uid']);
|
||||
if (!$userInfo) return app('json')->fail('用户信息不存在');
|
||||
$userInfo = $userInfo->hidden(['pwd', 'add_ip', 'last_ip', 'login_type']);
|
||||
$orderInfo = $this->services->tidyOrder($orderInfo->toArray());
|
||||
$userInfo = $userInfo->toArray();
|
||||
return app('json')->success(compact('orderInfo', 'userInfo'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物流信息
|
||||
* @param $id 订单id
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_express($id, ExpressServices $services)
|
||||
{
|
||||
if (!$id || !($orderInfo = $this->services->get($id)))
|
||||
return app('json')->fail('订单不存在');
|
||||
if ($orderInfo['delivery_type'] != 'express' || !$orderInfo['delivery_id'])
|
||||
return app('json')->fail('该订单不存在快递单号');
|
||||
|
||||
$cacheName = 'integral' . $orderInfo['order_id'] . $orderInfo['delivery_id'];
|
||||
|
||||
$data['delivery_name'] = $orderInfo['delivery_name'];
|
||||
$data['delivery_id'] = $orderInfo['delivery_id'];
|
||||
$data['result'] = $services->query($cacheName, $orderInfo['delivery_id'], $orderInfo['delivery_code'] ?? null);
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取修改配送信息表单结构
|
||||
* @param $id 订单id
|
||||
* @return mixed
|
||||
* @throws \FormBuilder\Exception\FormBuilderException
|
||||
*/
|
||||
public function distribution($id)
|
||||
{
|
||||
if (!$id) {
|
||||
return app('json')->fail('订单不存在');
|
||||
}
|
||||
return app('json')->success($this->services->distributionForm((int)$id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配送信息
|
||||
* @param $id 订单id
|
||||
* @return mixed
|
||||
*/
|
||||
public function update_distribution($id)
|
||||
{
|
||||
$data = $this->request->postMore([['delivery_name', ''], ['delivery_id', '']]);
|
||||
if (!$id) return app('json')->fail('Data does not exist!');
|
||||
$this->services->updateDistribution($id, $data);
|
||||
return app('json')->success('Modified success');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改备注
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function remark($id)
|
||||
{
|
||||
$data = $this->request->postMore([['remark', '']]);
|
||||
if (!$data['remark'])
|
||||
return app('json')->fail('请输入要备注的内容');
|
||||
if (!$id)
|
||||
return app('json')->fail('缺少参数');
|
||||
if (!$order = $this->services->get($id)) {
|
||||
return app('json')->fail('修改的订单不存在!');
|
||||
}
|
||||
$order->remark = $data['remark'];
|
||||
if ($order->save()) {
|
||||
return app('json')->success('备注成功');
|
||||
} else
|
||||
return app('json')->fail('备注失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单状态列表并分页
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function status(StoreIntegralOrderStatusServices $services, $id)
|
||||
{
|
||||
if (!$id) return app('json')->fail('缺少参数');
|
||||
return app('json')->success($services->getStatusList(['oid' => $id])['list']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 易联云打印机打印
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function order_print($id)
|
||||
{
|
||||
if (!$id) return app('json')->fail('缺少参数');
|
||||
$order = $this->services->get($id);
|
||||
if (!$order) {
|
||||
return app('json')->fail('订单没有查到,无法打印!');
|
||||
}
|
||||
$res = $this->services->orderPrint($order);
|
||||
if ($res) {
|
||||
return app('json')->success('打印成功');
|
||||
} else {
|
||||
return app('json')->fail('打印失败');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 电子面单模板
|
||||
* @param $com
|
||||
* @return mixed
|
||||
*/
|
||||
public function expr_temp(ServeServices $services, $com)
|
||||
{
|
||||
if (!$com) {
|
||||
return app('json')->fail('快递公司编号缺失');
|
||||
}
|
||||
$list = $services->express()->temp($com);
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板
|
||||
*/
|
||||
public function express_temp(ServeServices $services)
|
||||
{
|
||||
$data = $this->request->getMore([['com', '']]);
|
||||
$tpd = $services->express()->temp($data['com']);
|
||||
return app('json')->success($tpd['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单发货后打印电子面单
|
||||
* @param $orderId
|
||||
* @param StoreOrderDeliveryServices $storeOrderDeliveryServices
|
||||
* @return mixed
|
||||
*/
|
||||
public function order_dump($order_id, StoreOrderDeliveryServices $storeOrderDeliveryServices)
|
||||
{
|
||||
return app('json')->success($storeOrderDeliveryServices->orderDump($order_id));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配置信息
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDeliveryInfo()
|
||||
{
|
||||
return app('json')->success([
|
||||
'express_temp_id' => sys_config('config_export_temp_id'),
|
||||
'id' => sys_config('config_export_id'),
|
||||
'to_name' => sys_config('config_export_to_name'),
|
||||
'to_tel' => sys_config('config_export_to_tel'),
|
||||
'to_add' => sys_config('config_export_to_address'),
|
||||
'export_open' => (int)sys_config('config_export_open') ? true : false
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,174 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\adminapi\controller\v1\marketing\lottery;
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\activity\lottery\LuckLotteryServices;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
* 抽奖活动
|
||||
* Class LuckLottery
|
||||
* @package app\controller\admin\v1\marketing\lottery
|
||||
*/
|
||||
class LuckLottery extends AuthController
|
||||
{
|
||||
|
||||
/**
|
||||
* LuckLottery constructor.
|
||||
* @param App $app
|
||||
* @param LuckLotteryServices $services
|
||||
*/
|
||||
public function __construct(App $app, LuckLotteryServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->postMore([
|
||||
['start_status', '','','start'],
|
||||
['status', ''],
|
||||
['factor', ''],
|
||||
['store_name', '','','keyword'],
|
||||
]);
|
||||
return app('json')->success($this->services->getList($where));
|
||||
}
|
||||
|
||||
public function detail($id)
|
||||
{
|
||||
if (!$id) {
|
||||
return app('json')->fail('缺少参数id');
|
||||
}
|
||||
return app('json')->success($this->services->getlotteryInfo((int)$id));
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['name', ''],
|
||||
['desc', ''],
|
||||
['image', ''],
|
||||
['factor', 1],
|
||||
['factor_num', 1],
|
||||
['attends_user', 1],
|
||||
['user_level', []],
|
||||
['user_label', []],
|
||||
['is_svip', 0],
|
||||
['period', [0, 0]],
|
||||
['lottery_num_term', 1],
|
||||
['lottery_num', 1],
|
||||
['spread_num', 1],
|
||||
['is_all_record', 1],
|
||||
['is_personal_record', 1],
|
||||
['is_content', 1],
|
||||
['content', ''],
|
||||
['status', 1],
|
||||
['prize', []]
|
||||
]);
|
||||
if (!$data['name']) {
|
||||
return app('json')->fail('请添加抽奖活动名称');
|
||||
}
|
||||
if ($data['is_content'] && !$data['content']) {
|
||||
return app('json')->fail('请添加抽奖描述等文案');
|
||||
}
|
||||
[$start, $end] = $data['period'];
|
||||
unset($data['period']);
|
||||
$data['start_time'] = $start ? strtotime($start) : 0;
|
||||
$data['end_time'] = $end ? strtotime($end) : 0;
|
||||
if ($data['start_time'] && $data['end_time'] && $data['end_time'] <= $data['start_time']) {
|
||||
return app('json')->fail('活动结束时间必须大于开始时间');
|
||||
}
|
||||
if (!$data['prize']) {
|
||||
return app('json')->fail('请添加奖品');
|
||||
}
|
||||
if (in_array($data['factor'], [1, 2]) && !$data['factor_num']) {
|
||||
return app('json')->fail('请填写消耗' . ($data['factor'] == '1' ? '积分' : '余额') . '数量');
|
||||
}
|
||||
return app('json')->success($this->services->add($data) ? '添加成功' : '添加失败');
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['name', ''],
|
||||
['desc', ''],
|
||||
['image', ''],
|
||||
['factor', 1],
|
||||
['factor_num', 1],
|
||||
['attends_user', 1],
|
||||
['user_level', []],
|
||||
['user_label', []],
|
||||
['is_svip', 0],
|
||||
['period', [0, 0]],
|
||||
['lottery_num_term', 1],
|
||||
['lottery_num', 1],
|
||||
['spread_num', 1],
|
||||
['is_all_record', 1],
|
||||
['is_personal_record', 1],
|
||||
['is_content', 1],
|
||||
['content', ''],
|
||||
['status', 1],
|
||||
['prize', []]
|
||||
]);
|
||||
if (!$id) {
|
||||
return app('json')->fail('缺少参数id');
|
||||
}
|
||||
if (!$data['name']) {
|
||||
return app('json')->fail('请添加抽奖活动名称');
|
||||
}
|
||||
[$start, $end] = $data['period'];
|
||||
unset($data['period']);
|
||||
$data['start_time'] = $start ? strtotime($start) : 0;
|
||||
$data['end_time'] = $end ? strtotime($end) : 0;
|
||||
if ($data['start_time'] && $data['end_time'] && $data['end_time'] <= $data['start_time']) {
|
||||
return app('json')->fail('活动结束时间必须大于开始时间');
|
||||
}
|
||||
if ($data['is_content'] && !$data['content']) {
|
||||
return app('json')->fail('请添加抽奖描述等文案');
|
||||
}
|
||||
if (!$data['prize']) {
|
||||
return app('json')->fail('请添加奖品');
|
||||
}
|
||||
if (in_array($data['factor'], [1, 2]) && !$data['factor_num']) {
|
||||
return app('json')->fail('请填写消耗' . ($data['factor'] == '1' ? '积分' : '余额') . '数量');
|
||||
}
|
||||
return app('json')->success($this->services->edit((int)$id, $data) ? '编辑成功' : '编辑失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param $id
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
list($id) = $this->request->getMore([
|
||||
['id', 0],
|
||||
], true);
|
||||
if (!$id) return app('json')->fail('数据不存在');
|
||||
$this->services->delLottery((int)$id);
|
||||
return app('json')->success('刪除成功!');
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置活动状态
|
||||
* @return json
|
||||
*/
|
||||
public function setStatus($id = '', $status = '')
|
||||
{
|
||||
if ($status == '' || $id == '') return app('json')->fail('缺少参数');
|
||||
return app('json')->success($this->services->setStatus((int)$id, (int)$status) ? '上架成功' : '下架成功');
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\adminapi\controller\v1\marketing\lottery;
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\activity\lottery\LuckLotteryRecordServices;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
* 抽奖中奖记录
|
||||
* Class LuckLotteryRecord
|
||||
* @package app\controller\admin\v1\marketing\lottery
|
||||
*/
|
||||
class LuckLotteryRecord extends AuthController
|
||||
{
|
||||
|
||||
/**
|
||||
* LuckLotteryRecord constructor.
|
||||
* @param App $app
|
||||
* @param LuckLotteryRecordServices $services
|
||||
*/
|
||||
public function __construct(App $app, LuckLotteryRecordServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
|
||||
public function index($id)
|
||||
{
|
||||
$where = $this->request->postMore([
|
||||
['lottery_id', 0],
|
||||
['is_receive', ''],
|
||||
['is_deliver', ''],
|
||||
['type', ''],
|
||||
['keyword', ''],
|
||||
['data', '', '', 'time'],
|
||||
]);
|
||||
if (!$id) {
|
||||
return app('json')->fail('缺少活动ID');
|
||||
}
|
||||
$where['lottery_id'] = $id;
|
||||
return app('json')->success($this->services->getList($where));
|
||||
}
|
||||
|
||||
public function deliver($id)
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['deliver_name', ''],
|
||||
['deliver_number', ''],
|
||||
['mark', ''],
|
||||
]);
|
||||
if (!$id) {
|
||||
return app('json')->fail('缺少ID');
|
||||
}
|
||||
return app('json')->success($this->services->setDeliver((int)$id, $data) ? '处理成功' : '处理失败');
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\adminapi\controller\v1\marketing\lottery;
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\activity\lottery\LuckPrizeServices;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
* 抽奖奖品
|
||||
* Class LuckPrize
|
||||
* @package app\controller\admin\v1\marketing\lottery
|
||||
*/
|
||||
class LuckPrize extends AuthController
|
||||
{
|
||||
|
||||
/**
|
||||
* LuckPrize constructor.
|
||||
* @param App $app
|
||||
* @param LuckPrizeServices $services
|
||||
*/
|
||||
public function __construct(App $app, LuckPrizeServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['type', 1],
|
||||
['lottery_id', 0],
|
||||
['name', ''],
|
||||
['prompt', ''],
|
||||
['image', ''],
|
||||
['chance', 1],
|
||||
['total', 1],
|
||||
['couon_id', 0],
|
||||
['product_id', 0],
|
||||
['unique', ''],
|
||||
['num', 1]
|
||||
]);
|
||||
if (!$id) {
|
||||
return app('json')->fail('缺少参数id');
|
||||
}
|
||||
if (!$data['lottery_id']) {
|
||||
return app('json')->fail('缺少抽奖活动id');
|
||||
}
|
||||
return app('json')->success($this->services->edit((int)$id, $data) ? '编辑成功' : '编辑失败');
|
||||
}
|
||||
|
||||
}
|
||||
@ -80,7 +80,7 @@ class SystemStore extends AuthController
|
||||
public function select_address()
|
||||
{
|
||||
$key = sys_config('tengxun_map_key');
|
||||
if (!$key) return app('json')->fail('请前往设置->系统设置->物流配置 配置腾讯地图KEY');
|
||||
if (!$key) return app('json')->fail('请前往设置->系统设置->第三方接口设置 配置腾讯地图KEY');
|
||||
return app('json')->success(compact('key'));
|
||||
}
|
||||
|
||||
@ -111,13 +111,15 @@ class SystemStore extends AuthController
|
||||
['name', ''],
|
||||
['introduction', ''],
|
||||
['image', ''],
|
||||
['oblong_image', ''],
|
||||
['phone', ''],
|
||||
['address', ''],
|
||||
['detailed_address', ''],
|
||||
['latlng', ''],
|
||||
['day_time', []],
|
||||
]);
|
||||
validate(\app\adminapi\validate\merchant\SystemStoreValidate::class)->scene('save')->check($data);
|
||||
$this->validate($data, \app\adminapi\validate\merchant\SystemStoreValidate::class, 'save');
|
||||
|
||||
$data['address'] = implode(',', $data['address']);
|
||||
$data['latlng'] = explode(',', $data['latlng']);
|
||||
if (!isset($data['latlng'][0]) || !isset($data['latlng'][1])) {
|
||||
|
||||
@ -72,16 +72,13 @@ class SystemVerifyOrder extends AuthController
|
||||
{
|
||||
/** @var UserServices $userServices */
|
||||
$userServices = app()->make(UserServices::class);
|
||||
$userInfo = $userServices->getUserInfo((int)$uid);
|
||||
$spread = [];
|
||||
if ($userInfo['spread_uid']) {
|
||||
$spread = $userServices->getUserInfo((int)$userInfo['spread_uid']);
|
||||
if ($spread) {
|
||||
$spread = $spread->toArray();
|
||||
$spread['brokerage_pric'] = $spread['brokerage_price'];
|
||||
$spread['birthday'] = $spread['birthday'] ? date('Y-m-d', $spread['birthday']) : '';
|
||||
$spread['last_time'] = $spread['last_time'] ? date('Y-m-d H:i:s', $spread['last_time']) : '';
|
||||
}
|
||||
$spread = $userServices->getUserInfo((int)$uid);
|
||||
if ($spread) {
|
||||
$spread = $spread->toArray();
|
||||
$spread['brokerage_pric'] = $spread['brokerage_price'];
|
||||
$spread['birthday'] = $spread['birthday'] ? date('Y-m-d', $spread['birthday']) : '';
|
||||
$spread['last_time'] = $spread['last_time'] ? date('Y-m-d H:i:s', $spread['last_time']) : '';
|
||||
}
|
||||
return app('json')->success(['spread' => $spread]);
|
||||
}
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
namespace app\adminapi\controller\v1\notification\sms;
|
||||
|
||||
use app\services\message\sms\SmsAdminServices;
|
||||
use app\services\message\sms\SmsRecordServices;
|
||||
use app\services\serve\ServeServices;
|
||||
use crmeb\services\CacheService;
|
||||
use app\adminapi\controller\AuthController;
|
||||
@ -48,7 +47,7 @@ class SmsConfig extends AuthController
|
||||
['sms_token', '']
|
||||
], true);
|
||||
|
||||
validate(\app\adminapi\validate\notification\SmsConfigValidate::class)->check(['sms_account' => $account, 'sms_token' => $token]);
|
||||
$this->validate(['sms_account' => $account, 'sms_token' => $token], \app\adminapi\validate\notification\SmsConfigValidate::class);
|
||||
|
||||
if ($this->services->login($account, $token)) {
|
||||
return app('json')->success('登录成功');
|
||||
|
||||
@ -11,14 +11,10 @@
|
||||
namespace app\adminapi\controller\v1\order;
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\kefu\LoginServices;
|
||||
use app\services\message\service\StoreServiceLogServices;
|
||||
use app\services\message\service\StoreServiceServices;
|
||||
use app\services\order\DeliveryServiceServices;
|
||||
use app\services\user\UserServices;
|
||||
use app\services\user\UserWechatuserServices;
|
||||
use crmeb\exceptions\AdminException;
|
||||
use crmeb\services\CacheService;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
@ -29,9 +25,9 @@ use think\facade\App;
|
||||
class DeliveryService extends AuthController
|
||||
{
|
||||
/**
|
||||
* StoreService constructor.
|
||||
* DeliveryService constructor.
|
||||
* @param App $app
|
||||
* @param StoreServiceServices $services
|
||||
* @param DeliveryServiceServices $services
|
||||
*/
|
||||
public function __construct(App $app, DeliveryServiceServices $services)
|
||||
{
|
||||
|
||||
@ -10,13 +10,17 @@
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\v1\order;
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\order\OtherOrderServices;
|
||||
use app\services\other\QrcodeServices;
|
||||
use crmeb\utils\Canvas;
|
||||
use think\facade\App;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* Class OtherOrder
|
||||
* @package app\adminapi\controller\v1\order
|
||||
*/
|
||||
class OtherOrder extends AuthController
|
||||
{
|
||||
/**
|
||||
@ -80,7 +84,7 @@ class OtherOrder extends AuthController
|
||||
$canvas->setImageUrl($v)->setImageHeight(344)->setImageWidth(344)->setImageLeft(76)->setImageTop(120)->pushImageValue();
|
||||
$image = $canvas->setFileName($name)->setImageType($imageType)->setPath($path)->setBackgroundWidth(500)->setBackgroundHeight(720)->starDrawChart();
|
||||
$data[$k] = $image ? $siteUrl . '/' . $image : '';
|
||||
}else{
|
||||
} else {
|
||||
$data[$k] = "";
|
||||
}
|
||||
|
||||
|
||||
54
crmeb/app/adminapi/controller/v1/order/RefundOrder.php
Normal file
54
crmeb/app/adminapi/controller/v1/order/RefundOrder.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\adminapi\controller\v1\order;
|
||||
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\order\StoreOrderServices;
|
||||
use think\facade\App;
|
||||
|
||||
class RefundOrder extends AuthController
|
||||
{
|
||||
/**
|
||||
* StoreOrder constructor.
|
||||
* @param App $app
|
||||
* @param StoreOrderServices $service
|
||||
* @method temp
|
||||
*/
|
||||
public function __construct(App $app, StoreOrderServices $service)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款订单列表
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getRefundList()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['order_id', ''],
|
||||
['time', '', '', 'refund_reason_time'],
|
||||
['refund_type', 0]
|
||||
]);
|
||||
return app('json')->success($this->services->refundList($where));
|
||||
}
|
||||
|
||||
/**
|
||||
* 商家同意退款
|
||||
* @return mixed
|
||||
*/
|
||||
public function agreeRefund()
|
||||
{
|
||||
[$order_id] = $this->request->getMore([
|
||||
['order_id', '']
|
||||
], true);
|
||||
$this->services->agreeRefund($order_id);
|
||||
return app('json')->success('操作成功');
|
||||
}
|
||||
}
|
||||
@ -14,7 +14,7 @@ namespace app\adminapi\controller\v1\order;
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\adminapi\validate\order\StoreOrderValidate;
|
||||
use app\services\serve\ServeServices;
|
||||
use app\services\order\{
|
||||
use app\services\order\{StoreOrderCartInfoServices,
|
||||
StoreOrderDeliveryServices,
|
||||
StoreOrderRefundServices,
|
||||
StoreOrderStatusServices,
|
||||
@ -79,7 +79,12 @@ class StoreOrder extends AuthController
|
||||
]);
|
||||
$where['shipping_type'] = 1;
|
||||
$where['is_system_del'] = 0;
|
||||
return app('json')->success($this->services->getOrderList($where, ['*'], ['pink', 'invoice']));
|
||||
if (!$where['real_name'] && !in_array($where['status'], [-1, -2, -3])) {
|
||||
$where['pid'] = 0;
|
||||
}
|
||||
return app('json')->success($this->services->getOrderList($where, ['*'], ['split' => function ($query) {
|
||||
$query->field('id,pid');
|
||||
}, 'pink', 'invoice']));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -160,7 +165,8 @@ class StoreOrder extends AuthController
|
||||
['gain_integral', 0],
|
||||
]);
|
||||
|
||||
validate(StoreOrderValidate::class)->check($data);
|
||||
$this->validate($data, StoreOrderValidate::class);
|
||||
|
||||
if ($data['total_price'] < 0) return app('json')->fail('Please enter the total price');
|
||||
if ($data['pay_price'] < 0) return app('json')->fail('Please enter the actual payment amount');
|
||||
|
||||
@ -174,7 +180,12 @@ class StoreOrder extends AuthController
|
||||
*/
|
||||
public function express(ExpressServices $services)
|
||||
{
|
||||
return app('json')->success($services->express(['is_show' => 1]));
|
||||
[$status] = $this->request->getMore([
|
||||
['status', ''],
|
||||
], true);
|
||||
if ($status != '') $data['status'] = $status;
|
||||
$data['is_show'] = 1;
|
||||
return app('json')->success($services->express($data));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -242,6 +253,74 @@ class StoreOrder extends AuthController
|
||||
return app('json')->success('SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单拆单发送货
|
||||
* @param $id 订单id
|
||||
* @return mixed
|
||||
*/
|
||||
public function split_delivery($id, StoreOrderDeliveryServices $services)
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['type', 1],
|
||||
['delivery_name', ''],//快递公司名称
|
||||
['delivery_id', ''],//快递单号
|
||||
['delivery_code', ''],//快递公司编码
|
||||
|
||||
['express_record_type', 2],//发货记录类型
|
||||
['express_temp_id', ""],//电子面单模板
|
||||
['to_name', ''],//寄件人姓名
|
||||
['to_tel', ''],//寄件人电话
|
||||
['to_addr', ''],//寄件人地址
|
||||
|
||||
['sh_delivery_name', ''],//送货人姓名
|
||||
['sh_delivery_id', ''],//送货人电话
|
||||
['sh_delivery_uid', ''],//送货人ID
|
||||
|
||||
['fictitious_content', ''],//虚拟发货内容
|
||||
|
||||
['cart_ids', []]
|
||||
]);
|
||||
if (!$id) {
|
||||
return app('json')->fail('缺少发货ID');
|
||||
}
|
||||
if (!$data['cart_ids']) {
|
||||
return app('json')->fail('请选择发货商品');
|
||||
}
|
||||
foreach ($data['cart_ids'] as $cart) {
|
||||
if (!isset($cart['cart_id']) || !$cart['cart_id'] || !isset($cart['cart_num']) || !$cart['cart_num']) {
|
||||
return app('json')->fail('请重新选择发货商品,或发货件数');
|
||||
}
|
||||
}
|
||||
$services->splitDelivery((int)$id, $data);
|
||||
return app('json')->success('SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单可拆分发货商品列表
|
||||
* @param $id
|
||||
* @param StoreOrderCartInfoServices $services
|
||||
* @return mixed
|
||||
*/
|
||||
public function split_cart_info($id, StoreOrderCartInfoServices $services)
|
||||
{
|
||||
if (!$id) {
|
||||
return app('json')->fail('缺少发货ID');
|
||||
}
|
||||
return app('json')->success($services->getSplitCartList((int)$id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单拆分子订单列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function split_order($id)
|
||||
{
|
||||
if (!$id) {
|
||||
return app('json')->fail('缺少订单ID');
|
||||
}
|
||||
return app('json')->success($this->services->getSplitOrderList(['pid' => $id, 'is_system_del' => 0], ['*'], ['split', 'pink', 'invoice']));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 确认收货
|
||||
@ -346,6 +425,7 @@ class StoreOrder extends AuthController
|
||||
} else if ($data['type'] == 2) {
|
||||
$data['refund_status'] = 0;
|
||||
}
|
||||
$data['refund_type'] = 6;
|
||||
$type = $data['type'];
|
||||
unset($data['type']);
|
||||
$refund_data['pay_price'] = $order['pay_price'];
|
||||
@ -392,7 +472,12 @@ class StoreOrder extends AuthController
|
||||
$userInfo['spread_uid'] = '';
|
||||
}
|
||||
|
||||
$orderInfo = $this->services->tidyOrder($orderInfo->toArray());
|
||||
$orderInfo = $this->services->tidyOrder($orderInfo->toArray(), true, true);
|
||||
//核算优惠金额
|
||||
$vipTruePrice = array_column($orderInfo['cartInfo'], 'vip_sum_truePrice');
|
||||
$vipTruePrice = round(array_sum($vipTruePrice), 2);
|
||||
$orderInfo['vip_true_price'] = $vipTruePrice ? $vipTruePrice : 0;
|
||||
$orderInfo['total_price'] = bcadd($orderInfo['total_price'], $orderInfo['vip_true_price'], 2);
|
||||
if ($orderInfo['store_id'] && $orderInfo['shipping_type'] == 2) {
|
||||
/** @var $storeServices */
|
||||
$storeServices = app()->make(SystemStoreServices::class);
|
||||
@ -479,9 +564,21 @@ class StoreOrder extends AuthController
|
||||
}
|
||||
$orderInfo->refund_reason = $refund_reason;
|
||||
$orderInfo->refund_status = 0;
|
||||
$orderInfo->refund_type = 3;
|
||||
$orderInfo->save();
|
||||
if ($orderInfo->pid > 0) {
|
||||
$res1 = $this->services->getCount([
|
||||
['pid', '=', $orderInfo->pid],
|
||||
['refund_type', '>', 0],
|
||||
['refund_type', '<>', 3],
|
||||
]);
|
||||
if ($res1 == 0) {
|
||||
$this->services->update($orderInfo->pid, ['refund_status' => 0]);
|
||||
}
|
||||
}
|
||||
$services->storeProductOrderRefundNo((int)$id, $refund_reason);
|
||||
$services->OrderRefundNoSendTemplate($orderInfo);
|
||||
//提醒推送
|
||||
event('notice.notice', [['orderInfo' => $orderInfo], 'send_order_refund_no_status']);
|
||||
return app('json')->success('Modified success');
|
||||
}
|
||||
|
||||
@ -603,5 +700,40 @@ class StoreOrder extends AuthController
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 电子面单模板
|
||||
* @param $com
|
||||
* @return mixed
|
||||
*/
|
||||
public function expr_temp(ServeServices $services, $com)
|
||||
{
|
||||
if (!$com) {
|
||||
return app('json')->fail('快递公司编号缺失');
|
||||
}
|
||||
$list = $services->express()->temp($com);
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板
|
||||
*/
|
||||
public function express_temp(ServeServices $services)
|
||||
{
|
||||
$data = $this->request->getMore([['com', '']]);
|
||||
$tpd = $services->express()->temp($data['com']);
|
||||
return app('json')->success($tpd['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单发货后打印电子面单
|
||||
* @param $orderId
|
||||
* @param StoreOrderDeliveryServices $storeOrderDeliveryServices
|
||||
* @return mixed
|
||||
*/
|
||||
public function order_dump($order_id, StoreOrderDeliveryServices $storeOrderDeliveryServices)
|
||||
{
|
||||
return app('json')->success($storeOrderDeliveryServices->orderDump($order_id));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -19,7 +19,8 @@ use app\services\user\UserServices;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
* Class UserLevel
|
||||
* 发票管理
|
||||
* Class StoreOrderInvoice
|
||||
* @package app\adminapi\controller\v1\order
|
||||
*/
|
||||
class StoreOrderInvoice extends AuthController
|
||||
@ -50,6 +51,10 @@ class StoreOrderInvoice extends AuthController
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询发票列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function list()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
@ -107,7 +112,12 @@ class StoreOrderInvoice extends AuthController
|
||||
$userInfo['spread_name'] = '';
|
||||
if ($userInfo['spread_uid'])
|
||||
$userInfo['spread_name'] = $services->value(['uid' => $userInfo['spread_uid']], 'nickname');
|
||||
$orderInfo = $orderServices->tidyOrder($orderInfo->toArray(), true);
|
||||
$orderInfo = $orderServices->tidyOrder($orderInfo->toArray(), true, true);
|
||||
//核算优惠金额
|
||||
$vipTruePrice = array_column($orderInfo['cartInfo'], 'vip_sum_truePrice');
|
||||
$vipTruePrice = array_sum($vipTruePrice);
|
||||
$orderInfo['vip_true_price'] = $vipTruePrice ? $vipTruePrice : 0;
|
||||
|
||||
$orderInfo['add_time'] = $orderInfo['_add_time'] ?? '';
|
||||
$productId = array_column($orderInfo['cartInfo'], 'product_id');
|
||||
$cateData = $productServices->productIdByProductCateName($productId);
|
||||
|
||||
@ -34,6 +34,7 @@ class CopyTaobao extends AuthController
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取复制商品配置信息
|
||||
* @return mixed
|
||||
*/
|
||||
public function getConfig()
|
||||
|
||||
@ -65,6 +65,19 @@ class StoreCategory extends AuthController
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分类cascader格式数据
|
||||
* @param $type
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function cascader_list($type = 1)
|
||||
{
|
||||
return app('json')->success($this->service->cascaderList(1, $type));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* @param string $is_show
|
||||
|
||||
@ -16,6 +16,7 @@ use app\services\order\StoreCartServices;
|
||||
use app\services\other\CacheServices;
|
||||
use app\services\product\product\StoreCategoryServices;
|
||||
use app\services\product\product\StoreProductServices;
|
||||
use crmeb\services\FileService;
|
||||
use crmeb\services\UploadService;
|
||||
use think\facade\App;
|
||||
|
||||
@ -93,12 +94,24 @@ class StoreProduct extends AuthController
|
||||
['coupon_ids', []],
|
||||
['label_id', []],
|
||||
['command_word', ''],
|
||||
['tao_words', '']
|
||||
['tao_words', ''],
|
||||
['type', 0]
|
||||
]);
|
||||
$services->setDbCache($this->adminId . '_product_data', $data, 68400);
|
||||
return app('json')->success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据缓存
|
||||
* @param CacheServices $services
|
||||
* @return mixed
|
||||
*/
|
||||
public function deleteCacheData(CacheServices $services)
|
||||
{
|
||||
$services->delectDbCache($this->adminId . '_product_data');
|
||||
return app('json')->success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示资源列表
|
||||
* @return mixed
|
||||
@ -209,6 +222,8 @@ class StoreProduct extends AuthController
|
||||
['mer_use', 0],
|
||||
['is_postage', 0],
|
||||
['is_good', 0],
|
||||
['is_virtual', 0],// 是否是虚拟商品
|
||||
['virtual_type', 0],// 虚拟商品类型
|
||||
['description', ''],
|
||||
['spec_type', 0],
|
||||
['video_link', ''],
|
||||
@ -218,7 +233,9 @@ class StoreProduct extends AuthController
|
||||
['coupon_ids', []],
|
||||
['label_id', []],
|
||||
['command_word', ''],
|
||||
['tao_words', '']
|
||||
['tao_words', ''],
|
||||
['type', 0],
|
||||
['recommend_list', []]
|
||||
]);
|
||||
$this->service->save((int)$id, $data);
|
||||
return app('json')->success('添加商品成功!');
|
||||
@ -251,7 +268,9 @@ class StoreProduct extends AuthController
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['attrs', []],
|
||||
['items', []]
|
||||
['items', []],
|
||||
['is_virtual', 0],
|
||||
['virtual_type', 0]
|
||||
]);
|
||||
if ($id > 0 && $type == 1) $this->service->checkActivity($id);
|
||||
$info = $this->service->getAttr($data, $id, $type);
|
||||
@ -270,7 +289,8 @@ class StoreProduct extends AuthController
|
||||
['store_name', ''],
|
||||
['type', 1],
|
||||
['is_live', 0],
|
||||
['is_new', '']
|
||||
['is_new', ''],
|
||||
['is_virtual', -1]
|
||||
]);
|
||||
$where['is_show'] = 1;
|
||||
$where['is_del'] = 0;
|
||||
@ -311,6 +331,11 @@ class StoreProduct extends AuthController
|
||||
return app('json')->success($this->service->getTemp());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取视频上传token
|
||||
* @return mixed
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function getTempKeys()
|
||||
{
|
||||
$upload = UploadService::init();
|
||||
@ -330,4 +355,17 @@ class StoreProduct extends AuthController
|
||||
$this->service->checkActivity($id);
|
||||
return app('json')->success('删除成功');
|
||||
}
|
||||
|
||||
public function import_card()
|
||||
{
|
||||
$data = $this->request->getMore([
|
||||
['file', ""]
|
||||
]);
|
||||
if (!$data['file']) return app('json')->fail('请上传文件');
|
||||
$file = public_path() . substr($data['file'], 1);
|
||||
/** @var FileService $readExcelService */
|
||||
$readExcelService = app()->make(FileService::class);
|
||||
$cardData = $readExcelService->readExcel($file);
|
||||
return app('json')->success($cardData);
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,9 @@ class StoreProductReply extends AuthController
|
||||
['store_name', ''],
|
||||
['account', ''],
|
||||
['data', ''],
|
||||
['product_id', 0]
|
||||
['product_id', 0],
|
||||
['key', ''],
|
||||
['order', '']
|
||||
]);
|
||||
$list = $this->services->sysPage($where);
|
||||
return app('json')->success($list);
|
||||
@ -103,7 +105,7 @@ class StoreProductReply extends AuthController
|
||||
if (!$data['product_id']) {
|
||||
$data['product_id'] = $data['image']['product_id'] ?? '';
|
||||
}
|
||||
validate(\app\adminapi\validate\product\StoreProductReplyValidate::class)->scene('save')->check(['product_id' => $data['product_id'], 'nickname' => $data['nickname'], 'avatar' => $data['avatar'], 'comment' => $data['comment'], 'product_score' => $data['product_score'], 'service_score' => $data['service_score']]);
|
||||
$this->validate(['product_id' => $data['product_id'], 'nickname' => $data['nickname'], 'avatar' => $data['avatar'], 'comment' => $data['comment'], 'product_score' => $data['product_score'], 'service_score' => $data['service_score']], \app\adminapi\validate\product\StoreProductReplyValidate::class, 'save');
|
||||
$this->services->saveReply($data);
|
||||
return app('json')->success('添加成功!');
|
||||
}
|
||||
|
||||
@ -25,6 +25,11 @@ use think\facade\App;
|
||||
class Export extends AuthController
|
||||
{
|
||||
|
||||
/**
|
||||
* Export constructor.
|
||||
* @param App $app
|
||||
* @param ExpressServices $services
|
||||
*/
|
||||
public function __construct(App $app, ExpressServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
@ -53,4 +58,26 @@ class Export extends AuthController
|
||||
], true);
|
||||
return app('json')->success($services->express()->temp($com));
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印电子面单是否开启
|
||||
* @return mixed
|
||||
*/
|
||||
public function dumpIsOpen(ServeServices $services)
|
||||
{
|
||||
$userInfo = $services->user()->getUser();
|
||||
$res = false;
|
||||
if ($userInfo['dump']['open']) {
|
||||
$res = true;
|
||||
if (!sys_config('config_export_siid')
|
||||
&& !sys_config('config_export_com')
|
||||
&& !sys_config('config_export_to_name')
|
||||
&& !sys_config('config_export_to_tel')
|
||||
&& !sys_config('config_export_to_address')
|
||||
) {
|
||||
$res = false;
|
||||
}
|
||||
}
|
||||
return app('json')->success(['isOpen' => $res]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ class Login extends AuthController
|
||||
*/
|
||||
public function captcha(string $phone)
|
||||
{
|
||||
validate(ServeValidata::class)->scene('phone')->check(['phone' => $phone]);
|
||||
$this->validate(['phone' => $phone], ServeValidata::class, 'phone');
|
||||
return app('json')->success('发送成功', $this->services->user()->code($phone));
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ class Login extends AuthController
|
||||
['phone', ''],
|
||||
['verify_code', ''],
|
||||
], true);
|
||||
validate(ServeValidata::class)->scene('phone')->check(['phone' => $phone]);
|
||||
$this->validate(['phone' => $phone], ServeValidata::class, 'phone');
|
||||
return app('json')->success('success', $this->services->user()->checkCode($phone, $verify_code));
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ class Login extends AuthController
|
||||
]);
|
||||
|
||||
$data['account'] = $data['phone'];
|
||||
validate(ServeValidata::class)->check($data);
|
||||
$this->validate($data, ServeValidata::class);
|
||||
$data['password'] = md5($data['password']);
|
||||
$res = $this->services->user()->register($data);
|
||||
if ($res) {
|
||||
@ -100,7 +100,8 @@ class Login extends AuthController
|
||||
['password', '']
|
||||
], true);
|
||||
|
||||
validate(ServeValidata::class)->scene('login')->check(['account' => $account, 'password' => $password]);
|
||||
$this->validate(['account' => $account, 'password' => $password], ServeValidata::class, 'login');
|
||||
|
||||
$password = md5($account . md5($password));
|
||||
|
||||
$res = $this->services->user()->login($account, $password);
|
||||
|
||||
@ -96,7 +96,8 @@ class Serve extends AuthController
|
||||
if (!$openInfo['copy']['open']) return app('json')->fail('请先开通商品采集服务');
|
||||
break;
|
||||
}
|
||||
validate(MealValidata::class)->check($data);
|
||||
$this->validate($data, MealValidata::class);
|
||||
|
||||
$res = $this->services->user()->payMeal($data);
|
||||
if ($res) {
|
||||
return app('json')->success($res);
|
||||
@ -111,8 +112,23 @@ class Serve extends AuthController
|
||||
*/
|
||||
public function openExpress()
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['com', ''],
|
||||
['temp_id', ''],
|
||||
['to_name', ''],
|
||||
['to_tel', ''],
|
||||
['to_address', ''],
|
||||
['siid', ''],
|
||||
]);
|
||||
|
||||
$this->validate($data, ExpressValidata::class);
|
||||
|
||||
/** @var SystemConfigServices $systemConfigService */
|
||||
$systemConfigService = app()->make(SystemConfigServices::class);
|
||||
$systemConfigService->saveExpressInfo($data);
|
||||
$this->services->express()->open();
|
||||
return app('json')->success('开通成功');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -168,7 +184,8 @@ class Serve extends AuthController
|
||||
['verify_code', ''],
|
||||
]);
|
||||
|
||||
validate(ServeValidata::class)->check($data);
|
||||
$this->validate($data, ServeValidata::class);
|
||||
|
||||
$data['password'] = md5($data['password']);
|
||||
$this->services->user()->modify($data);
|
||||
CacheService::redisHandler()->delete('sms_account');
|
||||
@ -187,7 +204,8 @@ class Serve extends AuthController
|
||||
['verify_code', ''],
|
||||
]);
|
||||
|
||||
validate(ServeValidata::class)->scene('phone')->check($data);
|
||||
$this->validate($data, ServeValidata::class, 'phone');
|
||||
|
||||
$this->services->user()->modifyPhone($data);
|
||||
CacheService::redisHandler()->delete('sms_account');
|
||||
return app('json')->success('修改成功');
|
||||
|
||||
@ -63,7 +63,8 @@ class Sms extends AuthController
|
||||
['code', ''],
|
||||
], true);
|
||||
|
||||
validate(ServeValidata::class)->scene('phone')->check(['phone' => $phone]);
|
||||
$this->validate(['phone' => $phone], ServeValidata::class, 'phone');
|
||||
|
||||
if (!$sign) {
|
||||
return app('json')->fail('请设置短信签名');
|
||||
}
|
||||
|
||||
@ -65,15 +65,18 @@ class ShippingTemplates extends AuthController
|
||||
$data = $this->request->postMore([
|
||||
[['region_info', 'a'], []],
|
||||
[['appoint_info', 'a'], []],
|
||||
[['no_delivery_info', 'a'], []],
|
||||
[['sort', 'd'], 0],
|
||||
[['type', 'd'], 0],
|
||||
[['name', 's'], ''],
|
||||
[['appoint', 'd'], 0],
|
||||
[['no_delivery', 'd'], 0]
|
||||
]);
|
||||
validate(\app\adminapi\validate\setting\ShippingTemplatesValidate::class)->scene('save')->check($data);
|
||||
$this->validate($data, \app\adminapi\validate\setting\ShippingTemplatesValidate::class, 'save');
|
||||
$temp['name'] = $data['name'];
|
||||
$temp['type'] = $data['type'];
|
||||
$temp['appoint'] = $data['appoint'];
|
||||
$temp['appoint'] = $data['appoint'] && $data['appoint_info'] ? 1 : 0;
|
||||
$temp['no_delivery'] = $data['no_delivery'] && $data['no_delivery_info'] ? 1 : 0;
|
||||
$temp['sort'] = $data['sort'];
|
||||
$temp['add_time'] = time();
|
||||
$this->services->save((int)$id, $temp, $data);
|
||||
|
||||
@ -74,7 +74,8 @@ class SystemAdmin extends AuthController
|
||||
['status', 0],
|
||||
]);
|
||||
|
||||
validate(\app\adminapi\validate\setting\SystemAdminValidata::class)->check($data);
|
||||
$this->validate($data, \app\adminapi\validate\setting\SystemAdminValidata::class);
|
||||
|
||||
$data['level'] = $this->adminInfo['level'] + 1;
|
||||
$this->services->create($data);
|
||||
return app('json')->success('添加成功');
|
||||
@ -111,7 +112,8 @@ class SystemAdmin extends AuthController
|
||||
['status', 0],
|
||||
]);
|
||||
|
||||
validate(\app\adminapi\validate\setting\SystemAdminValidata::class)->scene('update')->check($data);
|
||||
$this->validate($data, \app\adminapi\validate\setting\SystemAdminValidata::class, 'update');
|
||||
|
||||
if ($this->services->save((int)$id, $data)) {
|
||||
return app('json')->success('修改成功');
|
||||
} else {
|
||||
|
||||
@ -79,7 +79,7 @@ class SystemCity extends AuthController
|
||||
[['level', 'd'], 0],
|
||||
[['parent_id', 'd'], 0],
|
||||
]);
|
||||
validate(\app\adminapi\validate\setting\SystemCityValidate::class)->scene('save')->check($data);
|
||||
$this->validate($data, \app\adminapi\validate\setting\SystemCityValidate::class, 'save');
|
||||
if ($data['parent_id'] == 0) {
|
||||
$data['merger_name'] = $data['name'];
|
||||
} else {
|
||||
@ -133,7 +133,8 @@ class SystemCity extends AuthController
|
||||
*/
|
||||
public function clean_cache()
|
||||
{
|
||||
$res = CacheService::delete('CITY_LIST');
|
||||
$res = CacheService::delete('tree_city_list');
|
||||
$res = $res && CacheService::delete('CITY_LIST');
|
||||
if ($res) {
|
||||
return app('json')->success('清除成功!');
|
||||
} else {
|
||||
|
||||
@ -77,20 +77,20 @@ class SystemConfig extends AuthController
|
||||
public function save()
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
'menu_name',
|
||||
'type',
|
||||
'input_type',
|
||||
'config_tab_id',
|
||||
'parameter',
|
||||
'upload_type',
|
||||
'required',
|
||||
'width',
|
||||
'high',
|
||||
'value',
|
||||
'info',
|
||||
'desc',
|
||||
'sort',
|
||||
'status',
|
||||
['menu_name', ''],
|
||||
['type', ''],
|
||||
['input_type', 'input'],
|
||||
['config_tab_id', 0],
|
||||
['parameter', ''],
|
||||
['upload_type', 1],
|
||||
['required', ''],
|
||||
['width', 0],
|
||||
['high', 0],
|
||||
['value', ''],
|
||||
['info', ''],
|
||||
['desc', ''],
|
||||
['sort', 0],
|
||||
['status', 0]
|
||||
]);
|
||||
if (!$data['info']) return app('json')->fail('请输入配置名称');
|
||||
if (!$data['menu_name']) return app('json')->fail('请输入字段名称');
|
||||
@ -164,7 +164,22 @@ class SystemConfig extends AuthController
|
||||
$value = request()->post('value/a');
|
||||
}
|
||||
if (!$value) $value = request()->post(request()->post('menu_name'));
|
||||
$data = $this->request->postMore(['status', 'info', 'desc', 'sort', 'config_tab_id', 'required', 'parameter', ['value', $value], 'upload_type', 'input_type']);
|
||||
$data = $this->request->postMore([
|
||||
['menu_name', ''],
|
||||
['type', ''],
|
||||
['input_type', 'input'],
|
||||
['config_tab_id', 0],
|
||||
['parameter', ''],
|
||||
['upload_type', 1],
|
||||
['required', ''],
|
||||
['width', 0],
|
||||
['high', 0],
|
||||
['value', $value],
|
||||
['info', ''],
|
||||
['desc', ''],
|
||||
['sort', 0],
|
||||
['status', 0]
|
||||
]);
|
||||
if (!$this->services->get($id)) {
|
||||
return app('json')->fail('编辑的记录不存在!');
|
||||
}
|
||||
@ -237,8 +252,13 @@ class SystemConfig extends AuthController
|
||||
}
|
||||
}
|
||||
}
|
||||
validate(\app\adminapi\validate\setting\SystemConfigValidata::class)->check($post);
|
||||
$this->services->checkParam($request->baseUrl(), $post);
|
||||
$this->validate($post, \app\adminapi\validate\setting\SystemConfigValidata::class);
|
||||
if (isset($post['upload_type'])) {
|
||||
$this->services->checkThumbParam($post);
|
||||
}
|
||||
if (isset($post['store_brokerage_binding_status'])) {
|
||||
$this->services->checkBrokerageBinding($post);
|
||||
}
|
||||
if (isset($post['store_brokerage_ratio']) && isset($post['store_brokerage_two'])) {
|
||||
$num = $post['store_brokerage_ratio'] + $post['store_brokerage_two'];
|
||||
if ($num > 100) {
|
||||
@ -251,10 +271,12 @@ class SystemConfig extends AuthController
|
||||
return app('json')->fail('分销海报不能多于5张');
|
||||
}
|
||||
}
|
||||
foreach ($post as $k => $v) {
|
||||
if ($k === 'user_extract_min_price' && !preg_match('/[0-9]$/', $v)) {
|
||||
if (isset($post['user_extract_min_price'])) {
|
||||
if (!preg_match('/[0-9]$/', $post['user_extract_min_price'])) {
|
||||
return app('json')->fail('提现最低金额只能为数字!');
|
||||
}
|
||||
}
|
||||
foreach ($post as $k => $v) {
|
||||
$config_one = $this->services->getOne(['menu_name' => $k]);
|
||||
if ($config_one) {
|
||||
$config_one['value'] = $v;
|
||||
@ -265,6 +287,33 @@ class SystemConfig extends AuthController
|
||||
if (isset($post['wss_open'])) {
|
||||
$this->services->saveSslFilePath((int)$post['wss_open'], $post['wss_local_pk'] ?? '', $post['wss_local_cert'] ?? '');
|
||||
}
|
||||
if (isset($post['store_brokerage_price']) && $post['store_brokerage_statu'] == 3) {
|
||||
if ($post['store_brokerage_price'] === '') {
|
||||
return app('json')->fail('满额分销最低金额不能为空!');
|
||||
}
|
||||
if ($post['store_brokerage_price'] < 0) {
|
||||
return app('json')->fail('满额分销最低金额不能小于0!');
|
||||
}
|
||||
}
|
||||
if (isset($post['store_brokerage_binding_time']) && $post['store_brokerage_binding_status'] == 2) {
|
||||
if (!preg_match("/^[0-9][0-9]*$/", $post['store_brokerage_binding_time'])) {
|
||||
return app('json')->fail('绑定有效期请填写正整数!');
|
||||
}
|
||||
}
|
||||
if (isset($post['weixin_ckeck_file'])) {
|
||||
$from = public_path() . $post['weixin_ckeck_file'];
|
||||
$to = public_path() . array_reverse(explode('/', $post['weixin_ckeck_file']))[0];
|
||||
@copy($from, $to);
|
||||
}
|
||||
if (isset($post['ico_path'])) {
|
||||
$from = public_path() . $post['ico_path'];
|
||||
$toAdmin = public_path('admin') . 'favicon.ico';
|
||||
$toHome = public_path('home') . 'favicon.ico';
|
||||
$toPublic = public_path() . 'favicon.ico';
|
||||
@copy($from, $toAdmin);
|
||||
@copy($from, $toHome);
|
||||
@copy($from, $toPublic);
|
||||
}
|
||||
\crmeb\services\CacheService::clear();
|
||||
return app('json')->success('修改成功');
|
||||
|
||||
@ -292,4 +341,14 @@ class SystemConfig extends AuthController
|
||||
return app('json')->success(compact('config_tab'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单个配置的值
|
||||
* @param $name
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_system($name)
|
||||
{
|
||||
$value = sys_config($name);
|
||||
return app('json')->success(compact('value'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,6 +210,6 @@ class SystemGroup extends AuthController
|
||||
*/
|
||||
public function getGroup()
|
||||
{
|
||||
return app('json')->success($this->services->getGroupList(['cate_id' => 1], ['id', 'name'])['list']);
|
||||
return app('json')->success($this->services->getGroupList(['cate_id' => 1], ['id', 'name', 'config_name'])['list']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,8 +42,14 @@ class SystemGroupData extends AuthController
|
||||
*/
|
||||
public function header(SystemGroupServices $services)
|
||||
{
|
||||
$gid = $this->request->param('gid/d');
|
||||
if (!$gid) return app('json')->fail('参数错误');
|
||||
[$gid, $config_name] = $this->request->getMore([
|
||||
['gid', 0],
|
||||
['config_name', '']
|
||||
], true);
|
||||
if (!$gid && !$config_name) return $this->fail('参数错误');
|
||||
if (!$gid) {
|
||||
$gid = $services->value(['config_name' => $config_name], 'id');
|
||||
}
|
||||
return app('json')->success($services->getGroupDataTabHeader($gid));
|
||||
}
|
||||
|
||||
@ -52,12 +58,18 @@ class SystemGroupData extends AuthController
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function index()
|
||||
public function index(SystemGroupServices $group)
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['gid', 0],
|
||||
['status', ''],
|
||||
['config_name', '']
|
||||
]);
|
||||
if (!$where['gid'] && !$where['config_name']) return app('json')->fail('参数错误');
|
||||
if (!$where['gid']) {
|
||||
$where['gid'] = $group->value(['config_name' => $where['config_name']], 'id');
|
||||
}
|
||||
unset($where['config_name']);
|
||||
return app('json')->success($this->services->getGroupDataList($where));
|
||||
}
|
||||
|
||||
@ -145,7 +157,7 @@ class SystemGroupData extends AuthController
|
||||
public function edit($id)
|
||||
{
|
||||
$gid = $this->request->param('gid/d');
|
||||
if(!$gid){
|
||||
if (!$gid) {
|
||||
return app('json')->fail('缺少参数');
|
||||
}
|
||||
return app('json')->success($this->services->updateForm((int)$gid, (int)$id));
|
||||
@ -305,4 +317,40 @@ class SystemGroupData extends AuthController
|
||||
$cache->setDbCache('kf_adv', $content);
|
||||
return app('json')->success('设置成功');
|
||||
}
|
||||
|
||||
public function saveAll()
|
||||
{
|
||||
$params = request()->post();
|
||||
if (!isset($params['config_name']) || !isset($params['data'])) {
|
||||
return app('json')->fail('缺少参数');
|
||||
}
|
||||
$this->services->saveAllData($params['data'], $params['config_name']);
|
||||
return app('json')->success('添加数据成功!');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户协议内容
|
||||
* @return mixed
|
||||
*/
|
||||
public function getUserAgreement()
|
||||
{
|
||||
/** @var CacheServices $cache */
|
||||
$cache = app()->make(CacheServices::class);
|
||||
$content = $cache->getDbCache('user_agreement', '');
|
||||
return app('json')->success(compact('content'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置用户协议内容
|
||||
* @return mixed
|
||||
*/
|
||||
public function setUserAgreement()
|
||||
{
|
||||
$content = $this->request->post('content');
|
||||
/** @var CacheServices $cache */
|
||||
$cache = app()->make(CacheServices::class);
|
||||
$cache->setDbCache('user_agreement', $content);
|
||||
return app('json')->success('设置成功');
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ namespace app\adminapi\controller\v1\setting;
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\system\SystemMenusServices;
|
||||
use think\facade\App;
|
||||
use think\facade\Route;
|
||||
|
||||
/**
|
||||
* 菜单权限
|
||||
@ -213,4 +214,27 @@ class SystemMenus extends AuthController
|
||||
[$menus, $unique] = $this->services->getMenusList($this->adminInfo['roles'], (int)$this->adminInfo['level']);
|
||||
return app('json')->success(['menus' => $menus, 'unique' => $unique]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取接口列表
|
||||
* @return array
|
||||
*/
|
||||
public function ruleList()
|
||||
{
|
||||
//获取所有的路由
|
||||
$ruleList = Route::getRuleList();
|
||||
$menuApiList = $this->services->getColumn(['auth_type' => 2, 'is_del' => 0], "concat(`api_url`,'_',lower(`methods`)) as rule");
|
||||
if ($menuApiList) $menuApiList = array_column($menuApiList, 'rule');
|
||||
$list = [];
|
||||
foreach ($ruleList as $item) {
|
||||
$item['rule'] = str_replace('adminapi/', '', $item['rule']);
|
||||
if (!in_array($item['rule'] . '_' . $item['method'], $menuApiList)) {
|
||||
$item['real_name'] = $item['option']['real_name'] ?? '';
|
||||
unset($item['option']);
|
||||
$item['method'] = strtoupper($item['method']);
|
||||
$list[] = $item;
|
||||
}
|
||||
}
|
||||
return app('json')->success($list);
|
||||
}
|
||||
}
|
||||
|
||||
112
crmeb/app/adminapi/controller/v1/setting/SystemNotification.php
Normal file
112
crmeb/app/adminapi/controller/v1/setting/SystemNotification.php
Normal file
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\adminapi\controller\v1\setting;
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\system\SystemNotificationServices;
|
||||
use crmeb\services\CacheService;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
* Class SystemRole
|
||||
* @package app\adminapi\controller\v1\setting
|
||||
*/
|
||||
class SystemNotification extends AuthController
|
||||
{
|
||||
/**
|
||||
* SystemRole constructor.
|
||||
* @param App $app
|
||||
* @param SystemNotificationServices $services
|
||||
*/
|
||||
public function __construct(App $app, SystemNotificationServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示资源列表
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['type', ''],
|
||||
]);
|
||||
return app('json')->success($this->services->getNotList($where));
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示编辑
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function info()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['type', ''],
|
||||
['id', 0]
|
||||
]);
|
||||
if (!$where['id']) return app('json')->fail('参数错误');
|
||||
return app('json')->success($this->services->getNotInfo($where));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存新建的资源
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['id', 0],
|
||||
['type', ''],
|
||||
['name', ''],
|
||||
['title', ''],
|
||||
['is_system', 0],
|
||||
['is_app', 0],
|
||||
['is_wechat', 0],
|
||||
['is_routine', 0],
|
||||
['is_sms', 0],
|
||||
['is_ent_wechat', 0],
|
||||
['system_title', ''],
|
||||
['system_text', ''],
|
||||
['tempid', ''],
|
||||
['ent_wechat_text', ''],
|
||||
['url', ''],
|
||||
['wechat_id', ''],
|
||||
['routine_id', ''],
|
||||
['mark', ''],
|
||||
]);
|
||||
if (!$data['id']) return app('json')->fail('参数错误');
|
||||
if ($this->services->saveData($data)) {
|
||||
CacheService::delete('NOTCE_'. $data['mark']);
|
||||
return app('json')->success('修改成功!');
|
||||
} else {
|
||||
return app('json')->fail('修改失败,请稍候再试!');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改消息状态
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function set_status($type, $status, $id)
|
||||
{
|
||||
if ($type == '' || $status == '' || $id == 0) return app('json')->fail('参数错误');
|
||||
$this->services->update($id, [$type => $status]);
|
||||
$res = $this->services->getOneNotce(['id'=>$id]);
|
||||
CacheService::delete('NOTCE_'.$res->mark);
|
||||
return app('json')->success($status == 1 ? '开启成功' : '关闭成功');
|
||||
}
|
||||
}
|
||||
74
crmeb/app/adminapi/controller/v1/system/AppVersion.php
Normal file
74
crmeb/app/adminapi/controller/v1/system/AppVersion.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\v1\system;
|
||||
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\system\AppVersionServices;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
*
|
||||
* Class AppVersion
|
||||
* @package app\adminapi\controller\v1\system
|
||||
*/
|
||||
class AppVersion extends AuthController
|
||||
{
|
||||
/**
|
||||
* user constructor.
|
||||
* @param App $app
|
||||
* @param AppVersionServices $services
|
||||
*/
|
||||
public function __construct(App $app, AppVersionServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 版本列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function list()
|
||||
{
|
||||
[$platform] = $this->request->getMore([
|
||||
['platform', '']
|
||||
], true);
|
||||
return app('json')->success($this->services->versionList($platform));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增版本表单
|
||||
* @return mixed
|
||||
*/
|
||||
public function crate()
|
||||
{
|
||||
return app('json')->success($this->services->createForm());
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
* @return mixed
|
||||
*/
|
||||
public function save($id = 0)
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['version', ''],
|
||||
['platform', 1],
|
||||
['info', ''],
|
||||
['is_force', 1],
|
||||
['url', ''],
|
||||
]);
|
||||
$this->services->versionSave($id, $data);
|
||||
return app('json')->success('添加成功');
|
||||
}
|
||||
}
|
||||
@ -10,12 +10,10 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\adminapi\controller\v1\system;
|
||||
|
||||
use crmeb\services\CacheService;
|
||||
use think\facade\App;
|
||||
use think\facade\Session;
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\system\SystemDatabackupServices;
|
||||
use think\Response;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -40,7 +40,6 @@ class SystemLog extends AuthController
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$where = $this->request->getMore([
|
||||
['pages', ''],
|
||||
['path', ''],
|
||||
|
||||
@ -10,12 +10,10 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\adminapi\controller\v1\user;
|
||||
|
||||
use app\adminapi\validate\user\UserValidata;
|
||||
use app\services\user\UserServices;
|
||||
use app\adminapi\controller\AuthController;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\App;
|
||||
use think\Request;
|
||||
|
||||
|
||||
class User extends AuthController
|
||||
@ -137,20 +135,20 @@ class User extends AuthController
|
||||
$data['avatar'] = sys_config('h5_avatar');
|
||||
$data['adminId'] = $this->adminId;
|
||||
$data['user_type'] = 'h5';
|
||||
$lables = $data['label_id'];
|
||||
$label = $data['label_id'];
|
||||
unset($data['label_id']);
|
||||
foreach ($lables as $k => $v) {
|
||||
foreach ($label as $k => $v) {
|
||||
if (!$v) {
|
||||
unset($lables[$k]);
|
||||
unset($label[$k]);
|
||||
}
|
||||
}
|
||||
$data['birthday'] = empty($data['birthday']) ? 0 : strtotime($data['birthday']);
|
||||
$data['add_time'] = time();
|
||||
$this->services->transaction(function () use ($data, $lables) {
|
||||
$this->services->transaction(function () use ($data, $label) {
|
||||
$res = true;
|
||||
$userInfo = $this->services->save($data);
|
||||
if ($lables) {
|
||||
$res = $this->services->saveSetLabel([$userInfo->uid], $lables);
|
||||
if ($label) {
|
||||
$res = $this->services->saveSetLabel([$userInfo->uid], $label);
|
||||
}
|
||||
if ($data['level']) {
|
||||
$res = $this->services->saveGiveLevel((int)$userInfo->uid, (int)$data['level']);
|
||||
@ -379,7 +377,7 @@ class User extends AuthController
|
||||
['level', 0],
|
||||
['phone', 0],
|
||||
['addres', ''],
|
||||
['label_id', ''],
|
||||
['label_id', []],
|
||||
['group_id', 0],
|
||||
['pwd', ''],
|
||||
['true_pwd'],
|
||||
|
||||
@ -15,6 +15,7 @@ namespace app\adminapi\controller\v1\user;
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\user\UserLabelCateServices;
|
||||
use app\adminapi\validate\user\UserLabeCateValidata;
|
||||
use app\services\user\UserLabelServices;
|
||||
use think\facade\App;
|
||||
use app\Request;
|
||||
|
||||
@ -72,7 +73,8 @@ class UserLabelCate extends AuthController
|
||||
['sort', 0]
|
||||
]);
|
||||
|
||||
validate(UserLabeCateValidata::class)->check($data);
|
||||
$this->validate($data, UserLabeCateValidata::class);
|
||||
|
||||
if ($this->services->count(['name' => $data['name']])) {
|
||||
return app('json')->fail('分类已经存在,请勿重复添加');
|
||||
}
|
||||
@ -127,7 +129,9 @@ class UserLabelCate extends AuthController
|
||||
['name', ''],
|
||||
['sort', 0],
|
||||
]);
|
||||
validate(UserLabeCateValidata::class)->check($data);
|
||||
|
||||
$this->validate($data, UserLabeCateValidata::class);
|
||||
|
||||
if ($this->services->update($id, $data)) {
|
||||
$this->services->deleteCateCache();
|
||||
return app('json')->success('修改成功');
|
||||
@ -147,6 +151,10 @@ class UserLabelCate extends AuthController
|
||||
if (!$id || !($info = $this->services->get($id))) {
|
||||
return app('json')->fail('删除的数据不存在');
|
||||
}
|
||||
/** @var $labelService $labelservice */
|
||||
$labelService = app()->make(UserLabelServices::class);
|
||||
$count = $labelService->getCount(['label_cate' => $id]);
|
||||
if($count) return app('json')->fail('该分类下有标签,请先删除标签');
|
||||
if ($info->delete()) {
|
||||
$this->services->deleteCateCache();
|
||||
return app('json')->success('删除成功');
|
||||
|
||||
190
crmeb/app/adminapi/controller/v1/user/member/MemberCard.php
Normal file
190
crmeb/app/adminapi/controller/v1/user/member/MemberCard.php
Normal file
@ -0,0 +1,190 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\v1\user\member;
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\user\MemberCardServices;
|
||||
use app\services\user\MemberRightServices;
|
||||
use app\services\user\MemberShipServices;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
* Class MemberCard
|
||||
* @package app\adminapi\controller\v1\user\member
|
||||
*/
|
||||
class MemberCard extends AuthController
|
||||
{
|
||||
|
||||
/**
|
||||
* 初始化service层句柄
|
||||
* MemberCard constructor.
|
||||
* @param App $app
|
||||
* @param MemberCardServices $memberCardServices
|
||||
*/
|
||||
public function __construct(App $app, MemberCardServices $memberCardServices)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $memberCardServices;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员卡列表
|
||||
* @param $card_batch_id
|
||||
* @return mixed
|
||||
*/
|
||||
public function index($card_batch_id)
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['card_number', ""],
|
||||
['phone', ""],
|
||||
['card_batch_id', $card_batch_id],
|
||||
['is_use', ""],
|
||||
['is_status', ""],
|
||||
['page', 1],
|
||||
['limit', 20],
|
||||
]);
|
||||
$data = $this->services->getSearchList($where);
|
||||
return app('json')->success($data);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员分类
|
||||
* @return mixed
|
||||
*/
|
||||
public function member_ship()
|
||||
{
|
||||
/** @var MemberShipServices $memberShipService */
|
||||
$memberShipService = app()->make(MemberShipServices::class);
|
||||
$data = $memberShipService->getSearchList();
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存分类
|
||||
* @param $id
|
||||
* @param MemberShipServices $memberShipServices
|
||||
* @return mixed
|
||||
*/
|
||||
public function ship_save($id, MemberShipServices $memberShipServices)
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['title', ''],
|
||||
['price', ''],
|
||||
['pre_price', ''],
|
||||
['vip_day', ''],
|
||||
['type', ''],
|
||||
['sort', ''],
|
||||
]);
|
||||
$memberShipServices->save((int)$id, $data);
|
||||
return app('json')->success($id ? "编辑成功" : '添加成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param $id
|
||||
* @param MemberShipServices $memberShipServices
|
||||
* @return mixed
|
||||
*/
|
||||
public function delete($id,MemberShipServices $memberShipServices)
|
||||
{
|
||||
if (!$id) return app('json')->fail('数据不存在');
|
||||
$res = $memberShipServices->delete((int)$id);
|
||||
return app('json')->success($res ? "删除成功" : '删除失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员记录
|
||||
* @return mixed
|
||||
*/
|
||||
public function member_record()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['name', ""],
|
||||
['add_time', ""],
|
||||
['member_type', ""],
|
||||
['pay_type', ""],
|
||||
['page', 1],
|
||||
['limit', 20],
|
||||
]);
|
||||
$data = $this->services->getSearchRecordList($where);
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员权益
|
||||
* @return mixed
|
||||
*/
|
||||
public function member_right()
|
||||
{
|
||||
/** @var MemberRightServices $memberRightService */
|
||||
$memberRightService = app()->make(MemberRightServices::class);
|
||||
$data = $memberRightService->getSearchList();
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存会员权益
|
||||
* @param $id
|
||||
* @param MemberRightServices $memberRightServices
|
||||
* @return mixed
|
||||
*/
|
||||
public function right_save($id, MemberRightServices $memberRightServices)
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['title', ''],
|
||||
['show_title', ''],
|
||||
['image', ''],
|
||||
['right_type', ''],
|
||||
['explain', ''],
|
||||
['number', ''],
|
||||
['sort', ''],
|
||||
['status', ''],
|
||||
]);
|
||||
$memberRightServices->save((int)$id, $data);
|
||||
return app('json')->success("权益编辑成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员卡激活冻结状态修改
|
||||
* @return mixed
|
||||
*/
|
||||
public function set_status()
|
||||
{
|
||||
[$card_id, $status] = $this->request->getMore([
|
||||
['card_id', 0],
|
||||
['status', 0],
|
||||
], true);
|
||||
$msg = $status == 1 ? '激活' : '冻结';
|
||||
$res = $this->services->setStatus($card_id, $status);
|
||||
if ($res) return app('json')->success($msg . '成功');
|
||||
return app('json')->success($msg . '失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* 付费会员类型启用/禁用
|
||||
* @return mixed
|
||||
*/
|
||||
public function set_ship_status()
|
||||
{
|
||||
[$id, $is_del] = $this->request->getMore([
|
||||
['id', 0],
|
||||
['is_del', 0],
|
||||
], true);
|
||||
/** @var MemberShipServices $memberShipService */
|
||||
$memberShipService = app()->make(MemberShipServices::class);
|
||||
$msg = $is_del == 1 ? '禁用' : '启用';
|
||||
$res = $memberShipService->setStatus($id, $is_del);
|
||||
if ($res) return app('json')->success($msg . '成功');
|
||||
return app('json')->success($msg . '失败');
|
||||
}
|
||||
}
|
||||
132
crmeb/app/adminapi/controller/v1/user/member/MemberCardBatch.php
Normal file
132
crmeb/app/adminapi/controller/v1/user/member/MemberCardBatch.php
Normal file
@ -0,0 +1,132 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\v1\user\member;
|
||||
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\other\AgreementServices;
|
||||
use app\services\other\QrcodeServices;
|
||||
use app\services\user\MemberCardBatchServices;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
* Class MemberCardBatch
|
||||
* @package app\adminapi\controller\v1\user\member
|
||||
*/
|
||||
class MemberCardBatch extends AuthController
|
||||
{
|
||||
/**
|
||||
* MemberCardBatch constructor.
|
||||
* @param App $app
|
||||
* @param MemberCardBatchServices $memberCardBatchServices
|
||||
*/
|
||||
public function __construct(App $app, MemberCardBatchServices $memberCardBatchServices)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $memberCardBatchServices;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员卡批次资源列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['title', ''],
|
||||
// ['page', 1],
|
||||
// ['limit', 20],
|
||||
]);
|
||||
$data = $this->services->getList($where);
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
/** 保存卡片资源
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function save($id)
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['title', ''],
|
||||
['use_day', 1],
|
||||
['total_num', 1],
|
||||
['status', 0],
|
||||
['remark', '']
|
||||
]);
|
||||
$this->services->save((int)$id, $data);
|
||||
return app('json')->success("卡片生成成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表操作
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function set_value($id)
|
||||
{
|
||||
|
||||
$data = $this->request->getMore([
|
||||
['value', ''],
|
||||
['field', ''],
|
||||
]);
|
||||
$this->services->setValue($id, $data);
|
||||
return app('json')->success("修改成功");
|
||||
}
|
||||
|
||||
/**会员二维码,兑换卡
|
||||
* @return mixed
|
||||
*/
|
||||
public function member_scan()
|
||||
{
|
||||
//生成h5地址
|
||||
$weixinPage = "/pages/annex/vip_active/index";
|
||||
$weixinFileName = "wechat_member_card.png";
|
||||
/** @var QrcodeServices $QrcodeService */
|
||||
$QrcodeService = app()->make(QrcodeServices::class);
|
||||
$wechatQrcode = $QrcodeService->getWechatQrcodePath($weixinFileName,$weixinPage, false, false);
|
||||
//生成小程序地址
|
||||
$routineQrcode = $QrcodeService->getRoutineQrcodePath(4,6,4, [], false);
|
||||
return app('json')->success(['wechat_img' => $wechatQrcode, 'routine' => $routineQrcode ? $routineQrcode : ""]);
|
||||
}
|
||||
|
||||
/** 添加会员协议
|
||||
* @param int $id
|
||||
* @param AgreementServices $agreementServices
|
||||
* @return mixed
|
||||
*/
|
||||
public function save_member_agreement($id = 0, AgreementServices $agreementServices)
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['type', 1],
|
||||
['title', ""],
|
||||
['content', ''],
|
||||
['status', ''],
|
||||
]);
|
||||
|
||||
return app('json')->success($agreementServices->saveAgreement($data, $id));
|
||||
}
|
||||
|
||||
/**获取会员协议
|
||||
* @param AgreementServices $agreementServices
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getAgreement(AgreementServices $agreementServices)
|
||||
{
|
||||
$list = $agreementServices->getAgreementBytype(1);
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -32,7 +32,6 @@ class AdminAuthTokenMiddleware implements MiddlewareInterface
|
||||
/** @var AdminAuthServices $service */
|
||||
$service = app()->make(AdminAuthServices::class);
|
||||
$adminInfo = $service->parseToken($token);
|
||||
|
||||
Request::macro('isAdminLogin', function () use (&$adminInfo) {
|
||||
return !is_null($adminInfo);
|
||||
});
|
||||
|
||||
@ -15,31 +15,46 @@ use think\facade\Route;
|
||||
*/
|
||||
Route::group('agent', function () {
|
||||
//推销员列表
|
||||
Route::get('index', 'v1.agent.AgentManage/index');
|
||||
Route::get('index', 'v1.agent.AgentManage/index')->option(['real_name' => '分销员列表']);
|
||||
//修改上级推广人
|
||||
Route::put('spread', 'v1.agent.AgentManage/editSpread');
|
||||
Route::put('spread', 'v1.agent.AgentManage/editSpread')->option(['real_name' => '修改上级推广人']);
|
||||
//头部统计
|
||||
Route::get('statistics', 'v1.agent.AgentManage/get_badge');
|
||||
Route::get('statistics', 'v1.agent.AgentManage/get_badge')->option(['real_name' => '分销员列表头部统计']);
|
||||
//推广人列表
|
||||
Route::get('stair', 'v1.agent.AgentManage/get_stair_list');
|
||||
Route::get('stair', 'v1.agent.AgentManage/get_stair_list')->option(['real_name' => '推广人列表']);
|
||||
//推广人头部统计
|
||||
Route::get('stair/statistics', 'v1.agent.AgentManage/get_stair_badge');
|
||||
// Route::get('stair/statistics', 'v1.agent.AgentManage/get_stair_badge')->option(['real_name' => '推广人头部统计']);
|
||||
//统计推广订单列表
|
||||
Route::get('stair/order', 'v1.agent.AgentManage/get_stair_order_list');
|
||||
Route::get('stair/order', 'v1.agent.AgentManage/get_stair_order_list')->option(['real_name' => '推广订单列表']);
|
||||
//统计推广订单列表头部
|
||||
Route::get('stair/order/statistics', 'v1.agent.AgentManage/get_stair_order_badge');
|
||||
// Route::get('stair/order/statistics', 'v1.agent.AgentManage/get_stair_order_badge')->option(['real_name' => '推广订单列表头部']);
|
||||
//清除上级推广人
|
||||
Route::put('stair/delete_spread/:uid', 'v1.agent.AgentManage/delete_spread');
|
||||
Route::put('stair/delete_spread/:uid', 'v1.agent.AgentManage/delete_spread')->option(['real_name' => '清除上级推广人']);
|
||||
//取消推广资格
|
||||
Route::put('stair/delete_system_spread/:uid', 'v1.agent.AgentManage/delete_system_spread')->option(['real_name' => '取消推广资格']);
|
||||
//查看公众号推广二维码
|
||||
Route::get('look_code', 'v1.agent.AgentManage/look_code');
|
||||
Route::get('look_code', 'v1.agent.AgentManage/look_code')->option(['real_name' => '查看公众号推广二维码']);
|
||||
//查看小程序推广二维码
|
||||
Route::get('look_xcx_code', 'v1.agent.AgentManage/look_xcx_code');
|
||||
Route::get('look_xcx_code', 'v1.agent.AgentManage/look_xcx_code')->option(['real_name' => '查看小程序推广二维码']);
|
||||
//查看H5推广二维码
|
||||
Route::get('look_h5_code', 'v1.agent.AgentManage/look_h5_code');
|
||||
Route::get('look_h5_code', 'v1.agent.AgentManage/look_h5_code')->option(['real_name' => '查看H5推广二维码']);
|
||||
//积分配置编辑表单
|
||||
Route::get('config/edit_basics', 'v1.setting.SystemConfig/edit_basics');
|
||||
Route::get('config/edit_basics', 'v1.setting.SystemConfig/edit_basics')->option(['real_name' => '积分配置编辑表单']);
|
||||
//积分配置保存数据
|
||||
Route::post('config/save_basics', 'v1.setting.SystemConfig/save_basics');
|
||||
Route::post('config/save_basics', 'v1.setting.SystemConfig/save_basics')->option(['real_name' => '积分配置保存数据']);
|
||||
|
||||
//分销员等级资源路由
|
||||
Route::resource('level', 'v1.agent.AgentLevel')->name('AgentLevelResource')->option(['real_name' => '分销员等级']);
|
||||
//修改分销等级状态
|
||||
Route::put('level/set_status/:id/:status', 'v1.agent.AgentLevel/set_status')->name('levelSetStatus')->option(['real_name' => '修改分销等级状态']);
|
||||
//分销员等级任务资源路由
|
||||
Route::resource('level_task', 'v1.agent.AgentLevelTask')->name('AgentLevelTaskResource')->option(['real_name' => '分销员等级任务']);
|
||||
//修改分销任务状态
|
||||
Route::put('level_task/set_status/:id/:status', 'v1.agent.AgentLevelTask/set_status')->name('levelTaskSetStatus')->option(['real_name' => '修改分销等级任务状态']);
|
||||
//获取赠送分销等级表单
|
||||
Route::get('get_level_form', 'v1.agent.AgentManage/getLevelForm')->name('getLevelForm')->option(['real_name' => '获取赠送分销等级表单']);
|
||||
//赠送分销等级
|
||||
Route::post('give_level', 'v1.agent.AgentManage/giveAgentLevel')->name('giveAgentLevel')->option(['real_name' => '赠送分销等级']);
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
\app\adminapi\middleware\AdminAuthTokenMiddleware::class,
|
||||
|
||||
@ -15,115 +15,83 @@ use think\facade\Route;
|
||||
*/
|
||||
Route::group('app', function () {
|
||||
//小程序模板资源路由
|
||||
Route::resource('routine', 'v1.application.routine.RoutineTemplate')->name('RoutineResource');
|
||||
Route::resource('routine', 'v1.application.routine.RoutineTemplate')->name('RoutineResource')->option(['real_name' => '小程序订阅消息']);
|
||||
//客服反馈接口
|
||||
Route::resource('feedback', 'v1.application.wechat.StoreServiceFeedback')->only(['index', 'delete', 'update', 'edit']);
|
||||
Route::resource('feedback', 'v1.application.wechat.StoreServiceFeedback')->only(['index', 'delete', 'update', 'edit'])->option(['real_name' => '用户反馈']);
|
||||
//一键同步订阅消息
|
||||
Route::get('routine/syncSubscribe', 'v1.application.routine.RoutineTemplate/syncSubscribe')->name('syncSubscribe');
|
||||
Route::get('routine/syncSubscribe', 'v1.application.routine.RoutineTemplate/syncSubscribe')->name('syncSubscribe')->option(['real_name' => '一键同步订阅消息']);
|
||||
//一键同步微信模版消息消息
|
||||
Route::get('wechat/syncSubscribe', 'v1.application.wechat.WechatTemplate/syncSubscribe')->name('syncSubscribe')->option(['real_name' => '一键同步模版消息']);
|
||||
//修改状态
|
||||
Route::put('routine/set_status/:id/:status', 'v1.application.routine.RoutineTemplate/set_status')->name('RoutineSetStatus');
|
||||
Route::put('routine/set_status/:id/:status', 'v1.application.routine.RoutineTemplate/set_status')->name('RoutineSetStatus')->option(['real_name' => '修改订阅消息状态']);
|
||||
//菜单值
|
||||
Route::get('wechat/menu', 'v1.application.wechat.menus/index');
|
||||
Route::get('wechat/menu', 'v1.application.wechat.menus/index')->option(['real_name' => '微信公众号菜单列表']);
|
||||
//保存菜单
|
||||
Route::post('wechat/menu', 'v1.application.wechat.menus/save');
|
||||
Route::post('wechat/menu', 'v1.application.wechat.menus/save')->option(['real_name' => '保存微信公众号菜单']);
|
||||
//微信模板消息资源路由
|
||||
Route::resource('wechat/template', 'v1.application.wechat.WechatTemplate')->name('WechatTemplateResource');
|
||||
Route::resource('wechat/template', 'v1.application.wechat.WechatTemplate')->name('WechatTemplateResource')->option(['real_name' => '公众号模版消息']);
|
||||
//话术接口
|
||||
Route::resource('wechat/speechcraft', 'v1.application.wechat.StoreServiceSpeechcraft');
|
||||
Route::resource('wechat/speechcraft', 'v1.application.wechat.StoreServiceSpeechcraft')->option(['real_name' => '客服话术']);
|
||||
//话术分类接口
|
||||
Route::resource('wechat/speechcraftcate', 'v1.application.wechat.StoreServiceSpeechcraftCate');
|
||||
Route::resource('wechat/speechcraftcate', 'v1.application.wechat.StoreServiceSpeechcraftCate')->option(['real_name' => '客服话术分类']);
|
||||
|
||||
//微信模板消息修改状态
|
||||
Route::put('wechat/template/set_status/:id/:status', 'v1.application.wechat.WechatTemplate/set_status')->name('WechatTemplateSetStatus');
|
||||
Route::put('wechat/template/set_status/:id/:status', 'v1.application.wechat.WechatTemplate/set_status')->name('WechatTemplateSetStatus')->option(['real_name' => '修改关键字回复状态']);
|
||||
//关注回复
|
||||
Route::get('wechat/reply', 'v1.application.wechat.Reply/reply');
|
||||
Route::get('wechat/reply', 'v1.application.wechat.Reply/reply')->option(['real_name' => '关注回复']);
|
||||
//获取关注回复二维码
|
||||
Route::get('wechat/code_reply/:id', 'v1.application.wechat.Reply/code_reply');
|
||||
Route::get('wechat/code_reply/:id', 'v1.application.wechat.Reply/code_reply')->option(['real_name' => '获取关注回复二维码']);
|
||||
//关键字回复列表
|
||||
Route::get('wechat/keyword', 'v1.application.wechat.Reply/index');
|
||||
Route::get('wechat/keyword', 'v1.application.wechat.Reply/index')->option(['real_name' => '关键字回复列表']);
|
||||
//关键字详情
|
||||
Route::get('wechat/keyword/:id', 'v1.application.wechat.Reply/read');
|
||||
Route::get('wechat/keyword/:id', 'v1.application.wechat.Reply/read')->option(['real_name' => '关键字回复详情']);
|
||||
//保存关键字修改
|
||||
Route::post('wechat/keyword/:id', 'v1.application.wechat.Reply/save');
|
||||
Route::post('wechat/keyword/:id', 'v1.application.wechat.Reply/save')->option(['real_name' => '保存关键字回复']);
|
||||
//删除关键字
|
||||
Route::delete('wechat/keyword/:id', 'v1.application.wechat.Reply/delete');
|
||||
Route::delete('wechat/keyword/:id', 'v1.application.wechat.Reply/delete')->option(['real_name' => '删除关键字回复']);
|
||||
//修改关键字状态
|
||||
Route::put('wechat/keyword/set_status/:id/:status', 'v1.application.wechat.Reply/set_status');
|
||||
Route::put('wechat/keyword/set_status/:id/:status', 'v1.application.wechat.Reply/set_status')->option(['real_name' => '修改关键字回复状态']);
|
||||
//图文列表
|
||||
Route::get('wechat/news', 'v1.application.wechat.WechatNewsCategory/index');
|
||||
Route::get('wechat/news', 'v1.application.wechat.WechatNewsCategory/index')->option(['real_name' => '图文列表']);
|
||||
//详情
|
||||
Route::get('wechat/news/:id', 'v1.application.wechat.WechatNewsCategory/read');
|
||||
Route::get('wechat/news/:id', 'v1.application.wechat.WechatNewsCategory/read')->option(['real_name' => '图文详情']);
|
||||
//保存图文
|
||||
Route::post('wechat/news', 'v1.application.wechat.WechatNewsCategory/save');
|
||||
Route::post('wechat/news', 'v1.application.wechat.WechatNewsCategory/save')->option(['real_name' => '保存图文']);
|
||||
//删除图文
|
||||
Route::delete('wechat/news/:id', 'v1.application.wechat.WechatNewsCategory/delete');
|
||||
Route::delete('wechat/news/:id', 'v1.application.wechat.WechatNewsCategory/delete')->option(['real_name' => '删除图文']);
|
||||
//发送图文消息
|
||||
Route::post('wechat/push', 'v1.application.wechat.WechatNewsCategory/push');
|
||||
/*微信用户管理*/
|
||||
//用户列表
|
||||
Route::get('wechat/user', 'v1.application.wechat.WechatUser/index');
|
||||
//获取用户分组和标签
|
||||
Route::get('wechat/user/tag_group', 'v1.application.wechat.WechatUser/get_tag_group');
|
||||
//修改用户标签表单
|
||||
Route::get('wechat/user_tag/:openid/edit', 'v1.application.wechat.WechatUser/edit_user_tag');
|
||||
//修改用户标签
|
||||
Route::put('wechat/user_tag/:openid', 'v1.application.wechat.WechatUser/update_user_tag');
|
||||
//修改用户分组表单
|
||||
Route::get('wechat/user_group/:openid/edit', 'v1.application.wechat.WechatUser/edit_user_group');
|
||||
//修改用户分组
|
||||
Route::put('wechat/user_group/:openid', 'v1.application.wechat.WechatUser/update_user_group');
|
||||
//同步标签
|
||||
Route::put('wechat/syn_tag/:openid', 'v1.application.wechat.WechatUser/syn_tag');
|
||||
//标签列表
|
||||
Route::get('wechat/tag', 'v1.application.wechat.WechatUser/tag');
|
||||
//新增标签表单
|
||||
Route::get('wechat/tag/create', 'v1.application.wechat.WechatUser/create_tag');
|
||||
//新增标签
|
||||
Route::post('wechat/tag', 'v1.application.wechat.WechatUser/save_tag');
|
||||
//编辑标签表单
|
||||
Route::get('wechat/tag/:id/edit', 'v1.application.wechat.WechatUser/edit_tag');
|
||||
//编辑标签
|
||||
Route::put('wechat/tag/:id', 'v1.application.wechat.WechatUser/update_tag');
|
||||
//删除标签
|
||||
Route::delete('wechat/tag/:id', 'v1.application.wechat.WechatUser/delete_tag');
|
||||
//分组列表
|
||||
Route::get('wechat/group', 'v1.application.wechat.WechatUser/group');
|
||||
//新增分组表单
|
||||
Route::get('wechat/group/create', 'v1.application.wechat.WechatUser/create_group');
|
||||
//新增分组
|
||||
Route::post('wechat/group', 'v1.application.wechat.WechatUser/save_group');
|
||||
//编辑分组表单
|
||||
Route::get('wechat/group/:id/edit', 'v1.application.wechat.WechatUser/edit_group');
|
||||
//编辑分组
|
||||
Route::put('wechat/group/:id', 'v1.application.wechat.WechatUser/update_group');
|
||||
//删除分组
|
||||
Route::delete('wechat/group/:id', 'v1.application.wechat.WechatUser/delete_group');
|
||||
Route::post('wechat/push', 'v1.application.wechat.WechatNewsCategory/push')->option(['real_name' => '发送图文消息']);
|
||||
//用户行为列表
|
||||
Route::get('wechat/action', 'v1.application.wechat.WechatMessage/index');
|
||||
Route::get('wechat/action', 'v1.application.wechat.WechatMessage/index')->option(['real_name' => '用户行为列表']);
|
||||
//用户行为列表操作名称列表
|
||||
Route::get('wechat/action/operate', 'v1.application.wechat.WechatMessage/operate');
|
||||
Route::get('wechat/action/operate', 'v1.application.wechat.WechatMessage/operate')->option(['real_name' => '用户行为列表操作名称列表']);
|
||||
//客服列表
|
||||
Route::get('wechat/kefu', 'v1.application.wechat.StoreService/index');
|
||||
Route::get('wechat/kefu', 'v1.application.wechat.StoreService/index')->option(['real_name' => '客服列表']);
|
||||
//客服登录
|
||||
Route::get('wechat/kefu/login/:id', 'v1.application.wechat.StoreService/keufLogin');
|
||||
Route::get('wechat/kefu/login/:id', 'v1.application.wechat.StoreService/keufLogin')->option(['real_name' => '客服登录']);
|
||||
//新增客服选择用户列表
|
||||
Route::get('wechat/kefu/create', 'v1.application.wechat.StoreService/create');
|
||||
Route::get('wechat/kefu/create', 'v1.application.wechat.StoreService/create')->option(['real_name' => '新增客服选择用户列表']);
|
||||
//新增客服表单
|
||||
Route::get('wechat/kefu/add', 'v1.application.wechat.StoreService/add');
|
||||
Route::get('wechat/kefu/add', 'v1.application.wechat.StoreService/add')->option(['real_name' => '添加客服表单']);
|
||||
//保存新建的数据
|
||||
Route::post('wechat/kefu', 'v1.application.wechat.StoreService/save');
|
||||
Route::post('wechat/kefu', 'v1.application.wechat.StoreService/save')->option(['real_name' => '添加客服']);
|
||||
//编辑客服表单
|
||||
Route::get('wechat/kefu/:id/edit', 'v1.application.wechat.StoreService/edit');
|
||||
Route::get('wechat/kefu/:id/edit', 'v1.application.wechat.StoreService/edit')->option(['real_name' => '修改客服表单']);
|
||||
//保存编辑的数据
|
||||
Route::put('wechat/kefu/:id', 'v1.application.wechat.StoreService/update');
|
||||
Route::put('wechat/kefu/:id', 'v1.application.wechat.StoreService/update')->option(['real_name' => '修改客服']);
|
||||
//删除
|
||||
Route::delete('wechat/kefu/:id', 'v1.application.wechat.StoreService/delete');
|
||||
Route::delete('wechat/kefu/:id', 'v1.application.wechat.StoreService/delete')->option(['real_name' => '删除客服']);
|
||||
//修改状态
|
||||
Route::put('wechat/kefu/set_status/:id/:status', 'v1.application.wechat.StoreService/set_status');
|
||||
Route::put('wechat/kefu/set_status/:id/:status', 'v1.application.wechat.StoreService/set_status')->option(['real_name' => '修改客服状态']);
|
||||
//聊天记录
|
||||
Route::get('wechat/kefu/record/:id', 'v1.application.wechat.StoreService/chat_user');
|
||||
Route::get('wechat/kefu/record/:id', 'v1.application.wechat.StoreService/chat_user')->option(['real_name' => '聊天记录']);
|
||||
//查看对话
|
||||
Route::get('wechat/kefu/chat_list', 'v1.application.wechat.StoreService/chat_list');
|
||||
Route::get('wechat/kefu/chat_list', 'v1.application.wechat.StoreService/chat_list')->option(['real_name' => '查看对话']);
|
||||
|
||||
//下载小程序模版页面数据
|
||||
Route::get('routine/info', 'v1.application.routine.RoutineTemplate/getDownloadInfo')->option(['real_name' => '下载小程序页面数据']);
|
||||
//下载小程序模版
|
||||
Route::post('routine/download', 'v1.application.routine.RoutineTemplate/downloadTemp')->option(['real_name' => '下载小程序模版']);
|
||||
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
|
||||
@ -15,19 +15,17 @@ use think\facade\Route;
|
||||
*/
|
||||
Route::group('cms', function () {
|
||||
//文章资源路由
|
||||
Route::resource('cms', 'v1.cms.Article')->name('ArticleResource');
|
||||
//分类列表
|
||||
Route::get('cms/merchant_index/:id', 'v1.cms.Article/merchantIndex')->name('MerchantIndex');
|
||||
Route::resource('cms', 'v1.cms.Article')->name('ArticleResource')->option(['real_name' => '文章']);
|
||||
//关联商品
|
||||
Route::put('cms/relation/:id', 'v1.cms.Article/relation')->name('Relation');
|
||||
Route::put('cms/relation/:id', 'v1.cms.Article/relation')->name('Relation')->option(['real_name' => '文章关联商品']);
|
||||
//取消关联
|
||||
Route::put('cms/unrelation/:id', 'v1.cms.Article/unrelation')->name('UnRelation');
|
||||
Route::put('cms/unrelation/:id', 'v1.cms.Article/unrelation')->name('UnRelation')->option(['real_name' => '取消文章关联商品']);
|
||||
//文章分类资源路由
|
||||
Route::resource('category', 'v1.cms.ArticleCategory')->name('ArticleCategoryResource');
|
||||
Route::resource('category', 'v1.cms.ArticleCategory')->name('ArticleCategoryResource')->option(['real_name' => '文章分类']);
|
||||
//修改状态
|
||||
Route::put('category/set_status/:id/:status', 'v1.cms.ArticleCategory/set_status')->name('CategoryStatus');
|
||||
Route::put('category/set_status/:id/:status', 'v1.cms.ArticleCategory/set_status')->name('CategoryStatus')->option(['real_name' => '修改文章分类状态']);
|
||||
//分类列表
|
||||
Route::get('category_list', 'v1.cms.ArticleCategory/categoryList')->name('categoryList');
|
||||
Route::get('category_list', 'v1.cms.ArticleCategory/categoryList')->name('categoryList')->option(['real_name' => '分类列表']);
|
||||
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
|
||||
@ -16,30 +16,29 @@ use think\facade\Route;
|
||||
Route::group(function () {
|
||||
|
||||
//下载备份记录表
|
||||
Route::get('backup/download', 'v1.system.SystemDatabackup/downloadFile');
|
||||
Route::get('backup/download', 'v1.system.SystemDatabackup/downloadFile')->option(['real_name' => '下载表备份记录']);
|
||||
//首页统计数据
|
||||
Route::get('home/header', 'Common/homeStatics');
|
||||
Route::get('home/header', 'Common/homeStatics')->option(['real_name' => '首页统计数据']);
|
||||
//首页订单图表
|
||||
Route::get('home/order', 'Common/orderChart');
|
||||
Route::get('home/order', 'Common/orderChart')->option(['real_name' => '首页订单图表']);
|
||||
//首页用户图表
|
||||
Route::get('home/user', 'Common/userChart');
|
||||
Route::get('home/user', 'Common/userChart')->option(['real_name' => '首页用户图表']);
|
||||
//
|
||||
Route::get('home/rank', 'Common/purchaseRanking');
|
||||
Route::get('home/rank', 'Common/purchaseRanking')->option(['real_name' => '首页交易额排行']);
|
||||
// 消息提醒
|
||||
Route::get('jnotice', 'Common/jnotice');
|
||||
Route::get('jnotice', 'Common/jnotice')->option(['real_name' => '消息提醒']);
|
||||
//验证授权
|
||||
Route::get('check_auth', 'Common/check_auth');
|
||||
Route::get('check_auth', 'Common/auth')->option(['real_name' => '验证授权']);
|
||||
//申请授权
|
||||
Route::post('auth_apply', 'Common/auth_apply');
|
||||
Route::post('auth_apply', 'Common/auth_apply')->option(['real_name' => '申请授权']);
|
||||
//授权
|
||||
Route::get('auth', 'Common/auth');
|
||||
Route::get('auth', 'Common/auth')->option(['real_name' => '授权信息']);
|
||||
//获取左侧菜单
|
||||
Route::get('menus', 'v1.setting.SystemMenus/menus');
|
||||
Route::get('menus', 'v1.setting.SystemMenus/menus')->option(['real_name' => '左侧菜单']);
|
||||
//获取搜索菜单列表
|
||||
Route::get('menusList', 'Common/menusList');
|
||||
Route::get('menusList', 'Common/menusList')->option(['real_name' => '搜索菜单列表']);
|
||||
//获取logo
|
||||
Route::get('logo', 'Common/getLogo');
|
||||
|
||||
Route::get('logo', 'Common/getLogo')->option(['real_name' => '获取logo']);
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
\app\adminapi\middleware\AdminAuthTokenMiddleware::class,
|
||||
|
||||
@ -17,35 +17,47 @@ use think\facade\Route;
|
||||
Route::group('diy', function () {
|
||||
|
||||
//DIY列表
|
||||
Route::get('get_list', 'v1.diy.Diy/getList');
|
||||
Route::get('get_list', 'v1.diy.Diy/getList')->option(['real_name' => 'Diy模板列表']);
|
||||
//DIY列表
|
||||
Route::get('get_info/:id', 'v1.diy.Diy/getInfo');
|
||||
Route::get('get_info/:id', 'v1.diy.Diy/getInfo')->option(['real_name' => 'Diy模板数据详情']);
|
||||
//删除DIY模板
|
||||
Route::delete('del/:id', 'v1.diy.Diy/del');
|
||||
Route::delete('del/:id', 'v1.diy.Diy/del')->option(['real_name' => '删除DIY模板']);
|
||||
//使用DIY模板
|
||||
Route::put('set_status/:id', 'v1.diy.Diy/setStatus');
|
||||
//保存DIY模板
|
||||
Route::post('save/[:id]', 'v1.diy.Diy/saveData');
|
||||
//获取路径
|
||||
Route::get('get_url','v1.diy.Diy/getUrl');
|
||||
//获取商品分类
|
||||
Route::get('get_category','v1.diy.Diy/getCategory');
|
||||
//获取商品
|
||||
Route::get('get_product','v1.diy.Diy/getProduct');
|
||||
//获取门店自提开启状态
|
||||
Route::get('get_store_status','v1.diy.Diy/getStoreStatus');
|
||||
//还原默认数据
|
||||
Route::get('recovery/:id','v1.diy.Diy/Recovery');
|
||||
//获取所有二级分类
|
||||
Route::get('get_by_category','v1.diy.Diy/getByCategory');
|
||||
Route::put('set_status/:id', 'v1.diy.Diy/setStatus')->option(['real_name' => '使用DIY模板']);
|
||||
//获取添加表单
|
||||
Route::get('create', 'v1.diy.Diy/create');
|
||||
Route::get('create', 'v1.diy.Diy/create')->option(['real_name' => '添加表单']);
|
||||
//添加表单
|
||||
Route::post('create', 'v1.diy.Diy/save');
|
||||
Route::post('create', 'v1.diy.Diy/save')->option(['real_name' => '添加DIY']);
|
||||
//保存DIY模板
|
||||
Route::post('save/[:id]', 'v1.diy.Diy/saveData')->option(['real_name' => '添加DIY模板']);
|
||||
//获取路径
|
||||
Route::get('get_url','v1.diy.Diy/getUrl')->option(['real_name' => '获取前端页面路径']);
|
||||
//获取商品分类
|
||||
Route::get('get_category','v1.diy.Diy/getCategory')->option(['real_name' => '获取商品分类']);
|
||||
//获取商品
|
||||
Route::get('get_product','v1.diy.Diy/getProduct')->option(['real_name' => '获取商品列表']);
|
||||
//获取门店自提开启状态
|
||||
Route::get('get_store_status','v1.diy.Diy/getStoreStatus')->option(['real_name' => '获取门店自提开启状态']);
|
||||
//还原默认数据
|
||||
Route::get('recovery/:id','v1.diy.Diy/Recovery')->option(['real_name' => '还原Diy默认数据']);
|
||||
//获取所有二级分类
|
||||
Route::get('get_by_category','v1.diy.Diy/getByCategory')->option(['real_name' => '获取所有二级分类']);
|
||||
//设置默认数据
|
||||
Route::get('set_recovery/:id','v1.diy.Diy/setRecovery');
|
||||
Route::get('set_recovery/:id','v1.diy.Diy/setRecovery')->option(['real_name' => '设置Diy默认数据']);
|
||||
//获取商品列表
|
||||
Route::get('get_product_list','v1.diy.Diy/getProductList');
|
||||
Route::get('get_product_list','v1.diy.Diy/getProductList')->option(['real_name' => '获取商品列表']);
|
||||
//分类、个人中心、一键换色
|
||||
Route::get('get_color_change/:type','v1.diy.Diy/getColorChange')->option(['real_name' => '获取风格设置']);
|
||||
//换色和分类保存
|
||||
Route::put('color_change/:status/:type', 'v1.diy.Diy/colorChange')->option(['real_name' => '换色和分类保存']);
|
||||
//个人中心菜单获取
|
||||
Route::get('get_member', 'v1.diy.Diy/getMember')->option(['real_name' => '个人中心详情']);
|
||||
//获取页面链接分类
|
||||
Route::get('get_page_category', 'v1.diy.PageLink/getCategory')->option(['real_name' => '获取页面链接分类']);
|
||||
//获取页面链接
|
||||
Route::get('get_page_link/:cate_id', 'v1.diy.PageLink/getLinks')->option(['real_name' => '获取页面链接']);
|
||||
//个人中心菜单保存
|
||||
Route::post('member_save', 'v1.diy.Diy/memberSaveData')->option(['real_name' => '个人中心保存']);
|
||||
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
|
||||
@ -15,31 +15,31 @@ use think\facade\Route;
|
||||
*/
|
||||
Route::group('export', function () {
|
||||
//用户资金监控
|
||||
Route::get('userFinance', 'v1.export.ExportExcel/userFinance');
|
||||
Route::get('userFinance', 'v1.export.ExportExcel/userFinance')->option(['real_name' => '用户资金导出']);
|
||||
//用户佣金
|
||||
Route::get('userCommission', 'v1.export.ExportExcel/userCommission');
|
||||
Route::get('userCommission', 'v1.export.ExportExcel/userCommission')->option(['real_name' => '用户佣金导出']);
|
||||
//用户积分
|
||||
Route::get('userPoint', 'v1.export.ExportExcel/userPoint');
|
||||
Route::get('userPoint', 'v1.export.ExportExcel/userPoint')->option(['real_name' => '用户积分导出']);
|
||||
//用户充值
|
||||
Route::get('userRecharge', 'v1.export.ExportExcel/userRecharge');
|
||||
Route::get('userRecharge', 'v1.export.ExportExcel/userRecharge')->option(['real_name' => '用户充值导出']);
|
||||
//分销用户推广列表
|
||||
Route::get('userAgent', 'v1.export.ExportExcel/userAgent');
|
||||
Route::get('userAgent', 'v1.export.ExportExcel/userAgent')->option(['real_name' => '分销员推广列表导出']);
|
||||
//微信用户
|
||||
Route::get('wechatUser', 'v1.export.ExportExcel/wechatUser');
|
||||
Route::get('wechatUser', 'v1.export.ExportExcel/wechatUser')->option(['real_name' => '微信用户导出']);
|
||||
//商铺砍价活动
|
||||
Route::get('storeBargain', 'v1.export.ExportExcel/storeBargain');
|
||||
Route::get('storeBargain', 'v1.export.ExportExcel/storeBargain')->option(['real_name' => '砍价商品导出']);
|
||||
//商铺拼团
|
||||
Route::get('storeCombination', 'v1.export.ExportExcel/storeCombination');
|
||||
Route::get('storeCombination', 'v1.export.ExportExcel/storeCombination')->option(['real_name' => '拼团商品导出']);
|
||||
//商铺秒杀
|
||||
Route::get('storeSeckill', 'v1.export.ExportExcel/storeSeckill');
|
||||
Route::get('storeSeckill', 'v1.export.ExportExcel/storeSeckill')->option(['real_name' => '秒杀商品导出']);
|
||||
//商铺产品
|
||||
Route::get('storeProduct', 'v1.export.ExportExcel/storeProduct');
|
||||
Route::get('storeProduct', 'v1.export.ExportExcel/storeProduct')->option(['real_name' => '商品导出']);
|
||||
//商铺订单
|
||||
Route::get('storeOrder', 'v1.export.ExportExcel/storeOrder');
|
||||
Route::get('storeOrder', 'v1.export.ExportExcel/storeOrder')->option(['real_name' => '订单导出']);
|
||||
//商铺提货点
|
||||
Route::get('storeMerchant', 'v1.export.ExportExcel/storeMerchant');
|
||||
Route::get('storeMerchant', 'v1.export.ExportExcel/storeMerchant')->option(['real_name' => '提货点导出']);
|
||||
//导出会员卡
|
||||
Route::get('memberCard/:id', 'v1.export.ExportExcel/memberCard');
|
||||
Route::get('memberCard/:id', 'v1.export.ExportExcel/memberCard')->option(['real_name' => '会员卡导出']);
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
\app\adminapi\middleware\AdminAuthTokenMiddleware::class,
|
||||
|
||||
@ -15,19 +15,21 @@ use think\facade\Route;
|
||||
*/
|
||||
Route::group('file', function () {
|
||||
//附件列表
|
||||
Route::get('file', 'v1.file.SystemAttachment/index');
|
||||
Route::get('file', 'v1.file.SystemAttachment/index')->option(['real_name' => '图片附件列表']);
|
||||
//删除图片和数据记录
|
||||
Route::post('file/delete', 'v1.file.SystemAttachment/delete');
|
||||
Route::post('file/delete', 'v1.file.SystemAttachment/delete')->option(['real_name' => '删除图片']);
|
||||
//移动图片分来表单
|
||||
Route::get('file/move', 'v1.file.SystemAttachment/move');
|
||||
Route::get('file/move', 'v1.file.SystemAttachment/move')->option(['real_name' => '移动图片分类表单']);
|
||||
//移动图片分类
|
||||
Route::put('file/do_move', 'v1.file.SystemAttachment/moveImageCate');
|
||||
Route::put('file/do_move', 'v1.file.SystemAttachment/moveImageCate')->option(['real_name' => '移动图片分类']);
|
||||
//修改图片名称
|
||||
Route::put('file/update/:id', 'v1.file.SystemAttachment/update');
|
||||
Route::put('file/update/:id', 'v1.file.SystemAttachment/update')->option(['real_name' => '修改图片名称']);
|
||||
//上传图片
|
||||
Route::post('upload/[:upload_type]', 'v1.file.SystemAttachment/upload');
|
||||
Route::post('upload/[:upload_type]', 'v1.file.SystemAttachment/upload')->option(['real_name' => '上传图片']);
|
||||
//附件分类管理资源路由
|
||||
Route::resource('category', 'v1.file.SystemAttachmentCategory');
|
||||
Route::resource('category', 'v1.file.SystemAttachmentCategory')->option(['real_name' => '附件分类管理']);
|
||||
//获取上传类型
|
||||
Route::get('upload_type', 'v1.file.SystemAttachment/uploadType')->option(['real_name' => '上传类型']);
|
||||
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
|
||||
@ -15,37 +15,35 @@ use think\facade\Route;
|
||||
*/
|
||||
Route::group('finance', function () {
|
||||
//筛选类型
|
||||
Route::get('finance/bill_type', 'v1.finance.Finance/bill_type');
|
||||
Route::get('finance/bill_type', 'v1.finance.Finance/bill_type')->option(['real_name' => '资金记录类型']);
|
||||
//资金记录
|
||||
Route::get('finance/list', 'v1.finance.Finance/list');
|
||||
//保存资金监控的excel表格
|
||||
Route::get('finance/export', 'v1.finance.Finance/save_bell_export');
|
||||
Route::get('finance/list', 'v1.finance.Finance/list')->option(['real_name' => '资金记录列表']);
|
||||
//佣金记录
|
||||
Route::get('finance/commission_list', 'v1.finance.Finance/get_commission_list');
|
||||
Route::get('finance/commission_list', 'v1.finance.Finance/get_commission_list')->option(['real_name' => '佣金记录列表']);
|
||||
//佣金详情用户信息
|
||||
Route::get('finance/user_info/:id', 'v1.finance.Finance/user_info');
|
||||
Route::get('finance/user_info/:id', 'v1.finance.Finance/user_info')->option(['real_name' => '佣金详情用户信息']);
|
||||
//佣金提现记录个人列表
|
||||
Route::get('finance/extract_list/:id', 'v1.finance.Finance/get_extract_list');
|
||||
Route::get('finance/extract_list/:id', 'v1.finance.Finance/get_extract_list')->option(['real_name' => '佣金提现记录个人列表']);
|
||||
//申请列表
|
||||
Route::get('extract', 'v1.finance.UserExtract/index');
|
||||
Route::get('extract', 'v1.finance.UserExtract/index')->option(['real_name' => '提现申请列表']);
|
||||
//编辑表单
|
||||
Route::get('extract/:id/edit', 'v1.finance.UserExtract/edit');
|
||||
Route::get('extract/:id/edit', 'v1.finance.UserExtract/edit')->option(['real_name' => '提现记录修改表单']);
|
||||
//保存修改
|
||||
Route::put('extract/:id', 'v1.finance.UserExtract/update');
|
||||
Route::put('extract/:id', 'v1.finance.UserExtract/update')->option(['real_name' => '提现记录修改']);
|
||||
//拒绝申请
|
||||
Route::put('extract/refuse/:id', 'v1.finance.UserExtract/refuse');
|
||||
Route::put('extract/refuse/:id', 'v1.finance.UserExtract/refuse')->option(['real_name' => '拒绝提现申请']);
|
||||
//通过申请
|
||||
Route::put('extract/adopt/:id', 'v1.finance.UserExtract/adopt');
|
||||
Route::put('extract/adopt/:id', 'v1.finance.UserExtract/adopt')->option(['real_name' => '通过提现申请']);
|
||||
//充值记录列表
|
||||
Route::get('recharge', 'v1.finance.UserRecharge/index');
|
||||
Route::get('recharge', 'v1.finance.UserRecharge/index')->option(['real_name' => '充值记录列表']);
|
||||
//删除记录
|
||||
Route::delete('recharge/:id', 'v1.finance.UserRecharge/delete');
|
||||
Route::delete('recharge/:id', 'v1.finance.UserRecharge/delete')->option(['real_name' => '删除充值记录']);
|
||||
//获取用户充值数据
|
||||
Route::get('recharge/user_recharge', 'v1.finance.UserRecharge/user_recharge');
|
||||
Route::get('recharge/user_recharge', 'v1.finance.UserRecharge/user_recharge')->option(['real_name' => '获取用户充值数据']);
|
||||
//退款表单
|
||||
Route::get('recharge/:id/refund_edit', 'v1.finance.UserRecharge/refund_edit');
|
||||
Route::get('recharge/:id/refund_edit', 'v1.finance.UserRecharge/refund_edit')->option(['real_name' => '充值退款表单']);
|
||||
//退款
|
||||
Route::put('recharge/:id', 'v1.finance.UserRecharge/refund_update');
|
||||
Route::put('recharge/:id', 'v1.finance.UserRecharge/refund_update')->option(['real_name' => '充值退款']);
|
||||
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
|
||||
@ -15,15 +15,15 @@ use think\facade\Route;
|
||||
*/
|
||||
Route::group('freight', function () {
|
||||
//物流公司资源路由
|
||||
Route::resource('express', 'v1.freight.Express')->name('ExpressResource');
|
||||
Route::resource('express', 'v1.freight.Express')->name('ExpressResource')->option(['real_name' => '物流公司']);
|
||||
//修改状态
|
||||
Route::put('express/set_status/:id/:status', 'v1.freight.Express/set_status');
|
||||
Route::put('express/set_status/:id/:status', 'v1.freight.Express/set_status')->option(['real_name' => '修改物流公司状态']);
|
||||
//同步物流快递公司
|
||||
Route::get('express/sync_express', 'v1.freight.Express/syncExpress');
|
||||
Route::get('express/sync_express', 'v1.freight.Express/syncExpress')->option(['real_name' => '同步物流公司']);
|
||||
//物流配置编辑表单
|
||||
Route::get('config/edit_basics', 'v1.setting.SystemConfig/edit_basics');
|
||||
Route::get('config/edit_basics', 'v1.setting.SystemConfig/edit_basics')->option(['real_name' => '物流配置编辑表单']);
|
||||
//物流配置保存数据
|
||||
Route::post('config/save_basics', 'v1.setting.SystemConfig/save_basics');
|
||||
Route::post('config/save_basics', 'v1.setting.SystemConfig/save_basics')->option(['real_name' => '物流配置保存数据']);
|
||||
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
|
||||
@ -17,51 +17,51 @@ use think\facade\Route;
|
||||
Route::group('live', function () {
|
||||
|
||||
//主播列表
|
||||
Route::get('anchor/list', 'v1.marketing.live.LiveAnchor/list');
|
||||
Route::get('anchor/list', 'v1.marketing.live.LiveAnchor/list')->option(['real_name' => '主播列表']);
|
||||
//添加修改主播表单
|
||||
Route::get('anchor/add/:id', 'v1.marketing.live.LiveAnchor/add');
|
||||
Route::get('anchor/add/:id', 'v1.marketing.live.LiveAnchor/add')->option(['real_name' => '添加修改主播表单']);
|
||||
//保存主播数据
|
||||
Route::post('anchor/save', 'v1.marketing.live.LiveAnchor/save');
|
||||
Route::post('anchor/save', 'v1.marketing.live.LiveAnchor/save')->option(['real_name' => '保存主播数据']);
|
||||
//删除主播
|
||||
Route::delete('anchor/del/:id', 'v1.marketing.live.LiveAnchor/delete');
|
||||
Route::delete('anchor/del/:id', 'v1.marketing.live.LiveAnchor/delete')->option(['real_name' => '删除主播']);
|
||||
//设置是否显示
|
||||
Route::get('anchor/set_show/:id/:is_show', 'v1.marketing.live.LiveAnchor/setShow');
|
||||
Route::get('anchor/set_show/:id/:is_show', 'v1.marketing.live.LiveAnchor/setShow')->option(['real_name' => '设置主播是否显示']);
|
||||
//同步主播
|
||||
Route::get('anchor/syncAnchor', 'v1.marketing.live.LiveAnchor/syncAnchor');
|
||||
Route::get('anchor/syncAnchor', 'v1.marketing.live.LiveAnchor/syncAnchor')->option(['real_name' => '同步主播']);
|
||||
|
||||
//直播商品列表
|
||||
Route::get('goods/list', 'v1.marketing.live.LiveGoods/list');
|
||||
Route::get('goods/list', 'v1.marketing.live.LiveGoods/list')->option(['real_name' => '直播商品列表']);
|
||||
//生成直播商品
|
||||
Route::post('goods/create', 'v1.marketing.live.LiveGoods/create');
|
||||
Route::post('goods/create', 'v1.marketing.live.LiveGoods/create')->option(['real_name' => '生成直播商品']);
|
||||
//添加修改商品
|
||||
Route::post('goods/add', 'v1.marketing.live.LiveGoods/add');
|
||||
Route::post('goods/add', 'v1.marketing.live.LiveGoods/add')->option(['real_name' => '添加修改直播商品']);
|
||||
//商品详情
|
||||
Route::get('goods/detail/:id', 'v1.marketing.live.LiveGoods/detail');
|
||||
Route::get('goods/detail/:id', 'v1.marketing.live.LiveGoods/detail')->option(['real_name' => '直播商品详情']);
|
||||
//商品重新审核
|
||||
Route::get('goods/audit/:id', 'v1.marketing.live.LiveGoods/audit');
|
||||
Route::get('goods/audit/:id', 'v1.marketing.live.LiveGoods/audit')->option(['real_name' => '直播商品重新审核']);
|
||||
//商品撤回审核
|
||||
Route::get('goods/resestAudit/:id', 'v1.marketing.live.LiveGoods/resetAudit');
|
||||
Route::get('goods/resestAudit/:id', 'v1.marketing.live.LiveGoods/resetAudit')->option(['real_name' => '直播商品撤回审核']);
|
||||
//删除商品
|
||||
Route::delete('goods/del/:id', 'v1.marketing.live.LiveGoods/delete');
|
||||
Route::delete('goods/del/:id', 'v1.marketing.live.LiveGoods/delete')->option(['real_name' => '删除直播商品']);
|
||||
//设置是否显示
|
||||
Route::get('goods/set_show/:id/:is_show', 'v1.marketing.live.liveGoods/setShow');
|
||||
Route::get('goods/set_show/:id/:is_show', 'v1.marketing.live.liveGoods/setShow')->option(['real_name' => '设置直播商品是否显示']);
|
||||
//同步直播商品状态
|
||||
Route::get('goods/syncGoods', 'v1.marketing.live.liveGoods/syncGoods');
|
||||
Route::get('goods/syncGoods', 'v1.marketing.live.liveGoods/syncGoods')->option(['real_name' => '同步直播商品状态']);
|
||||
|
||||
//直播间列表
|
||||
Route::get('room/list', 'v1.marketing.live.LiveRoom/list');
|
||||
Route::get('room/list', 'v1.marketing.live.LiveRoom/list')->option(['real_name' => '直播间列表']);
|
||||
//直播间添加
|
||||
Route::post('room/add', 'v1.marketing.live.LiveRoom/add');
|
||||
Route::post('room/add', 'v1.marketing.live.LiveRoom/add')->option(['real_name' => '直播间添加']);
|
||||
//直播间详情
|
||||
Route::get('room/detail/:id', 'v1.marketing.live.LiveRoom/detail');
|
||||
Route::get('room/detail/:id', 'v1.marketing.live.LiveRoom/detail')->option(['real_name' => '直播间详情']);
|
||||
//直播间添加商品
|
||||
Route::post('room/add_goods', 'v1.marketing.live.LiveRoom/addGoods');
|
||||
Route::post('room/add_goods', 'v1.marketing.live.LiveRoom/addGoods')->option(['real_name' => '直播间添加商品']);
|
||||
//删除直播
|
||||
Route::delete('room/del/:id', 'v1.marketing.live.LiveRoom/delete');
|
||||
Route::delete('room/del/:id', 'v1.marketing.live.LiveRoom/delete')->option(['real_name' => '删除直播间']);
|
||||
//设置是否显示
|
||||
Route::get('room/set_show/:id/:is_show', 'v1.marketing.live.LiveRoom/setShow');
|
||||
Route::get('room/set_show/:id/:is_show', 'v1.marketing.live.LiveRoom/setShow')->option(['real_name' => '设置直播间是否显示']);
|
||||
//同步直播间状态
|
||||
Route::get('room/syncRoom', 'v1.marketing.live.LiveRoom/syncRoom');
|
||||
Route::get('room/syncRoom', 'v1.marketing.live.LiveRoom/syncRoom')->option(['real_name' => '同步直播间状态']);
|
||||
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
|
||||
@ -15,105 +15,168 @@ use think\facade\Route;
|
||||
*/
|
||||
Route::group('marketing', function () {
|
||||
//已发布优惠券列表
|
||||
Route::get('coupon/released', 'v1.marketing.StoreCouponIssue/index');
|
||||
Route::get('coupon/released', 'v1.marketing.StoreCouponIssue/index')->option(['real_name' => '已发布优惠券列表']);
|
||||
//添加优惠券
|
||||
Route::post('coupon/save_coupon', 'v1.marketing.StoreCouponIssue/saveCoupon');
|
||||
Route::post('coupon/save_coupon', 'v1.marketing.StoreCouponIssue/saveCoupon')->option(['real_name' => '添加优惠券']);
|
||||
//修改优惠券状态
|
||||
Route::get('coupon/status/:id/:status', 'v1.marketing.StoreCouponIssue/status');
|
||||
Route::get('coupon/status/:id/:status', 'v1.marketing.StoreCouponIssue/status')->option(['real_name' => '修改优惠券状态']);
|
||||
//一键复制优惠券
|
||||
Route::get('coupon/copy/:id', 'v1.marketing.StoreCouponIssue/copy');
|
||||
Route::get('coupon/copy/:id', 'v1.marketing.StoreCouponIssue/copy')->option(['real_name' => '一键复制优惠券']);
|
||||
//发送优惠券列表
|
||||
Route::get('coupon/grant', 'v1.marketing.StoreCouponIssue/index');
|
||||
Route::get('coupon/grant', 'v1.marketing.StoreCouponIssue/index')->option(['real_name' => '发送优惠券列表']);
|
||||
|
||||
|
||||
//优惠券相关 资源路由
|
||||
Route::get('coupon/list', 'v1.marketing.StoreCoupon/index');
|
||||
Route::get('coupon/list', 'v1.marketing.StoreCoupon/index')->option(['real_name' => '优惠券']);
|
||||
//优惠卷添加
|
||||
Route::get('coupon/create/:type', 'v1.marketing.StoreCoupon/create');
|
||||
Route::get('coupon/create/:type', 'v1.marketing.StoreCoupon/create')->option(['real_name' => '优惠卷添加']);
|
||||
//优惠卷数据添加添加
|
||||
Route::post('coupon/save', 'v1.marketing.StoreCoupon/save');
|
||||
Route::post('coupon/save', 'v1.marketing.StoreCoupon/save')->option(['real_name' => '优惠卷数据添加']);
|
||||
//优惠卷修改
|
||||
Route::delete('coupon/del/:id', 'v1.marketing.StoreCoupon/delete');
|
||||
Route::delete('coupon/del/:id', 'v1.marketing.StoreCoupon/delete')->option(['real_name' => '优惠卷修改']);
|
||||
//修改状态
|
||||
Route::put('coupon/status/:id', 'v1.marketing.StoreCoupon/status');
|
||||
Route::put('coupon/status/:id', 'v1.marketing.StoreCoupon/status')->option(['real_name' => '修改优惠券状态']);
|
||||
//发布优惠券表单
|
||||
Route::get('coupon/issue/:id', 'v1.marketing.StoreCoupon/issue');
|
||||
Route::get('coupon/issue/:id', 'v1.marketing.StoreCoupon/issue')->option(['real_name' => '发布优惠券表单']);
|
||||
//发布优惠券
|
||||
Route::post('coupon/issue/:id', 'v1.marketing.StoreCoupon/update_issue');
|
||||
Route::post('coupon/issue/:id', 'v1.marketing.StoreCoupon/update_issue')->option(['real_name' => '发布优惠券']);
|
||||
|
||||
|
||||
//已发布优惠券删除
|
||||
Route::delete('coupon/released/:id', 'v1.marketing.StoreCouponIssue/delete');
|
||||
Route::delete('coupon/released/:id', 'v1.marketing.StoreCouponIssue/delete')->option(['real_name' => '已发布优惠券删除']);
|
||||
//已发布优惠券修改状态表单
|
||||
Route::get('coupon/released/:id/status', 'v1.marketing.StoreCouponIssue/edit');
|
||||
Route::get('coupon/released/:id/status', 'v1.marketing.StoreCouponIssue/edit')->option(['real_name' => '已发布优惠券修改状态表单']);
|
||||
//已发布优惠券修改状态
|
||||
Route::put('coupon/released/status/:id', 'v1.marketing.StoreCouponIssue/status');
|
||||
Route::put('coupon/released/status/:id', 'v1.marketing.StoreCouponIssue/status')->option(['real_name' => '已发布优惠券修改状态']);
|
||||
//已发布优惠券领取记录
|
||||
Route::get('coupon/released/issue_log/:id', 'v1.marketing.StoreCouponIssue/issue_log');
|
||||
Route::get('coupon/released/issue_log/:id', 'v1.marketing.StoreCouponIssue/issue_log')->option(['real_name' => '已发布优惠券领取记录']);
|
||||
//会员领取记录
|
||||
Route::get('coupon/user', 'v1.marketing.StoreCouponUser/index');
|
||||
Route::get('coupon/user', 'v1.marketing.StoreCouponUser/index')->option(['real_name' => '会员领取记录']);
|
||||
//发送优惠券
|
||||
Route::post('coupon/user/grant', 'v1.marketing.StoreCouponUser/grant');
|
||||
Route::post('coupon/user/grant', 'v1.marketing.StoreCouponUser/grant')->option(['real_name' => '发送优惠券']);
|
||||
|
||||
//砍价商品列表
|
||||
Route::get('bargain', 'v1.marketing.StoreBargain/index');
|
||||
Route::get('bargain', 'v1.marketing.StoreBargain/index')->option(['real_name' => '砍价商品列表']);
|
||||
//砍价详情
|
||||
Route::get('bargain/:id', 'v1.marketing.StoreBargain/read');
|
||||
Route::get('bargain/:id', 'v1.marketing.StoreBargain/read')->option(['real_name' => '砍价商品详情']);
|
||||
//保存新增或编辑砍价
|
||||
Route::post('bargain/:id', 'v1.marketing.StoreBargain/save');
|
||||
Route::post('bargain/:id', 'v1.marketing.StoreBargain/save')->option(['real_name' => '新增或编辑砍价商品']);
|
||||
//删除砍价
|
||||
Route::delete('bargain/:id', 'v1.marketing.StoreBargain/delete');
|
||||
Route::delete('bargain/:id', 'v1.marketing.StoreBargain/delete')->option(['real_name' => '删除砍价商品']);
|
||||
//修改砍价状态
|
||||
Route::put('bargain/set_status/:id/:status', 'v1.marketing.StoreBargain/set_status');
|
||||
Route::put('bargain/set_status/:id/:status', 'v1.marketing.StoreBargain/set_status')->option(['real_name' => '修改砍价商品状态']);
|
||||
//砍价列表
|
||||
Route::get('bargain_list', 'v1.marketing.StoreBargain/bargainList');
|
||||
Route::get('bargain_list', 'v1.marketing.StoreBargain/bargainList')->option(['real_name' => '参与砍价列表']);
|
||||
//砍价人列表
|
||||
Route::get('bargain_list_info/:id', 'v1.marketing.StoreBargain/bargainListInfo');
|
||||
Route::get('bargain_list_info/:id', 'v1.marketing.StoreBargain/bargainListInfo')->option(['real_name' => '砍价人列表']);
|
||||
|
||||
//拼团商品列表
|
||||
Route::get('combination', 'v1.marketing.StoreCombination/index');
|
||||
Route::get('combination', 'v1.marketing.StoreCombination/index')->option(['real_name' => '拼团商品列表']);
|
||||
//拼团统计
|
||||
Route::get('combination/statistics', 'v1.marketing.StoreCombination/statistics');
|
||||
//拼团导出
|
||||
Route::get('combination/export', 'v1.marketing.StoreCombination/save_excel');
|
||||
Route::get('combination/statistics', 'v1.marketing.StoreCombination/statistics')->option(['real_name' => '拼团商品统计']);
|
||||
//拼团商品详情
|
||||
Route::get('combination/:id', 'v1.marketing.StoreCombination/read');
|
||||
Route::get('combination/:id', 'v1.marketing.StoreCombination/read')->option(['real_name' => '拼团商品详情']);
|
||||
//保存新疆或编辑
|
||||
Route::post('combination/:id', 'v1.marketing.StoreCombination/save');
|
||||
Route::post('combination/:id', 'v1.marketing.StoreCombination/save')->option(['real_name' => '新增或编辑拼团商品']);
|
||||
//删除
|
||||
Route::delete('combination/:id', 'v1.marketing.StoreCombination/delete');
|
||||
Route::delete('combination/:id', 'v1.marketing.StoreCombination/delete')->option(['real_name' => '删除拼团商品']);
|
||||
//修改拼团状态
|
||||
Route::put('combination/set_status/:id/:status', 'v1.marketing.StoreCombination/set_status');
|
||||
Route::put('combination/set_status/:id/:status', 'v1.marketing.StoreCombination/set_status')->option(['real_name' => '修改拼团商品状态']);
|
||||
//拼团列表
|
||||
Route::get('combination/combine/list', 'v1.marketing.StoreCombination/combine_list');
|
||||
Route::get('combination/combine/list', 'v1.marketing.StoreCombination/combine_list')->option(['real_name' => '参与拼团列表']);
|
||||
//拼团人列表
|
||||
Route::get('combination/order_pink/:id', 'v1.marketing.StoreCombination/order_pink');
|
||||
Route::get('combination/order_pink/:id', 'v1.marketing.StoreCombination/order_pink')->option(['real_name' => '拼团人列表']);
|
||||
|
||||
//秒杀列表
|
||||
Route::get('seckill', 'v1.marketing.StoreSeckill/index');
|
||||
Route::get('seckill', 'v1.marketing.StoreSeckill/index')->option(['real_name' => '秒杀商品列表']);
|
||||
//秒杀时间段列表
|
||||
Route::get('seckill/time_list', 'v1.marketing.StoreSeckill/time_list');
|
||||
//秒杀导出
|
||||
Route::get('seckill/export', 'v1.marketing.StoreSeckill/save_excel');
|
||||
Route::get('seckill/time_list', 'v1.marketing.StoreSeckill/time_list')->option(['real_name' => '秒杀时间段列表']);
|
||||
//秒杀详情
|
||||
Route::get('seckill/:id', 'v1.marketing.StoreSeckill/read');
|
||||
Route::get('seckill/:id', 'v1.marketing.StoreSeckill/read')->option(['real_name' => '秒杀商品详情']);
|
||||
//秒杀保存新增或编辑
|
||||
Route::post('seckill/:id', 'v1.marketing.StoreSeckill/save');
|
||||
Route::post('seckill/:id', 'v1.marketing.StoreSeckill/save')->option(['real_name' => '新增或编辑秒杀商品']);
|
||||
//秒杀删除
|
||||
Route::delete('seckill/:id', 'v1.marketing.StoreSeckill/delete');
|
||||
Route::delete('seckill/:id', 'v1.marketing.StoreSeckill/delete')->option(['real_name' => '删除秒杀商品']);
|
||||
//修改秒杀状态
|
||||
Route::put('seckill/set_status/:id/:status', 'v1.marketing.StoreSeckill/set_status');
|
||||
Route::put('seckill/set_status/:id/:status', 'v1.marketing.StoreSeckill/set_status')->option(['real_name' => '修改秒杀商品状态']);
|
||||
|
||||
//积分日志列表
|
||||
Route::get('integral', 'v1.marketing.UserPoint/index');
|
||||
//导出积分日志
|
||||
Route::get('integral/export', 'v1.marketing.UserPoint/export');
|
||||
Route::get('integral', 'v1.marketing.UserPoint/index')->option(['real_name' => '积分日志列表']);
|
||||
//积分日志头部数据
|
||||
Route::get('integral/statistics', 'v1.marketing.UserPoint/integral_statistics');
|
||||
Route::get('integral/statistics', 'v1.marketing.UserPoint/integral_statistics')->option(['real_name' => '积分日志头部数据']);
|
||||
//积分配置编辑表单
|
||||
Route::get('integral_config/edit_basics', 'v1.setting.SystemConfig/edit_basics');
|
||||
Route::get('integral_config/edit_basics', 'v1.setting.SystemConfig/edit_basics')->option(['real_name' => '积分配置编辑表单']);
|
||||
//积分配置保存数据
|
||||
Route::post('integral_config/save_basics', 'v1.setting.SystemConfig/save_basics');
|
||||
Route::post('integral_config/save_basics', 'v1.setting.SystemConfig/save_basics')->option(['real_name' => '积分配置保存数据']);
|
||||
|
||||
//预售列表
|
||||
Route::get('advance/index','v1.marketing.StoreAdvance/index')->option(['real_name' => '预售商品列表']);
|
||||
Route::get('advance/info/:id','v1.marketing.StoreAdvance/info')->option(['real_name' => '预售商品详情']);
|
||||
Route::post('advance/save/:id','v1.marketing.StoreAdvance/save')->option(['real_name' => '保存预售商品']);
|
||||
Route::delete('advance/:id','v1.marketing.StoreAdvance/del')->option(['real_name' => '删除预售商品']);
|
||||
Route::put('advance/set_status/:id/:status','v1.marketing.StoreAdvance/setStatus')->option(['real_name' => '上下架预售商品']);
|
||||
|
||||
//积分商城
|
||||
//积分商品列表
|
||||
Route::get('integral_product', 'v1.marketing.integral.StoreIntegral/index')->option(['real_name' => '积分商品列表']);
|
||||
//积分商品新增或编辑
|
||||
Route::post('integral/:id', 'v1.marketing.integral.StoreIntegral/save')->option(['real_name' => '积分商品新增或编辑']);
|
||||
//积分商品详情
|
||||
Route::get('integral/:id', 'v1.marketing.integral.StoreIntegral/read')->option(['real_name' => '积分商品详情']);
|
||||
//积分商品删除
|
||||
Route::delete('integral/:id', 'v1.marketing.integral.StoreIntegral/delete')->option(['real_name' => '积分商品删除']);
|
||||
//修改积分商品状态
|
||||
Route::put('integral/set_show/:id/:is_show', 'v1.marketing.integral.StoreIntegral/set_show')->option(['real_name' => '修改积分商品状态']);
|
||||
//积分商城订单列表
|
||||
Route::get('integral/order/list', 'v1.marketing.integral.StoreIntegralOrder/lst')->option(['real_name' => '积分商城订单列表']);
|
||||
//积分商城订单数据
|
||||
Route::get('integral/order/chart', 'v1.marketing.integral.StoreIntegralOrder/chart')->option(['real_name' => '积分商城订单数据']);
|
||||
//积分商城订单详情数据
|
||||
Route::get('integral/order/info/:id', 'v1.marketing.integral.StoreIntegralOrder/order_info')->option(['real_name' => '积分商城订单详情数据']);
|
||||
//修改积分商品订单备注信息
|
||||
Route::put('integral/order/remark/:id', 'v1.marketing.integral.StoreIntegralOrder/remark')->option(['real_name' => '修改积分商品订单备注信息']);
|
||||
//获取积分订单状态
|
||||
Route::get('integral/order/status/:id', 'v1.marketing.integral.StoreIntegralOrder/status')->option(['real_name' => '获取积分订单状态']);
|
||||
//删除积分订单
|
||||
Route::delete('integral/order/del/:id', 'v1.marketing.integral.StoreIntegralOrder/del')->option(['real_name' => '删除积分订单']);
|
||||
//积分订单发送货
|
||||
Route::put('integral/order/delivery/:id', 'v1.marketing.integral.StoreIntegralOrder/update_delivery')->option(['real_name' => '积分订单发送货']);
|
||||
//获取积分订单配送信息表单
|
||||
Route::get('integral/order/distribution/:id', 'v1.marketing.integral.StoreIntegralOrder/distribution')->option(['real_name' => '获取积分订单配送信息表单']);
|
||||
//修改积分订单配送信息
|
||||
Route::put('integral/order/distribution/:id', 'v1.marketing.integral.StoreIntegralOrder/update_distribution')->option(['real_name' => '修改积分订单配送信息']);
|
||||
//积分订单确认收货
|
||||
Route::put('integral/order/take/:id', 'v1.marketing.integral.StoreIntegralOrder/take_delivery')->option(['real_name' => '积分订单确认收货']);
|
||||
//积分订单获取物流公司
|
||||
Route::get('integral/order/express_list', 'v1.marketing.integral.StoreIntegralOrder/express')->option(['real_name' => '积分订单获取物流公司']);
|
||||
//积分订单快递公司电子面单模版
|
||||
Route::get('integral/order/express/temp', 'v1.marketing.integral.StoreIntegralOrder/express_temp')->option(['real_name' => '积分订单快递公司电子面单模版']);
|
||||
//积分订单获取物流信息
|
||||
Route::get('integral/order/express/:id', 'v1.marketing.integral.StoreIntegralOrder/get_express')->option(['real_name' => '积分订单获取物流信息']);
|
||||
//打印积分订单
|
||||
Route::get('integral/order/print/:id', 'v1.marketing.integral.StoreIntegralOrder/order_print')->option(['real_name' => '打印积分订单']);
|
||||
//积分订单列表获取配送员
|
||||
Route::get('integral/order/delivery/list', 'v1.order.DeliveryService/get_delivery_list')->option(['real_name' => '积分订单列表获取配送员']);
|
||||
//积分订单获取面单默认配置信息
|
||||
Route::get('integral/order/sheet_info', 'v1.marketing.integral.StoreIntegralOrder/getDeliveryInfo')->option(['real_name' => '积分订单获取面单默认配置信息']);
|
||||
|
||||
//九宫格抽奖
|
||||
//抽奖活动列表
|
||||
Route::get('lottery/list', 'v1.marketing.lottery.LuckLottery/index')->option(['real_name' => '抽奖活动列表']);
|
||||
//抽奖活动详情
|
||||
Route::get('lottery/detail/:id', 'v1.marketing.lottery.LuckLottery/detail')->option(['real_name' => '抽奖活动详情']);
|
||||
//添加抽奖活动
|
||||
Route::post('lottery/add', 'v1.marketing.lottery.LuckLottery/add')->option(['real_name' => '添加抽奖活动']);
|
||||
//修改抽奖活动数据
|
||||
Route::put('lottery/edit/:id', 'v1.marketing.lottery.LuckLottery/edit')->option(['real_name' => '修改抽奖活动数据']);
|
||||
//删除抽奖活动
|
||||
Route::delete('lottery/del/:id', 'v1.marketing.lottery.LuckLottery/delete')->option(['real_name' => '删除抽奖活动']);
|
||||
//设置抽奖活动是否显示
|
||||
Route::post('lottery/set_status/:id/:status', 'v1.marketing.lottery.LuckLottery/setStatus')->option(['real_name' => '设置抽奖活动是否显示']);
|
||||
//抽奖记录列表
|
||||
Route::get('lottery/record/list/:id', 'v1.marketing.lottery.LuckLotteryRecord/index')->option(['real_name' => '抽奖记录列表']);
|
||||
//抽奖中奖发货、备注处理
|
||||
Route::post('lottery/record/deliver', 'v1.marketing.lottery.LuckLotteryRecord/deliver')->option(['real_name' => '抽奖中奖发货、备注处理']);
|
||||
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
|
||||
@ -15,39 +15,39 @@ use think\facade\Route;
|
||||
*/
|
||||
Route::group('merchant', function () {
|
||||
//门店设置详情
|
||||
Route::get('store', 'v1.merchant.SystemStore/index');
|
||||
Route::get('store', 'v1.merchant.SystemStore/index')->option(['real_name' => '门店列表']);
|
||||
//门店列表数量
|
||||
Route::get('store/get_header', 'v1.merchant.SystemStore/get_header');
|
||||
Route::get('store/get_header', 'v1.merchant.SystemStore/get_header')->option(['real_name' => '门店列表头部数据']);
|
||||
//门店列表数量
|
||||
Route::put('store/set_show/:id/:is_show', 'v1.merchant.SystemStore/set_show');
|
||||
Route::put('store/set_show/:id/:is_show', 'v1.merchant.SystemStore/set_show')->option(['real_name' => '门店上下架']);
|
||||
//门店列表数量
|
||||
Route::delete('store/del/:id', 'v1.merchant.SystemStore/delete');
|
||||
Route::delete('store/del/:id', 'v1.merchant.SystemStore/delete')->option(['real_name' => '门店删除']);
|
||||
//位置选择
|
||||
Route::get('store/address', 'v1.merchant.SystemStore/select_address');
|
||||
Route::get('store/address', 'v1.merchant.SystemStore/select_address')->option(['real_name' => '门店位置选择']);
|
||||
//门店设置详情
|
||||
Route::get('store/get_info/:id', 'v1.merchant.SystemStore/get_info');
|
||||
Route::get('store/get_info/:id', 'v1.merchant.SystemStore/get_info')->option(['real_name' => '门店详情']);
|
||||
//保存修改门店信息
|
||||
Route::post('store/:id', 'v1.merchant.SystemStore/save');
|
||||
Route::post('store/:id', 'v1.merchant.SystemStore/save')->option(['real_name' => '保存修改门店信息']);
|
||||
//获取店员列表
|
||||
Route::get('store_staff', 'v1.merchant.SystemStoreStaff/index');
|
||||
Route::get('store_staff', 'v1.merchant.SystemStoreStaff/index')->option(['real_name' => '获取门店店员列表']);
|
||||
//添加店员表单
|
||||
Route::get('store_staff/create', 'v1.merchant.SystemStoreStaff/create');
|
||||
Route::get('store_staff/create', 'v1.merchant.SystemStoreStaff/create')->option(['real_name' => '添加门店店员表单']);
|
||||
//门店搜索列表
|
||||
Route::get('store_list', 'v1.merchant.SystemStoreStaff/store_list');
|
||||
Route::get('store_list', 'v1.merchant.SystemStoreStaff/store_list')->option(['real_name' => '门店搜索列表']);
|
||||
//修改店员状态
|
||||
Route::put('store_staff/set_show/:id/:is_show', 'v1.merchant.SystemStoreStaff/set_show');
|
||||
Route::put('store_staff/set_show/:id/:is_show', 'v1.merchant.SystemStoreStaff/set_show')->option(['real_name' => '修改店员状态']);
|
||||
//修改店员表单
|
||||
Route::get('store_staff/:id/edit', 'v1.merchant.SystemStoreStaff/edit');
|
||||
Route::get('store_staff/:id/edit', 'v1.merchant.SystemStoreStaff/edit')->option(['real_name' => '修改店员表单']);
|
||||
//保存店员
|
||||
Route::post('store_staff/save/:id', 'v1.merchant.SystemStoreStaff/save');
|
||||
Route::post('store_staff/save/:id', 'v1.merchant.SystemStoreStaff/save')->option(['real_name' => '保存店员']);
|
||||
//删除店员
|
||||
Route::delete('store_staff/del/:id', 'v1.merchant.SystemStoreStaff/delete');
|
||||
Route::delete('store_staff/del/:id', 'v1.merchant.SystemStoreStaff/delete')->option(['real_name' => '删除店员']);
|
||||
//获取核销订单列表
|
||||
Route::get('verify_order', 'v1.merchant.SystemVerifyOrder/list');
|
||||
Route::get('verify_order', 'v1.merchant.SystemVerifyOrder/list')->option(['real_name' => '获取核销订单列表']);
|
||||
//获取核销订单头部
|
||||
Route::get('verify_badge', 'v1.merchant.SystemVerifyOrder/getVerifyBadge');
|
||||
Route::get('verify_badge', 'v1.merchant.SystemVerifyOrder/getVerifyBadge')->option(['real_name' => '获取核销订单头部']);
|
||||
//获取核销订单头部
|
||||
Route::get('verify/spread_info/:uid', 'v1.merchant.SystemVerifyOrder/order_spread_user');
|
||||
Route::get('verify/spread_info/:uid', 'v1.merchant.SystemVerifyOrder/order_spread_user')->option(['real_name' => '核销订单推荐人信息']);
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
\app\adminapi\middleware\AdminAuthTokenMiddleware::class,
|
||||
|
||||
@ -15,33 +15,33 @@ use think\facade\Route;
|
||||
*/
|
||||
Route::group('notify', function () {
|
||||
//保存配置 登录
|
||||
Route::post('sms/config', 'v1.notification.sms.SmsConfig/save_basics');
|
||||
Route::post('sms/config', 'v1.notification.sms.SmsConfig/save_basics')->option(['real_name' => '保存短信配置']);
|
||||
//短信发送记录
|
||||
Route::get('sms/record', 'v1.notification.sms.SmsConfig/record');
|
||||
Route::get('sms/record', 'v1.notification.sms.SmsConfig/record')->option(['real_name' => '短信发送记录']);
|
||||
//短信账号数据
|
||||
Route::get('sms/data', 'v1.notification.sms.SmsConfig/data');
|
||||
Route::get('sms/data', 'v1.notification.sms.SmsConfig/data')->option(['real_name' => '短信账号数据']);
|
||||
//查看是否登录
|
||||
Route::get('sms/is_login', 'v1.notification.sms.SmsConfig/is_login');
|
||||
Route::get('sms/is_login', 'v1.notification.sms.SmsConfig/is_login')->option(['real_name' => '查看短信账号是否登录']);
|
||||
//查看是否登录
|
||||
Route::get('sms/logout', 'v1.notification.sms.SmsConfig/logout');
|
||||
Route::get('sms/logout', 'v1.notification.sms.SmsConfig/logout')->option(['real_name' => '短信账号退出登录']);
|
||||
//发送短信验证码
|
||||
Route::post('sms/captcha', 'v1.notification.sms.SmsAdmin/captcha');
|
||||
Route::post('sms/captcha', 'v1.notification.sms.SmsAdmin/captcha')->option(['real_name' => '发送短信验证码']);
|
||||
//修改/注册短信平台账号
|
||||
Route::post('sms/register', 'v1.notification.sms.SmsAdmin/save');
|
||||
Route::post('sms/register', 'v1.notification.sms.SmsAdmin/save')->option(['real_name' => '修改或注册短信平台账号']);
|
||||
//短信模板列表
|
||||
Route::get('sms/temp', 'v1.notification.sms.SmsTemplateApply/index');
|
||||
Route::get('sms/temp', 'v1.notification.sms.SmsTemplateApply/index')->option(['real_name' => '短信模板列表']);
|
||||
//短信模板申请表单
|
||||
Route::get('sms/temp/create', 'v1.notification.sms.SmsTemplateApply/create');
|
||||
Route::get('sms/temp/create', 'v1.notification.sms.SmsTemplateApply/create')->option(['real_name' => '短信模板申请表单']);
|
||||
//短信模板申请
|
||||
Route::post('sms/temp', 'v1.notification.sms.SmsTemplateApply/save');
|
||||
Route::post('sms/temp', 'v1.notification.sms.SmsTemplateApply/save')->option(['real_name' => '短信模板申请']);
|
||||
//公共短信模板列表
|
||||
Route::get('sms/public_temp', 'v1.notification.sms.SmsPublicTemp/index');
|
||||
Route::get('sms/public_temp', 'v1.notification.sms.SmsPublicTemp/index')->option(['real_name' => '公共短信模板列表']);
|
||||
//剩余条数
|
||||
Route::get('sms/number', 'v1.notification.sms.SmsPay/number');
|
||||
Route::get('sms/number', 'v1.notification.sms.SmsPay/number')->option(['real_name' => '短信剩余条数']);
|
||||
//获取支付套餐
|
||||
Route::get('sms/price', 'v1.notification.sms.SmsPay/price');
|
||||
Route::get('sms/price', 'v1.notification.sms.SmsPay/price')->option(['real_name' => '获取短信购买套餐']);
|
||||
//获取支付码
|
||||
Route::post('sms/pay_code', 'v1.notification.sms.SmsPay/pay');
|
||||
Route::post('sms/pay_code', 'v1.notification.sms.SmsPay/pay')->option(['real_name' => '获取短信购买支付码']);
|
||||
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
|
||||
@ -15,93 +15,115 @@ use think\facade\Route;
|
||||
*/
|
||||
Route::group('order', function () {
|
||||
//打印订单
|
||||
Route::get('print/:id', 'v1.order.StoreOrder/order_print')->name('StoreOrderPrint');
|
||||
Route::get('print/:id', 'v1.order.StoreOrder/order_print')->name('StoreOrderPrint')->option(['real_name' => '打印订单']);
|
||||
//订单列表
|
||||
Route::get('list', 'v1.order.StoreOrder/lst')->name('StoreOrderList');
|
||||
Route::get('list', 'v1.order.StoreOrder/lst')->name('StoreOrderList')->option(['real_name' => '订单列表']);
|
||||
//订单数据
|
||||
Route::get('chart', 'v1.order.StoreOrder/chart')->name('StoreOrderChart');
|
||||
Route::get('chart', 'v1.order.StoreOrder/chart')->name('StoreOrderChart')->option(['real_name' => '订单头部数据']);
|
||||
//订单核销
|
||||
Route::post('write', 'v1.order.StoreOrder/write_order')->name('writeOrder');
|
||||
Route::post('write', 'v1.order.StoreOrder/write_order')->name('writeOrder')->option(['real_name' => '订单核销']);
|
||||
//订单号核销
|
||||
Route::put('write_update/:order_id', 'v1.order.StoreOrder/write_update')->name('writeOrderUpdate');
|
||||
Route::put('write_update/:order_id', 'v1.order.StoreOrder/write_update')->name('writeOrderUpdate')->option(['real_name' => '订单号核销']);
|
||||
//获取订单编辑表格
|
||||
Route::get('edit/:id', 'v1.order.StoreOrder/edit')->name('StoreOrderEdit');
|
||||
Route::get('edit/:id', 'v1.order.StoreOrder/edit')->name('StoreOrderEdit')->option(['real_name' => '获取订单编辑表单']);
|
||||
//修改订单
|
||||
Route::put('update/:id', 'v1.order.StoreOrder/update')->name('StoreOrderUpdate');
|
||||
Route::put('update/:id', 'v1.order.StoreOrder/update')->name('StoreOrderUpdate')->option(['real_name' => '修改订单']);
|
||||
//确认收货
|
||||
Route::put('take/:id', 'v1.order.StoreOrder/take_delivery')->name('StoreOrderTakeDelivery');
|
||||
Route::put('take/:id', 'v1.order.StoreOrder/take_delivery')->name('StoreOrderTakeDelivery')->option(['real_name' => '确认收货']);
|
||||
//发送货
|
||||
Route::put('delivery/:id', 'v1.order.StoreOrder/update_delivery')->name('StoreOrderUpdateDelivery');
|
||||
Route::put('delivery/:id', 'v1.order.StoreOrder/update_delivery')->name('StoreOrderUpdateDelivery')->option(['real_name' => '订单发送货']);
|
||||
//获取订单可拆分商品列表
|
||||
Route::get('split_cart_info/:id', 'v1.order.StoreOrder/split_cart_info')->name('StoreOrderSplitCartInfo')->option(['real_name' => '获取订单可拆分商品列表']);
|
||||
//拆单发送货
|
||||
Route::put('split_delivery/:id', 'v1.order.StoreOrder/split_delivery')->name('StoreOrderSplitDelivery')->option(['real_name' => '拆单发送货']);
|
||||
//获取订单拆分子订单列表
|
||||
Route::get('split_order/:id', 'v1.order.StoreOrder/split_order')->name('StoreOrderSplitOrder')->option(['real_name' => '获取订单拆分子订单列表']);
|
||||
//订单退款表格
|
||||
Route::get('refund/:id', 'v1.order.StoreOrder/refund')->name('StoreOrderRefund');
|
||||
Route::get('refund/:id', 'v1.order.StoreOrder/refund')->name('StoreOrderRefund')->option(['real_name' => '订单退款表单']);
|
||||
//订单退款
|
||||
Route::put('refund/:id', 'v1.order.StoreOrder/update_refund')->name('StoreOrderUpdateRefund');
|
||||
Route::put('refund/:id', 'v1.order.StoreOrder/update_refund')->name('StoreOrderUpdateRefund')->option(['real_name' => '订单退款']);
|
||||
//获取物流信息
|
||||
Route::get('express/:id', 'v1.order.StoreOrder/get_express')->name('StoreOrderUpdateExpress');
|
||||
Route::get('express/:id', 'v1.order.StoreOrder/get_express')->name('StoreOrderUpdateExpress')->option(['real_name' => '获取物流信息']);
|
||||
//获取物流公司
|
||||
Route::get('express_list', 'v1.order.StoreOrder/express')->name('StoreOrdeRexpressList');
|
||||
Route::get('express_list', 'v1.order.StoreOrder/express')->name('StoreOrdeRexpressList')->option(['real_name' => '获取物流公司']);
|
||||
//订单详情
|
||||
Route::get('info/:id', 'v1.order.StoreOrder/order_info')->name('StoreOrderorInfo');
|
||||
Route::get('info/:id', 'v1.order.StoreOrder/order_info')->name('StoreOrderorInfo')->option(['real_name' => '订单详情']);
|
||||
//获取配送信息表格
|
||||
Route::get('distribution/:id', 'v1.order.StoreOrder/distribution')->name('StoreOrderorDistribution');
|
||||
Route::get('distribution/:id', 'v1.order.StoreOrder/distribution')->name('StoreOrderorDistribution')->option(['real_name' => '获取配送信息表单']);
|
||||
//修改配送信息
|
||||
Route::put('distribution/:id', 'v1.order.StoreOrder/update_distribution')->name('StoreOrderorUpdateDistribution');
|
||||
Route::put('distribution/:id', 'v1.order.StoreOrder/update_distribution')->name('StoreOrderorUpdateDistribution')->option(['real_name' => '修改配送信息']);
|
||||
//获取不退款表格
|
||||
Route::get('no_refund/:id', 'v1.order.StoreOrder/no_refund')->name('StoreOrderorNoRefund');
|
||||
Route::get('no_refund/:id', 'v1.order.StoreOrder/no_refund')->name('StoreOrderorNoRefund')->option(['real_name' => '获取不退款表单']);
|
||||
//修改不退款理由
|
||||
Route::put('no_refund/:id', 'v1.order.StoreOrder/update_un_refund')->name('StoreOrderorUpdateNoRefund');
|
||||
Route::put('no_refund/:id', 'v1.order.StoreOrder/update_un_refund')->name('StoreOrderorUpdateNoRefund')->option(['real_name' => '修改不退款理由']);
|
||||
//线下支付
|
||||
Route::post('pay_offline/:id', 'v1.order.StoreOrder/pay_offline')->name('StoreOrderorPayOffline');
|
||||
Route::post('pay_offline/:id', 'v1.order.StoreOrder/pay_offline')->name('StoreOrderorPayOffline')->option(['real_name' => '线下支付']);
|
||||
//获取退积分表格
|
||||
Route::get('refund_integral/:id', 'v1.order.StoreOrder/refund_integral')->name('StoreOrderorRefundIntegral');
|
||||
Route::get('refund_integral/:id', 'v1.order.StoreOrder/refund_integral')->name('StoreOrderorRefundIntegral')->option(['real_name' => '获取退积分表单']);
|
||||
//修改退积分
|
||||
Route::put('refund_integral/:id', 'v1.order.StoreOrder/update_refund_integral')->name('StoreOrderorUpdateRefundIntegral');
|
||||
Route::put('refund_integral/:id', 'v1.order.StoreOrder/update_refund_integral')->name('StoreOrderorUpdateRefundIntegral')->option(['real_name' => '修改退积分']);
|
||||
//修改备注信息
|
||||
Route::put('remark/:id', 'v1.order.StoreOrder/remark')->name('StoreOrderorRemark');
|
||||
Route::put('remark/:id', 'v1.order.StoreOrder/remark')->name('StoreOrderorRemark')->option(['real_name' => '修改备注信息']);
|
||||
//获取订单状态
|
||||
Route::get('status/:id', 'v1.order.StoreOrder/status')->name('StoreOrderorStatus');
|
||||
Route::get('status/:id', 'v1.order.StoreOrder/status')->name('StoreOrderorStatus')->option(['real_name' => '获取订单状态']);
|
||||
//删除订单单个
|
||||
Route::delete('del/:id', 'v1.order.StoreOrder/del')->name('StoreOrderorDel');
|
||||
Route::delete('del/:id', 'v1.order.StoreOrder/del')->name('StoreOrderorDel')->option(['real_name' => '删除订单单个']);
|
||||
//批量删除订单
|
||||
Route::post('dels', 'v1.order.StoreOrder/del_orders')->name('StoreOrderorDels');
|
||||
Route::post('dels', 'v1.order.StoreOrder/del_orders')->name('StoreOrderorDels')->option(['real_name' => '批量删除订单']);
|
||||
//面单默认配置信息
|
||||
Route::get('sheet_info', 'v1.order.StoreOrder/getDeliveryInfo');
|
||||
Route::get('sheet_info', 'v1.order.StoreOrder/getDeliveryInfo')->option(['real_name' => '面单默认配置信息']);
|
||||
|
||||
//获取线下付款二维码
|
||||
Route::get('offline_scan', 'v1.order.OtherOrder/offline_scan')->name('OfflineScan');
|
||||
Route::get('offline_scan', 'v1.order.OtherOrder/offline_scan')->name('OfflineScan')->option(['real_name' => '获取线下付款二维码']);
|
||||
//线下收银列表
|
||||
Route::get('scan_list', 'v1.order.OtherOrder/scan_list')->name('ScanList');
|
||||
Route::get('scan_list', 'v1.order.OtherOrder/scan_list')->name('ScanList')->option(['real_name' => '线下收银列表']);
|
||||
//发票列表头部统计
|
||||
Route::get('invoice/chart', 'v1.order.StoreOrderInvoice/chart')->name('StoreOrderorInvoiceChart');
|
||||
Route::get('invoice/chart', 'v1.order.StoreOrderInvoice/chart')->name('StoreOrderorInvoiceChart')->option(['real_name' => '发票列表头部统计']);
|
||||
//申请发票列表
|
||||
Route::get('invoice/list', 'v1.order.StoreOrderInvoice/list')->name('StoreOrderorInvoiceList');
|
||||
Route::get('invoice/list', 'v1.order.StoreOrderInvoice/list')->name('StoreOrderorInvoiceList')->option(['real_name' => '申请发票列表']);
|
||||
//设置发票状态
|
||||
Route::post('invoice/set/:id', 'v1.order.StoreOrderInvoice/set_invoice')->name('StoreOrderorInvoiceSet');
|
||||
Route::post('invoice/set/:id', 'v1.order.StoreOrderInvoice/set_invoice')->name('StoreOrderorInvoiceSet')->option(['real_name' => '设置发票状态']);
|
||||
//开票订单详情
|
||||
Route::get('invoice_order_info/:id', 'v1.order.StoreOrderInvoice/orderInfo')->name('StoreOrderorInvoiceOrderInfo');
|
||||
Route::get('invoice_order_info/:id', 'v1.order.StoreOrderInvoice/orderInfo')->name('StoreOrderorInvoiceOrderInfo')->option(['real_name' => '开票订单详情']);
|
||||
//配送员列表
|
||||
Route::get('delivery/index', 'v1.order.DeliveryService/index');
|
||||
Route::get('delivery/index', 'v1.order.DeliveryService/index')->option(['real_name' => '配送员列表']);
|
||||
//新增配送员选择用户列表
|
||||
Route::get('delivery/create', 'v1.order.DeliveryService/create');
|
||||
Route::get('delivery/create', 'v1.order.DeliveryService/create')->option(['real_name' => '新增配送员选择用户列表']);
|
||||
//新增配送表单
|
||||
Route::get('delivery/add', 'v1.order.DeliveryService/add');
|
||||
Route::get('delivery/add', 'v1.order.DeliveryService/add')->option(['real_name' => '新增配送表单']);
|
||||
//保存新建的数据
|
||||
Route::post('delivery/save', 'v1.order.DeliveryService/save');
|
||||
Route::post('delivery/save', 'v1.order.DeliveryService/save')->option(['real_name' => '保存新建的配送员']);
|
||||
//编辑配送员表单
|
||||
Route::get('delivery/:id/edit', 'v1.order.DeliveryService/edit');
|
||||
Route::get('delivery/:id/edit', 'v1.order.DeliveryService/edit')->option(['real_name' => '编辑配送员表单']);
|
||||
//保存编辑的数据
|
||||
Route::put('delivery/update/:id', 'v1.order.DeliveryService/update');
|
||||
Route::put('delivery/update/:id', 'v1.order.DeliveryService/update')->option(['real_name' => '修改配送员']);
|
||||
//删除
|
||||
Route::delete('delivery/del/:id', 'v1.order.DeliveryService/delete');
|
||||
Route::delete('delivery/del/:id', 'v1.order.DeliveryService/delete')->option(['real_name' => '删除配送员']);
|
||||
//修改状态
|
||||
Route::get('delivery/set_status/:id/:status', 'v1.order.DeliveryService/set_status');
|
||||
Route::get('delivery/set_status/:id/:status', 'v1.order.DeliveryService/set_status')->option(['real_name' => '修改配送员状态']);
|
||||
//订单列表获取配送员
|
||||
Route::get('delivery/list', 'v1.order.DeliveryService/get_delivery_list');
|
||||
Route::get('delivery/list', 'v1.order.DeliveryService/get_delivery_list')->option(['real_name' => '订单列表获取配送员']);
|
||||
//电子面单模板列表
|
||||
Route::get('expr/temp', 'v1.order.StoreOrder/expr_temp');
|
||||
Route::get('express/temp', 'v1.order.StoreOrder/express_temp');
|
||||
Route::get('expr/temp', 'v1.order.StoreOrder/expr_temp')->option(['real_name' => '电子面单模板列表']);
|
||||
Route::get('express/temp', 'v1.order.StoreOrder/express_temp')->option(['real_name' => '快递公司电子面单模版']);
|
||||
//更多操作打印电子面单
|
||||
Route::get('order_dump/:order_id', 'v1.order.StoreOrder/order_dump');
|
||||
Route::get('order_dump/:order_id', 'v1.order.StoreOrder/order_dump')->option(['real_name' => '更多操作打印电子面单']);
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
\app\adminapi\middleware\AdminAuthTokenMiddleware::class,
|
||||
\app\adminapi\middleware\AdminCkeckRoleMiddleware::class,
|
||||
\app\adminapi\middleware\AdminLogMiddleware::class
|
||||
]);
|
||||
|
||||
/**
|
||||
* 售后 相关路由
|
||||
*/
|
||||
Route::group('refund', function () {
|
||||
//售后列表
|
||||
Route::get('list', 'v1.order.RefundOrder/getRefundList');
|
||||
//商家同意退款,等待用户退货
|
||||
Route::get('agree/:order_id', 'v1.order.RefundOrder/agreeRefund');
|
||||
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
\app\adminapi\middleware\AdminAuthTokenMiddleware::class,
|
||||
|
||||
@ -12,85 +12,87 @@ use think\facade\Route;
|
||||
|
||||
Route::group('product', function () {
|
||||
|
||||
Route::get('category', 'v1.product.StoreCategory/index');
|
||||
Route::get('category', 'v1.product.StoreCategory/index')->option(['real_name' => '商品分类列表']);
|
||||
//商品树形列表
|
||||
Route::get('category/tree/:type', 'v1.product.StoreCategory/tree_list');
|
||||
Route::get('category/tree/:type', 'v1.product.StoreCategory/tree_list')->option(['real_name' => '商品分类树形列表']);
|
||||
//商品分类新增表单
|
||||
Route::get('category/create', 'v1.product.StoreCategory/create');
|
||||
Route::get('category/create', 'v1.product.StoreCategory/create')->option(['real_name' => '商品分类新增表单']);
|
||||
//商品分类新增
|
||||
Route::post('category', 'v1.product.StoreCategory/save');
|
||||
Route::post('category', 'v1.product.StoreCategory/save')->option(['real_name' => '商品分类新增']);
|
||||
//商品分类编辑表单
|
||||
Route::get('category/:id', 'v1.product.StoreCategory/edit');
|
||||
Route::get('category/:id', 'v1.product.StoreCategory/edit')->option(['real_name' => '商品分类编辑表单']);
|
||||
//商品分类编辑
|
||||
Route::put('category/:id', 'v1.product.StoreCategory/update');
|
||||
Route::put('category/:id', 'v1.product.StoreCategory/update')->option(['real_name' => '商品分类编辑']);
|
||||
//删除商品分类
|
||||
Route::delete('category/:id', 'v1.product.StoreCategory/delete');
|
||||
Route::delete('category/:id', 'v1.product.StoreCategory/delete')->option(['real_name' => '删除商品分类']);
|
||||
//商品分类修改状态
|
||||
Route::put('category/set_show/:id/:is_show', 'v1.product.StoreCategory/set_show');
|
||||
Route::put('category/set_show/:id/:is_show', 'v1.product.StoreCategory/set_show')->option(['real_name' => '商品分类修改状态']);
|
||||
//商品分类快捷编辑
|
||||
Route::put('category/set_category/:id', 'v1.product.StoreCategory/set_category');
|
||||
Route::put('category/set_category/:id', 'v1.product.StoreCategory/set_category')->option(['real_name' => '商品分类快捷编辑']);
|
||||
//商品列表
|
||||
Route::get('product', 'v1.product.StoreProduct/index');
|
||||
Route::get('product', 'v1.product.StoreProduct/index')->option(['real_name' => '商品列表']);
|
||||
//获取退出未保存的数据
|
||||
Route::get('cache', 'v1.product.StoreProduct/getCacheData');
|
||||
Route::get('cache', 'v1.product.StoreProduct/getCacheData')->option(['real_name' => '获取退出未保存的数据']);
|
||||
//1分钟保存一次数据
|
||||
Route::post('cache', 'v1.product.StoreProduct/saveCacheData');
|
||||
Route::post('cache', 'v1.product.StoreProduct/saveCacheData')->option(['real_name' => '保存还未提交数据']);
|
||||
//获取所有商品列表
|
||||
Route::get('product/list', 'v1.product.StoreProduct/search_list');
|
||||
Route::get('product/list', 'v1.product.StoreProduct/search_list')->option(['real_name' => '获取所有商品列表']);
|
||||
//获取商品规格
|
||||
Route::get('product/attrs/:id/:type', 'v1.product.StoreProduct/get_attrs');
|
||||
Route::get('product/attrs/:id/:type', 'v1.product.StoreProduct/get_attrs')->option(['real_name' => '获取商品规格']);
|
||||
//商品列表头
|
||||
Route::get('product/type_header', 'v1.product.StoreProduct/type_header');
|
||||
Route::get('product/type_header', 'v1.product.StoreProduct/type_header')->option(['real_name' => '商品列表头部数据']);
|
||||
//商品详情
|
||||
Route::get('product/:id', 'v1.product.StoreProduct/get_product_info');
|
||||
Route::get('product/:id', 'v1.product.StoreProduct/get_product_info')->option(['real_name' => '商品详情']);
|
||||
//加入回收站
|
||||
Route::delete('product/:id', 'v1.product.StoreProduct/delete');
|
||||
Route::delete('product/:id', 'v1.product.StoreProduct/delete')->option(['real_name' => '商品放入回收站']);
|
||||
//保存新建或保存
|
||||
Route::post('product/:id', 'v1.product.StoreProduct/save');
|
||||
Route::post('product/:id', 'v1.product.StoreProduct/save')->option(['real_name' => '新建或修改商品']);
|
||||
//修改商品状态
|
||||
Route::put('product/set_show/:id/:is_show', 'v1.product.StoreProduct/set_show');
|
||||
Route::put('product/set_show/:id/:is_show', 'v1.product.StoreProduct/set_show')->option(['real_name' => '修改商品状态']);
|
||||
//商品快速编辑
|
||||
Route::put('product/set_product/:id', 'v1.product.StoreProduct/set_product');
|
||||
Route::put('product/set_product/:id', 'v1.product.StoreProduct/set_product')->option(['real_name' => '商品快速编辑']);
|
||||
//设置批量商品上架
|
||||
Route::put('product/product_show', 'v1.product.StoreProduct/product_show');
|
||||
Route::put('product/product_show', 'v1.product.StoreProduct/product_show')->option(['real_name' => '设置批量商品上架']);
|
||||
//设置批量商品下架
|
||||
Route::put('product/product_unshow', 'v1.product.StoreProduct/product_unshow');
|
||||
Route::put('product/product_unshow', 'v1.product.StoreProduct/product_unshow')->option(['real_name' => '设置批量商品下架']);
|
||||
//规则列表
|
||||
Route::get('product/rule', 'v1.product.StoreProductRule/index');
|
||||
Route::get('product/rule', 'v1.product.StoreProductRule/index')->option(['real_name' => '商品规则列表']);
|
||||
//规则 保存新建或编辑
|
||||
Route::post('product/rule/:id', 'v1.product.StoreProductRule/save');
|
||||
Route::post('product/rule/:id', 'v1.product.StoreProductRule/save')->option(['real_name' => '新建或编辑商品规则']);
|
||||
//规则详情
|
||||
Route::get('product/rule/:id', 'v1.product.StoreProductRule/read');
|
||||
Route::get('product/rule/:id', 'v1.product.StoreProductRule/read')->option(['real_name' => '商品规则详情']);
|
||||
//删除属性规则
|
||||
Route::delete('product/rule/delete', 'v1.product.StoreProductRule/delete');
|
||||
Route::delete('product/rule/delete', 'v1.product.StoreProductRule/delete')->option(['real_name' => '删除商品规则']);
|
||||
//生成属性
|
||||
Route::post('generate_attr/:id/:type', 'v1.product.StoreProduct/is_format_attr');
|
||||
Route::post('generate_attr/:id/:type', 'v1.product.StoreProduct/is_format_attr')->option(['real_name' => '生成商品规格列表']);
|
||||
//评论列表
|
||||
Route::get('reply', 'v1.product.StoreProductReply/index');
|
||||
Route::get('reply', 'v1.product.StoreProductReply/index')->option(['real_name' => '商品评论列表']);
|
||||
//回复评论
|
||||
Route::put('reply/set_reply/:id', 'v1.product.StoreProductReply/set_reply');
|
||||
Route::put('reply/set_reply/:id', 'v1.product.StoreProductReply/set_reply')->option(['real_name' => '商品回复评论']);
|
||||
//删除评论
|
||||
Route::delete('reply/:id', 'v1.product.StoreProductReply/delete');
|
||||
Route::delete('reply/:id', 'v1.product.StoreProductReply/delete')->option(['real_name' => '删除商品评论']);
|
||||
//获取商品数据
|
||||
Route::post('crawl', 'v1.product.CopyTaobao/get_request_contents');
|
||||
Route::post('crawl', 'v1.product.CopyTaobao/get_request_contents')->option(['real_name' => '获取采集商品数据']);
|
||||
//获取复制商品配置
|
||||
Route::get('copy_config', 'v1.product.CopyTaobao/getConfig');
|
||||
Route::get('copy_config', 'v1.product.CopyTaobao/getConfig')->option(['real_name' => '获取复制商品配置']);
|
||||
//复制其他平台商品
|
||||
Route::post('copy', 'v1.product.CopyTaobao/copyProduct');
|
||||
Route::post('copy', 'v1.product.CopyTaobao/copyProduct')->option(['real_name' => '复制其他平台商品']);
|
||||
//保存商品数据
|
||||
Route::post('crawl/save', 'v1.product.CopyTaobao/save_product');
|
||||
Route::post('crawl/save', 'v1.product.CopyTaobao/save_product')->option(['real_name' => '保存采集商品数据']);
|
||||
//调起虚拟评论表单
|
||||
Route::get('reply/fictitious_reply/:product_id', 'v1.product.StoreProductReply/fictitious_reply');
|
||||
Route::get('reply/fictitious_reply/:product_id', 'v1.product.StoreProductReply/fictitious_reply')->option(['real_name' => '虚拟评论表单']);
|
||||
//保存虚拟评论
|
||||
Route::post('reply/save_fictitious_reply', 'v1.product.StoreProductReply/save_fictitious_reply');
|
||||
Route::post('reply/save_fictitious_reply', 'v1.product.StoreProductReply/save_fictitious_reply')->option(['real_name' => '保存虚拟评论']);
|
||||
//获取规则属性模板
|
||||
Route::get('product/get_rule', 'v1.product.StoreProduct/get_rule');
|
||||
Route::get('product/get_rule', 'v1.product.StoreProduct/get_rule')->option(['real_name' => '获取商品规则属性模板']);
|
||||
//获取运费模板
|
||||
Route::get('product/get_template', 'v1.product.StoreProduct/get_template');
|
||||
Route::get('product/get_template', 'v1.product.StoreProduct/get_template')->option(['real_name' => '获取运费模板']);
|
||||
//上传视频密钥接口
|
||||
Route::get('product/get_temp_keys', 'v1.product.StoreProduct/getTempKeys');
|
||||
Route::get('product/get_temp_keys', 'v1.product.StoreProduct/getTempKeys')->option(['real_name' => '上传视频密钥接口']);
|
||||
//检测是否有活动开启
|
||||
Route::get('product/check_activity/:id', 'v1.product.StoreProduct/check_activity');
|
||||
Route::get('product/check_activity/:id', 'v1.product.StoreProduct/check_activity')->option(['real_name' => '检测是商品否有活动开启']);
|
||||
//导入虚拟商品卡密
|
||||
Route::get('product/import_card', 'v1.product.StoreProduct/import_card')->option(['real_name' => '导入虚拟商品卡密']);
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
\app\adminapi\middleware\AdminAuthTokenMiddleware::class,
|
||||
|
||||
@ -18,15 +18,17 @@ use app\http\middleware\AllowOriginMiddleware;
|
||||
*/
|
||||
Route::group(function () {
|
||||
//用户名密码登录
|
||||
Route::post('login', 'Login/login')->name('AdminLogin');
|
||||
Route::post('login', 'Login/login')->name('AdminLogin')->option(['real_name' => '下载表备份记录']);
|
||||
//后台登录页面数据
|
||||
Route::get('login/info', 'Login/info');
|
||||
Route::get('login/info', 'Login/info')->option(['real_name' => '登录信息']);
|
||||
//下载文件
|
||||
Route::get('download', 'PublicController/download');
|
||||
Route::get('download', 'PublicController/download')->option(['real_name' => '下载文件']);
|
||||
//验证码
|
||||
Route::get('captcha_pro', 'Login/captcha');
|
||||
//测试路由
|
||||
Route::get('index', 'Test/index');
|
||||
Route::get('captcha_pro', 'Login/captcha')->name('')->option(['real_name' => '获取验证码']);
|
||||
//获取客服数据
|
||||
Route::get('get_workerman_url', 'PublicController/getWorkerManUrl')->option(['real_name' => '获取客服数据']);
|
||||
|
||||
Route::get('index', 'Test/index')->option(['real_name' => '测试地址']);
|
||||
|
||||
})->middleware(AllowOriginMiddleware::class);
|
||||
|
||||
|
||||
@ -16,47 +16,49 @@ use think\facade\Route;
|
||||
*/
|
||||
Route::group('serve', function () {
|
||||
//平台登录
|
||||
Route::post('login', 'v1.serve.Login/login');
|
||||
Route::post('login', 'v1.serve.Login/login')->option(['real_name' => '一号通平台登录']);
|
||||
//验证码
|
||||
Route::post('captcha', 'v1.serve.Login/captcha');
|
||||
Route::post('captcha', 'v1.serve.Login/captcha')->option(['real_name' => '一号通获取验证码']);
|
||||
//验证验证码
|
||||
Route::post('checkCode', 'v1.serve.Login/checkCode');
|
||||
Route::post('checkCode', 'v1.serve.Login/checkCode')->option(['real_name' => '一号通验证验证码']);
|
||||
//注册
|
||||
Route::post('register', 'v1.serve.Login/register');
|
||||
Route::post('register', 'v1.serve.Login/register')->option(['real_name' => '一号通注册']);
|
||||
//开通电子面单
|
||||
Route::post('opn_express', 'v1.serve.Serve/openExpress');
|
||||
Route::post('opn_express', 'v1.serve.Serve/openExpress')->option(['real_name' => '一号通开通电子面单']);
|
||||
//获取用户信息
|
||||
Route::get('info', 'v1.serve.Serve/getUserInfo');
|
||||
Route::get('info', 'v1.serve.Serve/getUserInfo')->option(['real_name' => '一号通账户信息']);
|
||||
//获取列表模板
|
||||
Route::get('meal_list', 'v1.serve.Serve/mealList');
|
||||
Route::get('meal_list', 'v1.serve.Serve/mealList')->option(['real_name' => '一号通支付套餐列表']);
|
||||
//获取支付
|
||||
Route::post('pay_meal', 'v1.serve.Serve/payMeal');
|
||||
Route::post('pay_meal', 'v1.serve.Serve/payMeal')->option(['real_name' => '一号通支付二维码']);
|
||||
//开通短信服务
|
||||
Route::get('sms/open', 'v1.serve.Sms/openServe');
|
||||
Route::get('sms/open', 'v1.serve.Sms/openServe')->option(['real_name' => '一号通开通短信服务']);
|
||||
//开通其他服务
|
||||
Route::get('open', 'v1.serve.Serve/openServe');
|
||||
Route::get('open', 'v1.serve.Serve/openServe')->option(['real_name' => '一号通开通其他服务']);
|
||||
//修改签名
|
||||
Route::put('sms/sign', 'v1.serve.Sms/editSign');
|
||||
Route::put('sms/sign', 'v1.serve.Sms/editSign')->option(['real_name' => '一号通修改签名']);
|
||||
//获取短信模板
|
||||
Route::get('sms/temps', 'v1.serve.Sms/temps');
|
||||
Route::get('sms/temps', 'v1.serve.Sms/temps')->option(['real_name' => '一号通获取短信模板']);
|
||||
//申请模板
|
||||
Route::post('sms/apply', 'v1.serve.Sms/apply');
|
||||
Route::post('sms/apply', 'v1.serve.Sms/apply')->option(['real_name' => '一号通申请模板']);
|
||||
//获取申请记录
|
||||
Route::get('sms/apply_record', 'v1.serve.Sms/applyRecord');
|
||||
Route::get('sms/apply_record', 'v1.serve.Sms/applyRecord')->option(['real_name' => '一号通获取申请记录']);
|
||||
//记录
|
||||
Route::get('record', 'v1.serve.Serve/getRecord');
|
||||
Route::get('record', 'v1.serve.Serve/getRecord')->option(['real_name' => '一号通消费记录']);
|
||||
//是否开启电子面单打印
|
||||
Route::get('dump_open', 'v1.serve.Export/dumpIsOpen')->name('dumpIsOpen')->option(['real_name' => '一号通是否开启电子面单打印']);
|
||||
//获取全部物流公司
|
||||
Route::get('export_all', 'v1.serve.Export/getExportAll');
|
||||
Route::get('export_all', 'v1.serve.Export/getExportAll')->option(['real_name' => '一号通获取全部物流公司']);
|
||||
//获取物流公司模板
|
||||
Route::get('export_temp', 'v1.serve.Export/getExportTemp');
|
||||
Route::get('export_temp', 'v1.serve.Export/getExportTemp')->option(['real_name' => '一号通获取物流公司模板']);
|
||||
//修改密码
|
||||
Route::post('modify', 'v1.serve.Serve/modify');
|
||||
Route::post('modify', 'v1.serve.Serve/modify')->option(['real_name' => '一号通修改密码']);
|
||||
//修改手机号码
|
||||
Route::post('update_phone', 'v1.serve.Serve/updatePhone');
|
||||
Route::post('update_phone', 'v1.serve.Serve/updatePhone')->option(['real_name' => '一号通修改手机号码']);
|
||||
//短信配置编辑表单
|
||||
Route::get('sms_config/edit_basics', 'v1.setting.SystemConfig/edit_basics');
|
||||
Route::get('sms_config/edit_basics', 'v1.setting.SystemConfig/edit_basics')->option(['real_name' => '一号通短信配置编辑表单']);
|
||||
//短信配置保存数据
|
||||
Route::post('sms_config/save_basics', 'v1.setting.SystemConfig/save_basics');
|
||||
Route::post('sms_config/save_basics', 'v1.setting.SystemConfig/save_basics')->option(['real_name' => '一号通短信配置保存数据']);
|
||||
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
|
||||
@ -16,115 +16,135 @@ use think\facade\Route;
|
||||
Route::group('setting', function () {
|
||||
|
||||
//管理员资源路由
|
||||
Route::resource('admin', 'v1.setting.SystemAdmin')->except(['read']);
|
||||
Route::resource('admin', 'v1.setting.SystemAdmin')->except(['read'])->option(['real_name' => '管理员']);
|
||||
//退出登陆
|
||||
Route::get('admin/logout', 'v1.setting.SystemAdmin/logout')->name('SystemAdminLogout');
|
||||
Route::get('admin/logout', 'v1.setting.SystemAdmin/logout')->name('SystemAdminLogout')->option(['real_name' => '退出登陆']);
|
||||
//修改状态
|
||||
Route::put('set_status/:id/:status', 'v1.setting.SystemAdmin/set_status')->name('SystemAdminSetStatus');
|
||||
Route::put('set_status/:id/:status', 'v1.setting.SystemAdmin/set_status')->name('SystemAdminSetStatus')->option(['real_name' => '修改管理员状态']);
|
||||
//获取当前管理员信息
|
||||
Route::get('info', 'v1.setting.SystemAdmin/info')->name('SystemAdminInfo');
|
||||
Route::get('info', 'v1.setting.SystemAdmin/info')->name('SystemAdminInfo')->option(['real_name' => '获取当前管理员信息']);
|
||||
//修改当前管理员信息
|
||||
Route::put('update_admin', 'v1.setting.SystemAdmin/update_admin')->name('SystemAdminUpdateAdmin');
|
||||
Route::put('update_admin', 'v1.setting.SystemAdmin/update_admin')->name('SystemAdminUpdateAdmin')->option(['real_name' => '修改当前管理员信息']);
|
||||
//权限菜单资源路由
|
||||
Route::resource('menus', 'v1.setting.SystemMenus');
|
||||
Route::resource('menus', 'v1.setting.SystemMenus')->option(['real_name' => '权限菜单']);
|
||||
//未添加的权限规则列表
|
||||
Route::get('ruleList', 'v1.setting.SystemMenus/ruleList')->option(['real_name' => '未添加的权限规则列表']);
|
||||
//修改显示
|
||||
Route::put('menus/show/:id', 'v1.setting.SystemMenus/show')->name('SystemMenusShow');
|
||||
Route::put('menus/show/:id', 'v1.setting.SystemMenus/show')->name('SystemMenusShow')->option(['real_name' => '修改权限规格显示状态']);
|
||||
//身份列表
|
||||
Route::get('role', 'v1.setting.SystemRole/index');
|
||||
Route::get('role', 'v1.setting.SystemRole/index')->option(['real_name' => '管理员身份列表']);
|
||||
//身份权限列表
|
||||
Route::get('role/create', 'v1.setting.SystemRole/create');
|
||||
Route::get('role/create', 'v1.setting.SystemRole/create')->option(['real_name' => '管理员身份权限列表']);
|
||||
//编辑详情
|
||||
Route::get('role/:id/edit', 'v1.setting.SystemRole/edit');
|
||||
Route::get('role/:id/edit', 'v1.setting.SystemRole/edit')->option(['real_name' => '编辑管理员详情']);
|
||||
//保存新建或编辑
|
||||
Route::post('role/:id', 'v1.setting.SystemRole/save');
|
||||
Route::post('role/:id', 'v1.setting.SystemRole/save')->option(['real_name' => '新建或编辑管理员']);
|
||||
//修改身份状态
|
||||
Route::put('role/set_status/:id/:status', 'v1.setting.SystemRole/set_status');
|
||||
Route::put('role/set_status/:id/:status', 'v1.setting.SystemRole/set_status')->option(['real_name' => '修改管理员身份状态']);
|
||||
//删除身份
|
||||
Route::delete('role/:id', 'v1.setting.SystemRole/delete');
|
||||
Route::delete('role/:id', 'v1.setting.SystemRole/delete')->option(['real_name' => '删除管理员身份']);
|
||||
//配置分类资源路由
|
||||
Route::resource('config_class', 'v1.setting.SystemConfigTab');
|
||||
Route::resource('config_class', 'v1.setting.SystemConfigTab')->option(['real_name' => '系统配置分类']);
|
||||
//修改配置分类状态
|
||||
Route::put('config_class/set_status/:id/:status', 'v1.setting.SystemConfigTab/set_status');
|
||||
Route::put('config_class/set_status/:id/:status', 'v1.setting.SystemConfigTab/set_status')->option(['real_name' => '修改配置分类状态']);
|
||||
//配置资源路由
|
||||
Route::resource('config', 'v1.setting.SystemConfig');
|
||||
Route::resource('config', 'v1.setting.SystemConfig')->option(['real_name' => '系统配置']);
|
||||
//修改配置状态
|
||||
Route::put('config/set_status/:id/:status', 'v1.setting.SystemConfig/set_status');
|
||||
Route::put('config/set_status/:id/:status', 'v1.setting.SystemConfig/set_status')->option(['real_name' => '修改配置状态']);
|
||||
//基本配置编辑表单
|
||||
Route::get('config/header_basics', 'v1.setting.SystemConfig/header_basics');
|
||||
Route::get('config/header_basics', 'v1.setting.SystemConfig/header_basics')->option(['real_name' => '基本配置编辑头部数据']);
|
||||
//基本配置编辑表单
|
||||
Route::get('config/edit_basics', 'v1.setting.SystemConfig/edit_basics');
|
||||
Route::get('config/edit_basics', 'v1.setting.SystemConfig/edit_basics')->option(['real_name' => '基本配置编辑表单']);
|
||||
//基本配置保存数据
|
||||
Route::post('config/save_basics', 'v1.setting.SystemConfig/save_basics');
|
||||
Route::post('config/save_basics', 'v1.setting.SystemConfig/save_basics')->option(['real_name' => '基本配置保存数据']);
|
||||
//基本配置上传文件
|
||||
Route::post('config/upload', 'v1.setting.SystemConfig/file_upload');
|
||||
Route::post('config/upload', 'v1.setting.SystemConfig/file_upload')->option(['real_name' => '基本配置上传文件']);
|
||||
//获取单个配置值
|
||||
Route::get('config/get_system/:name', 'v1.setting.SystemConfig/get_system')->option(['real_name' => '基本配置编辑表单']);
|
||||
//组合数据资源路由
|
||||
Route::resource('group', 'v1.setting.SystemGroup');
|
||||
Route::resource('group', 'v1.setting.SystemGroup')->option(['real_name' => '组合数据']);
|
||||
//组合数据全部
|
||||
Route::get('group_all', 'v1.setting.SystemGroup/getGroup');
|
||||
Route::get('group_all', 'v1.setting.SystemGroup/getGroup')->option(['real_name' => '组合数据全部']);
|
||||
//组合数据子数据资源路由
|
||||
Route::resource('group_data', 'v1.setting.SystemGroupData');
|
||||
Route::resource('group_data', 'v1.setting.SystemGroupData')->option(['real_name' => '组合数据子数据']);
|
||||
//修改数据状态
|
||||
Route::get('group_data/header', 'v1.setting.SystemGroupData/header');
|
||||
Route::get('group_data/header', 'v1.setting.SystemGroupData/header')->option(['real_name' => '组合数据头部']);
|
||||
//修改数据状态
|
||||
Route::put('group_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status');
|
||||
Route::put('group_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status')->option(['real_name' => '修改组合数据状态']);
|
||||
//数据配置保存
|
||||
Route::post('group_data/save_all', 'v1.setting.SystemGroupData/saveAll')->option(['real_name' => '提交数据配置']);
|
||||
//获取城市数据列表
|
||||
Route::get('city/list/:parent_id', 'v1.setting.SystemCity/index');
|
||||
Route::get('city/list/:parent_id', 'v1.setting.SystemCity/index')->option(['real_name' => '获取城市数据列表']);
|
||||
//添加城市数据表单
|
||||
Route::get('city/add/:parent_id', 'v1.setting.SystemCity/add');
|
||||
Route::get('city/add/:parent_id', 'v1.setting.SystemCity/add')->option(['real_name' => '添加城市数据表单']);
|
||||
//修改城市数据表单
|
||||
Route::get('city/:id/edit', 'v1.setting.SystemCity/edit');
|
||||
Route::get('city/:id/edit', 'v1.setting.SystemCity/edit')->option(['real_name' => '修改城市数据表单']);
|
||||
//新增/修改城市数据
|
||||
Route::post('city/save', 'v1.setting.SystemCity/save');
|
||||
Route::post('city/save', 'v1.setting.SystemCity/save')->option(['real_name' => '新增/修改城市数据']);
|
||||
//修改城市数据表单
|
||||
Route::delete('city/del/:city_id', 'v1.setting.SystemCity/delete');
|
||||
Route::delete('city/del/:city_id', 'v1.setting.SystemCity/delete')->option(['real_name' => '删除城市数据']);
|
||||
//清除城市数据缓存
|
||||
Route::get('city/clean_cache', 'v1.setting.SystemCity/clean_cache');
|
||||
Route::get('city/clean_cache', 'v1.setting.SystemCity/clean_cache')->option(['real_name' => '清除城市数据缓存']);
|
||||
//运费模板列表
|
||||
Route::get('shipping_templates/list', 'v1.setting.ShippingTemplates/temp_list');
|
||||
Route::get('shipping_templates/list', 'v1.setting.ShippingTemplates/temp_list')->option(['real_name' => '运费模板列表']);
|
||||
//修改运费模板数据
|
||||
Route::get('shipping_templates/:id/edit', 'v1.setting.ShippingTemplates/edit');
|
||||
Route::get('shipping_templates/:id/edit', 'v1.setting.ShippingTemplates/edit')->option(['real_name' => '修改运费模板数据']);
|
||||
//保存新增修改
|
||||
Route::post('shipping_templates/save/:id', 'v1.setting.ShippingTemplates/save');
|
||||
Route::post('shipping_templates/save/:id', 'v1.setting.ShippingTemplates/save')->option(['real_name' => '新增或修改运费模版']);
|
||||
//删除运费模板
|
||||
Route::delete('shipping_templates/del/:id', 'v1.setting.ShippingTemplates/delete');
|
||||
Route::delete('shipping_templates/del/:id', 'v1.setting.ShippingTemplates/delete')->option(['real_name' => '删除运费模板']);
|
||||
//城市数据接口
|
||||
Route::get('shipping_templates/city_list', 'v1.setting.ShippingTemplates/city_list');
|
||||
Route::get('shipping_templates/city_list', 'v1.setting.ShippingTemplates/city_list')->option(['real_name' => '城市数据接口']);
|
||||
//获取客服广告
|
||||
Route::get('get_kf_adv', 'v1.setting.SystemGroupData/getKfAdv');
|
||||
Route::get('get_kf_adv', 'v1.setting.SystemGroupData/getKfAdv')->option(['real_name' => '获取客服广告']);
|
||||
//设置客服广告
|
||||
Route::post('set_kf_adv', 'v1.setting.SystemGroupData/setKfAdv');
|
||||
Route::post('set_kf_adv', 'v1.setting.SystemGroupData/setKfAdv')->option(['real_name' => '设置客服广告']);
|
||||
|
||||
|
||||
//签到天数配置资源
|
||||
Route::resource('sign_data', 'v1.setting.SystemGroupData');
|
||||
Route::resource('sign_data', 'v1.setting.SystemGroupData')->option(['real_name' => '签到天数配置']);
|
||||
//签到数据字段
|
||||
Route::get('sign_data/header', 'v1.setting.SystemGroupData/header');
|
||||
Route::get('sign_data/header', 'v1.setting.SystemGroupData/header')->option(['real_name' => '签到数据头部']);
|
||||
//修改签到数据状态
|
||||
Route::put('sign_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status');
|
||||
Route::put('sign_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status')->option(['real_name' => '修改签到数据状态']);
|
||||
//订单详情动态图配置资源
|
||||
Route::resource('order_data', 'v1.setting.SystemGroupData');
|
||||
Route::resource('order_data', 'v1.setting.SystemGroupData')->option(['real_name' => '订单详情动态图配置资源']);
|
||||
//订单数据字段
|
||||
Route::get('order_data/header', 'v1.setting.SystemGroupData/header');
|
||||
Route::get('order_data/header', 'v1.setting.SystemGroupData/header')->option(['real_name' => '订单数据字段']);
|
||||
//订单数据状态
|
||||
Route::put('order_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status');
|
||||
Route::put('order_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status')->option(['real_name' => '订单数据状态']);
|
||||
//个人中心菜单配置资源
|
||||
Route::resource('usermenu_data', 'v1.setting.SystemGroupData');
|
||||
Route::resource('usermenu_data', 'v1.setting.SystemGroupData')->option(['real_name' => '个人中心菜单']);
|
||||
//个人中心菜单数据字段
|
||||
Route::get('usermenu_data/header', 'v1.setting.SystemGroupData/header');
|
||||
Route::get('usermenu_data/header', 'v1.setting.SystemGroupData/header')->option(['real_name' => '个人中心菜单数据字段']);
|
||||
//个人中心菜单数据状态
|
||||
Route::put('usermenu_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status');
|
||||
Route::put('usermenu_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status')->option(['real_name' => '个人中心菜单数据状态']);
|
||||
//分享海报配置资源
|
||||
Route::resource('poster_data', 'v1.setting.SystemGroupData');
|
||||
Route::resource('poster_data', 'v1.setting.SystemGroupData')->option(['real_name' => '分享海报']);
|
||||
//分享海报数据字段
|
||||
Route::get('poster_data/header', 'v1.setting.SystemGroupData/header');
|
||||
Route::get('poster_data/header', 'v1.setting.SystemGroupData/header')->option(['real_name' => '分享海报数据字段']);
|
||||
//分享海报数据状态
|
||||
Route::put('poster_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status');
|
||||
Route::put('poster_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status')->option(['real_name' => '分享海报数据状态']);
|
||||
//秒杀配置资源
|
||||
Route::resource('seckill_data', 'v1.setting.SystemGroupData');
|
||||
Route::resource('seckill_data', 'v1.setting.SystemGroupData')->option(['real_name' => '秒杀配置']);
|
||||
//秒杀数据字段
|
||||
Route::get('seckill_data/header', 'v1.setting.SystemGroupData/header');
|
||||
Route::get('seckill_data/header', 'v1.setting.SystemGroupData/header')->option(['real_name' => '秒杀数据字段']);
|
||||
//秒杀数据状态
|
||||
Route::put('seckill_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status');
|
||||
Route::put('seckill_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status')->option(['real_name' => '秒杀数据状态']);
|
||||
//获取隐私协议
|
||||
Route::get('get_user_agreement', 'v1.setting.SystemGroupData/getUserAgreement')->option(['real_name' => '获取隐私协议']);
|
||||
//设置隐私协议
|
||||
Route::post('set_user_agreement', 'v1.setting.SystemGroupData/setUserAgreement')->option(['real_name' => '设置隐私协议']);
|
||||
|
||||
//系统通知
|
||||
//系统通知列表
|
||||
Route::get('notification/index', 'v1.setting.SystemNotification/index')->option(['real_name' => '系统通知列表']);
|
||||
//获取单条数据
|
||||
Route::get('notification/info', 'v1.setting.SystemNotification/info')->option(['real_name' => '获取单条通知数据']);
|
||||
//保存通知设置
|
||||
Route::post('notification/save', 'v1.setting.SystemNotification/save')->option(['real_name' => '保存通知设置']);
|
||||
//修改消息状态
|
||||
Route::put('notification/set_status/:type/:status/:id', 'v1.setting.SystemNotification/set_status')->option(['real_name' => '修改消息状态']);
|
||||
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
|
||||
@ -16,44 +16,49 @@ use think\facade\Route;
|
||||
*/
|
||||
Route::group('system', function () {
|
||||
//系统日志
|
||||
Route::get('log', 'v1.system.SystemLog/index')->name('SystemLog');
|
||||
Route::get('log', 'v1.system.SystemLog/index')->name('SystemLog')->option(['real_name' => '系统日志']);
|
||||
//系统日志管理员搜索条件
|
||||
Route::get('log/search_admin', 'v1.system.SystemLog/search_admin');
|
||||
Route::get('log/search_admin', 'v1.system.SystemLog/search_admin')->option(['real_name' => '系统日志管理员搜索条件']);
|
||||
//文件校验
|
||||
Route::get('file', 'v1.system.SystemFile/index')->name('SystemFile');
|
||||
Route::get('file', 'v1.system.SystemFile/index')->name('SystemFile')->option(['real_name' => '文件校验']);
|
||||
//打开目录
|
||||
Route::get('file/opendir', 'v1.system.SystemFile/opendir');
|
||||
Route::get('file/opendir', 'v1.system.SystemFile/opendir')->option(['real_name' => '打开目录']);
|
||||
//读取文件
|
||||
Route::get('file/openfile', 'v1.system.SystemFile/openfile');
|
||||
Route::get('file/openfile', 'v1.system.SystemFile/openfile')->option(['real_name' => '读取文件']);
|
||||
//保存文件
|
||||
Route::post('file/savefile', 'v1.system.SystemFile/savefile');
|
||||
Route::post('file/savefile', 'v1.system.SystemFile/savefile')->option(['real_name' => '保存文件']);
|
||||
//数据所有表
|
||||
Route::get('backup', 'v1.system.SystemDatabackup/index');
|
||||
Route::get('backup', 'v1.system.SystemDatabackup/index')->option(['real_name' => '数据库所有表']);
|
||||
//数据备份详情
|
||||
Route::get('backup/read', 'v1.system.SystemDatabackup/read');
|
||||
Route::get('backup/read', 'v1.system.SystemDatabackup/read')->option(['real_name' => '数据备份详情']);
|
||||
//数据备份 优化表
|
||||
Route::put('backup/optimize', 'v1.system.SystemDatabackup/optimize');
|
||||
Route::put('backup/optimize', 'v1.system.SystemDatabackup/optimize')->option(['real_name' => '数据备份优化表']);
|
||||
//数据备份 修复表
|
||||
Route::put('backup/repair', 'v1.system.SystemDatabackup/repair');
|
||||
Route::put('backup/repair', 'v1.system.SystemDatabackup/repair')->option(['real_name' => '数据备份修复表']);
|
||||
//数据备份 备份表
|
||||
Route::put('backup/backup', 'v1.system.SystemDatabackup/backup');
|
||||
Route::put('backup/backup', 'v1.system.SystemDatabackup/backup')->option(['real_name' => '数据备份备份表']);
|
||||
//备份记录
|
||||
Route::get('backup/file_list', 'v1.system.SystemDatabackup/fileList');
|
||||
Route::get('backup/file_list', 'v1.system.SystemDatabackup/fileList')->option(['real_name' => '数据库备份记录']);
|
||||
//删除备份记录
|
||||
Route::delete('backup/del_file', 'v1.system.SystemDatabackup/delFile');
|
||||
Route::delete('backup/del_file', 'v1.system.SystemDatabackup/delFile')->option(['real_name' => '删除数据库备份记录']);
|
||||
//导入备份记录表
|
||||
Route::post('backup/import', 'v1.system.SystemDatabackup/import');
|
||||
Route::post('backup/import', 'v1.system.SystemDatabackup/import')->option(['real_name' => '导入数据库备份记录']);
|
||||
//下载备份记录表
|
||||
// Route::get('backup/download', 'v1.system.SystemDatabackup/downloadFile');
|
||||
//清除用户数据
|
||||
Route::get('clear/:type', 'v1.system.SystemClearData/index');
|
||||
Route::get('clear/:type', 'v1.system.SystemClearData/index')->option(['real_name' => '清除用户数据']);
|
||||
//清除缓存
|
||||
Route::get('refresh_cache/cache', 'v1.system.Clear/refresh_cache');
|
||||
Route::get('refresh_cache/cache', 'v1.system.Clear/refresh_cache')->option(['real_name' => '清除系统缓存']);
|
||||
//清除日志
|
||||
Route::get('refresh_cache/log', 'v1.system.Clear/delete_log');
|
||||
Route::get('refresh_cache/log', 'v1.system.Clear/delete_log')->option(['real_name' => '清除系统日志']);
|
||||
//域名替换接口
|
||||
Route::post('replace_site_url', 'v1.system.SystemClearData/replaceSiteUrl');
|
||||
|
||||
Route::post('replace_site_url', 'v1.system.SystemClearData/replaceSiteUrl')->option(['real_name' => '域名替换']);
|
||||
//获取APP版本列表
|
||||
Route::get('version_list', 'v1.system.AppVersion/list')->option(['real_name' => '获取APP版本列表']);
|
||||
//添加版本信息
|
||||
Route::get('version_crate', 'v1.system.AppVersion/crate')->option(['real_name' => '添加版本']);
|
||||
//添加版本信息
|
||||
Route::post('version_save', 'v1.system.AppVersion/save')->option(['real_name' => '添加版本']);
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
\app\adminapi\middleware\AdminAuthTokenMiddleware::class,
|
||||
|
||||
@ -15,120 +15,122 @@ use think\facade\Route;
|
||||
*/
|
||||
Route::group('user', function () {
|
||||
//用户管理资源路由
|
||||
Route::resource('user', 'v1.user.user');
|
||||
Route::resource('user', 'v1.user.user')->option(['real_name' => '用户']);
|
||||
//添加用户保存
|
||||
Route::post('user/save', 'v1.user.user/save_info');
|
||||
Route::post('user/save', 'v1.user.user/save_info')->option(['real_name' => '添加用户']);
|
||||
//同步微信用户
|
||||
Route::get('user/syncUsers', 'v1.user.user/syncWechatUsers');
|
||||
Route::get('user/syncUsers', 'v1.user.user/syncWechatUsers')->option(['real_name' => '同步微信用户']);
|
||||
//用户表单头
|
||||
Route::get('user/type_header', 'v1.user.user/type_header');
|
||||
Route::get('user/type_header', 'v1.user.user/type_header')->option(['real_name' => '用户列表头部数据']);
|
||||
//赠送会员等级
|
||||
Route::get('give_level/:id', 'v1.user.user/give_level');
|
||||
Route::get('give_level/:id', 'v1.user.user/give_level')->option(['real_name' => '赠送用户等级']);
|
||||
//执行赠送会员等级
|
||||
Route::put('save_give_level/:id', 'v1.user.user/save_give_level');
|
||||
Route::put('save_give_level/:id', 'v1.user.user/save_give_level')->option(['real_name' => '执行赠送用户等级']);
|
||||
//赠送付费会员时长
|
||||
Route::get('give_level_time/:id', 'v1.user.user/give_level_time');
|
||||
Route::get('give_level_time/:id', 'v1.user.user/give_level_time')->option(['real_name' => '赠送付费会员时长']);
|
||||
//执行赠送付费会员时长
|
||||
Route::put('save_give_level_time/:id', 'v1.user.user/save_give_level_time');
|
||||
Route::put('save_give_level_time/:id', 'v1.user.user/save_give_level_time')->option(['real_name' => '执行赠送付费会员时长']);
|
||||
//清除会员等级
|
||||
Route::delete('del_level/:id', 'v1.user.user/del_level');
|
||||
Route::delete('del_level/:id', 'v1.user.user/del_level')->option(['real_name' => '清除用户等级']);
|
||||
//编辑其他
|
||||
Route::get('edit_other/:id', 'v1.user.user/edit_other');
|
||||
Route::get('edit_other/:id', 'v1.user.user/edit_other')->option(['real_name' => '修改积分余额表单']);
|
||||
//编辑其他
|
||||
Route::put('update_other/:id', 'v1.user.user/update_other');
|
||||
Route::put('update_other/:id', 'v1.user.user/update_other')->option(['real_name' => '修改积分余额']);
|
||||
//修改用户状态
|
||||
Route::put('set_status/:status/:id', 'v1.user.user/set_status');
|
||||
Route::put('set_status/:status/:id', 'v1.user.user/set_status')->option(['real_name' => '修改用户状态']);
|
||||
//获取指定用户的信息
|
||||
Route::get('one_info/:id', 'v1.user.user/oneUserInfo');
|
||||
Route::get('one_info/:id', 'v1.user.user/oneUserInfo')->option(['real_name' => '获取指定用户的信息']);
|
||||
/*会员设置模块*/
|
||||
//获取添加会员等级表单
|
||||
Route::get('user_level/create', 'v1.user.UserLevel/create');
|
||||
Route::get('user_level/create', 'v1.user.UserLevel/create')->option(['real_name' => '添加用户等级表单']);
|
||||
//添加或修改会员等级
|
||||
Route::post('user_level', 'v1.user.UserLevel/save');
|
||||
Route::post('user_level', 'v1.user.UserLevel/save')->option(['real_name' => '添加或修改用户等级']);
|
||||
//等级详情
|
||||
Route::get('user_level/read/:id', 'v1.user.UserLevel/read');
|
||||
Route::get('user_level/read/:id', 'v1.user.UserLevel/read')->option(['real_name' => '用户等级详情']);
|
||||
//获取系统设置的vip列表
|
||||
Route::get('user_level/vip_list', 'v1.user.UserLevel/get_system_vip_list');
|
||||
Route::get('user_level/vip_list', 'v1.user.UserLevel/get_system_vip_list')->option(['real_name' => '获取系统设置的用户等级列表']);
|
||||
//删除会员等级
|
||||
Route::put('user_level/delete/:id', 'v1.user.UserLevel/delete');
|
||||
Route::put('user_level/delete/:id', 'v1.user.UserLevel/delete')->option(['real_name' => '删除用户等级']);
|
||||
//设置单个商品上架|下架
|
||||
Route::put('user_level/set_show/:id/:is_show', 'v1.user.UserLevel/set_show');
|
||||
Route::put('user_level/set_show/:id/:is_show', 'v1.user.UserLevel/set_show')->option(['real_name' => '设置用户等级上下架']);
|
||||
//等级列表快速编辑
|
||||
Route::put('user_level/set_value/:id', 'v1.user.UserLevel/set_value');
|
||||
Route::put('user_level/set_value/:id', 'v1.user.UserLevel/set_value')->option(['real_name' => '用户等级列表快速编辑']);
|
||||
//等级任务列表
|
||||
Route::get('user_level/task/:level_id', 'v1.user.UserLevel/get_task_list');
|
||||
Route::get('user_level/task/:level_id', 'v1.user.UserLevel/get_task_list')->option(['real_name' => '用户等级任务列表']);
|
||||
//快速编辑等级任务
|
||||
Route::put('user_level/set_task/:id', 'v1.user.UserLevel/set_task_value');
|
||||
Route::put('user_level/set_task/:id', 'v1.user.UserLevel/set_task_value')->option(['real_name' => '快速编辑用户等级任务']);
|
||||
//设置等级任务显示|隐藏
|
||||
Route::put('user_level/set_task_show/:id/:is_show', 'v1.user.UserLevel/set_task_show');
|
||||
Route::put('user_level/set_task_show/:id/:is_show', 'v1.user.UserLevel/set_task_show')->option(['real_name' => '设置用户等级任务显示|隐藏']);
|
||||
//设置是否务必达成
|
||||
Route::put('user_level/set_task_must/:id/:is_must', 'v1.user.UserLevel/set_task_must');
|
||||
Route::put('user_level/set_task_must/:id/:is_must', 'v1.user.UserLevel/set_task_must')->option(['real_name' => '设置用户等级任务是否务必达成']);
|
||||
//添加等级任务表单
|
||||
Route::get('user_level/create_task', 'v1.user.UserLevel/create_task');
|
||||
Route::get('user_level/create_task', 'v1.user.UserLevel/create_task')->option(['real_name' => '添加用户等级任务表单']);
|
||||
//保存或者修改任务
|
||||
Route::post('user_level/save_task', 'v1.user.UserLevel/save_task');
|
||||
Route::post('user_level/save_task', 'v1.user.UserLevel/save_task')->option(['real_name' => '保存或修改用户等级任务']);
|
||||
//删除任务
|
||||
Route::delete('user_level/delete_task/:id', 'v1.user.UserLevel/delete_task');
|
||||
Route::delete('user_level/delete_task/:id', 'v1.user.UserLevel/delete_task')->option(['real_name' => '删除用户等级任务']);
|
||||
//获取用户分组列表
|
||||
Route::get('user_group/list', 'v1.user.UserGroup/index');
|
||||
Route::get('user_group/list', 'v1.user.UserGroup/index')->option(['real_name' => '获取用户分组列表']);
|
||||
//添加修改分组表单
|
||||
Route::get('user_group/add/:id', 'v1.user.UserGroup/add');
|
||||
Route::get('user_group/add/:id', 'v1.user.UserGroup/add')->option(['real_name' => '添加修改分组表单']);
|
||||
//保存分组表单数据
|
||||
Route::post('user_group/save', 'v1.user.UserGroup/save');
|
||||
Route::post('user_group/save', 'v1.user.UserGroup/save')->option(['real_name' => '保存分组表单数据']);
|
||||
//删除分组数据
|
||||
Route::delete('user_group/del/:id', 'v1.user.UserGroup/delete');
|
||||
Route::delete('user_group/del/:id', 'v1.user.UserGroup/delete')->option(['real_name' => '删除用户分组数据']);
|
||||
//设置会员分组
|
||||
Route::post('set_group', 'v1.user.user/set_group');
|
||||
Route::post('set_group', 'v1.user.user/set_group')->option(['real_name' => '用户分组表单']);
|
||||
//执行设置会员分组
|
||||
Route::put('save_set_group', 'v1.user.user/save_set_group');
|
||||
Route::put('save_set_group', 'v1.user.user/save_set_group')->option(['real_name' => '设置用户分组']);
|
||||
//会员标签列表
|
||||
Route::get('user_label', 'v1.user.UserLabel/index');
|
||||
Route::get('user_label', 'v1.user.UserLabel/index')->option(['real_name' => '用户标签列表']);
|
||||
//会员标签添加修改表单
|
||||
Route::get('user_label/add/:id', 'v1.user.UserLabel/add');
|
||||
Route::get('user_label/add/:id', 'v1.user.UserLabel/add')->option(['real_name' => '添加或修改用户标签表单']);
|
||||
//保存标签表单数据
|
||||
Route::post('user_label/save', 'v1.user.UserLabel/save');
|
||||
Route::post('user_label/save', 'v1.user.UserLabel/save')->option(['real_name' => '添加或修改用户标签']);
|
||||
//删除会员标签
|
||||
Route::delete('user_label/del/:id', 'v1.user.UserLabel/delete');
|
||||
Route::delete('user_label/del/:id', 'v1.user.UserLabel/delete')->option(['real_name' => '删除用户标签']);
|
||||
//设置会员分组
|
||||
Route::post('set_label', 'v1.user.user/set_label');
|
||||
Route::post('set_label', 'v1.user.user/set_label')->option(['real_name' => '设置用户标签']);
|
||||
//获取用户标签
|
||||
Route::get('label/:uid', 'v1.user.UserLabel/getUserLabel');
|
||||
Route::get('label/:uid', 'v1.user.UserLabel/getUserLabel')->option(['real_name' => '获取用户标签']);
|
||||
//设置和取消用户标签
|
||||
Route::post('label/:uid', 'v1.user.UserLabel/setUserLabel');
|
||||
Route::post('label/:uid', 'v1.user.UserLabel/setUserLabel')->option(['real_name' => '设置和取消用户标签']);
|
||||
//设置会员分组
|
||||
Route::put('save_set_label', 'v1.user.user/save_set_label');
|
||||
Route::put('save_set_label', 'v1.user.user/save_set_label')->option(['real_name' => '保存用户标签']);
|
||||
//标签分类
|
||||
Route::resource('user_label_cate', 'v1.user.UserLabelCate');
|
||||
Route::get('user_label_cate/all', 'v1.user.user_label_cate/getAll');
|
||||
Route::resource('user_label_cate', 'v1.user.UserLabelCate')->option(['real_name' => '标签分类']);
|
||||
Route::get('user_label_cate/all', 'v1.user.user_label_cate/getAll')->option(['real_name' => '获取用户标签分类全部']);
|
||||
|
||||
//会员卡批次列表资源
|
||||
Route::get('member_batch/index', 'v1.user.member.MemberCardBatch/index');
|
||||
Route::get('member_batch/index', 'v1.user.member.MemberCardBatch/index')->option(['real_name' => '会员卡批次列表']);
|
||||
//添加会员卡批次
|
||||
Route::post('member_batch/save/:id', 'v1.user.member.MemberCardBatch/save');
|
||||
Route::post('member_batch/save/:id', 'v1.user.member.MemberCardBatch/save')->option(['real_name' => '添加会员卡批次']);
|
||||
//会员卡列表
|
||||
Route::get('member_card/index/:card_batch_id', 'v1.user.member.MemberCard/index');
|
||||
Route::get('member_card/index/:card_batch_id', 'v1.user.member.MemberCard/index')->option(['real_name' => '会员卡列表']);
|
||||
//会员卡修改状态
|
||||
Route::get('member_card/set_status', 'v1.user.member.MemberCard/set_status');
|
||||
Route::get('member_card/set_status', 'v1.user.member.MemberCard/set_status')->option(['real_name' => '会员卡修改状态']);
|
||||
//列表单字段修改操作
|
||||
Route::get('member_batch/set_value/:id', 'v1.user.member.MemberCardBatch/set_value');
|
||||
Route::get('member_batch/set_value/:id', 'v1.user.member.MemberCardBatch/set_value')->option(['real_name' => '会员卡批次快速修改']);
|
||||
//会员类型
|
||||
Route::get('member/ship', 'v1.user.member.MemberCard/member_ship');
|
||||
Route::get('member/ship', 'v1.user.member.MemberCard/member_ship')->option(['real_name' => '会员类型列表']);
|
||||
//会员类型删除
|
||||
Route::delete('member_ship/delete/:id', 'v1.user.member.MemberCard/delete')->option(['real_name' => '会员类型删除']);
|
||||
//会员类型修改状态
|
||||
Route::get('member_ship/set_ship_status', 'v1.user.member.MemberCard/set_ship_status');
|
||||
Route::get('member_ship/set_ship_status', 'v1.user.member.MemberCard/set_ship_status')->option(['real_name' => '会员类型修改状态']);
|
||||
//会员卡类型编辑
|
||||
Route::post('member_ship/save/:id', 'v1.user.member.MemberCard/ship_save');
|
||||
Route::post('member_ship/save/:id', 'v1.user.member.MemberCard/ship_save')->option(['real_name' => '会员卡类型编辑']);
|
||||
//兑换会员卡二维码
|
||||
Route::get('member_scan', 'v1.user.member.MemberCardBatch/member_scan');
|
||||
Route::get('member_scan', 'v1.user.member.MemberCardBatch/member_scan')->option(['real_name' => '兑换会员卡二维码']);
|
||||
//会员记录
|
||||
Route::get('member/record', 'v1.user.member.MemberCard/member_record');
|
||||
Route::get('member/record', 'v1.user.member.MemberCard/member_record')->option(['real_name' => '会员记录']);
|
||||
//会员权益
|
||||
Route::get('member/right', 'v1.user.member.MemberCard/member_right');
|
||||
Route::get('member/right', 'v1.user.member.MemberCard/member_right')->option(['real_name' => '会员权益列表']);
|
||||
//会员权益修改
|
||||
Route::post('member_right/save/:id', 'v1.user.member.MemberCard/right_save');
|
||||
Route::post('member_right/save/:id', 'v1.user.member.MemberCard/right_save')->option(['real_name' => '会员权益修改']);
|
||||
//会员协议
|
||||
Route::post('member_agreement/save/:id', 'v1.user.member.MemberCardBatch/save_member_agreement');
|
||||
Route::post('member_agreement/save/:id', 'v1.user.member.MemberCardBatch/save_member_agreement')->option(['real_name' => '会员协议']);
|
||||
//获取会员协议
|
||||
Route::get('member/agreement', 'v1.user.member.MemberCardBatch/getAgreement');
|
||||
Route::get('member/agreement', 'v1.user.member.MemberCardBatch/getAgreement')->option(['real_name' => '获取会员协议']);
|
||||
})->middleware([
|
||||
\app\http\middleware\AllowOriginMiddleware::class,
|
||||
\app\adminapi\middleware\AdminAuthTokenMiddleware::class,
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\adminapi\validate\marketing;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class StoreIntegralValidate extends Validate
|
||||
{
|
||||
/**
|
||||
* 定义验证规则
|
||||
* 格式:'字段名' => ['规则1','规则2'...]
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $rule = [
|
||||
'product_id' => 'require',
|
||||
'title' => 'require',
|
||||
'info' => 'require',
|
||||
'unit_name' => 'require',
|
||||
'image' => 'require',
|
||||
'images' => 'require',
|
||||
'description' => 'require',
|
||||
'attrs' => 'require',
|
||||
'items' => 'require',
|
||||
];
|
||||
|
||||
/**
|
||||
* 定义错误信息
|
||||
* 格式:'字段名.规则名' => '错误信息'
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $message = [
|
||||
'product_id.require' => '请选择商品',
|
||||
'title.require' => '请填写商品标题',
|
||||
'info.require' => '请填写秒杀活动简介',
|
||||
'unit_name.require' => '请填写单位',
|
||||
'image.require' => '请选择商品主图',
|
||||
'images.require' => '请选择商品轮播图',
|
||||
'description.require' => '请填写积分商品详情',
|
||||
'attrs.require' => '请选择规格',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'save' => ['product_id', 'title', 'unit_name', 'image', 'images', 'num', 'once_num', 'sort', 'description', 'attrs', 'items'],
|
||||
];
|
||||
}
|
||||
@ -23,8 +23,10 @@ class SystemStoreValidate extends Validate
|
||||
protected $rule = [
|
||||
'name' => 'require',
|
||||
'introduction' => 'require',
|
||||
'phone' => ['require','mobile'],
|
||||
'phone' => ['require', 'mobile'],
|
||||
'address' => 'require',
|
||||
'image' => 'require',
|
||||
'oblong_image' => 'require',
|
||||
'detailed_address' => 'require',
|
||||
'latlng' => 'require',
|
||||
'day_time' => 'require',
|
||||
@ -39,6 +41,8 @@ class SystemStoreValidate extends Validate
|
||||
'name.require' => '请填写门店名称',
|
||||
'introduction.require' => '请填写门店简介',
|
||||
'phone.require' => '请填写门店电话',
|
||||
'image.require' => '请选择提货点logo',
|
||||
'oblong_image.require' => '请选择提货点大图',
|
||||
'phone.mobile' => '手机号格式不正确',
|
||||
'address.require' => '请选择地址',
|
||||
'detailed_address.require' => '请填写详细地址',
|
||||
@ -47,6 +51,6 @@ class SystemStoreValidate extends Validate
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'save' => ['name', 'phone', 'address', 'detailed_address', 'latlng', 'day_time'],
|
||||
'save' => ['name', 'phone', 'address', 'detailed_address', 'latlng', 'day_time', 'image', 'oblong_image'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -36,6 +36,6 @@ class StoreServiceSpeechcraftValidata extends Validate
|
||||
protected $message = [
|
||||
'message.require' => '请填写话术内容',
|
||||
'sort.require' => '请填写排序数字',
|
||||
'sort.number' => '排序序号为数字',
|
||||
'sort.number' => '排序序号为整数',
|
||||
];
|
||||
}
|
||||
|
||||
@ -24,8 +24,10 @@ class ShippingTemplatesValidate extends Validate
|
||||
'name' => 'require',
|
||||
'region_info' => 'array',
|
||||
'appoint_info' => 'array',
|
||||
'no_delivery_info' => 'array',
|
||||
'type' => 'number',
|
||||
'appoint' => 'number',
|
||||
'no_delivery' => 'number',
|
||||
'sort' => 'number'
|
||||
];
|
||||
|
||||
@ -39,12 +41,14 @@ class ShippingTemplatesValidate extends Validate
|
||||
'name.require' => '请填写运费模板名称',
|
||||
'region_info.array' => '运费信息必须为数组',
|
||||
'appoint_info.array' => '包邮信息必须为数组',
|
||||
'no_delivery_info.array' => '不送达信息必须为数组',
|
||||
'type.number' => 'type数据格式错误,应为1或2或3',
|
||||
'appoint.number' => 'appoint数据格式错误,应为0或1',
|
||||
'no_delivery.number' => 'no_delivery数据格式错误,应为0或1',
|
||||
'sort.number' => 'sort数据格式错误,应为整数',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'save' => ['name', 'type', 'appoint', 'sort', 'region_info', 'appoint_info'],
|
||||
'save' => ['name', 'type', 'appoint', 'sort', 'region_info', 'appoint_info', 'no_delivery_info', 'no_delivery'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ class SystemAdminValidata extends Validate
|
||||
*/
|
||||
protected $message = [
|
||||
'account.require' => '请填写管理员账号',
|
||||
'account.alphaDash' => '管理员账号为应为和字母',
|
||||
'account.alphaDash' => '管理员账号为英文字母',
|
||||
'conf_pwd.require' => '请输入确认密码',
|
||||
'pwd.require' => '请输入密码',
|
||||
'real_name.require' => '请输管理员姓名',
|
||||
|
||||
@ -36,7 +36,7 @@ class SystemConfigValidata extends Validate
|
||||
'extract_time' => 'number|between:0,180',
|
||||
'replenishment_num' => 'number',
|
||||
'store_stock' => 'number',
|
||||
'store_brokerage_price' => 'float|egt:0',
|
||||
'store_brokerage_price' => 'float',
|
||||
'integral_ratio' => 'float|egt:0|elt:1000|regex:float_two',
|
||||
'integral_max_num' => 'number|egt:0',
|
||||
'order_give_integral' => 'float|egt:0|elt:1000',
|
||||
@ -59,6 +59,17 @@ class SystemConfigValidata extends Validate
|
||||
'config_export_to_address' => 'chsAlphaNum|length:10,100',
|
||||
'config_export_siid' => 'alphaNum|length:10,50',
|
||||
'service_feedback' => 'length:10,90',
|
||||
'thumb_big_height' => 'number|egt:0',
|
||||
'thumb_big_width' => 'number|egt:0',
|
||||
'thumb_mid_height' => 'number|egt:0',
|
||||
'thumb_mid_width' => 'number|egt:0',
|
||||
'thumb_small_height' => 'number|egt:0',
|
||||
'thumb_small_width' => 'number|egt:0',
|
||||
'watermark_opacity' => 'number|between:0,100',
|
||||
'watermark_text' => 'chsAlphaNum|length:1,10',
|
||||
'watermark_text_size' => 'number|egt:0',
|
||||
'watermark_x' => 'number|egt:0',
|
||||
'watermark_y' => 'number|egt:0',
|
||||
];
|
||||
|
||||
/**
|
||||
@ -85,7 +96,6 @@ class SystemConfigValidata extends Validate
|
||||
'extract_time.number' => '佣金冻结时间范围在0-180之间',
|
||||
'extract_time.between' => '佣金冻结时间范围在0-180之间',
|
||||
'store_brokerage_price.float' => '满额分销金额金额必须为数字',
|
||||
'store_brokerage_price.gt' => '满额分销金额金额必须大于0',
|
||||
'integral_ratio.float' => '积分抵用比例必须为数字',
|
||||
'integral_ratio.regex' => '积分抵用比例最多两位小数',
|
||||
'integral_ratio.egt' => '积分抵用比例必须在0-1000之间',
|
||||
@ -120,6 +130,26 @@ class SystemConfigValidata extends Validate
|
||||
'config_export_siid.alphaNum' => '电子面单打印机编号必须为数字、字母',
|
||||
'config_export_siid.length' => '电子面单打印机编号长度为10-50位',
|
||||
'service_feedback.length' => '客服反馈长度位10-90位',
|
||||
'thumb_big_height.number' => '缩略图大图尺寸(高)必须为数字',
|
||||
'thumb_big_height.egt' => '缩略图大图尺寸(高)必须大于等于0',
|
||||
'thumb_big_width.number' => '缩略图大图尺寸(宽)必须为数字',
|
||||
'thumb_big_width.egt' => '缩略图大图尺寸(宽)必须大于等于0',
|
||||
'thumb_mid_height.number' => '缩略图中图尺寸(高)必须为数字',
|
||||
'thumb_mid_height.egt' => '缩略图中图尺寸(高)必须大于等于0',
|
||||
'thumb_mid_width.number' => '缩略图中图尺寸(宽)必须为数字',
|
||||
'thumb_mid_width.egt' => '缩略图中图尺寸(宽)必须大于等于0',
|
||||
'thumb_small_height.number' => '缩略图小图尺寸(高)必须为数字',
|
||||
'thumb_small_height.egt' => '缩略图小图尺寸(高)必须大于等于0',
|
||||
'thumb_small_width.number' => '缩略图小图尺寸(宽)必须为数字',
|
||||
'thumb_small_width.egt' => '缩略图小图尺寸(宽)必须大于等于0',
|
||||
'watermark_text.chsAlphaNum' => '水印文字只能是汉字、字母、数字',
|
||||
'watermark_text.length' => '水印文字长度为1-10位',
|
||||
'watermark_text_size.number' => '水印文字大小必须为数字',
|
||||
'watermark_text_size.egt' => '水印文字大小必须大于等于0',
|
||||
'watermark_x.number' => '水印横坐标偏移量必须为数字',
|
||||
'watermark_x.egt' => '水印横坐标偏移量必须大于等于0',
|
||||
'watermark_y.number' => '水印纵坐标偏移量必须为数字',
|
||||
'watermark_y.egt' => '水印纵坐标偏移量必须大于等于0',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
|
||||
@ -11,14 +11,25 @@
|
||||
namespace app\api\controller\pc;
|
||||
|
||||
|
||||
use app\services\other\QrcodeServices;
|
||||
use app\services\pc\HomeServices;
|
||||
use app\services\other\QrcodeServices;
|
||||
|
||||
|
||||
/**
|
||||
* Class HomeController
|
||||
* @package app\api\controller\pc
|
||||
*/
|
||||
class HomeController
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var HomeServices
|
||||
*/
|
||||
protected $services;
|
||||
|
||||
/**
|
||||
* HomeController constructor.
|
||||
* @param HomeServices $services
|
||||
*/
|
||||
public function __construct(HomeServices $services)
|
||||
{
|
||||
$this->services = $services;
|
||||
|
||||
@ -58,6 +58,7 @@ class OrderController
|
||||
$where['uid'] = $request->uid();
|
||||
$where['is_del'] = 0;
|
||||
$where['is_system_del'] = 0;
|
||||
if (!in_array($where['status'], [-1, -2, -3])) $where['pid'] = 0;
|
||||
return app('json')->successful($this->services->getOrderList($where));
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ class ProductController
|
||||
{
|
||||
/** @var StoreProductServices $product */
|
||||
$product = app()->make(StoreProductServices::class);
|
||||
$list = $product->getProducts(['is_good' => 1, 'is_del' => 0, 'is_show' => 1]);
|
||||
$list = get_thumb_water($product->getProducts(['is_good' => 1, 'is_del' => 0, 'is_show' => 1]), 'mid');
|
||||
return app('json')->successful(compact('list'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ namespace app\api\controller\v1;
|
||||
|
||||
|
||||
use app\Request;
|
||||
use app\services\wechat\WechatServices;
|
||||
use think\facade\Cache;
|
||||
use app\jobs\TaskJob;
|
||||
use think\facade\Config;
|
||||
@ -187,7 +188,7 @@ class LoginController
|
||||
return app('json')->fail('验证码错误');
|
||||
if (strlen(trim($password)) < 6 || strlen(trim($password)) > 16)
|
||||
return app('json')->fail('密码必须是在6到16位之间');
|
||||
if ($password == '123456') return app('json')->fail('密码太过简单,请输入较为复杂的密码');
|
||||
if (md5($password) == md5('123456')) return app('json')->fail('密码太过简单,请输入较为复杂的密码');
|
||||
|
||||
$registerStatus = $this->services->register($account, $password, $spread, 'h5');
|
||||
if ($registerStatus) {
|
||||
@ -410,4 +411,52 @@ class LoginController
|
||||
CacheService::set($code, '0', 600);
|
||||
return app('json')->success();
|
||||
}
|
||||
|
||||
/**
|
||||
* apple快捷登陆
|
||||
* @param Request $request
|
||||
* @param WechatServices $services
|
||||
* @return mixed
|
||||
* @throws \Psr\SimpleCache\InvalidArgumentException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function appleLogin(Request $request, WechatServices $services)
|
||||
{
|
||||
[$openId, $phone, $email, $captcha] = $request->postMore([
|
||||
['openId', ''],
|
||||
['phone', ''],
|
||||
['email', ''],
|
||||
['captcha', '']
|
||||
], true);
|
||||
if ($phone) {
|
||||
if (!$captcha) {
|
||||
return app('json')->fail('请输入验证码');
|
||||
}
|
||||
//验证验证码
|
||||
$verifyCode = CacheService::get('code_' . $phone);
|
||||
if (!$verifyCode)
|
||||
return app('json')->fail('请先获取验证码');
|
||||
$verifyCode = substr($verifyCode, 0, 6);
|
||||
if ($verifyCode != $captcha) {
|
||||
CacheService::delete('code_' . $phone);
|
||||
return app('json')->fail('验证码错误');
|
||||
}
|
||||
}
|
||||
$userInfo = [
|
||||
'openId' => $openId,
|
||||
'unionid' => '',
|
||||
'avatarUrl' => sys_config('h5_avatar'),
|
||||
'nickName' => $email,
|
||||
];
|
||||
$token = $services->appAuth($userInfo, $phone, 'apple');
|
||||
if ($token) {
|
||||
return app('json')->success('登录成功', $token);
|
||||
} else if ($token === false) {
|
||||
return app('json')->success('登录成功', ['isbind' => true]);
|
||||
} else {
|
||||
return app('json')->fail('登陆失败');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,10 +15,12 @@ use app\services\activity\StorePinkServices;
|
||||
use app\services\diy\DiyServices;
|
||||
use app\services\message\service\StoreServiceServices;
|
||||
use app\services\order\DeliveryServiceServices;
|
||||
use app\services\other\CacheServices;
|
||||
use app\services\product\product\StoreCategoryServices;
|
||||
use app\services\product\product\StoreProductServices;
|
||||
use app\services\shipping\ExpressServices;
|
||||
use app\services\shipping\SystemCityServices;
|
||||
use app\services\system\AppVersionServices;
|
||||
use app\services\system\attachment\SystemAttachmentServices;
|
||||
use app\services\system\config\SystemConfigServices;
|
||||
use app\services\system\store\SystemStoreServices;
|
||||
@ -32,6 +34,7 @@ use crmeb\services\CacheService;
|
||||
use crmeb\services\UploadService;
|
||||
use crmeb\services\workerman\ChannelService;
|
||||
use think\facade\Cache;
|
||||
use think\facade\Config;
|
||||
|
||||
/**
|
||||
* 公共类
|
||||
@ -64,21 +67,18 @@ class PublicController
|
||||
}
|
||||
$logoUrl = str_replace('\\', '/', $logoUrl);
|
||||
$fastNumber = (int)sys_config('fast_number', 0);//TODO 快速选择分类个数
|
||||
$bastNumber = (int)sys_config('bast_number', 0);//TODO 精品推荐个数
|
||||
$firstNumber = (int)sys_config('first_number', 0);//TODO 首发新品个数
|
||||
$promotionNumber = (int)sys_config('promotion_number', 0);//TODO 首发新品个数
|
||||
|
||||
/** @var StoreCategoryServices $categoryService */
|
||||
$categoryService = app()->make(StoreCategoryServices::class);
|
||||
$info['fastList'] = $fastNumber ? $categoryService->byIndexList($fastNumber, 'id,cate_name,pid,pic') : [];//TODO 快速选择分类个数
|
||||
/** @var StoreProductServices $storeProductServices */
|
||||
$storeProductServices = app()->make(StoreProductServices::class);
|
||||
$info['bastList'] = $bastNumber ? $storeProductServices->getRecommendProduct($request->uid(), 'is_best', $bastNumber) : [];//TODO 精品推荐个数
|
||||
$info['firstList'] = $firstNumber ? $storeProductServices->getRecommendProduct($request->uid(), 'is_new', $firstNumber) : [];//TODO 首发新品个数
|
||||
//获取推荐商品
|
||||
[$baseList, $firstList, $benefit, $likeInfo, $vipList] = $storeProductServices->getRecommendProductArr((int)$request->uid(), ['is_best', 'is_new', 'is_benefit', 'is_hot']);
|
||||
$info['bastList'] = $baseList;//TODO 精品推荐个数
|
||||
$info['firstList'] = $firstList;//TODO 首发新品个数
|
||||
$info['bastBanner'] = sys_data('routine_home_bast_banner') ?? [];//TODO 首页精品推荐图片
|
||||
$benefit = $promotionNumber ? $storeProductServices->getRecommendProduct($request->uid(), 'is_benefit', $promotionNumber) : [];//TODO 首页促销单品
|
||||
$lovely = sys_data('routine_home_new_banner') ?: [];//TODO 首发新品顶部图
|
||||
$likeInfo = $storeProductServices->getRecommendProduct($request->uid(), 'is_hot', 3);//TODO 热门榜单 猜你喜欢
|
||||
if ($request->uid()) {
|
||||
/** @var WechatUserServices $wechatUserService */
|
||||
$wechatUserService = app()->make(WechatUserServices::class);
|
||||
@ -104,7 +104,7 @@ class PublicController
|
||||
$data['img'] = str_replace('\\', '/', $data['img']);
|
||||
$data['title'] = sys_config('wechat_share_title');
|
||||
$data['synopsis'] = sys_config('wechat_share_synopsis');
|
||||
return app('json')->successful(compact('data'));
|
||||
return app('json')->successful($data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -136,6 +136,8 @@ class PublicController
|
||||
$vipOpen = sys_config('member_func_status');
|
||||
$brokerageFuncStatus = sys_config('brokerage_func_status');
|
||||
$balanceFuncStatus = sys_config('balance_func_status');
|
||||
$vipCard = sys_config('member_card_status', 0);
|
||||
$svipOpen = sys_config('member_card_status') ? true : false;
|
||||
$userService = $invoiceStatus = $deliveryUser = $isUserPromoter = $userVerifyStatus = $userOrder = true;
|
||||
|
||||
if ($uid && $userInfo) {
|
||||
@ -156,7 +158,6 @@ class PublicController
|
||||
$isUserPromoter = $user->checkUserPromoter($uid, $userInfo);
|
||||
$userVerifyStatus = $systemStoreStaff->verifyStatus($uid);
|
||||
}
|
||||
|
||||
$auth = [];
|
||||
$auth['/pages/users/user_vip/index'] = !$vipOpen;
|
||||
$auth['/pages/users/user_spread_user/index'] = !$brokerageFuncStatus || !$isUserPromoter || $uid == 0;
|
||||
@ -164,6 +165,7 @@ class PublicController
|
||||
$auth['/pages/admin/order/index'] = !$userOrder || $uid == 0;
|
||||
$auth['/pages/admin/order_cancellation/index'] = (!$userVerifyStatus && !$deliveryUser) || $uid == 0;
|
||||
$auth['/pages/users/user_invoice_list/index'] = !$invoiceStatus;
|
||||
$auth['/pages/annex/vip_paid/index'] = !$vipCard || !$svipOpen;
|
||||
$auth['/kefu/mobile_list'] = !$userService || $uid == 0;
|
||||
foreach ($menusInfo as $key => &$value) {
|
||||
// $value['pic'] = set_file_url($value['pic']);
|
||||
@ -183,7 +185,11 @@ class PublicController
|
||||
$bannerInfo = $systemConfigServices->getSpreadBanner() ?? [];
|
||||
$my_banner = sys_data('routine_my_banner');
|
||||
$routine_contact_type = sys_config('routine_contact_type', 0);
|
||||
return app('json')->successful(['routine_my_menus' => array_merge($menusInfo), 'routine_my_banner' => $my_banner, 'routine_spread_banner' => $bannerInfo, 'routine_contact_type' => $routine_contact_type]);
|
||||
/** @var DiyServices $diyServices */
|
||||
$diyServices = app()->make(DiyServices::class);
|
||||
$diy_data = $diyServices->get(['template_name' => 'member', 'type' => 1], ['value', 'order_status', 'my_banner_status']);
|
||||
$diy_data = $diy_data ? $diy_data->toArray() : [];
|
||||
return app('json')->successful(['routine_my_menus' => array_merge($menusInfo), 'routine_my_banner' => $my_banner, 'routine_spread_banner' => $bannerInfo, 'routine_contact_type' => $routine_contact_type, 'diy_data' => $diy_data]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -353,8 +359,8 @@ class PublicController
|
||||
*/
|
||||
public function pink(StorePinkServices $pink, UserServices $user)
|
||||
{
|
||||
$data['pink_count'] = $pink->getCount(['status' => 2, 'is_refund' => 0]);
|
||||
$uids = array_flip($pink->getColumn(['status' => 2, 'is_refund' => 0], 'uid'));
|
||||
$data['pink_count'] = $pink->getCount(['is_refund' => 0]);
|
||||
$uids = array_flip($pink->getColumn(['is_refund' => 0], 'uid'));
|
||||
if (count($uids)) {
|
||||
$uids = array_rand($uids, count($uids) < 3 ? count($uids) : 3);
|
||||
}
|
||||
@ -432,6 +438,7 @@ class PublicController
|
||||
$where = [];
|
||||
$where['is_show'] = 1;
|
||||
$where['is_del'] = 0;
|
||||
$where['productId'] = '';
|
||||
if ($data['selectType'] == 1) {
|
||||
if (!$data['ids']) {
|
||||
return app('json')->success([]);
|
||||
@ -460,16 +467,59 @@ class PublicController
|
||||
return app('json')->success($services->homeProductList($where, $request->uid()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统信息
|
||||
* @return mixed
|
||||
*/
|
||||
public function getVersion()
|
||||
public function getNewAppVersion($platform)
|
||||
{
|
||||
$data['site_url'] = sys_config('site_url');
|
||||
$data['version'] = get_crmeb_version();
|
||||
$data['code'] = get_crmeb_version_code();
|
||||
$data['server'] = php_uname('s');
|
||||
/** @var AppVersionServices $appService */
|
||||
$appService = app()->make(AppVersionServices::class);
|
||||
return app('json')->success($appService->getNewInfo($platform));
|
||||
}
|
||||
|
||||
public function getCustomerType()
|
||||
{
|
||||
$data = [];
|
||||
$data['customer_type'] = sys_config('customer_type', 0);
|
||||
$data['customer_phone'] = sys_config('customer_phone', 0);
|
||||
$data['customer_url'] = sys_config('customer_url', 0);
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 统计代码
|
||||
* @return array|string
|
||||
*/
|
||||
public function getScript()
|
||||
{
|
||||
return sys_config('statistic_script', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取workerman请求域名
|
||||
* @return mixed
|
||||
*/
|
||||
public function getWorkerManUrl()
|
||||
{
|
||||
return app('json')->success(getWorkerManUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页开屏广告
|
||||
* @return mixed
|
||||
*/
|
||||
public function getOpenAdv()
|
||||
{
|
||||
return app('json')->success(sys_config('open_adv',''));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户协议内容
|
||||
* @return mixed
|
||||
*/
|
||||
public function getUserAgreement()
|
||||
{
|
||||
/** @var CacheServices $cache */
|
||||
$cache = app()->make(CacheServices::class);
|
||||
$content = $cache->getDbCache('user_agreement', '');
|
||||
return app('json')->success(compact('content'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\api\controller\v1\activity;
|
||||
|
||||
use app\Request;
|
||||
use app\services\activity\StoreAdvanceServices;
|
||||
|
||||
/**
|
||||
* 预售控制器
|
||||
* Class StoreAdvanceController
|
||||
* @package app\api\controller\v1\activity
|
||||
*/
|
||||
class StoreAdvanceController
|
||||
{
|
||||
/**
|
||||
* StoreAdvanceController constructor.
|
||||
* @param StoreAdvanceServices $services
|
||||
*/
|
||||
public function __construct(StoreAdvanceServices $services)
|
||||
{
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 预售列表
|
||||
* @param Request $request
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$where = $request->getMore([
|
||||
['time_type', 0]
|
||||
]);
|
||||
$where['status'] = 1;
|
||||
$data = $this->services->getList($where);
|
||||
return app('json')->successful($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 预售商品详情
|
||||
* @param Request $request
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function detail(Request $request, $id)
|
||||
{
|
||||
$data = $this->services->getAdvanceinfo($request, $id);
|
||||
return app('json')->successful($data);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user