mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-11 01:52:49 +00:00
【程序目录】更新优化
This commit is contained in:
parent
20346a1ecc
commit
e61aaa7677
@ -84,7 +84,7 @@ class AdminApiExceptionHandle extends Handle
|
|||||||
'trace' => $e->getTrace(),
|
'trace' => $e->getTrace(),
|
||||||
'previous' => $e->getPrevious(),
|
'previous' => $e->getPrevious(),
|
||||||
] : [];
|
] : [];
|
||||||
$message = Env::get('app_debug', false) ? $e->getMessage() : '很抱歉,系统开小差了';
|
$message = $e->getMessage();
|
||||||
// 添加自定义异常处理机制
|
// 添加自定义异常处理机制
|
||||||
if ($e instanceof AuthException || $e instanceof AdminException || $e instanceof ApiException || $e instanceof ValidateException) {
|
if ($e instanceof AuthException || $e instanceof AdminException || $e instanceof ApiException || $e instanceof ValidateException) {
|
||||||
return app('json')->make($e->getCode() ?: 400, $message, $massageData);
|
return app('json')->make($e->getCode() ?: 400, $message, $massageData);
|
||||||
|
|||||||
@ -60,7 +60,7 @@ class Common extends AuthController
|
|||||||
$res = $res ? json_decode($res, true) : [];
|
$res = $res ? json_decode($res, true) : [];
|
||||||
|
|
||||||
//兼容test.
|
//兼容test.
|
||||||
if ($res['data']['status'] !== 1) {
|
if (!isset($res['data']['status']) || $res['data']['status'] !== 1) {
|
||||||
$host = str_replace('test.', '', $host);
|
$host = str_replace('test.', '', $host);
|
||||||
$res = HttpService::request('http://authorize.crmeb.net/api/auth_cert_query', 'post', [
|
$res = HttpService::request('http://authorize.crmeb.net/api/auth_cert_query', 'post', [
|
||||||
'domain_name' => $host,
|
'domain_name' => $host,
|
||||||
@ -71,7 +71,7 @@ class Common extends AuthController
|
|||||||
}
|
}
|
||||||
|
|
||||||
//如果是主域名兼容www.
|
//如果是主域名兼容www.
|
||||||
if ($res['data']['status'] !== 1) {
|
if (!isset($res['data']['status']) || $res['data']['status'] !== 1) {
|
||||||
$host = str_replace('www.', '', $host);
|
$host = str_replace('www.', '', $host);
|
||||||
$res = HttpService::request('http://authorize.crmeb.net/api/auth_cert_query', 'post', [
|
$res = HttpService::request('http://authorize.crmeb.net/api/auth_cert_query', 'post', [
|
||||||
'domain_name' => $host,
|
'domain_name' => $host,
|
||||||
@ -82,9 +82,9 @@ class Common extends AuthController
|
|||||||
}
|
}
|
||||||
|
|
||||||
//升级状态
|
//升级状态
|
||||||
/** @var UpgradeServices $upgradeServices */
|
// /** @var UpgradeServices $upgradeServices */
|
||||||
$upgradeServices = app()->make(UpgradeServices::class);
|
// $upgradeServices = app()->make(UpgradeServices::class);
|
||||||
$upgradeStatus = $upgradeServices->getUpgradeStatus();
|
// $upgradeStatus = $upgradeServices->getUpgradeStatus();
|
||||||
|
|
||||||
$status = $res['data']['status'] ?? -9;
|
$status = $res['data']['status'] ?? -9;
|
||||||
switch ((int)$status) {
|
switch ((int)$status) {
|
||||||
|
|||||||
@ -91,10 +91,7 @@ class SystemNotification extends AuthController
|
|||||||
if ($data['mark'] == 'verify_code') $data['type'] = 'is_sms';
|
if ($data['mark'] == 'verify_code') $data['type'] = 'is_sms';
|
||||||
if (!$data['id']) return app('json')->fail(100100);
|
if (!$data['id']) return app('json')->fail(100100);
|
||||||
if ($this->services->saveData($data)) {
|
if ($this->services->saveData($data)) {
|
||||||
CacheService::delete('NOTICE_SMS_' . $data['mark']);
|
CacheService::clear();
|
||||||
CacheService::delete('wechat_' . $data['mark']);
|
|
||||||
CacheService::delete('routine_' . $data['mark']);
|
|
||||||
CacheService::delete('TEMP_IDS_LIST');
|
|
||||||
return app('json')->success(100001);
|
return app('json')->success(100001);
|
||||||
} else {
|
} else {
|
||||||
return app('json')->fail(100007);
|
return app('json')->fail(100007);
|
||||||
@ -117,10 +114,7 @@ class SystemNotification extends AuthController
|
|||||||
if ($type == '' || $status == '' || $id == 0) return app('json')->fail(100100);
|
if ($type == '' || $status == '' || $id == 0) return app('json')->fail(100100);
|
||||||
$this->services->update($id, [$type => $status]);
|
$this->services->update($id, [$type => $status]);
|
||||||
$res = $this->services->getOneNotce(['id' => $id]);
|
$res = $this->services->getOneNotce(['id' => $id]);
|
||||||
CacheService::delete('NOTICE_SMS_' . $res->mark);
|
CacheService::clear();
|
||||||
CacheService::delete('wechat_' . $res->mark);
|
|
||||||
CacheService::delete('routine_' . $res->mark);
|
|
||||||
CacheService::delete('TEMP_IDS_LIST');
|
|
||||||
return app('json')->success(100014);
|
return app('json')->success(100014);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,12 +80,12 @@ class SystemRole extends AuthController
|
|||||||
$data['rules'] = implode(',', $data['rules']);
|
$data['rules'] = implode(',', $data['rules']);
|
||||||
if ($id) {
|
if ($id) {
|
||||||
if (!$this->services->update($id, $data)) return app('json')->fail(100007);
|
if (!$this->services->update($id, $data)) return app('json')->fail(100007);
|
||||||
CacheService::clear();
|
$this->services->cacheDriver()->clear();
|
||||||
return app('json')->success(100001);
|
return app('json')->success(100001);
|
||||||
} else {
|
} else {
|
||||||
$data['level'] = $this->adminInfo['level'] + 1;
|
$data['level'] = $this->adminInfo['level'] + 1;
|
||||||
if (!$this->services->save($data)) return app('json')->fail(400223);
|
if (!$this->services->save($data)) return app('json')->fail(400223);
|
||||||
CacheService::clear();
|
$this->services->cacheDriver()->clear();
|
||||||
return app('json')->success(400222);
|
return app('json')->success(400222);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ class SystemRole extends AuthController
|
|||||||
if (!$this->services->delete($id))
|
if (!$this->services->delete($id))
|
||||||
return app('json')->fail(100008);
|
return app('json')->fail(100008);
|
||||||
else {
|
else {
|
||||||
CacheService::clear();
|
$this->services->cacheDriver()->clear();
|
||||||
return app('json')->success(100002);
|
return app('json')->success(100002);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ class SystemRole extends AuthController
|
|||||||
}
|
}
|
||||||
$role->status = $status;
|
$role->status = $status;
|
||||||
if ($role->save()) {
|
if ($role->save()) {
|
||||||
CacheService::clear();
|
$this->services->cacheDriver()->clear();
|
||||||
return app('json')->success(100001);
|
return app('json')->success(100001);
|
||||||
} else {
|
} else {
|
||||||
return app('json')->fail(100007);
|
return app('json')->fail(100007);
|
||||||
|
|||||||
@ -85,7 +85,7 @@ class ApiExceptionHandle extends Handle
|
|||||||
'trace' => $e->getTrace(),
|
'trace' => $e->getTrace(),
|
||||||
'previous' => $e->getPrevious(),
|
'previous' => $e->getPrevious(),
|
||||||
] : [];
|
] : [];
|
||||||
$message = Env::get('app_debug', false) ? $e->getMessage() : '很抱歉,系统开小差了';
|
$message = $e->getMessage();
|
||||||
// 添加自定义异常处理机制
|
// 添加自定义异常处理机制
|
||||||
if ($e instanceof ApiStatusException) {
|
if ($e instanceof ApiStatusException) {
|
||||||
return app('json')->status($e->getApiStatus(), $message, $e->getApiData());
|
return app('json')->status($e->getApiStatus(), $message, $e->getApiData());
|
||||||
|
|||||||
@ -50,6 +50,7 @@ class PublicController
|
|||||||
$data['site_name'] = sys_config('site_name');
|
$data['site_name'] = sys_config('site_name');
|
||||||
$data['site_keywords'] = sys_config('site_keywords');
|
$data['site_keywords'] = sys_config('site_keywords');
|
||||||
$data['site_description'] = sys_config('site_description');
|
$data['site_description'] = sys_config('site_description');
|
||||||
|
$data['network_security'] = sys_config('network_security');
|
||||||
$logoUrl = sys_config('pc_logo');
|
$logoUrl = sys_config('pc_logo');
|
||||||
if (strstr($logoUrl, 'http') === false && $logoUrl) {
|
if (strstr($logoUrl, 'http') === false && $logoUrl) {
|
||||||
$logoUrl = sys_config('site_url') . $logoUrl;
|
$logoUrl = sys_config('site_url') . $logoUrl;
|
||||||
|
|||||||
@ -168,7 +168,7 @@ class StoreOrderController
|
|||||||
$userInfo = $request->user()->toArray();
|
$userInfo = $request->user()->toArray();
|
||||||
if ($checkOrder = $this->services->getOne(['order_id|unique' => $key, 'uid' => $userInfo['uid'], 'is_del' => 0]))
|
if ($checkOrder = $this->services->getOne(['order_id|unique' => $key, 'uid' => $userInfo['uid'], 'is_del' => 0]))
|
||||||
return app('json')->status('extend_order', 410209, ['orderId' => $checkOrder['order_id'], 'key' => $key]);
|
return app('json')->status('extend_order', 410209, ['orderId' => $checkOrder['order_id'], 'key' => $key]);
|
||||||
[$addressId, $couponId, $payType, $useIntegral, $mark, $combinationId, $pinkId, $seckillId, $bargainId, $shipping_type, $real_name, $phone, $storeId, $news, $invoice_id, $quitUrl, $advanceId, $virtual_type, $customForm] = $request->postMore([
|
[$addressId, $couponId, $payType, $useIntegral, $mark, $combinationId, $pinkId, $seckillId, $bargainId, $shipping_type, $real_name, $phone, $storeId, $news, $invoice_id, $advanceId, $customForm] = $request->postMore([
|
||||||
[['addressId', 'd'], 0],
|
[['addressId', 'd'], 0],
|
||||||
[['couponId', 'd'], 0],
|
[['couponId', 'd'], 0],
|
||||||
['payType', ''],
|
['payType', ''],
|
||||||
@ -184,9 +184,7 @@ class StoreOrderController
|
|||||||
[['store_id', 'd'], 0],
|
[['store_id', 'd'], 0],
|
||||||
['new', 0],
|
['new', 0],
|
||||||
[['invoice_id', 'd'], 0],
|
[['invoice_id', 'd'], 0],
|
||||||
['quitUrl', ''],
|
|
||||||
[['advanceId', 'd'], 0],
|
[['advanceId', 'd'], 0],
|
||||||
['virtual_type', 0],
|
|
||||||
['custom_form', []],
|
['custom_form', []],
|
||||||
], true);
|
], true);
|
||||||
$payType = strtolower($payType);
|
$payType = strtolower($payType);
|
||||||
|
|||||||
@ -53,7 +53,7 @@ class UserRechargeController
|
|||||||
$uid = (int)$request->uid();
|
$uid = (int)$request->uid();
|
||||||
$re = $this->services->recharge($uid, $price, $recharId, $type, $from, true);
|
$re = $this->services->recharge($uid, $price, $recharId, $type, $from, true);
|
||||||
if ($re) {
|
if ($re) {
|
||||||
$payType = $re['pay_type'];
|
$payType = $re['pay_type'] ?? '';
|
||||||
unset($re['pay_type']);
|
unset($re['pay_type']);
|
||||||
return app('json')->status($payType, 410125, $re);
|
return app('json')->status($payType, 410125, $re);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,7 +84,7 @@ class KefuApiExceptionHandle extends Handle
|
|||||||
'trace' => $e->getTrace(),
|
'trace' => $e->getTrace(),
|
||||||
'previous' => $e->getPrevious(),
|
'previous' => $e->getPrevious(),
|
||||||
] : [];
|
] : [];
|
||||||
$message = Env::get('app_debug', false) ? $e->getMessage() : '很抱歉,系统开小差了';
|
$message = $e->getMessage();
|
||||||
// 添加自定义异常处理机制
|
// 添加自定义异常处理机制
|
||||||
if ($e instanceof AuthException || $e instanceof AdminException || $e instanceof ApiException || $e instanceof ValidateException) {
|
if ($e instanceof AuthException || $e instanceof AdminException || $e instanceof ApiException || $e instanceof ValidateException) {
|
||||||
return app('json')->make($e->getCode() ?: 400, $message, $massageData);
|
return app('json')->make($e->getCode() ?: 400, $message, $massageData);
|
||||||
|
|||||||
@ -84,7 +84,7 @@ class OutApiExceptionHandle extends Handle
|
|||||||
'trace' => $e->getTrace(),
|
'trace' => $e->getTrace(),
|
||||||
'previous' => $e->getPrevious(),
|
'previous' => $e->getPrevious(),
|
||||||
] : [];
|
] : [];
|
||||||
$message = Env::get('app_debug', false) ? $e->getMessage() : '很抱歉,系统开小差了';
|
$message = $e->getMessage();
|
||||||
// 添加自定义异常处理机制
|
// 添加自定义异常处理机制
|
||||||
if ($e instanceof AuthException || $e instanceof AdminException || $e instanceof ApiException || $e instanceof ValidateException) {
|
if ($e instanceof AuthException || $e instanceof AdminException || $e instanceof ApiException || $e instanceof ValidateException) {
|
||||||
return app('json')->make($e->getCode() ?: 400, $message, $massageData);
|
return app('json')->make($e->getCode() ?: 400, $message, $massageData);
|
||||||
|
|||||||
@ -75,14 +75,14 @@ class LiveAnchorServices extends BaseServices
|
|||||||
$field[] = Form::input('name', '主播名称', '')->maxlength(20)->required('请填写名称');
|
$field[] = Form::input('name', '主播名称', '')->maxlength(20)->required('请填写名称');
|
||||||
$field[] = Form::input('wechat', '主播微信号', '')->maxlength(32)->required('请填写微信号');
|
$field[] = Form::input('wechat', '主播微信号', '')->maxlength(32)->required('请填写微信号');
|
||||||
$field[] = Form::input('phone', '主播手机号', '')->maxlength(20)->required('请填写手机号');
|
$field[] = Form::input('phone', '主播手机号', '')->maxlength(20)->required('请填写手机号');
|
||||||
$field[] = Form::frameImage('cover_img', '主播图像', Url::buildUrl('admin/widget.images/index', array('fodder' => 'cover_img')), '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->appendValidate(Validate::str()->required('请选择图像'));
|
$field[] = Form::frameImage('cover_img', '主播图像', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'cover_img')), '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->appendValidate(Validate::str()->required('请选择图像'));
|
||||||
} else {
|
} else {
|
||||||
$title = '修改主播';
|
$title = '修改主播';
|
||||||
$field[] = Form::hidden('id', $anchor->getData('id'));
|
$field[] = Form::hidden('id', $anchor->getData('id'));
|
||||||
$field[] = Form::input('name', '主播名称', $anchor->getData('name'))->maxlength(20)->required('请填写名称');
|
$field[] = Form::input('name', '主播名称', $anchor->getData('name'))->maxlength(20)->required('请填写名称');
|
||||||
$field[] = Form::input('wechat', '主播微信号', $anchor->getData('wechat'))->maxlength(32)->required('请填写微信号');
|
$field[] = Form::input('wechat', '主播微信号', $anchor->getData('wechat'))->maxlength(32)->required('请填写微信号');
|
||||||
$field[] = Form::input('phone', '主播手机号', $anchor->getData('phone'))->maxlength(20)->required('请填写手机号');
|
$field[] = Form::input('phone', '主播手机号', $anchor->getData('phone'))->maxlength(20)->required('请填写手机号');
|
||||||
$field[] = Form::frameImage('cover_img', '主播图像', Url::buildUrl('admin/widget.images/index', array('fodder' => 'cover_img')), $anchor->getData('cover_img'))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->appendValidate(Validate::str()->required('请选择图像'));
|
$field[] = Form::frameImage('cover_img', '主播图像', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'cover_img')), $anchor->getData('cover_img'))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->appendValidate(Validate::str()->required('请选择图像'));
|
||||||
}
|
}
|
||||||
return create_form($title, $field, $this->url('/live/anchor/save'), 'POST');
|
return create_form($title, $field, $this->url('/live/anchor/save'), 'POST');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -262,7 +262,7 @@ class AgentLevelServices extends BaseServices
|
|||||||
{
|
{
|
||||||
$field[] = Form::input('name', '等级名称')->maxlength(8)->col(24);
|
$field[] = Form::input('name', '等级名称')->maxlength(8)->col(24);
|
||||||
$field[] = Form::number('grade', '等级', 0)->min(0)->precision(0);
|
$field[] = Form::number('grade', '等级', 0)->min(0)->precision(0);
|
||||||
$field[] = Form::frameImage('image', '背景图', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
$field[] = Form::frameImage('image', '背景图', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'image')))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
||||||
$field[] = Form::number('one_brokerage', '一级上浮', 0)->appendRule('suffix', [
|
$field[] = Form::number('one_brokerage', '一级上浮', 0)->appendRule('suffix', [
|
||||||
'type' => 'div',
|
'type' => 'div',
|
||||||
'class' => 'tips-info',
|
'class' => 'tips-info',
|
||||||
@ -292,7 +292,7 @@ class AgentLevelServices extends BaseServices
|
|||||||
$field[] = Form::hidden('id', $id);
|
$field[] = Form::hidden('id', $id);
|
||||||
$field[] = Form::input('name', '等级名称', $levelInfo['name'])->maxlength(8)->col(24);
|
$field[] = Form::input('name', '等级名称', $levelInfo['name'])->maxlength(8)->col(24);
|
||||||
$field[] = Form::number('grade', '等级', $levelInfo['grade'])->min(0)->precision(0);
|
$field[] = Form::number('grade', '等级', $levelInfo['grade'])->min(0)->precision(0);
|
||||||
$field[] = Form::frameImage('image', '背景图', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), $levelInfo['image'])->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
$field[] = Form::frameImage('image', '背景图', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'image')), $levelInfo['image'])->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
||||||
$field[] = Form::number('one_brokerage', '一级上浮', $levelInfo['one_brokerage'])->appendRule('suffix', [
|
$field[] = Form::number('one_brokerage', '一级上浮', $levelInfo['one_brokerage'])->appendRule('suffix', [
|
||||||
'type' => 'div',
|
'type' => 'div',
|
||||||
'class' => 'tips-info',
|
'class' => 'tips-info',
|
||||||
|
|||||||
@ -84,7 +84,7 @@ class ArticleCategoryServices extends BaseServices
|
|||||||
$f[] = Form::select('pid', '上级分类', (int)($info['pid'] ?? ''))->setOptions($this->menus($pid))->filterable(1);
|
$f[] = Form::select('pid', '上级分类', (int)($info['pid'] ?? ''))->setOptions($this->menus($pid))->filterable(1);
|
||||||
$f[] = Form::input('title', '分类名称', $info['title'] ?? '')->maxlength(20)->required();
|
$f[] = Form::input('title', '分类名称', $info['title'] ?? '')->maxlength(20)->required();
|
||||||
$f[] = Form::input('intr', '分类简介', $info['intr'] ?? '')->type('textarea')->required();
|
$f[] = Form::input('intr', '分类简介', $info['intr'] ?? '')->type('textarea')->required();
|
||||||
$f[] = Form::frameImage('image', '分类图片', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), $info['image'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
$f[] = Form::frameImage('image', '分类图片', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'image')), $info['image'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
||||||
$f[] = Form::number('sort', '排序', (int)($info['sort'] ?? 0))->precision(0);
|
$f[] = Form::number('sort', '排序', (int)($info['sort'] ?? 0))->precision(0);
|
||||||
$f[] = Form::radio('status', '状态', $info['status'] ?? 1)->options([['value' => 1, 'label' => '显示'], ['value' => 0, 'label' => '隐藏']]);
|
$f[] = Form::radio('status', '状态', $info['status'] ?? 1)->options([['value' => 1, 'label' => '显示'], ['value' => 0, 'label' => '隐藏']]);
|
||||||
return create_form('添加分类', $f, Url::buildUrl($url), $method);
|
return create_form('添加分类', $f, Url::buildUrl($url), $method);
|
||||||
|
|||||||
@ -91,7 +91,7 @@ class StoreServiceServices extends BaseServices
|
|||||||
public function createServiceForm(array $formData = [])
|
public function createServiceForm(array $formData = [])
|
||||||
{
|
{
|
||||||
if ($formData) {
|
if ($formData) {
|
||||||
$field[] = $this->builder->frameImage('avatar', '客服头像', $this->url('admin/widget.images/index', ['fodder' => 'avatar'], true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
$field[] = $this->builder->frameImage('avatar', '客服头像', $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', ['fodder' => 'avatar'], true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
||||||
} else {
|
} else {
|
||||||
$field[] = $this->builder->frameImage('image', '选择用户', $this->url('admin/system.user/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']);
|
$field[] = $this->builder->frameImage('image', '选择用户', $this->url('admin/system.user/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']);
|
||||||
$field[] = $this->builder->hidden('uid', 0);
|
$field[] = $this->builder->hidden('uid', 0);
|
||||||
|
|||||||
@ -80,7 +80,7 @@ class DeliveryServiceServices extends BaseServices
|
|||||||
public function createServiceForm(array $formData = [])
|
public function createServiceForm(array $formData = [])
|
||||||
{
|
{
|
||||||
if ($formData) {
|
if ($formData) {
|
||||||
$field[] = $this->builder->frameImage('avatar', '配送员头像', $this->url('admin/widget.images/index', ['fodder' => 'avatar'], true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
$field[] = $this->builder->frameImage('avatar', '配送员头像', $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', ['fodder' => 'avatar'], true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
||||||
} else {
|
} else {
|
||||||
$field[] = $this->builder->frameImage('image', '商城用户', $this->url('admin/system.user/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']);
|
$field[] = $this->builder->frameImage('image', '商城用户', $this->url('admin/system.user/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']);
|
||||||
$field[] = $this->builder->hidden('uid', 0);
|
$field[] = $this->builder->hidden('uid', 0);
|
||||||
|
|||||||
@ -49,7 +49,13 @@ class StoreOrderWriteOffServices extends BaseServices
|
|||||||
*/
|
*/
|
||||||
public function writeOffOrder(string $code, int $confirm, int $uid = 0)
|
public function writeOffOrder(string $code, int $confirm, int $uid = 0)
|
||||||
{
|
{
|
||||||
$orderInfo = $this->dao->getOne(['verify_code' => $code, 'paid' => 1, 'refund_status' => 0, 'is_del' => 0]);
|
$orderInfo = $this->dao->getOne([
|
||||||
|
['verify_code', '=', $code],
|
||||||
|
['paid', '=', 1],
|
||||||
|
['refund_status', '=', 0],
|
||||||
|
['is_del', '=', 0],
|
||||||
|
['pid', '>=', 0]
|
||||||
|
]);
|
||||||
if (!$orderInfo) {
|
if (!$orderInfo) {
|
||||||
throw new ApiException(410173);
|
throw new ApiException(410173);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -157,8 +157,8 @@ class StoreCategoryServices extends BaseServices
|
|||||||
$f[] = Form::select('pid', '上级分类', (int)($info['pid'] ?? ''))->setOptions($this->menus())->filterable(1);
|
$f[] = Form::select('pid', '上级分类', (int)($info['pid'] ?? ''))->setOptions($this->menus())->filterable(1);
|
||||||
}
|
}
|
||||||
$f[] = Form::input('cate_name', '分类名称', $info['cate_name'] ?? '')->maxlength(8)->required();
|
$f[] = Form::input('cate_name', '分类名称', $info['cate_name'] ?? '')->maxlength(8)->required();
|
||||||
$f[] = Form::frameImage('pic', '分类图标(180*180)', Url::buildUrl('admin/widget.images/index', array('fodder' => 'pic')), $info['pic'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
$f[] = Form::frameImage('pic', '分类图标(180*180)', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'pic')), $info['pic'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
||||||
$f[] = Form::frameImage('big_pic', '分类大图(468*340)', Url::buildUrl('admin/widget.images/index', array('fodder' => 'big_pic')), $info['big_pic'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
$f[] = Form::frameImage('big_pic', '分类大图(468*340)', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'big_pic')), $info['big_pic'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
||||||
$f[] = Form::number('sort', '排序', (int)($info['sort'] ?? 0))->min(0)->precision(0);
|
$f[] = Form::number('sort', '排序', (int)($info['sort'] ?? 0))->min(0)->precision(0);
|
||||||
$f[] = Form::radio('is_show', '状态', $info['is_show'] ?? 1)->options([['label' => '显示', 'value' => 1], ['label' => '隐藏', 'value' => 0]]);
|
$f[] = Form::radio('is_show', '状态', $info['is_show'] ?? 1)->options([['label' => '显示', 'value' => 1], ['label' => '隐藏', 'value' => 0]]);
|
||||||
return $f;
|
return $f;
|
||||||
|
|||||||
@ -67,12 +67,12 @@ class StoreProductReplyServices extends BaseServices
|
|||||||
} else {
|
} else {
|
||||||
$field[] = Form::hidden('product_id', $product_id);
|
$field[] = Form::hidden('product_id', $product_id);
|
||||||
}
|
}
|
||||||
$field[] = Form::frameImage('avatar', '用户头像', Url::buildUrl('admin/widget.images/index', array('fodder' => 'avatar')))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
$field[] = Form::frameImage('avatar', '用户头像', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'avatar')))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
||||||
$field[] = Form::input('nickname', '用户名称')->col(24);
|
$field[] = Form::input('nickname', '用户名称')->col(24);
|
||||||
$field[] = Form::input('comment', '评价文字')->type('textarea');
|
$field[] = Form::input('comment', '评价文字')->type('textarea');
|
||||||
$field[] = Form::rate('product_score', '商品分数', 0)->allowHalf(false);
|
$field[] = Form::rate('product_score', '商品分数', 0)->allowHalf(false);
|
||||||
$field[] = Form::rate('service_score', '服务分数', 0)->allowHalf(false);
|
$field[] = Form::rate('service_score', '服务分数', 0)->allowHalf(false);
|
||||||
$field[] = Form::frameImages('pics', '评价图片', Url::buildUrl('admin/widget.images/index', array('fodder' => 'pics', 'type' => 'many', 'maxLength' => 8)))->maxLength(8)->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->props(['closeBtn' => false, 'okBtn' => false]);
|
$field[] = Form::frameImages('pics', '评价图片', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'pics', 'type' => 'many', 'maxLength' => 8)))->maxLength(8)->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->props(['closeBtn' => false, 'okBtn' => false]);
|
||||||
$field[] = Form::dateTime('add_time', '评论时间', '')->placeholder('请选择评论时间(不选择默认当前添加时间)')->style(['width' => '300px']);
|
$field[] = Form::dateTime('add_time', '评论时间', '')->placeholder('请选择评论时间(不选择默认当前添加时间)')->style(['width' => '300px']);
|
||||||
return create_form('添加虚拟评论', $field, Url::buildUrl('/product/reply/save_fictitious_reply'), 'POST');
|
return create_form('添加虚拟评论', $field, Url::buildUrl('/product/reply/save_fictitious_reply'), 'POST');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -442,7 +442,7 @@ class SystemConfigServices extends BaseServices
|
|||||||
case 1:
|
case 1:
|
||||||
$data['value'] = json_decode($data['value'], true) ?: '';
|
$data['value'] = json_decode($data['value'], true) ?: '';
|
||||||
if ($data['value'] != '') $data['value'] = set_file_url($data['value']);
|
if ($data['value'] != '') $data['value'] = set_file_url($data['value']);
|
||||||
$formbuider[] = $this->builder->frameImage($data['menu_name'], $data['info'], $this->url('admin/widget.images/index', ['fodder' => $data['menu_name']], true), $data['value'])
|
$formbuider[] = $this->builder->frameImage($data['menu_name'], $data['info'], $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', ['fodder' => $data['menu_name']], true), $data['value'])
|
||||||
->icon('ios-image')->width('950px')->height('505px')->modal(['footer-hide' => true])->appendRule('suffix', [
|
->icon('ios-image')->width('950px')->height('505px')->modal(['footer-hide' => true])->appendRule('suffix', [
|
||||||
'type' => 'div',
|
'type' => 'div',
|
||||||
'class' => 'tips-info',
|
'class' => 'tips-info',
|
||||||
@ -453,7 +453,7 @@ class SystemConfigServices extends BaseServices
|
|||||||
$data['value'] = json_decode($data['value'], true) ?: [];
|
$data['value'] = json_decode($data['value'], true) ?: [];
|
||||||
if ($data['value'])
|
if ($data['value'])
|
||||||
$data['value'] = set_file_url($data['value']);
|
$data['value'] = set_file_url($data['value']);
|
||||||
$formbuider[] = $this->builder->frameImages($data['menu_name'], $data['info'], $this->url('admin/widget.images/index', ['fodder' => $data['menu_name'], 'type' => 'many', 'maxLength' => 5], true), $data['value'])
|
$formbuider[] = $this->builder->frameImages($data['menu_name'], $data['info'], $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', ['fodder' => $data['menu_name'], 'type' => 'many', 'maxLength' => 5], true), $data['value'])
|
||||||
->maxLength(5)->icon('ios-images')->width('950px')->height('505px')->modal(['footer-hide' => true])
|
->maxLength(5)->icon('ios-images')->width('950px')->height('505px')->modal(['footer-hide' => true])
|
||||||
->appendRule('suffix', [
|
->appendRule('suffix', [
|
||||||
'type' => 'div',
|
'type' => 'div',
|
||||||
|
|||||||
@ -204,7 +204,7 @@ class SystemGroupDataServices extends BaseServices
|
|||||||
} else {
|
} else {
|
||||||
$image = '';
|
$image = '';
|
||||||
}
|
}
|
||||||
$f[] = Form::frameImage($value["title"], $value["name"], $this->url('admin/widget.images/index', ['fodder' => $value["title"], 'big' => 1], true), $image)->icon('ios-image')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
$f[] = Form::frameImage($value["title"], $value["name"], $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', ['fodder' => $value["title"], 'big' => 1], true), $image)->icon('ios-image')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
||||||
break;
|
break;
|
||||||
case 'uploads':
|
case 'uploads':
|
||||||
if ($fvalue) {
|
if ($fvalue) {
|
||||||
@ -213,7 +213,7 @@ class SystemGroupDataServices extends BaseServices
|
|||||||
} else {
|
} else {
|
||||||
$images = [];
|
$images = [];
|
||||||
}
|
}
|
||||||
$f[] = Form::frameImages($value["title"], $value["name"], $this->url('admin/widget.images/index', ['fodder' => $value["title"], 'big' => 1, 'type' => 'many', 'maxLength' => 5], true), $images)->maxLength(5)->icon('ios-images')->width('950px')->height('505px')->modal(['footer-hide' => true])->spin(0);
|
$f[] = Form::frameImages($value["title"], $value["name"], $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', ['fodder' => $value["title"], 'big' => 1, 'type' => 'many', 'maxLength' => 5], true), $images)->maxLength(5)->icon('ios-images')->width('950px')->height('505px')->modal(['footer-hide' => true])->spin(0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$f[] = Form::input($value["title"], $value["name"], $fvalue);
|
$f[] = Form::input($value["title"], $value["name"], $fvalue);
|
||||||
|
|||||||
@ -101,7 +101,7 @@ class SystemStoreStaffServices extends BaseServices
|
|||||||
public function createStoreStaffForm(array $formData = [])
|
public function createStoreStaffForm(array $formData = [])
|
||||||
{
|
{
|
||||||
if ($formData) {
|
if ($formData) {
|
||||||
$field[] = $this->builder->frameImage('image', '更换头像', $this->url('admin/widget.images/index', array('fodder' => 'image'),true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
$field[] = $this->builder->frameImage('image', '更换头像', $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'image'),true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
||||||
} else {
|
} else {
|
||||||
$field[] = $this->builder->frameImage('image', '商城用户', $this->url('admin/system.User/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']);
|
$field[] = $this->builder->frameImage('image', '商城用户', $this->url('admin/system.User/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -221,8 +221,8 @@ class UserLevelServices extends BaseServices
|
|||||||
$field[] = Form::number('grade', '等级', isset($vipInfo) ? $vipInfo->grade : 0)->min(0)->precision(0)->col(8)->required();
|
$field[] = Form::number('grade', '等级', isset($vipInfo) ? $vipInfo->grade : 0)->min(0)->precision(0)->col(8)->required();
|
||||||
$field[] = Form::number('discount', '享受折扣', isset($vipInfo) ? $vipInfo->discount : 100)->min(0)->max(100)->col(8)->placeholder('输入折扣数100,代表原价,90代表9折')->required();
|
$field[] = Form::number('discount', '享受折扣', isset($vipInfo) ? $vipInfo->discount : 100)->min(0)->max(100)->col(8)->placeholder('输入折扣数100,代表原价,90代表9折')->required();
|
||||||
$field[] = Form::number('exp_num', '解锁需经验值达到', isset($vipInfo) ? $vipInfo->exp_num : 0)->min(0)->precision(0)->col(8)->required();
|
$field[] = Form::number('exp_num', '解锁需经验值达到', isset($vipInfo) ? $vipInfo->exp_num : 0)->min(0)->precision(0)->col(8)->required();
|
||||||
$field[] = Form::frameImage('icon', '图标', Url::buildUrl('admin/widget.images/index', array('fodder' => 'icon')), isset($vipInfo) ? $vipInfo->icon : '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
$field[] = Form::frameImage('icon', '图标', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'icon')), isset($vipInfo) ? $vipInfo->icon : '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
||||||
$field[] = Form::frameImage('image', '用户等级背景', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), isset($vipInfo) ? $vipInfo->image : '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
$field[] = Form::frameImage('image', '用户等级背景', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'image')), isset($vipInfo) ? $vipInfo->image : '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
|
||||||
$field[] = Form::radio('is_show', '是否显示', isset($vipInfo) ? $vipInfo->is_show : 0)->options([['label' => '显示', 'value' => 1], ['label' => '隐藏', 'value' => 0]])->col(24);
|
$field[] = Form::radio('is_show', '是否显示', isset($vipInfo) ? $vipInfo->is_show : 0)->options([['label' => '显示', 'value' => 1], ['label' => '隐藏', 'value' => 0]])->col(24);
|
||||||
return create_form($msg, $field, Url::buildUrl('/user/user_level'), 'POST');
|
return create_form($msg, $field, Url::buildUrl('/user/user_level'), 'POST');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -235,9 +235,9 @@ new Vue({
|
|||||||
// this.getMenus().then(menus => {
|
// this.getMenus().then(menus => {
|
||||||
// 处理手动清除db 跳转403问题
|
// 处理手动清除db 跳转403问题
|
||||||
if (!menus.length) {
|
if (!menus.length) {
|
||||||
if (path !== '/admin/login') {
|
// if (path !== '/admin/login') {
|
||||||
this.$router.replace('/admin/login');
|
// this.$router.replace('/admin/login');
|
||||||
}
|
// }
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 在 404 时,是没有 headerName 的
|
// 在 404 时,是没有 headerName 的
|
||||||
|
|||||||
@ -2,8 +2,6 @@ const path = require('path');
|
|||||||
const Setting = require('./src/setting.env');
|
const Setting = require('./src/setting.env');
|
||||||
// 引入打包分析文件
|
// 引入打包分析文件
|
||||||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
||||||
// 引入Gzip压缩文件
|
|
||||||
const CompressionPlugin = require('compression-webpack-plugin');
|
|
||||||
// 引入js打包工具
|
// 引入js打包工具
|
||||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
||||||
|
|
||||||
@ -43,15 +41,6 @@ module.exports = {
|
|||||||
configureWebpack: (config) => {
|
configureWebpack: (config) => {
|
||||||
const pluginsPro = [new BundleAnalyzerPlugin()];
|
const pluginsPro = [new BundleAnalyzerPlugin()];
|
||||||
|
|
||||||
pluginsPro.push(
|
|
||||||
new CompressionPlugin({
|
|
||||||
algorithm: 'gzip',
|
|
||||||
test: /\.js$|\.html$|\.css$/, // 匹配文件名
|
|
||||||
minRatio: 0.8, // 压缩率小于1才会压缩
|
|
||||||
threshold: 10240, // 对超过10k的数据压缩
|
|
||||||
deleteOriginalAssets: false, // 是否删除未压缩的源文件,谨慎设置,如果希望提供非gzip的资源,可不设置或者设置为false(比如删除打包后的gz后还可以加载到原始资源文件)
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
pluginsPro.push(
|
pluginsPro.push(
|
||||||
// js文件压缩
|
// js文件压缩
|
||||||
new UglifyJsPlugin({
|
new UglifyJsPlugin({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user