更新开源v4.4.4

This commit is contained in:
evoxwht 2022-05-09 09:23:53 +08:00
parent bfec09d189
commit ab096dca7f
747 changed files with 5709 additions and 3282 deletions

7
.gitignore vendored
View File

@ -1,11 +1,14 @@
/.git
/.idea
/crmeb/.constant
/crmeb/runtime
/crmeb/runtime/cache
/crmeb/runtime/log
/crmeb/runtime/session
/crmeb/runtime/temp
/crmeb/public/uploads
*.log
/crmeb/public/install/install.lock
/crmeb/.env
#/crmeb/.env
/crmeb/timer.pid
/crmeb/workerman.pid
/docker-compose/mysql/data/

View File

@ -9,7 +9,7 @@
CRMEB打通版是一款全开源支持免费商用的PHP单商户商城系统
CRMEB技术团队官网www.crmeb.com)历经4年时间匠心之作系统采用前后端分离技术基于TP6+Uni-app框架开发客户移动端采用uni-app开发管理后台前端使用iviewUI开发。系统支持微信公众号端、微信小程序端、H5端、PC端多端账号同步可快速打包生成APP
CRMEB技术团队官网www.crmeb.com)历经5年时间匠心之作系统采用前后端分离技术基于TP6+Uni-app框架开发客户移动端采用uni-app开发管理后台前端使用iviewUI开发。系统支持微信公众号端、微信小程序端、H5端、PC端多端账号同步可快速打包生成APP
赋能开发者,减少重复造轮子;系统支持自动检查安装环境一键安装部署,使用简单方便;围绕方便二次开发,系统内置强大灵活的权限管理,可以控制到每一个菜单;通过内置组合数据,管理碎片化数据,系统配置快速添加系统配置参数所有用户操作地方都内置钩子代码严格分控制层中间件、路由、Services层、Dao层、Model层后台应用form-builder PHP快速生成现代化表单并提供详细的使用文档、开发文档、接口文档、数据字典等相关文档及十几个技术交流群、技术论坛答疑让您二开无忧帮助更多开发者快速上手节省开发时间提升开发效率助力企业实现数字化经营
@ -52,12 +52,6 @@
技术交流社区:<a href="https://q.crmeb.com" target="_blank">https://q.crmeb.com
![](readme/images/gitee打通版-横.jpg)
[![](readme/images/1思维脑图功能清单.jpg)](http://s.crmeb.com/goods_detail/730)
[![](readme/images/2高清UI设计图.jpg)](http://s.crmeb.com/goods_detail/728)
[![](readme/images/3前后端接口文档.jpg)](http://s.crmeb.com/goods_detail/729)
[![](readme/images/4PC端前端模板.jpg)](http://s.crmeb.com/goods_detail/711)
#### 不懂服务器?不懂技术?无法解决高并发?想数据私有化?还想后期定制开发?
推荐云部署版一键解决以上所有问题,超低价格低至 :collision: 9.9元/年,点击了解 https://saas.crmeb.com/saas-home-software-detail-50042-s-y.html
@ -79,12 +73,12 @@ Redis
### 官方技术交流群
![输入图片说明](readme/images/image.jpg)
![输入图片说明](readme/pic/image.jpg)
### CRMEB官方论坛https://q.crmeb.com
技术交流、安装搭建问题、系统建议反馈 欢迎光临CRMEB官方论坛
提交BUG、产品建议反馈 有奖悬赏 欢迎参与https://q.crmeb.com/thread/7380
提交BUG、产品建议反馈 欢迎参与https://q.crmeb.com/?categoryId=147
## 技术亮点
@ -111,17 +105,17 @@ Redis
## 页面展示
(页面仅展示部分UI)
![输入图片说明](readme/images/gitee开源版详情_01.jpg)
![输入图片说明](readme/images/gitee开源版详情_02.jpg)
![输入图片说明](readme/images/gitee开源版详情_03.jpg)
![输入图片说明](readme/images/gitee开源版详情_04.jpg)
![输入图片说明](readme/images/gitee开源版详情_05.jpg)
## <a href='http://s.crmeb.com/goods_detail/728' target='_blank'>点击查看高清版全套UI设计图</a>
![输入图片说明](readme/pic/gitee开源版详情_01.jpg)
![输入图片说明](readme/pic/gitee开源版详情_02.jpg)
![输入图片说明](readme/pic/gitee开源版详情_03.jpg)
![输入图片说明](readme/pic/gitee开源版详情_04.jpg)
![输入图片说明](readme/pic/gitee开源版详情_05.jpg)
### <a href='http://s.crmeb.com/goods_detail/728' target='_blank'>点击查看高清版全套UI设计图</a>
## 系统演示
![输入图片说明](readme/images/20公众号.jpg)
![输入图片说明](readme/pic/20公众号.jpg)
演示站: http://v4.crmeb.net/admin
@ -134,43 +128,19 @@ Redis
## 程序下载
老版本v3.2.9 下载(功能全,后台非前后端分离,适合新手二开)
```
老版本v3.2.9 下载(功能全,后台非前后端分离,适合二开)
git clone -b v3.2.9 https://gitee.com/ZhongBangKeJi/CRMEB.git
最新版 下载(当前开源版功能全,前后台分离版,适合二开)
git clone https://gitee.com/ZhongBangKeJi/CRMEB.git
精简版Min下载(基础商城框架,适合精简需求的客户,适合二开)
git clone https://gitee.com/ZhongBangKeJi/CRMEB-Min.git
```
## 相关项目
## 推荐项目
:star: CRMChat客服系统 https://gitee.com/ZhongBangKeJi/CRMChat
TP6+swoole4开源客服系统支持微信网页、H5端、PC端客服接入商家端有PC端管理、H5端、App端接待支持用户添加标签、分组等功能
:star: CRMChat客服系统 https://gitee.com/ZhongBangKeJi/CRMChat
JAVA版商城https://gitee.com/ZhongBangKeJi/crmeb_java
CRMEB商城JAVA版SpringBoot + Maven + Swagger + Mybatis Plus + Redis + Uniapp +Vue+elementUI 包含移动端、小程序、PC后台、Api接口有产品、用户、购物车、订单、积分、优惠券、营销、余额、权限、角色、系统设置、组合数据、可拖拉拽的form表单等模块大量的减少了二开的成本。
知识付费https://gitee.com/ZhongBangKeJi/crmeb_zzff_class
CRMEB知识付费系统是基于ThinkPhp5.0+Vue开发的全开源知识付费系统。功能包含直播课堂、付费视频、付费音频、付费阅读、会员系统、课程分销、课程拼团、直播带货、直播打赏、商城系统等。能够快速积学员、学员数据分析、智能转化客户、有效提高销售、吸引流量、网络营销、品牌推广的一款应用且更适合企业二次开发
form-builder : https://github.com/xaboy/form-builder
tp PHP表单生成器快速生成现代化的form表单。包含复选框、单选框、输入框、下拉选择框等元素以及,省市区三级联动,时间选择,日期选择,颜色选择,文件/图片上传等功能。
CRMEB Min版商城https://gitee.com/ZhongBangKeJi/CRMEB-Min
CRMEB Min是一款轻量级、高性能开源电商商城系统采用TP6+Mysql+Uniapp+iView+Redis等最流行热门技术语言支持队列、表单生成、长链接、定时任务等完善的权限管理、会员管理、产品订单管理、CMS管理、支持多端、一键开通短信、产品采集、物流查询等接口。快速简单高效
## 特别鸣谢
@ -188,7 +158,7 @@ CRMEB Min是一款轻量级、高性能开源电商商城系统采用TP6+Mysq
## 开源版使用须知
1.允许用于个人学习、毕业设计、教学案例、公益事业;
1.允许用于个人学习、毕业设计、教学案例、公益事业、商业使用;
2.如果商用必须保留版权信息,请自觉遵守;
@ -205,4 +175,11 @@ All rights reserved。
CRMEB® 商标和著作权所有者为西安众邦网络科技有限公司。
![](readme/pic/gitee打通版-横.jpg)
[![](readme/pic/1思维脑图功能清单.jpg)](http://s.crmeb.com/goods_detail/730)
[![](readme/pic/2高清UI设计图.jpg)](http://s.crmeb.com/goods_detail/728)
[![](readme/pic/3前后端接口文档.jpg)](http://s.crmeb.com/goods_detail/729)
[![](readme/pic/4PC端前端模板.jpg)](http://s.crmeb.com/goods_detail/711)
[返回顶部 :fa-arrow-circle-up: ](https://gitee.com/ZhongBangKeJi/CRMEB#%E9%A1%B9%E7%9B%AE%E4%BB%8B%E7%BB%8D)

View File

@ -12,6 +12,7 @@
namespace app\adminapi;
use app\exceptions\CommonException;
use crmeb\exceptions\AdminException;
use crmeb\exceptions\ApiException;
use crmeb\exceptions\AuthException;
@ -34,6 +35,7 @@ class AdminApiExceptionHandle extends Handle
AuthException::class,
AdminException::class,
ApiException::class,
CommonException::class,
];
/**
@ -86,7 +88,7 @@ class AdminApiExceptionHandle extends Handle
// 添加自定义异常处理机制
if ($e instanceof DbException) {
return app('json')->fail('数据获取失败', $massageData);
} elseif ($e instanceof AuthException || $e instanceof ValidateException || $e instanceof ApiException) {
} elseif ($e instanceof AuthException || $e instanceof ValidateException || $e instanceof ApiException || $e instanceof CommonException) {
return app('json')->make($e->getCode() ? : 400, $e->getMessage());
} elseif ($e instanceof AdminException) {
return app('json')->fail($e->getMessage(), $massageData);

View File

@ -112,47 +112,31 @@ if (!function_exists('attr_format')) {
* @param $arr
* @return array
*/
function attr_format($arr)
function attr_format($arr): array
{
$data = [];
$res = [];
$count = count($arr);
$arr = array_merge($arr);
if ($count > 1) {
for ($i = 0; $i < $count - 1; $i++) {
if ($i == 0) $data = $arr[$i]['detail'];
//替代变量1
$rep1 = $rep4 = [];
foreach ($data as $v) {
foreach ($arr[$i + 1]['detail'] as $g) {
//替代变量2
$rep2 = ($i != 0 ? '' : $arr[$i]['value'] . '_$_') . $v . '-$-' . $arr[$i + 1]['value'] . '_$_' . $g;
$tmp[] = $rep2;
// if ($i == $count - 2) {
foreach (explode('-$-', $rep2) as $k => $h) {
//替代变量3
$rep3 = explode('_$_', $h);
//替代变量4
$rep4['detail'][$rep3[0]] = $rep3[1] ?? '';
}
if ($count == count($rep4['detail']))
$res[] = $rep4;
// }
$len = count($arr);
$title = array_column($arr, 'value');
$result = [];
if ($len > 0) {
if ($len > 1) {
$result = $arr[0]['detail'];
for ($i = 0; $i < $len - 1; $i++) {
$temp = $result;
$result = [];
foreach ($temp as $item) {
foreach ($arr[$i + 1]['detail'] as $datum) {
$result[] = trim($item) . ',' . trim($datum);
}
}
$data = $tmp ?? [];
}
} else {
$dataArr = [];
foreach ($arr as $k => $v) {
foreach ($v['detail'] as $kk => $vv) {
$dataArr[$kk] = $v['value'] . '_' . $vv;
$res[$kk]['detail'][$v['value']] = $vv;
foreach ($arr[0]['detail'] as $item) {
$result[] = trim($item);
}
}
$data[] = implode('-', $dataArr);
}
return [$data, array_merge(array_unique($res, SORT_REGULAR))];
return [$result, $title];
}
}

View File

@ -0,0 +1,54 @@
<?php
namespace app\adminapi\controller\v1\setting;
use app\adminapi\controller\AuthController;
use app\services\other\AgreementServices;
use think\facade\App;
class SystemAgreement extends AuthController
{
/**
* 构造方法
* SystemCity constructor.
* @param App $app
* @param AgreementServices $services
*/
public function __construct(App $app, AgreementServices $services)
{
parent::__construct($app);
$this->services = $services;
}
/**
* 获取协议内容
* @param $type
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getAgreement($type)
{
if (!$type) return app('json')->fail('协议类型不存在');
$info = $this->services->getAgreementBytype($type);
return app('json')->success($info);
}
/**
* 保存协议内容
* @return mixed
*/
public function saveAgreement()
{
$data = $this->request->postMore([
['id', 0],
['type', 0],
['title', ''],
['content', ''],
]);
$data['status'] = 1;
$this->services->saveAgreement($data, $data['id']);
return app('json')->success('保存成功');
}
}

View File

@ -276,14 +276,6 @@ class SystemConfig extends AuthController
return app('json')->fail('提现最低金额只能为数字!');
}
}
foreach ($post as $k => $v) {
$config_one = $this->services->getOne(['menu_name' => $k]);
if ($config_one) {
$config_one['value'] = $v;
$this->services->valiDateValue($config_one);
$this->services->update($k, ['value' => json_encode($v)], 'menu_name');
}
}
if (isset($post['wss_open'])) {
$this->services->saveSslFilePath((int)$post['wss_open'], $post['wss_local_pk'] ?? '', $post['wss_local_cert'] ?? '');
}
@ -314,6 +306,14 @@ class SystemConfig extends AuthController
@copy($from, $toHome);
@copy($from, $toPublic);
}
foreach ($post as $k => $v) {
$config_one = $this->services->getOne(['menu_name' => $k]);
if ($config_one) {
$config_one['value'] = $v;
$this->services->valiDateValue($config_one);
$this->services->update($k, ['value' => json_encode($v)], 'menu_name');
}
}
\crmeb\services\CacheService::clear();
return app('json')->success('修改成功');

View File

@ -126,11 +126,15 @@ class User extends AuthController
if (!check_phone($data['phone'])) {
return app('json')->fail('手机号码格式不正确');
}
if ($this->services->count(['phone' => $data['phone']])) {
if ($this->services->count(['phone' => $data['phone'], 'is_del' => 0])) {
return app('json')->fail('手机号已经存在不能添加相同的手机号用户');
}
if (trim($data['real_name']) != '') {
$data['nickname'] = $data['real_name'];
} else {
$data['nickname'] = substr_replace($data['phone'], '****', 3, 4);
}
}
if ($data['card_id']) {
if (!check_card($data['card_id'])) return app('json')->fail('请输入正确的身份证');
}

View File

@ -0,0 +1,59 @@
<?php
namespace app\adminapi\controller\v1\user;
use app\adminapi\controller\AuthController;
use app\services\user\UserCancelServices;
use think\facade\App;
class UserCancel extends AuthController
{
/**
* UserCancel constructor.
* @param App $app
* @param UserCancelServices $services
*/
public function __construct(App $app, UserCancelServices $services)
{
parent::__construct($app);
$this->services = $services;
}
/**
* 获取注销列表
* @return mixed
*/
public function getCancelList()
{
$where = $this->request->postMore([
['status', 0],
['keywords', ''],
]);
$data = $this->services->getCancelList($where);
return app('json')->success($data);
}
/**
* 备注
* @return mixed
*/
public function setMark()
{
[$id, $mark] = $this->request->postMore([
['id', 0],
['mark', ''],
], true);
$this->services->serMark($id, $mark);
return app('json')->success('备注成功');
}
public function agreeCancel($id)
{
return app('json')->success('注销成功');
}
public function refuseCancel($id)
{
return app('json')->success('拒绝注销');
}
}

View File

@ -0,0 +1,26 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
return [
// 商品
'product' => [
// 更新相关
'Please select product category' => '请选择商品分类',
'Please enter the product name' => '请输入商品名称',
'Please upload the slide image' => '请上传商品轮播图',
],
// 订单
'order' => [
]
];

View File

@ -148,6 +148,10 @@ Route::group('setting', function () {
//修改消息状态
Route::put('notification/set_status/:type/:status/:id', 'v1.setting.SystemNotification/set_status')->option(['real_name' => '修改消息状态']);
//协议设置
Route::get('get_agreement/:type', 'v1.setting.SystemAgreement/getAgreement')->option(['real_name' => '获取协议内容']);
Route::post('save_agreement', 'v1.setting.SystemAgreement/saveAgreement')->option(['real_name' => '设置协议内容']);
})->middleware([
\app\http\middleware\AllowOriginMiddleware::class,
\app\adminapi\middleware\AdminAuthTokenMiddleware::class,

View File

@ -135,6 +135,13 @@ Route::group('user', function () {
Route::get('member/agreement', 'v1.user.member.MemberCardBatch/getAgreement')->option(['real_name' => '获取会员协议']);
//用户标签(分类)树形列表
Route::get('user_tree_label', 'v1.user.UserLabel/tree_list')->option(['real_name' => '用户标签(分类)树形列表']);
/** 用户注销 */
Route::get('cancel_list', 'v1.user.UserCancel/getCancelList')->option(['real_name' => '用户注销列表']);
Route::post('cancel/set_mark', 'v1.user.UserCancel/setMark')->option(['real_name' => '注销列表备注']);
Route::get('cancel/agree/:id', 'v1.user.UserCancel/agreeCancel')->option(['real_name' => '同意注销']);
Route::get('cancel/refuse/:id', 'v1.user.UserCancel/refuseCancel')->option(['real_name' => '拒绝注销']);
})->middleware([
\app\http\middleware\AllowOriginMiddleware::class,
\app\adminapi\middleware\AdminAuthTokenMiddleware::class,

View File

@ -15,6 +15,7 @@ use app\services\activity\combination\StorePinkServices;
use app\services\diy\DiyServices;
use app\services\message\service\StoreServiceServices;
use app\services\order\DeliveryServiceServices;
use app\services\other\AgreementServices;
use app\services\other\CacheServices;
use app\services\product\product\StoreCategoryServices;
use app\services\product\product\StoreProductServices;
@ -525,4 +526,19 @@ class PublicController
$content = $cache->getDbCache('user_agreement', '');
return app('json')->success(compact('content'));
}
/**
* 获取协议
* @param AgreementServices $agreementServices
* @param $type
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getAgreement(AgreementServices $agreementServices, $type)
{
$data = $agreementServices->getAgreementBytype($type);
return app('json')->success($data);
}
}

View File

@ -29,7 +29,7 @@ class StoreIntegralController
$where = ['is_show' => 1];
$where['is_host'] = 1;
$data['list'] = $this->services->getIntegralList($where);
return app('json')->successful(get_thumb_water($data, 'mid'));
return app('json')->successful(get_thumb_water($data, 'big'));
}
/**
@ -46,7 +46,7 @@ class StoreIntegralController
]);
$where['is_show'] = 1;
$list = $this->services->getIntegralList($where);
return app('json')->successful(get_thumb_water($list));
return app('json')->successful(get_thumb_water($list, 'mid'));
}
/**

View File

@ -67,12 +67,8 @@ class StoreProductController
if (!$where['ids']) {
unset($where['ids']);
}
$type = 'mid';
$type = 'big';
$field = ['image', 'recommend_image'];
if ($where['store_name']) {
$type = 'small';
$field = ['image'];
}
$list = $this->services->getGoodsList($where, (int)$request->uid());
return app('json')->successful(get_thumb_water($list, $type, $field));
}
@ -205,7 +201,7 @@ class StoreProductController
/** @var StoreProductReplyServices $replyService */
$replyService = app()->make(StoreProductReplyServices::class);
$list = $replyService->getProductReplyList($id, $type);
return app('json')->successful(get_thumb_water($list, 'small', ['pics']));
return app('json')->successful(get_thumb_water($list, 'mid', ['pics']));
}
/**

View File

@ -440,4 +440,15 @@ class UserBillController
$uid = (int)$request->uid();
return app('json')->success($this->services->brokerage_rank($uid, $data['type']));
}
/**
* 事业部/代理商推广订单
* @param Request $request
* @return mixed
*/
public function divisionOrder(Request $request)
{
$uid = (int)$request->uid();
return app('json')->successful($this->services->divisionOrder($uid));
}
}

View File

@ -11,6 +11,7 @@
namespace app\api\controller\v1\user;
use app\Request;
use app\services\user\UserCancelServices;
use app\services\user\UserServices;
use app\services\wechat\WechatUserServices;
@ -229,4 +230,16 @@ class UserController
}
}
/**
* 用户注销
* @param Request $request
* @return mixed
*/
public function SetUserCancel(Request $request)
{
/** @var UserCancelServices $userCancelServices */
$userCancelServices = app()->make(UserCancelServices::class);
$userCancelServices->SetUserCancel($request->uid());
return app('json')->success('注销成功');
}
}

View File

@ -16,7 +16,6 @@ use think\Response;
Route::any('wechat/serve', 'v1.wechat.WechatController/serve');//公众号服务
Route::any('wechat/notify', 'v1.wechat.WechatController/notify');//公众号支付回调
Route::any('routine/notify', 'v1.wechat.AuthController/notify');//小程序支付回调
Route::any('pay/notify/:type', 'v1.PayController/notify');//支付回调
Route::get('get_script', 'v1.PublicController/getScript');//获取统计代码
@ -182,6 +181,7 @@ Route::group(function () {
Route::get('integral/list', 'v1.user.UserBillController/integral_list')->name('integralList');//积分记录
Route::get('user/routine_code', 'v1.user.UserBillController/getRoutineCode')->name('getRoutineCode');//小程序二维码
Route::get('user/spread_info', 'v1.user.UserBillController/getSpreadInfo')->name('getSpreadInfo');//获取分销背景等信息
Route::post('division/order', 'v1.user.UserBillController/divisionOrder')->name('divisionOrder');//事业部推广订单
//提现类
Route::get('extract/bank', 'v1.user.UserExtractController/bank')->name('extractBank');//提现银行/提现最低金额
Route::post('extract/cash', 'v1.user.UserExtractController/cash')->name('extractCash');//提现申请
@ -253,6 +253,11 @@ Route::group(function () {
Route::post('agent/set_staff_percent', 'v1.user.DivisionController/setStaffPercent')->name('setStaffPercent');//设置员工分佣比例
Route::get('agent/del_staff/:uid', 'v1.user.DivisionController/delStaff')->name('delStaff');//删除员工
/** 用户注销 */
Route::get('user_cancel', 'v1.user.UserController/SetUserCancel')->name('SetUserCancel');//用户注销
})->middleware(\app\http\middleware\AllowOriginMiddleware::class)->middleware(\app\api\middleware\StationOpenMiddleware::class)->middleware(\app\api\middleware\AuthTokenMiddleware::class, true);
//未授权接口
Route::group(function () {
@ -360,6 +365,7 @@ Route::group(function () {
Route::get('get_open_adv', 'v1.PublicController/getOpenAdv')->name('getOpenAdv');
//获取用户协议
Route::get('user_agreement', 'v1.PublicController/getUserAgreement')->name('getUserAgreement');
Route::get('get_agreement/:type', 'v1.PublicController/getAgreement')->name('getAgreement');
})->middleware(\app\http\middleware\AllowOriginMiddleware::class)->middleware(\app\api\middleware\StationOpenMiddleware::class)->middleware(\app\api\middleware\AuthTokenMiddleware::class, false);
Route::miss(function () {

View File

@ -86,7 +86,7 @@ if (!function_exists('sys_config')) {
if (strpos($sysConfig, '/uploads/system/') !== false) $sysConfig = set_file_url($sysConfig);
}
$config = is_array($sysConfig) ? $sysConfig : trim($sysConfig);
if ($config === '' || $config == false) {
if ($config === '' || $config === false) {
return $default;
} else {
return $config;

View File

@ -153,6 +153,8 @@ class StoreProductDao extends BaseDao
})->when(!isset($where['ids']), function ($query) use ($where) {
if (isset($where['timeOrder']) && $where['timeOrder'] == 1) {
$query->order('id desc');
} else if (isset($where['is_best']) && $where['is_best'] == 1) {
$query->order('sales desc,sort desc');
} else {
$query->order('sort desc,id desc');
}
@ -223,7 +225,7 @@ class StoreProductDao extends BaseDao
->when($limit, function ($query) use ($limit) {
$query->limit($limit);
})
->order(($field == 'is_hot' ? 'sales DESC' : 'sort DESC') . ', id DESC')->select()->toArray();
->order((in_array($field, ['is_hot','is_best']) ? 'sales DESC' : 'sort DESC') . ', id DESC')->select()->toArray();
}

View File

@ -0,0 +1,35 @@
<?php
namespace app\dao\user;
use app\dao\BaseDao;
use app\model\user\UserCancel;
class UserCancelDao extends BaseDao
{
/**
* @return string
*/
protected function setModel(): string
{
return UserCancel::class;
}
/**
* 获取列表
* @param $where
* @param int $page
* @param int $limit
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getList($where, $page = 0, $limit = 0)
{
return $this->search($where)->with(['user'])
->when($page && $limit, function ($query) use ($page, $limit) {
$query->page($page, $limit);
})->select()->toArray();
}
}

View File

@ -0,0 +1,42 @@
<?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\exceptions;
use crmeb\utils\AdminApiErrorCode;
use Throwable;
/**
* 公共错误信息
* Class CommonException
* @package app\exceptions
*/
class CommonException extends \RuntimeException
{
public function __construct($message, $code = 0, Throwable $previous = null)
{
if(is_array($message)){
$errInfo = $message;
$message = $errInfo[1] ?? '未知错误';
if ($code === 0) {
$code = $errInfo[0] ?? 400;
}
}
// 通过错误获取code 当前方式不支持常量数组
$errCode = AdminApiErrorCode::getCode($message);
if ($errCode > 0) {
$code = $errCode;
}
parent::__construct($message, $code, $previous);
}
}

View File

@ -13,7 +13,11 @@ namespace app\jobs;
use app\services\product\product\CopyTaobaoServices;
use app\services\product\product\StoreDescriptionServices;
use app\services\product\product\StoreProductServices;
use app\services\product\sku\StoreProductAttrValueServices;
use crmeb\basic\BaseJobs;
use crmeb\services\CacheService;
use crmeb\traits\QueueTrait;
use think\facade\Log;
@ -31,12 +35,34 @@ class ProductCopyJob extends BaseJobs
* @param $id
* @return bool
*/
public function copyDescriptionImage($id)
public function copyDescriptionImage($id, $description, $image, $count)
{
try {
/** @var CopyTaobaoServices $copyTaobao */
$copyTaobao = app()->make(CopyTaobaoServices::class);
$copyTaobao->uploadDescriptionImage((int)$id);
/** @var StoreDescriptionServices $storeDescriptionServices */
$storeDescriptionServices = app()->make(StoreDescriptionServices::class);
if (is_int(strpos($image, 'http'))) {
$d_image = $image;
} else {
$d_image = 'http://' . ltrim($image, '\//');
}
$description_cache = CacheService::getTokenBucket('desc_images_' . $id);
if ($description_cache === null) {
$description_cache = $description;
CacheService::setTokenBucket('desc_images_count' . $id, 0);
}
$res = $copyTaobao->downloadCopyImage($d_image);
$description_cache = str_replace($image, $res, $description_cache);
$desc_count = CacheService::getTokenBucket('desc_images_count' . $id) + 1;
if ($desc_count == $count) {
CacheService::clearToken('desc_images_' . $id);
CacheService::clearToken('desc_images_count' . $id);
$storeDescriptionServices->saveDescription((int)$id, $description_cache);
} else {
CacheService::setTokenBucket('desc_images_' . $id, $description_cache);
CacheService::setTokenBucket('desc_images_count' . $id, $desc_count);
}
} catch (\Throwable $e) {
Log::error('下载商品详情图片失败,失败原因:' . $e->getMessage());
}
@ -48,12 +74,33 @@ class ProductCopyJob extends BaseJobs
* @param $id
* @return bool
*/
public function copySliderImage($id)
public function copySliderImage($id, $image, $count)
{
try {
/** @var CopyTaobaoServices $copyTaobao */
$copyTaobao = app()->make(CopyTaobaoServices::class);
$copyTaobao->uploadSliderImage((int)$id);
/** @var StoreProductServices $StoreProductServices */
$StoreProductServices = app()->make(StoreProductServices::class);
/** @var StoreProductAttrValueServices $StoreProductAttrValueServices */
$StoreProductAttrValueServices = app()->make(StoreProductAttrValueServices::class);
//下载图片
$res = $copyTaobao->downloadCopyImage($image);
//获取缓存中的轮播图
$slider_images = CacheService::getTokenBucket('slider_images_' . $id);
//缓存为null则赋值[]
if ($slider_images === null) $slider_images = [];
//将下载的图片插入数组
array_push($slider_images, $res);
//如果$slider_images中图片数量和传入的$count相等说明已经下载完成写入商品表如果不等则继续插入缓存
if (count($slider_images) == $count) {
CacheService::clearToken('slider_images_' . $id);
$image = $slider_images[0];
$slider_images = $slider_images ? json_encode($slider_images) : '';
$StoreProductServices->update($id, ['slider_image' => $slider_images, 'image' => $image]);
$StoreProductAttrValueServices->update(['product_id' => $id], ['image' => $image]);
} else {
CacheService::setTokenBucket('slider_images_' . $id, $slider_images);
}
} catch (\Throwable $e) {
Log::error('下载商品轮播图片失败,失败原因:' . $e->getMessage());
}

View File

@ -71,6 +71,7 @@ class Notice implements ListenerInterface
$name = $data['nickname'] ?? '';
//站内信
$SystemMsg->sendMsg($data['spreadUid'], ['nickname' => $name]);
$userType = $UserServices->value(['uid' => $data['spreadUid']], 'user_type');
//模板消息公众号模版消息
if ($userType == 'wechat') {
$WechatTemplateList->sendBindSpreadUidSuccess($data['spreadUid'], $name);

View File

@ -21,4 +21,6 @@ return [
// \think\middleware\TraceDebug::class,
//初始化基础中间件
\app\http\middleware\BaseMiddleware::class,
// 多语言支持
\think\middleware\LoadLangPack::class,
];

View File

@ -566,4 +566,24 @@ class StoreOrder extends BaseModel
}
}
}
/**
* 事业部推广订单
* @param $query
* @param $value
*/
public function searchDivisionIdAttr($query, $value)
{
if ($value !== '') $query->where('division_id', $value);
}
/**
* 代理商推广订单
* @param $query
* @param $value
*/
public function searchAgentIdAttr($query, $value)
{
if ($value !== '') $query->where('agent_id', $value);
}
}

View File

@ -431,4 +431,13 @@ class User extends BaseModel
if ($value !== '') $query->where('uid|nickname', 'like', '%' . $value . '%');
}
/**
* 注销搜索器
* @param $query
* @param $value
*/
public function searchIsDelAttr($query, $value)
{
if ($value !== '') $query->where('is_del', $value);
}
}

View File

@ -0,0 +1,75 @@
<?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\model\user;
use crmeb\basic\BaseModel;
use crmeb\traits\ModelTrait;
/**
* Class UserCancel
* @package app\model\user
*/
class UserCancel extends BaseModel
{
use ModelTrait;
/**
* 数据表主键
* @var string
*/
protected $pk = 'id';
/**
* 模型名称
* @var string
*/
protected $name = 'user_cancel';
/**
* 关联用户表
* @return \think\model\relation\HasOne
*/
public function user()
{
return $this->hasOne(User::class, 'uid', 'uid')->bind([
'money' => 'now_money',
'brokerage' => 'brokerage_price'
]);
}
/**
* 状态搜索器
* @param $query
* @param $value
*/
public function searchStatusAttr($query, $value)
{
if ($value !== '') {
$query->where('status', $value);
}
}
/**
* 关键字搜索器
* @param $query
* @param $value
*/
public function searchKeywordsAttr($query, $value)
{
if ($value !== '') {
$query->where('uid|name|phone', 'like', '%' . $value . '%');
}
}
}

View File

@ -213,18 +213,17 @@ class StoreAdvanceServices extends BaseServices
{
/** @var StoreProductAttrValueServices $storeProductAttrValueServices */
$storeProductAttrValueServices = app()->make(StoreProductAttrValueServices::class);
$value = attr_format($attr)[1];
list($value, $head) = attr_format($attr);
$valueNew = [];
$count = 0;
foreach ($value as $key => $item) {
$detail = $item['detail'];
$suk = implode(',', $item['detail']);
foreach ($value as $suk) {
$detail = explode(',', $suk);
$sukValue = $storeProductAttrValueServices->getColumn(['product_id' => $id, 'type' => $type, 'suk' => $suk], 'bar_code,cost,price,ot_price,stock,image as pic,weight,volume,brokerage,brokerage_two,quota', 'suk');
if (count($sukValue)) {
foreach (array_values($detail) as $k => $v) {
foreach ($detail as $k => $v) {
$valueNew[$count]['value' . ($k + 1)] = $v;
}
$valueNew[$count]['detail'] = json_encode($detail);
$valueNew[$count]['detail'] = json_encode(array_combine($head,$detail));
$valueNew[$count]['pic'] = $sukValue[$suk]['pic'] ?? '';
$valueNew[$count]['price'] = $sukValue[$suk]['price'] ? floatval($sukValue[$suk]['price']) : 0;
$valueNew[$count]['cost'] = $sukValue[$suk]['cost'] ? floatval($sukValue[$suk]['cost']) : 0;

View File

@ -268,7 +268,7 @@ class StoreBargainServices extends BaseServices
{
/** @var StoreProductAttrValueServices $storeProductAttrValueServices */
$storeProductAttrValueServices = app()->make(StoreProductAttrValueServices::class);
$value = attr_format($attr)[1];
list($value, $head) = attr_format($attr);
$valueNew = [];
$count = 0;
if ($type == 2) {
@ -276,16 +276,15 @@ class StoreBargainServices extends BaseServices
} else {
$min_price = 0;
}
foreach ($value as $key => $item) {
$detail = $item['detail'];
// sort($item['detail'], SORT_STRING);
$suk = implode(',', $item['detail']);
foreach ($value as $suk) {
$detail = explode(',', $suk);
$sukValue = $storeProductAttrValueServices->getColumn(['product_id' => $id, 'type' => $type, 'suk' => $suk], 'bar_code,cost,price,ot_price,stock,image as pic,weight,volume,brokerage,brokerage_two,quota', 'suk');
if (count($sukValue)) {
foreach (array_values($detail) as $k => $v) {
foreach ($detail as $k => $v) {
$valueNew[$count]['value' . ($k + 1)] = $v;
}
$valueNew[$count]['detail'] = json_encode($detail);
$valueNew[$count]['detail'] = json_encode(array_combine($head,$detail));
$valueNew[$count]['pic'] = $sukValue[$suk]['pic'] ?? '';
$valueNew[$count]['price'] = $sukValue[$suk]['price'] ? floatval($sukValue[$suk]['price']) : 0;
$valueNew[$count]['min_price'] = $min_price ? floatval($min_price) : 0;

View File

@ -249,19 +249,17 @@ class StoreCombinationServices extends BaseServices
{
/** @var StoreProductAttrValueServices $storeProductAttrValueServices */
$storeProductAttrValueServices = app()->make(StoreProductAttrValueServices::class);
$value = attr_format($attr)[1];
list($value, $head) = attr_format($attr);
$valueNew = [];
$count = 0;
foreach ($value as $key => $item) {
$detail = $item['detail'];
// sort($item['detail'], SORT_STRING);
$suk = implode(',', $item['detail']);
foreach ($value as $suk) {
$detail = explode(',', $suk);
$sukValue = $storeProductAttrValueServices->getColumn(['product_id' => $id, 'type' => $type, 'suk' => $suk], 'bar_code,cost,price,ot_price,stock,image as pic,weight,volume,brokerage,brokerage_two,quota', 'suk');
if (count($sukValue)) {
foreach (array_values($detail) as $k => $v) {
foreach ($detail as $k => $v) {
$valueNew[$count]['value' . ($k + 1)] = $v;
}
$valueNew[$count]['detail'] = json_encode($detail);
$valueNew[$count]['detail'] = json_encode(array_combine($head, $detail));
$valueNew[$count]['pic'] = $sukValue[$suk]['pic'] ?? '';
$valueNew[$count]['price'] = $sukValue[$suk]['price'] ? floatval($sukValue[$suk]['price']) : 0;
$valueNew[$count]['cost'] = $sukValue[$suk]['cost'] ? floatval($sukValue[$suk]['cost']) : 0;

View File

@ -214,7 +214,7 @@ class StoreIntegralServices extends BaseServices
$header[] = ['title' => $item['value'], 'key' => 'value' . ($key + 1), 'align' => 'center', 'minWidth' => 80];
}
$header[] = ['title' => '图片', 'slot' => 'pic', 'align' => 'center', 'minWidth' => 120];
$header[] = ['title' => '兑换积分', 'slot' => 'price', 'align' => 'center', 'minWidth' => 80];
$header[] = ['title' => '兑换积分', 'key' => 'price', 'type' => 1, 'align' => 'center', 'minWidth' => 80];
$header[] = ['title' => '库存', 'key' => 'stock', 'align' => 'center', 'minWidth' => 80];
$header[] = ['title' => '兑换次数', 'key' => 'quota', 'type' => 1, 'align' => 'center', 'minWidth' => 80];
$header[] = ['title' => '重量(KG)', 'key' => 'weight', 'align' => 'center', 'minWidth' => 80];
@ -235,18 +235,17 @@ class StoreIntegralServices extends BaseServices
{
/** @var StoreProductAttrValueServices $storeProductAttrValueServices */
$storeProductAttrValueServices = app()->make(StoreProductAttrValueServices::class);
$value = attr_format($attr)[1];
list($value, $head) = attr_format($attr);
$valueNew = [];
$count = 0;
foreach ($value as $key => $item) {
$detail = $item['detail'];
$suk = implode(',', $item['detail']);
foreach ($value as $suk) {
$detail = explode(',', $suk);
$sukValue = $storeProductAttrValueServices->getColumn(['product_id' => $id, 'type' => $type, 'suk' => $suk], 'bar_code,cost,price,ot_price,stock,image as pic,weight,volume,brokerage,brokerage_two,quota,quota_show', 'suk');
if (count($sukValue)) {
foreach (array_values($detail) as $k => $v) {
foreach ($detail as $k => $v) {
$valueNew[$count]['value' . ($k + 1)] = $v;
}
$valueNew[$count]['detail'] = json_encode($detail);
$valueNew[$count]['detail'] = json_encode(array_combine($head, $detail));
$valueNew[$count]['pic'] = $sukValue[$suk]['pic'] ?? '';
$valueNew[$count]['price'] = $sukValue[$suk]['price'] ? floatval($sukValue[$suk]['price']) : 0;
$valueNew[$count]['cost'] = $sukValue[$suk]['cost'] ? floatval($sukValue[$suk]['cost']) : 0;

View File

@ -364,19 +364,17 @@ class StoreSeckillServices extends BaseServices
{
/** @var StoreProductAttrValueServices $storeProductAttrValueServices */
$storeProductAttrValueServices = app()->make(StoreProductAttrValueServices::class);
$value = attr_format($attr)[1];
list($value, $head) = attr_format($attr);
$valueNew = [];
$count = 0;
foreach ($value as $key => $item) {
$detail = $item['detail'];
// sort($item['detail'], SORT_STRING);
$suk = implode(',', $item['detail']);
foreach ($value as $suk) {
$detail = explode(',', $suk);
$sukValue = $storeProductAttrValueServices->getColumn(['product_id' => $id, 'type' => $type, 'suk' => $suk], 'bar_code,cost,price,ot_price,stock,image as pic,weight,volume,brokerage,brokerage_two,quota', 'suk');
if (count($sukValue)) {
foreach (array_values($detail) as $k => $v) {
foreach ($detail as $k => $v) {
$valueNew[$count]['value' . ($k + 1)] = $v;
}
$valueNew[$count]['detail'] = json_encode($detail);
$valueNew[$count]['detail'] = json_encode(array_combine($head, $detail));
$valueNew[$count]['pic'] = $sukValue[$suk]['pic'] ?? '';
$valueNew[$count]['price'] = $sukValue[$suk]['price'] ? floatval($sukValue[$suk]['price']) : 0;
$valueNew[$count]['cost'] = $sukValue[$suk]['cost'] ? floatval($sukValue[$suk]['cost']) : 0;

View File

@ -244,25 +244,14 @@ class DivisionServices extends BaseServices
$userServices = app()->make(UserServices::class);
$uid = $data['uid'];
$userInfo = $userServices->getUserInfo($uid, 'is_division,division_id,agent_id');
if (!$data['edit'] && $data['division_id'] != 0) {
if ($userInfo['is_division']) throw new AdminException('对方是事业部,您不能添加为代理商');
if ($userInfo['division_id'] == $data['division_id']) throw new AdminException('对方是您的代理商,请勿重复添加');
if ($userInfo['division_id']) throw new AdminException('对方已经是代理商,无法添加到您的下级');
}
$agentData = [
'division_id' => $data['division_id'],
'agent_id' => $uid,
'division_type' => 2,
'division_status' => $data['division_status'],
'is_agent' => 1,
'division_percent' => $data['division_percent'],
'division_change_time' => time(),
'division_end_time' => strtotime($data['division_end_time']),
'spread_uid' => $data['division_id'],
'spread_time' => time()
];
$division_info = $userServices->getUserInfo($agentData['division_id'], 'division_end_time,division_percent');
if ($data['division_id'] != 0) {
$division_info = $userServices->getUserInfo($userInfo['division_id'], 'division_end_time,division_percent');
if ($division_info) {
if ($agentData['division_percent'] > $division_info['division_percent']) throw new AdminException('代理商佣金比例不能大于事业部佣金比例');
if ($agentData['division_end_time'] > $division_info['division_end_time']) throw new AdminException('代理商到期时间不能大于事业部到期时间');
}
@ -331,71 +320,201 @@ class DivisionServices extends BaseServices
}
/**
* 获取比例
* 获取返佣比例佣金比例
* 当前方法会将获得的佣金逐步的递减
* @param $uid
* @param $storeBrokerageRatio
* @param $storeBrokerageRatioTwo
* @param $isSelfBrokerage
* @return array
*/
public function getDivisionPercent($uid, $storeBrokerageRatio, $storeBrokerageTwo, $isSelfBrokerage)
public function getDivisionPercent($uid, $storeBrokerageRatio, $storeBrokerageRatioTwo, $isSelfBrokerage)
{
$field = ['is_staff', 'is_agent', 'is_division', 'division_percent', 'division_end_time', 'staff_id', 'agent_id', 'division_id'];
/** @var UserServices $userServices */
$userServices = app()->make(UserServices::class);
$userInfo = $userServices->get(['uid' => $uid], $field);
if (!$userInfo) throw new ValidateException('用户错误');
if ($userInfo['staff_id'] || $userInfo['agent_id'] || $userInfo['division_id']) {
$spread_uid = $userServices->getSpreadUid($uid);
$spread_uid_two = $userServices->getSpreadUid($spread_uid);
$oneSpreadInfo = $userServices->get(['uid' => $spread_uid], $field);
if (isset($oneSpreadInfo['is_division']) && $oneSpreadInfo['is_division'] == 1 && $oneSpreadInfo['division_end_time'] > time()) {
$storeBrokerageRatio = $isSelfBrokerage ? $storeBrokerageRatio : 0;
$userInfo = $userServices->get($uid);
if ($userInfo['is_division'] == 1 && $userInfo['division_end_time'] > time()) {
/** 自己是事业部 */
if ($isSelfBrokerage) {
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = 0;
$staffPercent = 0;
$agentPercent = 0;
$divisionPercent = $oneSpreadInfo['division_percent'] - $storeBrokerageRatio;
} elseif (isset($oneSpreadInfo['is_agent']) && $oneSpreadInfo['is_agent'] == 1 && $oneSpreadInfo['division_end_time'] > time()) {
$twoSpreadInfo = $userServices->get(['uid' => $userInfo['division_id']], $field);
$storeBrokerageRatio = $isSelfBrokerage ? $storeBrokerageRatio : 0;
$divisionPercent = 0;
} else {
$storeBrokerageOne = 0;
$storeBrokerageTwo = 0;
$staffPercent = 0;
$agentPercent = $oneSpreadInfo['division_percent'] - $storeBrokerageRatio;
$divisionPercent = $twoSpreadInfo['division_percent'] - $oneSpreadInfo['division_percent'];
} elseif (isset($oneSpreadInfo['is_staff']) && $oneSpreadInfo['is_staff'] == 1) {
$twoSpreadInfo = $userServices->get(['uid' => $userInfo['agent_id']], $field);
$threeSpreadInfo = $userServices->get(['uid' => $userInfo['division_id']], $field);
$storeBrokerageRatio = $isSelfBrokerage ? $storeBrokerageRatio : 0;
$storeBrokerageTwo = 0;
$staffPercent = $oneSpreadInfo['division_percent'] - $storeBrokerageRatio;
$agentPercent = $twoSpreadInfo['division_percent'] - $oneSpreadInfo['division_percent'];
$divisionPercent = $threeSpreadInfo['division_percent'] - $twoSpreadInfo['division_percent'];
} elseif (isset($oneSpreadInfo['is_staff']) && $oneSpreadInfo['is_staff'] == 0 && $userServices->value(['uid' => $spread_uid_two], 'is_staff') == 1) {
$twoSpreadInfo = $userServices->get(['uid' => $spread_uid_two], $field);
$threeSpreadInfo = $userServices->get(['uid' => $userInfo['agent_id']], $field);
$fourSpreadInfo = $userServices->get(['uid' => $userInfo['division_id']], $field);
$storeBrokerageRatio = $storeBrokerageRatio;
$storeBrokerageTwo = $isSelfBrokerage ? $storeBrokerageTwo : 0;
$staffPercent = $isSelfBrokerage ? 0 : $twoSpreadInfo['division_percent'] - $storeBrokerageRatio;
$agentPercent = $isSelfBrokerage ? $threeSpreadInfo['division_percent'] - $storeBrokerageRatio - $storeBrokerageTwo : $threeSpreadInfo['division_percent'] - $twoSpreadInfo['division_percent'];
$divisionPercent = $fourSpreadInfo['division_percent'] - $threeSpreadInfo['division_percent'];
} else {
$twoSpreadInfo = $userServices->get(['uid' => $userInfo['agent_id']], $field);
$threeSpreadInfo = $userServices->get(['uid' => $userInfo['division_id']], $field);
$storeBrokerageRatio = $storeBrokerageRatio;
$storeBrokerageTwo = $storeBrokerageTwo;
$staffPercent = 0;
if (isset($twoSpreadInfo['is_agent']) && $twoSpreadInfo['is_agent'] == 1 && $twoSpreadInfo['division_end_time'] > time()) {
$agentPercent = $twoSpreadInfo['division_percent'] - $storeBrokerageRatio - $storeBrokerageTwo;
} else {
$agentPercent = 0;
$divisionPercent = 0;
}
if (isset($threeSpreadInfo['is_division']) && $threeSpreadInfo['is_division'] == 1 && $threeSpreadInfo['division_end_time'] > time() && $uid != $threeSpreadInfo['division_id']) {
$divisionPercent = $threeSpreadInfo['division_percent'] - ($twoSpreadInfo['division_percent'] ?? 0);
} elseif ($userInfo['is_agent'] == 1 && $userInfo['division_end_time'] > time()) {
/** 自己是代理商 */
$divisionInfo = $userServices->get($userInfo['division_id']);
if ($isSelfBrokerage) {
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = 0;
$staffPercent = 0;
$agentPercent = 0;
$divisionPercent = $divisionInfo['division_percent'] - $storeBrokerageOne;
} else {
$storeBrokerageOne = 0;
$storeBrokerageTwo = 0;
$staffPercent = 0;
$agentPercent = 0;
$divisionPercent = $divisionInfo['division_percent'];
}
} elseif ($userInfo['is_staff'] == 1 && $userInfo['division_end_time'] > time()) { // 自己是员工
/** 自己是员工 */
$agentInfo = $userServices->get($userInfo['agent_id']);
$divisionInfo = $userServices->get($userInfo['division_id']);
if ($isSelfBrokerage) {
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = 0;
$staffPercent = 0;
$agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne;
$divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent'];
} else {
$storeBrokerageOne = 0;
$storeBrokerageTwo = 0;
$staffPercent = 0;
$agentPercent = $agentInfo['division_percent'];
$divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent'];
}
} else {
/** 自己是普通用户 */
$staffInfo = $userServices->get($userInfo['staff_id']);
$agentInfo = $userServices->get($userInfo['agent_id']);
$divisionInfo = $userServices->get($userInfo['division_id']);
if ($userInfo['staff_id']) {
/** 该用户为员工推广 */
if ($userInfo['staff_id'] == $userInfo['spread_uid']) {
/** 员工直接下级 */
if ($isSelfBrokerage) {
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = $staffInfo['division_percent'] - $storeBrokerageOne;
$staffPercent = 0;
$agentPercent = $agentInfo['division_percent'] - $staffInfo['division_percent'];
$divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent'];
} else {
$storeBrokerageOne = $staffInfo['division_percent'];
$storeBrokerageTwo = 0;
$staffPercent = 0;
$agentPercent = $agentInfo['division_percent'] - $staffInfo['division_percent'];
$divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent'];
}
} elseif ($userServices->value(['uid' => $userInfo['spread_uid']], 'spread_uid') == $userInfo['staff_id']) {
/** 员工间接下级 */
if ($isSelfBrokerage) {
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = $storeBrokerageRatioTwo;
$staffPercent = 0;
$agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne - $storeBrokerageTwo;
$divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent'];
} else {
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = 0;
$staffPercent = $staffInfo['division_percent'] - $storeBrokerageOne;
$agentPercent = $agentInfo['division_percent'] - $staffInfo['division_percent'];
$divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent'];
}
} else {
/** 和员工的关系超过两级 */
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = $storeBrokerageRatioTwo;
$staffPercent = 0;
$agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne - $storeBrokerageTwo;
$divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent'];
}
} elseif ($userInfo['agent_id']) {
/** 该用户为代理商推广 */
if ($userInfo['agent_id'] == $userInfo['spread_uid']) {
/** 代理商直接下级 */
if ($isSelfBrokerage) {
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = 0;
$staffPercent = 0;
$agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne;
$divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent'];
} else {
$storeBrokerageOne = 0;
$storeBrokerageTwo = 0;
$staffPercent = 0;
$agentPercent = $agentInfo['division_percent'];
$divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent'];
}
} elseif ($userServices->value(['uid' => $userInfo['spread_uid']], 'spread_uid') == $userInfo['agent_id']) {
/** 代理商间接下级 */
if ($isSelfBrokerage) {
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = $storeBrokerageRatioTwo;
$staffPercent = 0;
$agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne - $storeBrokerageTwo;
$divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent'];
} else {
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = 0;
$staffPercent = 0;
$agentPercent = $agentInfo['division_percent'] - $storeBrokerageOne;
$divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent'];
}
} else {
/** 和代理商的关系超过两级 */
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = $storeBrokerageRatioTwo;
$staffPercent = 0;
$agentPercent = $agentInfo['division_percent'] - $storeBrokerageRatio - $storeBrokerageTwo;
$divisionPercent = $divisionInfo['division_percent'] - $agentInfo['division_percent'];
}
} elseif ($userInfo['division_id']) {
/** 该用户为事业部推广 */
if ($userInfo['division_id'] == $userInfo['spread_uid']) {
/** 事业部直接下级 */
if ($isSelfBrokerage) {
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = 0;
$staffPercent = 0;
$agentPercent = 0;
$divisionPercent = $divisionInfo['division_percent'] - $storeBrokerageOne;
} else {
$storeBrokerageOne = 0;
$storeBrokerageTwo = 0;
$staffPercent = 0;
$agentPercent = 0;
$divisionPercent = $divisionInfo['division_percent'];
}
} elseif ($userServices->value(['uid' => $userInfo['spread_uid']], 'spread_uid') == $userInfo['division_id']) {
/** 事业部间接下级 */
if ($isSelfBrokerage) {
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = $storeBrokerageRatioTwo;
$staffPercent = 0;
$agentPercent = 0;
$divisionPercent = $divisionInfo['division_percent'] - $storeBrokerageOne - $storeBrokerageTwo;
} else {
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = 0;
$staffPercent = 0;
$agentPercent = 0;
$divisionPercent = $divisionInfo['division_percent'] - $storeBrokerageOne;
}
} else {
/** 和事业部的关系超过两级 */
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = $storeBrokerageRatioTwo;
$staffPercent = 0;
$agentPercent = 0;
$divisionPercent = $divisionInfo['division_percent'] - $storeBrokerageOne - $storeBrokerageTwo;
}
} else {
/** 没有任何代理商关系 */
$storeBrokerageOne = $storeBrokerageRatio;
$storeBrokerageTwo = $storeBrokerageRatioTwo;
$staffPercent = 0;
$agentPercent = 0;
$divisionPercent = 0;
}
}
return [$storeBrokerageRatio, $storeBrokerageTwo, $staffPercent, $agentPercent, $divisionPercent];
} else {
return [$storeBrokerageRatio, $storeBrokerageTwo, 0, 0, 0];
}
return [$storeBrokerageOne, $storeBrokerageTwo, $staffPercent, $agentPercent, $divisionPercent];
}
}

View File

@ -55,7 +55,7 @@ class DiyServices extends BaseServices
{
[$page, $limit] = $this->getPageValue();
$where['is_del'] = 0;
$list = $this->dao->getDiyList($where, $page, $limit);
$list = $this->dao->getDiyList($where, $page, $limit, ['id', 'name', 'type', 'add_time', 'update_time', 'is_diy', 'status']);
foreach ($list as &$item) {
$item['type_name'] = $item['type'] == 0 ? '可视化' : 'DIY';
}
@ -375,7 +375,7 @@ class DiyServices extends BaseServices
}
/** @var QrcodeServices $QrcodeService */
$QrcodeService = app()->make(QrcodeServices::class);
$image = $QrcodeService->getRoutineQrcodePath($id, 0, 6, [], true);
$image = $QrcodeService->getRoutineQrcodePath($id, 0, 6, [], false);
return $image;
}
}

View File

@ -135,7 +135,7 @@ class StoreServiceLogServices extends BaseServices
['is_del', '=', 0],
['is_show', '=', 1],
];
$productList = get_thumb_water($productServices->getProductArray($where, '*', 'id'));
$productList = get_thumb_water($productServices->getProductArray($where, '*', 'id'),'mid');
}
/** @var StoreOrderServices $orderServices */
$orderServices = app()->make(StoreOrderServices::class);

View File

@ -214,13 +214,18 @@ class MessageServices extends BaseServices
$response = '上级用户不存在';
} else if ($loginService->updateUserInfo(['code' => $spreadUid], $userInfo, $is_new)) {
//写入扫码记录,返回内容
$response = $wechatQrcodeService->wechatQrcodeRecord($qrcodeInfo, $userInfo, $spreadInfo);
$response = $wechatQrcodeService->wechatQrcodeRecord($qrcodeInfo, $userInfo, $spreadInfo, 1);
}
} catch (\Exception $e) {
$response = $e->getMessage();
}
}
}
// 更新关注标识
if (!is_string($response)) {
$wechatUser->subscribe($message->FromUserName);
}
return $response;
}

View File

@ -259,6 +259,7 @@ class StoreCartServices extends BaseServices
$info['cart_num'] = $cart_num;
$info['productInfo'] = $productInfo ? $productInfo->toArray() : [];
$info['productInfo']['attrInfo'] = $attrInfo->toArray();
$info['attrInfo'] = $attrInfo->toArray();
$info['sum_price'] = $info['productInfo']['attrInfo']['price'];
//砍价
if ($bargain_id) {

View File

@ -474,22 +474,26 @@ class StoreOrderComputedServices extends BaseServices
}
$tempId = $item['productInfo']['temp_id'] ?? 0;
$tempPostage = $truePostageArr[$tempId] ?? 0;
$type = $temp_num[$tempId]['type'];
$tempNumber = $temp_num[$tempId]['number'] ?? 0;
if (!$tempId || !$tempPostage || !$tempNumber) continue;
$cartNumber = $item['cart_num'];
if ((($cartAlready[$tempId]['number'] ?? 0) + $cartNumber) >= $tempNumber) {
$price = isset($cartAlready[$tempId]['price']) ? bcsub((string)$tempPostage, (string)$cartAlready[$tempId]['price'], 6) : $tempPostage;
} else {
$price = bcmul((string)$tempPostage, bcdiv((string)$cartNumber, (string)$tempNumber, 6), 6);
}
$cartAlready[$tempId]['number'] = bcadd((string)($cartNumber[$tempId]['number'] ?? 0), (string)$cartNumber, 4);
$cartAlready[$tempId]['price'] = bcadd((string)($cartNumber[$tempId]['price'] ?? 0.00), (string)$price, 4);
if ($express_rule_number && $express_rule_number < 100) {
$price = bcmul($price, bcdiv($express_rule_number, 100, 4), 4);
}
if ($type == 2) {
$price = bcmul($price, $item['productInfo']['attrInfo']['weight'], 6);
} elseif ($type == 3) {
$price = bcmul($price, $item['productInfo']['attrInfo']['volume'], 6);
}
$price = sprintf("%.2f", $price);
$item['postage_price'] = $price;
}

View File

@ -693,8 +693,8 @@ class StoreOrderCreateServices extends BaseServices
//指定返佣金额
if (isset($productInfo['is_sub']) && $productInfo['is_sub'] == 1) {
$oneBrokerage = bcmul((string)($productInfo['attrInfo']['brokerage'] ?? '0'), $cartNum, 2);
$twoBrokerage = bcmul((string)($productInfo['attrInfo']['brokerage_two'] ?? '0'), $cartNum, 2);
$oneBrokerage = $storeBrokerageRatio > 0 ? bcmul((string)($productInfo['attrInfo']['brokerage'] ?? '0'), $cartNum, 2) : 0;
$twoBrokerage = $storeBrokerageTwo > 0 ? bcmul((string)($productInfo['attrInfo']['brokerage_two'] ?? '0'), $cartNum, 2) : 0;
} else {
if ($price) {
//一级返佣比例 小于等于零时直接返回 不返佣

View File

@ -229,7 +229,7 @@ class QrcodeServices extends BaseServices
$namePath = 'routine_pay_vip_code.jpg';
break;
case 6:
$page = 'pages/annex/special/index?id=' . $id;
$page = 'pages/annex/special/index';
$namePath = $id . 'routine_index_code.jpg';
break;
}

View File

@ -43,7 +43,7 @@ class HomeServices extends BaseServices
$item['star'] = '3.0';
}
}
$info['productList'] = get_thumb_water($productList, 'mid');
$info['productList'] = get_thumb_water($productList, 'big');
}
$data['list'] = array_merge($list);
$data['count'] = $category->getCidCount();

View File

@ -79,7 +79,7 @@ class UserServices extends BaseServices
$list[$k]['price'] = $product['product']['price'] ?? 0;
$list[$k]['ot_price'] = $product['product']['ot_price'] ?? 0;
$list[$k]['sales'] = $product['product']['sales'] ?? 0;
$list[$k]['image'] = get_thumb_water($product['product']['image'] ?? 0);
$list[$k]['image'] = get_thumb_water($product['product']['image'] ?? 0, 'mid');
$list[$k]['is_del'] = $product['product']['is_del'] ?? 0;
$list[$k]['is_show'] = $product['product']['is_show'] ?? 0;
$list[$k]['is_fail'] = $product['product']['is_del'] && $product['product']['is_show'];

View File

@ -232,181 +232,6 @@ class CopyTaobaoServices extends BaseServices
return true;
}
/**
* 下载商品轮播图片
* @param int $id
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function uploadSliderImage(int $id)
{
//查询附件分类
/** @var SystemAttachmentCategoryServices $systemAttachmentCategoryService */
$systemAttachmentCategoryService = app()->make(SystemAttachmentCategoryServices::class);
/** @var StoreProductServices $StoreProductServices */
$StoreProductServices = app()->make(StoreProductServices::class);
/** @var StoreProductAttrValueServices $StoreProductAttrValueServices */
$StoreProductAttrValueServices = app()->make(StoreProductAttrValueServices::class);
$AttachmentCategory = $systemAttachmentCategoryService->getOne(['name' => $this->AttachmentCategoryName]);
//不存在则创建
if (!$AttachmentCategory) $AttachmentCategory = $systemAttachmentCategoryService->save(['pid' => '0', 'name' => $this->AttachmentCategoryName, 'enname' => '']);
//生成附件目录
try {
if (make_path('attach', 3, true) === '')
throw new AdminException('无法创建文件夹,请检查您的上传目录权限:' . app()->getRootPath() . 'public' . DS . 'uploads' . DS . 'attach' . DS);
} catch (\Exception $e) {
throw new AdminException($e->getMessage() . '或无法创建文件夹,请检查您的上传目录权限:' . app()->getRootPath() . 'public' . DS . 'uploads' . DS . 'attach' . DS);
}
$slider_image = $StoreProductServices->value(['id' => $id], 'slider_image');
$slider_image = $slider_image ? json_decode($slider_image, true) : [];
$images = [];
//放入轮播图
foreach ($slider_image as $item) {
$value = ['w' => 640, 'h' => 640, 'line' => $item, 'valuename' => 'slider_image', 'isTwoArray' => true];
array_push($images, $value);
}
$res = $this->uploadImage($images, false, 0, $AttachmentCategory['id']);
if (!is_array($res)) throw new AdminException($this->errorInfo ? $this->errorInfo : '保存图片失败');
if (isset($res['slider_image'])) $slider_images = $res['slider_image'];
if (count($slider_images)) {
$slider_images = array_map(function ($item) {
$item = str_replace('\\', '/', $item);
return $item;
}, $slider_images);
}
$image = $slider_images[0];
$slider_images = $slider_images ? json_encode($slider_images) : '';
$StoreProductServices->update($id, ['slider_image' => $slider_images, 'image' => $image]);
$StoreProductAttrValueServices->update(['product_id' => $id], ['image' => $image]);
return true;
}
// /**
// * 保存数据
// * @param array $data
// * @throws \think\db\exception\DataNotFoundException
// * @throws \think\db\exception\DbException
// * @throws \think\db\exception\ModelNotFoundException
// */
// public function save(array $data)
// {
// $detail = $data['attrs'];
// $attrs = $data['items'];
// $data['spec_type'] = $data['attrs'] ? 1 : 0;
// if (count($detail)) {
// $data['price'] = min(array_column($detail, 'price'));
// $data['ot_price'] = min(array_column($detail, 'ot_price'));
// $data['cost'] = min(array_column($detail, 'cost'));
// $data['stock'] = array_sum(array_column($detail, 'stock'));
// }
// unset($data['attrs'], $data['items'], $data['info']);
// if (!$data['cate_id']) throw new AdminException('请选择分类!');
// if (!$data['store_name']) throw new AdminException('请填写商品名称');
// if (!$data['unit_name']) throw new AdminException('请填写商品单位');
// if (!$data['temp_id']) throw new AdminException('请选择运费模板');
// //查询附件分类
// /** @var SystemAttachmentCategoryServices $systemAttachmentCategoryService */
// $systemAttachmentCategoryService = app()->make(SystemAttachmentCategoryServices::class);
// $AttachmentCategory = $systemAttachmentCategoryService->getOne(['name' => $this->AttachmentCategoryName]);
// //不存在则创建
// if (!$AttachmentCategory) $AttachmentCategory = $systemAttachmentCategoryService->save(['pid' => '0', 'name' => $this->AttachmentCategoryName, 'enname' => '']);
// //生成附件目录
// try {
// if (make_path('attach', 3, true) === '')
// throw new AdminException('无法创建文件夹,请检查您的上传目录权限:' . app()->getRootPath() . 'public' . DS . 'uploads' . DS . 'attach' . DS);
//
// } catch (\Exception $e) {
// throw new AdminException($e->getMessage() . '或无法创建文件夹,请检查您的上传目录权限:' . app()->getRootPath() . 'public' . DS . 'uploads' . DS . 'attach' . DS);
// }
// ini_set("max_execution_time", '600');
// /** @var StoreProductServices $storeProductServices */
// $storeProductServices = app()->make(StoreProductServices::class);
// /** @var StoreDescriptionServices $storeDescriptionServices */
// $storeDescriptionServices = app()->make(StoreDescriptionServices::class);
// /** @var StoreProductCateServices $storeProductCateServices */
// $storeProductCateServices = app()->make(StoreProductCateServices::class);
// /** @var StoreProductAttrServices $storeProductAttrServices */
// $storeProductAttrServices = app()->make(StoreProductAttrServices::class);
// /** @var StoreProductCouponServices $storeProductCouponServices */
// $storeProductCouponServices = app()->make(StoreProductCouponServices::class);
// /** @var StoreCategoryServices $storeCategoryServices */
// $storeCategoryServices = app()->make(StoreCategoryServices::class);
// //开始图片下载处理
// $this->transaction(function () use ($attrs, $detail, $data, $AttachmentCategory, $storeCategoryServices, $storeProductServices, $storeDescriptionServices, $storeProductCateServices, $storeProductAttrServices, $storeProductCouponServices) {
// //放入主图
// $images = [
// ['w' => 305, 'h' => 305, 'line' => $data['image'], 'valuename' => 'image']
// ];
// //放入轮播图
// foreach ($data['slider_image'] as $item) {
// $value = ['w' => 640, 'h' => 640, 'line' => $item, 'valuename' => 'slider_image', 'isTwoArray' => true];
// array_push($images, $value);
// }
// //执行下载
// $res = $this->uploadImage($images, false, 0, $AttachmentCategory['id']);
// if (!is_array($res)) throw new AdminException($this->errorInfo ?: '保存图片失败');
// if (isset($res['image'])) $data['image'] = $res['image'];
// if (isset($res['slider_image'])) $data['slider_image'] = $res['slider_image'];
// $data['image'] = str_replace('\\', '/', $data['image']);
// if (count($data['slider_image'])) {
// $data['slider_image'] = array_map(function ($item) {
// $item = str_replace('\\', '/', $item);
// return $item;
// }, $data['slider_image']);
// }
// $data['slider_image'] = count($data['slider_image']) ? json_encode($data['slider_image']) : '';
// //替换并下载详情里面的图片默认下载全部图片
// $data['description'] = preg_replace('#<style>.*?</style>#is', '', $data['description']);
// $data['description'] = $this->uploadImage($data['description_images'], $data['description'], 1, $AttachmentCategory['id']);
// unset($data['description_images']);
// $description = $data['description'];
// unset($data['description']);
// $data['add_time'] = time();
// $cate_id = $data['cate_id'];
// $data['cate_id'] = implode(',', $data['cate_id']);
// $productInfo = $storeProductServices->getOne(['soure_link' => $data['soure_link']]);
// if ($productInfo) {
// $productInfo->slider_image = $data['slider_image'];
// $productInfo->image = $data['image'];
// $productInfo->store_name = $data['store_name'];
// $res = $storeProductServices->update($productInfo->id, $data);
// if (!$res) throw new AdminException('保存失败');
// $storeDescriptionServices->saveDescription($productInfo->id, $description);
// } else {
// $data['code_path'] = '';
// $data['spu'] = $this->createSpu();
// if ($data['spec_type'] == 0) {
// $attrs = [
// [
// 'value' => '规格',
// 'detailValue' => '',
// 'attrHidden' => '',
// 'detail' => ['默认']
// ]
// ];
// $detail[0]['value1'] = '规格';
// $detail[0]['detail'] = ['规格' => '默认'];
// }
// $res = $storeProductServices->create($data);
// $storeDescriptionServices->saveDescription((int)$res['id'], $description);
// $cateData = [];
// $time = time();
// $cateGory = $storeCategoryServices->getColumn([['id', 'IN', $cate_id]], 'id,pid', 'id');
// foreach ($cate_id as $cid) {
// if ($cid && isset($cateGory[$cid]['pid'])) {
// $cateData[] = ['product_id' => $res['id'], 'cate_id' => $cid, 'cate_pid' => $cateGory[$cid]['pid'], 'status' => $data['is_show'], 'add_time' => $time];
// }
// }
// $storeProductCateServices->change($res['id'], $cateData);
// $skuList = $storeProductServices->validateProductAttr($attrs, $detail, (int)$res['id']);
// $attrRes = $storeProductAttrServices->saveProductAttr($skuList, (int)$res['id'], 0);
// if (!empty($coupon_ids)) $storeProductCouponServices->setCoupon((int)$res['id'], $coupon_ids);
// if (!$attrRes) throw new AdminException('添加失败!');
// }
// });
// }
/**
* 上传图片处理
* @param array $images
@ -599,4 +424,58 @@ class CopyTaobaoServices extends BaseServices
{
return substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8) . str_pad((string)mt_rand(1, 99999), 5, '0', STR_PAD_LEFT);
}
/**
* 下载远程图片并上传
* @param $image
* @return false|mixed|string
* @throws \Exception
*/
public function downloadCopyImage($image)
{
//查询附件分类
/** @var SystemAttachmentCategoryServices $systemAttachmentCategoryService */
$attachmentCategoryService = app()->make(SystemAttachmentCategoryServices::class);
$AttachmentCategory = $attachmentCategoryService->getOne(['name' => '远程下载']);
//不存在则创建
if (!$AttachmentCategory) {
$AttachmentCategory = $systemAttachmentCategoryService->save(['pid' => '0', 'name' => '远程下载', 'enname' => '']);
}
//生成附件目录
if (make_path('attach', 3, true) === '') {
throw new AdminException('无法创建文件夹,请检查您的上传目录权限:' . app()->getRootPath() . 'public' . DS . 'uploads' . DS . 'attach' . DS);
}
//上传图片
/** @var SystemAttachmentServices $systemAttachmentService */
$systemAttachmentService = app()->make(SystemAttachmentServices::class);
$siteUrl = sys_config('site_url');
$uploadValue = $this->downloadImage($image);
if (is_array($uploadValue)) {
//TODO 拼接图片地址
if ($uploadValue['image_type'] == 1) {
$imagePath = $siteUrl . $uploadValue['path'];
} else {
$imagePath = $uploadValue['path'];
}
//写入数据库
if (!$uploadValue['is_exists'] && $AttachmentCategory['id']) {
$systemAttachmentService->save([
'name' => $uploadValue['name'],
'real_name' => $uploadValue['name'],
'att_dir' => $imagePath,
'satt_dir' => $imagePath,
'att_size' => $uploadValue['size'],
'att_type' => $uploadValue['mime'],
'image_type' => $uploadValue['image_type'],
'module_type' => 1,
'time' => time(),
'pid' => $AttachmentCategory['id']
]);
}
return $imagePath;
}
return false;
}
}

View File

@ -13,6 +13,7 @@ namespace app\services\product\product;
use app\dao\product\product\StoreProductDao;
use app\exceptions\CommonException;
use app\Request;
use app\services\activity\advance\StoreAdvanceServices;
use app\services\activity\bargain\StoreBargainServices;
@ -39,6 +40,7 @@ use crmeb\exceptions\AdminException;
use app\jobs\ProductLogJob;
use app\jobs\ProductCopyJob;
use crmeb\services\GroupDataService;
use crmeb\utils\AdminApiErrorCode;
use Lizhichao\Word\VicWord;
use think\exception\ValidateException;
use think\facade\Config;
@ -371,15 +373,13 @@ class StoreProductServices extends BaseServices
$attr = $data['attrs'];
$is_virtual = $data['is_virtual']; //是否虚拟商品
$virtual_type = $data['virtual_type']; //虚拟商品类型
$value = attr_format($attr)[1];
list($value, $head) = attr_format($attr);
$valueNew = [];
$count = 0;
foreach ($value as $key => $item) {
$detail = $item['detail'];
foreach ($detail as $v => $d) {
$detail[$v] = trim($d);
}
$suk = implode(',', $detail);
foreach ($value as $suk) {
$detail = explode(',', $suk);
$types = 1;
if ($id) {
$sukValue = $storeProductAttrValueServices->getColumn(['product_id' => $id, 'type' => 0, 'suk' => $suk], 'bar_code,cost,price,ot_price,stock,image as pic,weight,volume,brokerage,brokerage_two,vip_price,is_virtual,coupon_id,unique,disk_info', 'suk');
@ -423,16 +423,16 @@ class StoreProductServices extends BaseServices
$sukValue[$suk]['brokerage_two'] = 0;
}
if ($types) { //编辑商品时,将没有规格的数据不生成默认值
foreach (array_keys($detail) as $k => $title) {
foreach ($head as $k => $title) {
$header[$k]['title'] = $title;
$header[$k]['align'] = 'center';
$header[$k]['minWidth'] = 130;
}
foreach (array_values($detail) as $k => $v) {
foreach ($detail as $k => $v) {
$valueNew[$count]['value' . ($k + 1)] = $v;
$header[$k]['key'] = 'value' . ($k + 1);
}
$valueNew[$count]['detail'] = $detail;
$valueNew[$count]['detail'] = array_combine($head, $detail);
$valueNew[$count]['pic'] = $sukValue[$suk]['pic'] ?? '';
$valueNew[$count]['price'] = $sukValue[$suk]['price'] ? floatval($sukValue[$suk]['price']) : 0;
$valueNew[$count]['cost'] = $sukValue[$suk]['cost'] ? floatval($sukValue[$suk]['cost']) : 0;
@ -494,9 +494,11 @@ class StoreProductServices extends BaseServices
*/
public function save(int $id, array $data)
{
if (count($data['cate_id']) < 1) throw new AdminException('请选择商品分类');
if (!$data['store_name']) throw new AdminException('请输入商品名称');
if (count($data['slider_image']) < 1) throw new AdminException('请上传商品轮播图');
if (count($data['cate_id']) < 1) throw new CommonException(AdminApiErrorCode::ERR_PLEASE_SELECT_PRODUCT_CATEGORY);
if (!$data['store_name']) throw new CommonException(AdminApiErrorCode::ERR_PLEASE_ENTER_THE_PRODUCT_NAME);
// $data['slider_image'] = [];
if (count($data['slider_image']) < 1) throw new CommonException(AdminApiErrorCode::ERR_PLEASE_UPLOAD_SLIDER_IMAGE);
$detail = $data['attrs'];
$attr = $data['items'];
@ -553,6 +555,7 @@ class StoreProductServices extends BaseServices
}
$data['cate_id'] = implode(',', $data['cate_id']);
$data['label_id'] = implode(',', $data['label_id']);
$slider_image = $data['slider_image'];
$data['image'] = $data['slider_image'][0];
$data['slider_image'] = json_encode($data['slider_image']);
$data['stock'] = array_sum(array_column($detail, 'stock'));
@ -573,7 +576,7 @@ class StoreProductServices extends BaseServices
if (isset($data['description_images'])) {
$descriptionImages = $data['description_images'];
}
$this->transaction(function () use ($id, $is_copy, $data, $descriptionImages, $description, $cate_id, $storeDescriptionServices, $storeProductCateServices, $storeProductAttrServices, $storeProductCouponServices, $storeCategoryServices, $detail, $attr, $coupon_ids, $type) {
$this->transaction(function () use ($id, $is_copy, $data, $descriptionImages, $description, $cate_id, $storeDescriptionServices, $storeProductCateServices, $storeProductAttrServices, $storeProductCouponServices, $storeCategoryServices, $detail, $attr, $coupon_ids, $type, $slider_image) {
if ($data['spec_type'] == 0) {
$attr = [
[
@ -637,11 +640,18 @@ class StoreProductServices extends BaseServices
$attrRes = $storeProductAttrServices->saveProductAttr($skuList, $res->id, 0, $data['is_vip'], $data['virtual_type']);
if (!empty($coupon_ids)) $storeProductCouponServices->setCoupon($res->id, $coupon_ids);
if (!$attrRes) throw new AdminException('添加失败!');
//采集商品下载图片
if ($type == -1) {
//下载商品详情图片
ProductCopyJob::dispatchDo('copyDescriptionImage', [$res->id]);
//下载商品轮播图片
ProductCopyJob::dispatchDo('copySliderImage', [$res->id]);
//下载商品轮播图
foreach ($slider_image as $s_image) {
ProductCopyJob::dispatchDo('copySliderImage', [$res->id, $s_image, count($slider_image)]);
}
preg_match_all('#<img.*?src="([^"]*)"[^>]*>#i', $description, $match);
foreach ($match[1] as $d_image) {
ProductCopyJob::dispatchDo('copyDescriptionImage', [$res->id, $description, $d_image, count($match[1])]);
}
}
}
});
@ -872,24 +882,23 @@ class StoreProductServices extends BaseServices
$attr[$key]['attrHidden'] = true;
$attr[$key]['detail'] = $value['attr_values'];
}
$value = attr_format($attr)[1];
list($value, $head) = attr_format($attr);
$valueNew = [];
$count = 0;
$sukValue = $sukDefaultValue = $storeProductAttrValueServices->getSkuArray(['product_id' => $id, 'type' => 0]);
foreach ($value as $key => $item) {
$detail = $item['detail'];
$suk = implode(',', $item['detail']);
foreach ($value as $suk) {
$detail = explode(',', $suk);
if (!isset($sukDefaultValue[$suk])) continue;
foreach (array_keys($detail) as $k => $title) {
foreach ($head as $k => $title) {
$header[$k]['title'] = $title;
$header[$k]['align'] = 'center';
$header[$k]['minWidth'] = 80;
}
foreach (array_values($detail) as $k => $v) {
foreach ($detail as $k => $v) {
$valueNew[$count]['value' . ($k + 1)] = $v;
$header[$k]['key'] = 'value' . ($k + 1);
}
$valueNew[$count]['detail'] = $detail;
$valueNew[$count]['detail'] = array_combine($head, $detail);
$valueNew[$count]['pic'] = $sukValue[$suk]['pic'];
$valueNew[$count]['price'] = floatval($sukValue[$suk]['price']);
if ($type == 2) $valueNew[$count]['min_price'] = 0;
@ -920,7 +929,7 @@ class StoreProductServices extends BaseServices
$header[] = ['title' => '成本价', 'key' => 'cost', 'align' => 'center', 'minWidth' => 80];
$header[] = ['title' => '日常售价', 'key' => 'r_price', 'align' => 'center', 'minWidth' => 80];
} elseif ($type == 4) {
$header[] = ['title' => '兑换积分', 'slot' => 'price', 'align' => 'center', 'minWidth' => 80];
$header[] = ['title' => '兑换积分', 'key' => 'price', 'type' => 1, 'align' => 'center', 'minWidth' => 80];
} elseif ($type == 6) {
$header[] = ['title' => '预售价', 'key' => 'price', 'type' => 1, 'align' => 'center', 'minWidth' => 80];
$header[] = ['title' => '成本价', 'key' => 'cost', 'align' => 'center', 'minWidth' => 80];
@ -1257,7 +1266,7 @@ class StoreProductServices extends BaseServices
$storeInfo['userCollect'] = $storeProductRelationServices->isProductRelation(['uid' => $uid, 'product_id' => $id, 'type' => 'collect', 'category' => 'product']);
$storeInfo['userLike'] = false;
$storeInfo['small_image'] = $storeInfo['image'];
$storeInfo = get_thumb_water($storeInfo, 'big', ['image', 'slider_image', 'small_image']);
$storeInfo = get_thumb_water($storeInfo, 'small', ['small_image']);
//预售相关
if ($storeInfo['presale']) {
@ -1321,6 +1330,7 @@ class StoreProductServices extends BaseServices
/** @var MemberCardServices $memberCardService */
$memberCardService = app()->make(MemberCardServices::class);
$data['svip_open'] = $vipStatus = $memberCardService->isOpenMemberCard('vip_price');
$data['svip_price_open'] = (int)sys_config('member_price_status');
$data['storeInfo']['svip_economize_price'] = bcsub((string)$data['storeInfo']['price'], (string)$data['storeInfo']['vip_price'], 2);
if (!$this->vipIsOpen(!!$storeInfo['is_vip'], $vipStatus)) {
$data['storeInfo']['vip_price'] = 0;
@ -1658,7 +1668,7 @@ class StoreProductServices extends BaseServices
* @param string $type
* @return array[]
*/
public function getRecommendProductArr(int $uid, array $fields, bool $is_num = true, string $type = 'small')
public function getRecommendProductArr(int $uid, array $fields, bool $is_num = true, string $type = 'mid')
{
$baseList = $firstList = $benefitList = $hotList = $vipList = [];
$data = [$baseList, $firstList, $benefitList, $hotList, $vipList];
@ -1746,7 +1756,7 @@ class StoreProductServices extends BaseServices
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getRecommendProduct(int $uid, $field, int $num = 0, string $type = 'small')
public function getRecommendProduct(int $uid, $field, int $num = 0, string $type = 'mid')
{
[$page, $limit] = $this->getPageValue();
$where['vip_user'] = $uid ? app()->make(UserServices::class)->value(['uid' => $uid], 'is_money_level') : 0;

View File

@ -48,7 +48,7 @@ class LoginServices extends BaseServices
*/
public function login($account, $password, $spread)
{
$user = $this->dao->getOne(['account|phone' => $account]);
$user = $this->dao->getOne(['account|phone' => $account, 'is_del' => 0]);
if ($user) {
if ($user->pwd !== md5((string)$password))
throw new ValidateException('账号或密码错误');
@ -156,7 +156,7 @@ class LoginServices extends BaseServices
public function verify(SmsSendServices $services, $phone, $type, $time, $ip)
{
if ($this->dao->getOne(['account' => $phone]) && $type == 'register') {
if ($this->dao->getOne(['account' => $phone, 'is_del' => 0]) && $type == 'register') {
throw new ValidateException('手机号已注册');
}
$default = Config::get('sms.default', 'yunxin');
@ -190,7 +190,7 @@ class LoginServices extends BaseServices
*/
public function register($account, $password, $spread, $user_type = 'h5')
{
if ($this->dao->getOne(['account|phone' => $account])) {
if ($this->dao->getOne(['account|phone' => $account, 'is_del' => 0])) {
throw new ValidateException('用户已存在,请去修改密码');
}
$phone = $account;
@ -236,7 +236,7 @@ class LoginServices extends BaseServices
*/
public function reset($account, $password)
{
$user = $this->dao->getOne(['account|phone' => $account]);
$user = $this->dao->getOne(['account|phone' => $account, 'is_del' => 0]);
if (!$user) {
throw new ValidateException('用户不存在');
}
@ -258,7 +258,7 @@ class LoginServices extends BaseServices
public function mobile($phone, $spread, $user_type = 'h5')
{
//数据库查询
$user = $this->dao->getOne(['phone' => $phone]);
$user = $this->dao->getOne(['phone' => $phone, 'is_del' => 0]);
if (!$user) {
$user = $this->register($phone, '123456', $spread, $user_type);
if (!$user) {
@ -288,11 +288,11 @@ class LoginServices extends BaseServices
public function switchAccount($user, $from)
{
if ($from === 'h5') {
$where = [['phone', '=', $user['phone']], ['user_type', '<>', 'h5']];
$where = [['phone', '=', $user['phone']], ['user_type', '<>', 'h5'], ['is_del', '=', 0]];
$login_type = 'wechat';
} else {
//数据库查询
$where = [['account|phone', '=', $user['phone']], ['user_type', '=', 'h5']];
$where = [['account|phone', '=', $user['phone']], ['user_type', '=', 'h5'], ['is_del', '=', 0]];
$login_type = 'h5';
}
$switch_user = $this->dao->getOne($where);
@ -359,14 +359,14 @@ class LoginServices extends BaseServices
if (!$userInfo) {
throw new ValidateException('用户不存在');
}
if ($this->dao->getOne([['phone', '=', $phone], ['user_type', '<>', 'h5']])) {
if ($this->dao->getOne([['phone', '=', $phone], ['user_type', '<>', 'h5'], ['is_del', '=', 0]])) {
throw new ValidateException('此手机已经绑定,无法多次绑定!');
}
if ($userInfo->phone) {
throw new ValidateException('您的账号已经绑定过手机号码!');
}
$data = [];
if ($this->dao->getOne(['account' => $phone, 'phone' => $phone, 'user_type' => 'h5'])) {
if ($this->dao->getOne(['account' => $phone, 'phone' => $phone, 'user_type' => 'h5', 'is_del' => 0])) {
if (!$step) return ['msg' => 'H5已有账号是否绑定此账号上', 'data' => ['is_bind' => 1]];
} else {
$data['account'] = $phone;
@ -387,14 +387,14 @@ class LoginServices extends BaseServices
*/
public function updateBindindPhone(int $uid, $phone)
{
$userInfo = $this->dao->get($uid);
$userInfo = $this->dao->get(['uid' => $uid, 'is_del' => 0]);
if (!$userInfo) {
throw new ValidateException('用户不存在');
}
if ($userInfo->phone == $phone) {
throw new ValidateException('新手机号和原手机号相同,无需修改');
}
if ($this->dao->getOne([['phone', '=', $phone]])) {
if ($this->dao->getOne([['phone', '=', $phone], ['is_del', '=', 0]])) {
throw new ValidateException('此手机已经注册');
}
$data = [];

View File

@ -68,7 +68,7 @@ class UserAuthServices extends BaseServices
throw new AuthException('登录已过期,请重新登录', 410001);
}
$user = $this->dao->get($id);
$user = $this->dao->get(['uid' => $id, 'is_del' => 0]);
if (!$user || $user->uid != $tokenData['uid']) {
if (!request()->isCli()) CacheService::clearToken($md5Token);

View File

@ -1191,7 +1191,7 @@ class UserBillServices extends BaseServices
$time = [];
$where = ['paid' => 1, 'type' => 1, 'spread_or_uid' => $uid, 'pid' => 0];
$list = $storeOrderServices->getlist($where, ['id,order_id,uid,add_time,spread_uid,status,spread_two_uid,one_brokerage,two_brokerage,pay_price,pid'], $page, $limit, ['split']);
$result['count'] = $storeOrderServices->count($where + ['pid' => 0]);
$result['count'] = $storeOrderServices->count($where);
$time_data = [];
if ($list) {
$uids = array_unique(array_column($list, 'uid'));
@ -1240,4 +1240,60 @@ class UserBillServices extends BaseServices
return $this->dao->getGroupField($where, $rechargeSumField, $group);
}
}
/**
* 事业部/代理商订单
* @param $uid
* @return array
*/
public function divisionOrder($uid)
{
/** @var UserServices $userService */
$userService = app()->make(UserServices::class);
/** @var StoreOrderServices $storeOrderServices */
$storeOrderServices = app()->make(StoreOrderServices::class);
$userInfo = $userService->getUserInfo($uid);
if (!$userInfo) {
throw new ValidateException('数据不存在');
}
$division_type = $userInfo['division_type'];
[$page, $limit] = $this->getPageValue();
$where = ['paid' => 1, 'type' => 1, 'pid' => 0];
if ($division_type == 1) {
$where = $where + ['division_id' => $uid];
} elseif ($division_type == 2) {
$where = $where + ['agent_id' => $uid];
}
$list = $storeOrderServices->getlist($where, ['id,order_id,uid,add_time,spread_uid,division_id,agent_id,status,spread_two_uid,one_brokerage,two_brokerage,agent_brokerage,division_brokerage,pay_price,pid'], $page, $limit, ['split']);
$result['count'] = $storeOrderServices->count($where);
$time_data = [];
if ($list) {
$uids = array_unique(array_column($list, 'uid'));
$userInfos = $userService->getColumn([['uid', 'in', $uids]], 'uid,avatar,nickname', 'uid');
foreach ($list as &$item) {
$item['avatar'] = $userInfos[$item['uid']]['avatar'] ?? '';
$item['nickname'] = $userInfos[$item['uid']]['nickname'] ?? '';
$item['time'] = $item['add_time'] ? date('Y-m-d H:i', $item['add_time']) : '';
$item['time_key'] = $item['add_time'] ? date('Y-m', $item['add_time']) : '';
$item['type'] = in_array($item['status'], [2, 3]) ? 'brokerage' : 'number';
if ($division_type == 1) {
$item['number'] = $item['division_brokerage'];
} elseif ($division_type == 2) {
$item['number'] = $item['agent_brokerage'];
}
}
$times = array_unique(array_column($list, 'time_key'));
$time_data = [];
$i = 0;
foreach ($times as $time) {
$time_data[$i]['time'] = $time;
$time_data[$i]['count'] = $storeOrderServices->getMonthCount($where + ['pid' => 0], $time);
$i++;
}
}
$result['list'] = $list;
$result['time'] = $time_data;
return $result;
}
}

View File

@ -0,0 +1,66 @@
<?php
namespace app\services\user;
use app\dao\user\UserCancelDao;
use app\services\BaseServices;
use app\services\wechat\WechatUserServices;
use crmeb\services\CacheService;
class UserCancelServices extends BaseServices
{
protected $status = ['待审核', '已通过', '已拒绝'];
/**
* UserExtractServices constructor.
* @param UserCancelDao $dao
*/
public function __construct(UserCancelDao $dao)
{
$this->dao = $dao;
}
/**
* 提交用户注销
* @param $userInfo
* @return mixed
*/
public function SetUserCancel($uid)
{
/** @var UserServices $userServices */
$userServices = app()->make(UserServices::class);
/** @var WechatUserServices $wechatUserServices */
$wechatUserServices = app()->make(WechatUserServices::class);
$userServices->update($uid, ['is_del' => 1]);
$wechatUserServices->update(['uid' => $uid], ['is_del' => 1]);
}
/**
* 获取注销列表
* @param $where
* @return array
*/
public function getCancelList($where)
{
[$page, $limit] = $this->getPageValue();
$list = $this->dao->getList($where, $page, $limit);
foreach ($list as &$item) {
$item['add_time'] = date('Y-m-d H:i:s', $item['add_time']);
$item['up_time'] = $item['up_time'] != 0 ? date('Y-m-d H:i:s', $item['add_time']) : '';
$item['status'] = $this->status[$item['status']];
}
$count = $this->dao->count($where);
return compact('list', 'count');
}
/**
* 备注
* @param $id
* @param $mark
* @return mixed
*/
public function serMark($id, $mark)
{
return $this->dao->update($id, ['remark' => $mark]);
}
}

View File

@ -203,7 +203,7 @@ class WechatUserServices extends BaseServices
{
$user = [];
//兼容老用户
$uids = $this->dao->getColumn(['unionid|openid' => $openid], 'uid,user_type', 'user_type');
$uids = $this->dao->getColumn(['unionid|openid' => $openid, 'is_del' => 0], 'uid,user_type', 'user_type');
if ($uids) {
$uid = $uids[$user_type]['uid'] ?? 0;
if (!$uid) {
@ -303,13 +303,13 @@ class WechatUserServices extends BaseServices
$userInfo = [];
$uid = 0;
if (isset($wechatInfo['phone']) && $wechatInfo['phone']) {
$userInfo = $userServices->getOne(['phone' => $wechatInfo['phone']]);
$userInfo = $userServices->getOne(['phone' => $wechatInfo['phone'], 'is_del' => 0]);
}
if (!$userInfo) {
if (isset($wechatInfo['unionid']) && $wechatInfo['unionid']) {
$uid = $this->dao->value(['unionid' => $wechatInfo['unionid']], 'uid');
$uid = $this->dao->value(['unionid' => $wechatInfo['unionid'], 'is_del' => 0], 'uid');
if ($uid) {
$userInfo = $userServices->getOne(['uid' => $uid]);
$userInfo = $userServices->getOne(['uid' => $uid, 'is_del' => 0]);
}
} else {
$userInfo = $this->getAuthUserInfo($openid, $userType);
@ -323,7 +323,7 @@ class WechatUserServices extends BaseServices
if ($userInfo) {
//更新用户表和wechat_user表
//判断该类性用户在wechatUser中是否存在
$wechatUser = $this->dao->getOne(['uid' => $uid, 'user_type' => $userType]);
$wechatUser = $this->dao->getOne(['uid' => $uid, 'user_type' => $userType, 'is_del' => 0]);
/** @var LoginServices $loginService */
$loginService = app()->make(LoginServices::class);
$this->transaction(function () use ($loginService, $wechatInfo, $userInfo, $uid, $userType, $spreadId, $wechatUser) {
@ -410,4 +410,16 @@ class WechatUserServices extends BaseServices
}
return $noBeOpenids;
}
/**
* 用户关注
* @param $openid
* @return bool
*/
public function subscribe($openid): bool
{
if (!$this->dao->update($openid, ['subscribe' => 1, 'subscribe_time' => time()], 'openid'))
throw new AdminException('用户关注失败');
return true;
}
}

147
crmeb/baota.sh Normal file
View File

@ -0,0 +1,147 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
php_version='74'
mysql_version='5.7'
redis_version='6.2'
action_type='install'
root_path=$(cat /var/bt_setupPath.conf)
setup_path=$root_path/server
#宝塔是否已安装
if [ -z "$root_path" ]; then
echo "请先安装宝塔"
exit 1
fi
#nginx是否已安装
if [ ! -f "${setup_path}/nginx/sbin/nginx" ]; then
echo "请先安装nginx并配置网站"
exit 1
fi
#安装php
php_install=1
for phpVer in 71 72 73 74; do
if [ -d "${setup_path}/php/${phpVer}/bin" ]; then
php_version=${phpVer}
php_install=0
fi
done
if [ $php_install == 1 ]; then
. ${setup_path}/panel/install/install_soft.sh 1 $action_type php $php_version
fi
case "${php_version}" in
'71')
extFile="${setup_path}/php/71/lib/php/extensions/no-debug-non-zts-20160303"
;;
'72')
extFile="${setup_path}/php/72/lib/php/extensions/no-debug-non-zts-20170718"
;;
'73')
extFile="${setup_path}/php/73/lib/php/extensions/no-debug-non-zts-20180731"
;;
'74')
extFile="${setup_path}/php/74/lib/php/extensions/no-debug-non-zts-20190902"
;;
esac
#安装mysql
if [ ! -d "${setup_path}/mysql" ]; then
. ${setup_path}/panel/install/install_soft.sh 1 $action_type mysql $mysql_version
fi
#安装redis
if [ ! -d "${setup_path}/redis" ]; then
. ${setup_path}/panel/install/install_soft.sh 0 $action_type redis $redis_version
fi
#安装php-redis 插件
if [ ! -e "${extFile}/redis.so" ]; then
. ${setup_path}/panel/install/install_soft.sh 1 $action_type redis $php_version
fi
#安装php-swoole 插件
if [ ! -e "${extFile}/swoole.so" ]; then
. ${setup_path}/panel/install/install_soft.sh 1 $action_type swoole4 $php_version
fi
#pcntl_signal pcntl_signal_dispatch pcntl_fork pcntl_wait pcntl_alarm 禁用函数删除
sed -i 's/,proc_open//' ${setup_path}/php/$php_version/etc/php.ini
#安装php-fileinfo 插件
if [ ! -e "${extFile}/fileinfo.so" ]; then
. ${setup_path}/panel/install/install_soft.sh 1 $action_type fileinfo $php_version
fi
#修改nginx配置
project_path=$(cd `dirname $0`; pwd)
project_name="${project_path##*/}"
if [ -e "${setup_path}/panel/vhost/nginx/${project_name}.conf" ]; then
echo -e "
server
{
listen 80;
server_name ${project_name};
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/${project_name}/public;
#SSL-START SSL相关配置请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
#SSL-END
#ERROR-PAGE-START 错误页配置,可以注释、删除或修改
#error_page 404 /404.html;
#error_page 502 /502.html;
#ERROR-PAGE-END
#PHP-INFO-START PHP引用配置可以注释或修改
#清理缓存规则
location ~ /purge(/.*) {
proxy_cache_purge cache_one \$host\$1\$is_args\$args;
}
#引用反向代理规则,注释后配置的反向代理将无效
location /notice {
proxy_pass http://127.0.0.1:20002/;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-real-ip \$remote_addr;
proxy_set_header X-Forwarded-For \$remote_addr;
}
#提示v4.3.0 以前版本,可不用配置一下代码
location /msg {
proxy_pass http://127.0.0.1:20003/;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-real-ip \$remote_addr;
proxy_set_header X-Forwarded-For \$remote_addr;
}
include enable-php-00.conf;
#PHP-INFO-END
#REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
include ${setup_path}/panel/vhost/rewrite/${project_name}.conf;
#REWRITE-END
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
access_log /www/wwwlogs/${project_name}.log;
error_log /www/wwwlogs/${project_name}.error.log;
}
" > ${setup_path}/panel/vhost/nginx/${project_name}.conf
fi
echo ''
# 操作说明,进入程序根目录运行 /bin/bash baota.sh

View File

@ -33,6 +33,7 @@ return [
'application/vnd.ms-excel',
'text/xml',
'image/x-icon',
'image/vnd.microsoft.icon',
],
//驱动模式
'stores' => [

View File

@ -57,7 +57,7 @@ class Timer extends Command
protected function execute(Input $input, Output $output)
{
$this->init($input, $output);
Worker::$pidFile = app()->getRootPath().'timer.pid';
Worker::$pidFile = app()->getRootPath().'runtime/timer.pid';
$task = new Worker();
$task->count = 1;
event('Task_6');

View File

@ -102,7 +102,7 @@ class Workerman extends Command
} else {
$context = [];
}
Worker::$pidFile = app()->getRootPath() . 'workerman.pid';
Worker::$pidFile = app()->getRootPath() . 'runtime/workerman.pid';
if (!$server || $server == 'admin') {
var_dump('admin');
//创建 admin 长连接服务

View File

@ -589,14 +589,12 @@ class CopyProductService
*/
public static function formatAttr(array $attr, array $sku = [])
{
$value = attr_format($attr)[1];
list($value, $head) = attr_format($attr);
$valueNew = [];
$count = 0;
foreach ($value as $key => $item) {
$detail = $item['detail'];
// sort($item['detail'], SORT_STRING);
$suk = implode(',', $item['detail']);
foreach ($value as $suk) {
$detail = explode(',', $suk);
$sukValue[$suk]['pic'] = '';
$sukValue[$suk]['price'] = $sku[$suk]['price'] ?? 0;
@ -609,18 +607,18 @@ class CopyProductService
$sukValue[$suk]['brokerage'] = 0;
$sukValue[$suk]['brokerage_two'] = 0;
foreach (array_keys($detail) as $k => $title) {
foreach ($head as $k => $title) {
if ($title == '') continue;
$header[$k]['title'] = $title;
$header[$k]['align'] = 'center';
$header[$k]['minWidth'] = 120;
}
foreach (array_values($detail) as $k => $v) {
foreach ($detail as $k => $v) {
if ($v == '') continue;
$valueNew[$count]['value' . ($k + 1)] = $v;
$header[$k]['key'] = 'value' . ($k + 1);
}
$valueNew[$count]['detail'] = $detail;
$valueNew[$count]['detail'] = array_combine($head, $detail);
$valueNew[$count]['pic'] = $sukValue[$suk]['pic'] ?? '';
$valueNew[$count]['price'] = $sukValue[$suk]['price'] ? floatval($sukValue[$suk]['price']) : 0;
$valueNew[$count]['cost'] = $sukValue[$suk]['cost'] ? floatval($sukValue[$suk]['cost']) : 0;

View File

@ -0,0 +1,44 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace crmeb\utils;
/**
* AdminApi错误码统一存放类
* Class AdminApiErrorCode
* @package crmeb\utils
*/
class AdminApiErrorCode
{
// 商品相关
/** 请选择商品分类 Please select product category 411001 */
const ERR_PLEASE_SELECT_PRODUCT_CATEGORY = [411001, 'product.Please select product category'];
/** 请输入商品名称 Please enter the product name* code:411002 */
const ERR_PLEASE_ENTER_THE_PRODUCT_NAME = 'product.Please enter the product name';
/** 请上传商品轮播图 Please upload the slide image code:411003 */
const ERR_PLEASE_UPLOAD_SLIDER_IMAGE = 'product.Please upload the slide image';
public static $code = [
'product.Please enter the product name' => 411002,
'product.Please upload the slide image' => 411003,
];
public static function getCode($msg = ''): int
{
if (isset(self::$code[$msg])) {
return self::$code[$msg];
}
return 0;
}
}

View File

@ -95,7 +95,7 @@ class JwtAuth
{
$tokenInfo = $this->getToken($id, $type, $params);
$exp = $tokenInfo['params']['exp'] - $tokenInfo['params']['iat'] + 60;
$res = CacheService::setTokenBucket(md5($tokenInfo['token']), ['uid' => $id, 'type' => $type, 'token' => $tokenInfo['token'], 'exp' => $exp], (int)$exp);
$res = CacheService::setTokenBucket(md5($tokenInfo['token']), ['uid' => $id, 'type' => $type, 'token' => $tokenInfo['token'], 'exp' => $exp], (int)$exp, $type);
if (!$res) {
throw new AdminException(ApiErrorCode::ERR_SAVE_TOKEN);
}

View File

@ -1 +0,0 @@
[data-v-03a82876] .ivu-modal{top:20%!important}[data-v-03a82876] .ivu-input{width:80px}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.v-transfer-dom[data-v-7423233c] .ivu-modal-content-drag{z-index:2!important}.radio[data-v-7423233c]{margin-bottom:14px}.radio[data-v-7423233c] .name{width:125px;text-align:right;padding-right:12px}.tabBox_img[data-v-38800620]{width:36px;height:36px;border-radius:4px;cursor:pointer}.tabBox_img img[data-v-38800620]{width:100%;height:100%}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.agreemant[data-v-6419a52d]{background-color:#fff;padding:5px 15px;margin-top:10px}.content[data-v-6419a52d]{padding:10px 0}.ifam[data-v-6419a52d]{width:344px;height:644px;background:url(../img/ag-phone.596fa229.png) no-repeat top;background-size:344px 644px;padding:40px 20px;padding-top:50px;margin:0 auto 0 20px}.ifam .content[data-v-6419a52d]{height:560px;overflow:hidden;scrollbar-width:none;-ms-overflow-style:none;overflow-x:hidden;overflow-y:auto}.ifam .content[data-v-6419a52d]::-webkit-scrollbar{display:none}.new_tab[data-v-6419a52d] .ivu-tabs-nav .ivu-tabs-tab{padding:4px 16px 20px!important;font-weight:500}.fixed-card[data-v-6419a52d]{position:fixed;right:0;bottom:0;left:200px;z-index:99;-webkit-box-shadow:0 -1px 2px #f0f0f0;box-shadow:0 -1px 2px #f0f0f0}.fixed-card[data-v-6419a52d] .ivu-card-body{padding:15px 16px 14px}.fixed-card .ivu-form-item[data-v-6419a52d]{margin-bottom:0}.fixed-card[data-v-6419a52d] .ivu-form-item-content{margin-right:124px;text-align:center}

View File

@ -0,0 +1 @@
[data-v-38c96e62] .ivu-modal{top:20%!important}[data-v-38c96e62] .ivu-input{width:80px}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.code[data-v-2e1f47ea]{position:relative}.QRpic[data-v-2e1f47ea]{width:180px}.QRpic img[data-v-2e1f47ea]{width:100%;height:100%}

View File

@ -1 +0,0 @@
.code[data-v-12259c8c]{position:relative}.QRpic[data-v-12259c8c]{width:180px;height:259px}.QRpic img[data-v-12259c8c]{width:100%;height:100%}

View File

@ -1 +1 @@
.maxInpt[data-v-630cb3d6]{max-width:400px;margin-left:auto;margin-right:auto}.page-account-container[data-v-630cb3d6]{text-align:center;padding:50px 0}.page-account-top[data-v-630cb3d6]{margin-bottom:20px}.page-account-top-tit[data-v-630cb3d6]{font-size:21px;color:#1890ff}.page-account-other[data-v-630cb3d6]{text-align:center;color:#1890ff;font-size:12px}.page-account-other span[data-v-630cb3d6]{cursor:pointer}.maxInpt[data-v-58825f81]{max-width:400px;margin-left:auto;margin-right:auto}.code[data-v-58825f81]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.ivu-steps-item[data-v-58825f81]:last-child{width:unset!important}.maxInpt[data-v-71c6eb4b]{max-width:400px;margin-left:auto;margin-right:auto}.page-account-container[data-v-71c6eb4b]{text-align:center;padding:50px 0}.page-account-top[data-v-71c6eb4b]{margin-bottom:20px}.page-account-top-tit[data-v-71c6eb4b]{font-size:21px;color:#1890ff}.page-account-other[data-v-71c6eb4b]{text-align:center;color:#1890ff;font-size:12px}.page-account-other span[data-v-71c6eb4b]{cursor:pointer}.code[data-v-71c6eb4b]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.order_box[data-v-2c400d64] .ivu-form-item-content{margin-left:50px!important}.maxInpt[data-v-2c400d64]{max-width:400px;margin-left:auto;margin-right:auto}.smsBox .page-account-top[data-v-2c400d64]{text-align:center;margin:70px 0 30px 0}.note[data-v-2c400d64]{margin-top:15px}.tempId[data-v-2c400d64],.tempImg[data-v-2c400d64]{cursor:pointer;margin-left:11px;color:#1890ff}.tabBox_img[data-v-2c400d64]{opacity:0;width:38px;height:30px;margin-top:-30px;cursor:pointer}.tabBox_img img[data-v-2c400d64]{width:100%;height:100%}.width9[data-v-2c400d64]{width:90%}.width10[data-v-2c400d64],.wuBox[data-v-2c400d64]{width:100%}.wuSp1[data-v-2c400d64]{display:block;text-align:center;color:#000;font-size:21px;font-weight:500;line-height:32px;margin-top:23px;margin-bottom:5px}.wuSp2[data-v-2c400d64]{opacity:1%;font-weight:400;color:#000;line-height:22px;margin-bottom:30px}.page-account-top-tit[data-v-2c400d64]{font-size:21px;color:#1890ff}.wuTu[data-v-2c400d64]{width:295px;height:164px;margin-top:54px}.wuTu img[data-v-2c400d64]{width:100%;height:100%}.wuTu+span[data-v-2c400d64]{margin-bottom:20px}@aaa .ivu-form-item-content{text-align:left!important}.maxInpt[data-v-46634686]{max-width:400px;margin-left:auto;margin-right:auto}.code[data-v-46634686]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.picTxt[data-v-e8e198e2]{padding:8px 0 12px}.dashboard[data-v-e8e198e2]{width:auto!important;min-width:300px}.header-extra[data-v-e8e198e2]{border-right:1px solid #e9e9e9;text-align:center;padding:0 18px}.page-account-top-tit[data-v-e8e198e2]{font-size:21px;color:#1890ff}.dashboard-workplace-header-avatar[data-v-e8e198e2]{width:64px;height:64px;border-radius:50%;margin-right:16px}.dashboard-workplace-header-tip[data-v-e8e198e2]{display:inline-block;vertical-align:middle}.dashboard-workplace-header-tip-title[data-v-e8e198e2]{font-size:20px;font-weight:700;margin-bottom:12px}.dashboard-workplace-header-tip-desc[data-v-e8e198e2]{color:#808695}.dashboard-workplace-header-extra[data-v-e8e198e2]{width:100%!important}.dashboard-workplace-header-extra .ivu-col p[data-v-e8e198e2]{text-align:right}.dashboard-workplace-header-extra .ivu-col p:first-child span[data-v-e8e198e2]:first-child{margin-right:4px}.dashboard-workplace-header-extra .ivu-col p:first-child span[data-v-e8e198e2]:last-child{color:#808695}.dashboard-workplace-header-extra .ivu-col p[data-v-e8e198e2]:last-child{font-size:22px}.conBox[data-v-e8e198e2] .ivu-page-header-extra{width:auto!important;min-width:457px}.conBox[data-v-e8e198e2] .ivu-page-header{padding:16px 0 0 32px!important}.samll_font[data-v-e8e198e2]{text-align:center;padding:0 10px}
.maxInpt[data-v-630cb3d6]{max-width:400px;margin-left:auto;margin-right:auto}.page-account-container[data-v-630cb3d6]{text-align:center;padding:50px 0}.page-account-top[data-v-630cb3d6]{margin-bottom:20px}.page-account-top-tit[data-v-630cb3d6]{font-size:21px;color:#1890ff}.page-account-other[data-v-630cb3d6]{text-align:center;color:#1890ff;font-size:12px}.page-account-other span[data-v-630cb3d6]{cursor:pointer}.maxInpt[data-v-58825f81]{max-width:400px;margin-left:auto;margin-right:auto}.code[data-v-58825f81]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.ivu-steps-item[data-v-58825f81]:last-child{width:unset!important}.maxInpt[data-v-603c7feb]{max-width:400px;margin-left:auto;margin-right:auto}.page-account-container[data-v-603c7feb]{text-align:center;padding:50px 0}.page-account-top[data-v-603c7feb]{margin-bottom:20px}.page-account-top-tit[data-v-603c7feb]{font-size:21px;color:#1890ff}.page-account-other[data-v-603c7feb]{text-align:center;color:#1890ff;font-size:12px}.page-account-other span[data-v-603c7feb]{cursor:pointer}.code[data-v-603c7feb]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.order_box[data-v-2c400d64] .ivu-form-item-content{margin-left:50px!important}.maxInpt[data-v-2c400d64]{max-width:400px;margin-left:auto;margin-right:auto}.smsBox .page-account-top[data-v-2c400d64]{text-align:center;margin:70px 0 30px 0}.note[data-v-2c400d64]{margin-top:15px}.tempId[data-v-2c400d64],.tempImg[data-v-2c400d64]{cursor:pointer;margin-left:11px;color:#1890ff}.tabBox_img[data-v-2c400d64]{opacity:0;width:38px;height:30px;margin-top:-30px;cursor:pointer}.tabBox_img img[data-v-2c400d64]{width:100%;height:100%}.width9[data-v-2c400d64]{width:90%}.width10[data-v-2c400d64],.wuBox[data-v-2c400d64]{width:100%}.wuSp1[data-v-2c400d64]{display:block;text-align:center;color:#000;font-size:21px;font-weight:500;line-height:32px;margin-top:23px;margin-bottom:5px}.wuSp2[data-v-2c400d64]{opacity:1%;font-weight:400;color:#000;line-height:22px;margin-bottom:30px}.page-account-top-tit[data-v-2c400d64]{font-size:21px;color:#1890ff}.wuTu[data-v-2c400d64]{width:295px;height:164px;margin-top:54px}.wuTu img[data-v-2c400d64]{width:100%;height:100%}.wuTu+span[data-v-2c400d64]{margin-bottom:20px}@aaa .ivu-form-item-content{text-align:left!important}.maxInpt[data-v-46634686]{max-width:400px;margin-left:auto;margin-right:auto}.code[data-v-46634686]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.picTxt[data-v-e8e198e2]{padding:8px 0 12px}.dashboard[data-v-e8e198e2]{width:auto!important;min-width:300px}.header-extra[data-v-e8e198e2]{border-right:1px solid #e9e9e9;text-align:center;padding:0 18px}.page-account-top-tit[data-v-e8e198e2]{font-size:21px;color:#1890ff}.dashboard-workplace-header-avatar[data-v-e8e198e2]{width:64px;height:64px;border-radius:50%;margin-right:16px}.dashboard-workplace-header-tip[data-v-e8e198e2]{display:inline-block;vertical-align:middle}.dashboard-workplace-header-tip-title[data-v-e8e198e2]{font-size:20px;font-weight:700;margin-bottom:12px}.dashboard-workplace-header-tip-desc[data-v-e8e198e2]{color:#808695}.dashboard-workplace-header-extra[data-v-e8e198e2]{width:100%!important}.dashboard-workplace-header-extra .ivu-col p[data-v-e8e198e2]{text-align:right}.dashboard-workplace-header-extra .ivu-col p:first-child span[data-v-e8e198e2]:first-child{margin-right:4px}.dashboard-workplace-header-extra .ivu-col p:first-child span[data-v-e8e198e2]:last-child{color:#808695}.dashboard-workplace-header-extra .ivu-col p[data-v-e8e198e2]:last-child{font-size:22px}.conBox[data-v-e8e198e2] .ivu-page-header-extra{width:auto!important;min-width:457px}.conBox[data-v-e8e198e2] .ivu-page-header{padding:16px 0 0 32px!important}.samll_font[data-v-e8e198e2]{text-align:center;padding:0 10px}

View File

@ -0,0 +1 @@
.custom-label[data-v-77cb65f8]{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;line-height:1.5}.grey[data-v-77cb65f8]{color:#999}.maxW[data-v-77cb65f8] .ivu-select-dropdown{max-width:600px}.tabBox_img[data-v-77cb65f8]{width:50px;height:50px;margin:0 auto}.tabBox_img img[data-v-77cb65f8]{width:100%;height:100%}.priceBox[data-v-77cb65f8]{width:100%}.form .picBox[data-v-77cb65f8],.form .pictrue[data-v-77cb65f8]{display:inline-block;cursor:pointer}.form .pictrue[data-v-77cb65f8]{width:60px;height:60px;border:1px dotted rgba(0,0,0,.1);margin-right:15px;position:relative}.form .pictrue img[data-v-77cb65f8]{width:100%;height:100%}.form .pictrue .btndel[data-v-77cb65f8]{position:absolute;z-index:9;width:20px!important;height:20px!important;left:46px;top:-4px}.form .upLoad[data-v-77cb65f8]{width:58px;height:58px;line-height:58px;border:1px dotted rgba(0,0,0,.1);border-radius:4px;background:rgba(0,0,0,.02);cursor:pointer}

View File

@ -1 +0,0 @@
.custom-label[data-v-217c7c25]{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;line-height:1.5}.grey[data-v-217c7c25]{color:#999}.maxW[data-v-217c7c25] .ivu-select-dropdown{max-width:600px}.tabBox_img[data-v-217c7c25]{width:50px;height:50px;margin:0 auto}.tabBox_img img[data-v-217c7c25]{width:100%;height:100%}.priceBox[data-v-217c7c25]{width:100%}.form .picBox[data-v-217c7c25],.form .pictrue[data-v-217c7c25]{display:inline-block;cursor:pointer}.form .pictrue[data-v-217c7c25]{width:60px;height:60px;border:1px dotted rgba(0,0,0,.1);margin-right:15px;position:relative}.form .pictrue img[data-v-217c7c25]{width:100%;height:100%}.form .pictrue .btndel[data-v-217c7c25]{position:absolute;z-index:9;width:20px!important;height:20px!important;left:46px;top:-4px}.form .upLoad[data-v-217c7c25]{width:58px;height:58px;line-height:58px;border:1px dotted rgba(0,0,0,.1);border-radius:4px;background:rgba(0,0,0,.02);cursor:pointer}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0e488e"],{9144:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[a("Form",{ref:"formData",attrs:{model:t.table,"label-width":t.labelWidth,"label-position":t.labelPosition,inline:""},nativeOn:{submit:function(t){t.preventDefault()}}},[a("FormItem",{staticStyle:{width:"200px"},attrs:{label:"卡号:"}},[a("Input",{attrs:{placeholder:"请输入卡号"},model:{value:t.table.card_number,callback:function(e){t.$set(t.table,"card_number",e)},expression:"table.card_number"}})],1),a("FormItem",{staticStyle:{width:"200px"},attrs:{label:"手机号:"}},[a("Input",{attrs:{placeholder:"请输入手机号"},model:{value:t.table.phone,callback:function(e){t.$set(t.table,"phone",e)},expression:"table.phone"}})],1),a("FormItem",{staticStyle:{width:"200px"},attrs:{label:"是否领取:"}},[a("Select",{attrs:{clearable:""},model:{value:t.table.is_use,callback:function(e){t.$set(t.table,"is_use",e)},expression:"table.is_use"}},[a("Option",{attrs:{value:"1"}},[t._v("已领取")]),a("Option",{attrs:{value:"0"}},[t._v("未领取")])],1)],1),a("FormItem",[a("Button",{attrs:{type:"primary"},on:{click:t.formSubmit}},[t._v("搜索")])],1)],1),a("Table",{ref:"table",staticClass:"mt25",attrs:{columns:t.columns1,data:t.data1,loading:t.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"status",fn:function(e){var n=e.row;e.index;return[a("i-switch",{attrs:{value:n.status,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(n)}},model:{value:n.status,callback:function(e){t.$set(n,"status",e)},expression:"row.status"}},[a("span",{attrs:{slot:"open"},slot:"open"},[t._v("激活")]),a("span",{attrs:{slot:"close"},slot:"close"},[t._v("冻结")])])]}}])}),a("div",{staticClass:"acea-row row-right page"},[a("Page",{attrs:{total:t.total,current:t.table.page,"page-size":t.table.limit,"show-elevator":"","show-total":""},on:{"on-change":t.pageChange}})],1)],1)],1)},r=[],i=(a("8e6e"),a("ac6a"),a("456d"),a("bd86")),s=a("c24f"),o=a("2f62");function l(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)}return a}function c(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?l(Object(a),!0).forEach((function(e){Object(i["a"])(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}var u={name:"card",props:{id:{default:0}},data:function(){return{columns1:[{title:"编号",key:"id",minWidth:100,align:"center"},{title:"卡号",key:"card_number",minWidth:105,align:"center"},{title:"密码",key:"card_password",align:"center",minWidth:100},{title:"领取人名称",key:"username",align:"center",minWidth:100},{title:"领取人电话",key:"phone",align:"center",minWidth:100},{title:"领取时间",key:"use_time",align:"center",minWidth:100},{title:"是否激活",slot:"status",minWidth:100}],data1:[],loading:!1,total:0,table:{page:1,limit:15,card_number:"",phone:"",is_use:""}}},computed:c(c({},Object(o["e"])("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:75},labelPosition:function(){return this.isMobile?"top":"right"}}),created:function(){this.getMemberCard()},methods:{onchangeIsShow:function(t){var e=this,a={card_id:t.id,status:t.status};Object(s["w"])(a).then((function(t){e.$Message.success(t.msg),e.getMemberCard()})).catch((function(t){e.$Message.error(t.msg)}))},getMemberCard:function(){var t=this;this.loading=!0,Object(s["R"])(this.id,this.table).then((function(e){t.loading=!1,t.data1=e.data.list,t.total=e.data.count})).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},formSubmit:function(){this.table.page=1,this.getMemberCard()},pageChange:function(t){this.table.page=t,this.getMemberCard()}}},d=u,b=a("2877"),h=Object(b["a"])(d,n,r,!1,null,null,null);e["default"]=h.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0e488e"],{9144:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[a("Form",{ref:"formData",attrs:{model:t.table,"label-width":t.labelWidth,"label-position":t.labelPosition,inline:""},nativeOn:{submit:function(t){t.preventDefault()}}},[a("FormItem",{staticStyle:{width:"200px"},attrs:{label:"卡号:"}},[a("Input",{attrs:{placeholder:"请输入卡号"},model:{value:t.table.card_number,callback:function(e){t.$set(t.table,"card_number",e)},expression:"table.card_number"}})],1),a("FormItem",{staticStyle:{width:"200px"},attrs:{label:"手机号:"}},[a("Input",{attrs:{placeholder:"请输入手机号"},model:{value:t.table.phone,callback:function(e){t.$set(t.table,"phone",e)},expression:"table.phone"}})],1),a("FormItem",{staticStyle:{width:"200px"},attrs:{label:"是否领取:"}},[a("Select",{attrs:{clearable:""},model:{value:t.table.is_use,callback:function(e){t.$set(t.table,"is_use",e)},expression:"table.is_use"}},[a("Option",{attrs:{value:"1"}},[t._v("已领取")]),a("Option",{attrs:{value:"0"}},[t._v("未领取")])],1)],1),a("FormItem",[a("Button",{attrs:{type:"primary"},on:{click:t.formSubmit}},[t._v("搜索")])],1)],1),a("Table",{ref:"table",staticClass:"mt25",attrs:{columns:t.columns1,data:t.data1,loading:t.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"status",fn:function(e){var n=e.row;e.index;return[a("i-switch",{attrs:{value:n.status,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(n)}},model:{value:n.status,callback:function(e){t.$set(n,"status",e)},expression:"row.status"}},[a("span",{attrs:{slot:"open"},slot:"open"},[t._v("激活")]),a("span",{attrs:{slot:"close"},slot:"close"},[t._v("冻结")])])]}}])}),a("div",{staticClass:"acea-row row-right page"},[a("Page",{attrs:{total:t.total,current:t.table.page,"page-size":t.table.limit,"show-elevator":"","show-total":""},on:{"on-change":t.pageChange}})],1)],1)],1)},r=[],i=(a("8e6e"),a("ac6a"),a("456d"),a("bd86")),s=a("c24f"),o=a("2f62");function l(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)}return a}function c(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?l(Object(a),!0).forEach((function(e){Object(i["a"])(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}var u={name:"card",props:{id:{default:0}},data:function(){return{columns1:[{title:"编号",key:"id",minWidth:100,align:"center"},{title:"卡号",key:"card_number",minWidth:105,align:"center"},{title:"密码",key:"card_password",align:"center",minWidth:100},{title:"领取人名称",key:"username",align:"center",minWidth:100},{title:"领取人电话",key:"phone",align:"center",minWidth:100},{title:"领取时间",key:"use_time",align:"center",minWidth:100},{title:"是否激活",slot:"status",minWidth:100}],data1:[],loading:!1,total:0,table:{page:1,limit:15,card_number:"",phone:"",is_use:""}}},computed:c(c({},Object(o["e"])("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:75},labelPosition:function(){return this.isMobile?"top":"right"}}),created:function(){this.getMemberCard()},methods:{onchangeIsShow:function(t){var e=this,a={card_id:t.id,status:t.status};Object(s["w"])(a).then((function(t){e.$Message.success(t.msg),e.getMemberCard()})).catch((function(t){e.$Message.error(t.msg)}))},getMemberCard:function(){var t=this;this.loading=!0,Object(s["T"])(this.id,this.table).then((function(e){t.loading=!1,t.data1=e.data.list,t.total=e.data.count})).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},formSubmit:function(){this.table.page=1,this.getMemberCard()},pageChange:function(t){this.table.page=t,this.getMemberCard()}}},d=u,b=a("2877"),h=Object(b["a"])(d,n,r,!1,null,null,null);e["default"]=h.exports}}]);

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21afa5"],{be8d:function(t,e,r){"use strict";r.r(e);var i=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("div",{staticClass:"i-layout-page-header"},[r("div",{staticClass:"i-layout-page-header"},[r("span",{staticClass:"ivu-page-header-title"},[t._v(t._s(t.$route.meta.title))])])]),r("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[r("Row",{attrs:{type:"flex"}},[r("Col",t._b({},"Col",t.grid,!1),[r("Button",{directives:[{name:"auth",rawName:"v-auth",value:["admin-user-group"],expression:"['admin-user-group']"}],attrs:{type:"primary",icon:"md-add"},on:{click:t.add}},[t._v("添加分组")])],1)],1),r("Table",{ref:"table",staticClass:"mt25",attrs:{columns:t.columns1,data:t.groupLists,loading:t.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"icons",fn:function(t){var e=t.row;t.index;return[r("div",{directives:[{name:"viewer",rawName:"v-viewer"}],staticClass:"tabBox_img"},[r("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.icon,expression:"row.icon"}]})])]}},{key:"action",fn:function(e){var i=e.row,n=e.index;return[r("a",{on:{click:function(e){return t.edit(i.id)}}},[t._v("修改")]),r("Divider",{attrs:{type:"vertical"}}),r("a",{on:{click:function(e){return t.del(i,"删除分组",n)}}},[t._v("删除")])]}}])}),r("div",{staticClass:"acea-row row-right page"},[r("Page",{attrs:{total:t.total,"show-elevator":"","show-total":"","page-size":t.groupFrom.limit},on:{"on-change":t.pageChange}})],1)],1)],1)},n=[],a=(r("8e6e"),r("ac6a"),r("456d"),r("96cf"),r("3b8d")),o=r("bd86"),s=r("2f62"),c=r("c24f");function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){Object(o["a"])(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var d={name:"user_group",data:function(){return{grid:{xl:7,lg:7,md:12,sm:24,xs:24},loading:!1,columns1:[{title:"ID",key:"id",width:80},{title:"分组名称",key:"group_name",minWidth:600},{title:"操作",slot:"action",fixed:"right",minWidth:120}],groupFrom:{page:1,limit:15},groupLists:[],total:0}},computed:l(l({},Object(s["e"])("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:75},labelPosition:function(){return this.isMobile?"top":"left"}}),created:function(){this.getList()},methods:{add:function(){var t=this;this.$modalForm(Object(c["n"])(0)).then((function(){return t.getList()}))},getList:function(){var t=this;this.loading=!0,Object(c["J"])(this.groupFrom).then(function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(r){var i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:i=r.data,t.groupLists=i.list,t.total=i.count,t.loading=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},pageChange:function(t){this.groupFrom.page=t,this.getList()},edit:function(t){var e=this;this.$modalForm(Object(c["n"])(t)).then((function(){return e.getList()}))},del:function(t,e,r){var i=this,n={title:e,num:r,url:"user/user_group/del/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(n).then((function(t){i.$Message.success(t.msg),i.groupLists.splice(r,1),i.getList()})).catch((function(t){i.$Message.error(t.msg)}))}}},g=d,p=r("2877"),h=Object(p["a"])(g,i,n,!1,null,"0a206928",null);e["default"]=h.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21afa5"],{be8d:function(t,e,r){"use strict";r.r(e);var i=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("div",{staticClass:"i-layout-page-header"},[r("div",{staticClass:"i-layout-page-header"},[r("span",{staticClass:"ivu-page-header-title"},[t._v(t._s(t.$route.meta.title))])])]),r("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[r("Row",{attrs:{type:"flex"}},[r("Col",t._b({},"Col",t.grid,!1),[r("Button",{directives:[{name:"auth",rawName:"v-auth",value:["admin-user-group"],expression:"['admin-user-group']"}],attrs:{type:"primary",icon:"md-add"},on:{click:t.add}},[t._v("添加分组")])],1)],1),r("Table",{ref:"table",staticClass:"mt25",attrs:{columns:t.columns1,data:t.groupLists,loading:t.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"icons",fn:function(t){var e=t.row;t.index;return[r("div",{directives:[{name:"viewer",rawName:"v-viewer"}],staticClass:"tabBox_img"},[r("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.icon,expression:"row.icon"}]})])]}},{key:"action",fn:function(e){var i=e.row,n=e.index;return[r("a",{on:{click:function(e){return t.edit(i.id)}}},[t._v("修改")]),r("Divider",{attrs:{type:"vertical"}}),r("a",{on:{click:function(e){return t.del(i,"删除分组",n)}}},[t._v("删除")])]}}])}),r("div",{staticClass:"acea-row row-right page"},[r("Page",{attrs:{total:t.total,"show-elevator":"","show-total":"","page-size":t.groupFrom.limit},on:{"on-change":t.pageChange}})],1)],1)],1)},n=[],a=(r("8e6e"),r("ac6a"),r("456d"),r("96cf"),r("3b8d")),o=r("bd86"),s=r("2f62"),c=r("c24f");function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){Object(o["a"])(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var d={name:"user_group",data:function(){return{grid:{xl:7,lg:7,md:12,sm:24,xs:24},loading:!1,columns1:[{title:"ID",key:"id",width:80},{title:"分组名称",key:"group_name",minWidth:600},{title:"操作",slot:"action",fixed:"right",minWidth:120}],groupFrom:{page:1,limit:15},groupLists:[],total:0}},computed:l(l({},Object(s["e"])("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:75},labelPosition:function(){return this.isMobile?"top":"left"}}),created:function(){this.getList()},methods:{add:function(){var t=this;this.$modalForm(Object(c["n"])(0)).then((function(){return t.getList()}))},getList:function(){var t=this;this.loading=!0,Object(c["L"])(this.groupFrom).then(function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(r){var i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:i=r.data,t.groupLists=i.list,t.total=i.count,t.loading=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},pageChange:function(t){this.groupFrom.page=t,this.getList()},edit:function(t){var e=this;this.$modalForm(Object(c["n"])(t)).then((function(){return e.getList()}))},del:function(t,e,r){var i=this,n={title:e,num:r,url:"user/user_group/del/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(n).then((function(t){i.$Message.success(t.msg),i.groupLists.splice(r,1),i.getList()})).catch((function(t){i.$Message.error(t.msg)}))}}},g=d,p=r("2877"),h=Object(p["a"])(g,i,n,!1,null,"0a206928",null);e["default"]=h.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More