添加网站文件

This commit is contained in:
2025-12-22 13:59:40 +08:00
commit 117aaf83d1
19468 changed files with 2111999 additions and 0 deletions

1
application/.htaccess Normal file
View File

@@ -0,0 +1 @@
deny from all

View File

@@ -0,0 +1,38 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\behavior;
use app\admin\cache\RoleMenuCache;
use app\admin\cache\RoleNoneAuthCacheUris;
class ClearMenuAuthCache
{
/**
* 清除菜单权限缓存
*/
public function run()
{
(new RoleMenuCache())->delAll();
(new RoleNoneAuthCacheUris())->delAll();
}
}

View File

@@ -0,0 +1,51 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\behavior;
use think\Db;
use think\Request;
class SystemLog
{
/**
* 记录后台操作日志
* @param Request $request
*/
public function run(Request $request)
{
$admin_info = session('admin_info');
if (!session('admin_info')) {
return;
}
$data = [
'admin_id' => $admin_info['id'],
'account' => $admin_info['account'],
'name' => $admin_info['name'],
'create_time' => time(),
'uri' => url(),
'type' => $request->isPost() ? 'POST' : 'GET',
'param' => json_encode($request->param(),JSON_UNESCAPED_UNICODE),
'ip' => $request->ip(),
];
Db::name('system_log')->insert($data);
}
}

View File

@@ -0,0 +1,42 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\cache;
use app\admin\server\MenuServer;
use app\common\cache\CacheBase;
/**
* 登录控制
* Class LoginCtrlCache
* @package app\admin\cache
*/
class LoginStateCache extends CacheBase
{
public function setTag()
{
return 'login_state';
}
public function setData()
{
return time();
}
}

View File

@@ -0,0 +1,37 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\cache;
use app\admin\server\MenuServer;
use app\common\cache\CacheBase;
class RoleMenuCache extends CacheBase
{
public function setTag()
{
return 'role_menu';
}
public function setData()
{
return MenuServer::getMenuHtml($this->extend['role_id']);
}
}

View File

@@ -0,0 +1,38 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\cache;
use app\admin\server\AuthServer;
use app\common\cache\CacheBase;
class RoleNoneAuthCacheIds extends CacheBase
{
public function setTag()
{
return 'role_none_auth_ids';
}
public function setData()
{
return AuthServer::getRoleNoneAuthIds($this->extend['role_id']);
}
}

View File

@@ -0,0 +1,38 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\cache;
use app\admin\server\AuthServer;
use app\common\cache\CacheBase;
class RoleNoneAuthCacheUris extends CacheBase
{
public function setTag()
{
return 'role_none_auth_uris';
}
public function setData()
{
return AuthServer::getRoleNoneAuthUris($this->extend['role_id']);
}
}

View File

@@ -0,0 +1,28 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
use think\facade\Env;
return [
//默认错误跳转对应的模板文件
'dispatch_error_tmpl' => '../application/admin/view/dispatch/error.html',
//默认成功跳转对应的模板文件
'dispatch_success_tmpl' => '../application/admin/view/dispatch/success.html',
];

View File

@@ -0,0 +1,31 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
use think\facade\Env;
return [
//免登录页面
'free_login' => ['account_login'],
//样式显示
'env_name' => Env::get('project.env_name', '本地环境-'),
'admin_name' => Env::get('project.admin_name', 'LikeShop管理后台'),
'theme_color' => 'layui-bg-blue',
'theme_button' => 'layui-btn-normal',
];

View File

@@ -0,0 +1,36 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | 模板设置
// +----------------------------------------------------------------------
return [
//'layout_on' => true,
//'layout_name' => 'layout',
];

View File

@@ -0,0 +1,64 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\LoginLogic;
use app\admin\validate\Login;
use think\facade\Url;
class Account extends AdminBase
{
public $like_not_need_login = ['login'];
/**
* 登录
* @return mixed
*/
public function login()
{
if ($this->request->isAjax()) {
$post = input('post.');
$result = $this->validate($post, 'app\admin\validate\Login');
if ($result === true) {
LoginLogic::login($post);
$this->_success('登录成功');
}
$this->_error($result);
}
$this->assign('account', cookie('account'));
//首页配置
$this->assign('config', LoginLogic::config());
return $this->fetch();
}
/**
* 退出登录
*/
public function logout()
{
LoginLogic::logout(session('admin_info.id'));
$url = Url::build('account/login');
$this->redirect($url);
}
}

View File

@@ -0,0 +1,105 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\AccountLogLogic;
use think\helper\Time;
class AccountLog extends AdminBase{
/**
* note 资金记录
* create_time 2020/11/20 17:36
*/
public function capitalList(){
if($this->request->isAjax()){
$get = $this->request->get();
$list = AccountLogLogic::lists($get);
$this->_success('',$list);
}
$this->assign('order_source',AccountLogLogic::orderSourceList(1));
$this->assign('time',AccountLogLogic::getTime());
return $this->fetch();
}
/**
* note 积分记录
* create_time 2020/11/20 17:36
*/
public function integralList(){
if($this->request->isAjax()){
$get = $this->request->get();
$list = AccountLogLogic::lists($get);
$this->_success('',$list);
}
$this->assign('order_source',AccountLogLogic::orderSourceList(2));
$this->assign('time',AccountLogLogic::getTime());
return $this->fetch();
}
/**
* note 成长值记录
* create_time 2020/11/20 17:36
*/
public function growthList(){
if($this->request->isAjax()){
$get = $this->request->get();
$list = AccountLogLogic::lists($get);
$this->_success('',$list);
}
$this->assign('order_source',AccountLogLogic::orderSourceList(3));
$this->assign('time',AccountLogLogic::getTime());
return $this->fetch();
}
/**
* Notes: 佣金记录
* @author 段誉(2021/5/15 11:36)
* @return mixed
*/
public function withdrawList()
{
if($this->request->isAjax()){
$get = $this->request->get();
$list = [];
switch ($get['type']) {
case 'distribution':
$list = AccountLogLogic::getDistributionLog($get);
break;
}
$this->_success('',$list);
}
return $this->fetch();
}
/**
* Notes: 佣金统计
* @author 段誉(2021/5/15 11:36)
*/
public function withdrawTotalCount()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$result = AccountLogLogic::withdrawTotalCount($get);
$this->_success('OK', $result);
}
}
}

View File

@@ -0,0 +1,152 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\ActivityAreaLogic;
class Activity extends AdminBase{
public function lists(){
$this->assign('activity_list',ActivityAreaLogic::getActivityList());
return $this->fetch();
}
/**
* note 活动专区列表
* create_time 2020/11/25 10:36
*/
public function areaLists(){
if($this->request->isAjax()){
$list = ActivityAreaLogic::areaLists();
$this->_success('',$list);
}
}
/**
* note 活动商品列表
* create_time 2020/11/25 10:36
*/
public function goodsLists(){
if($this->request->isAjax()){
$get = $this->request->get();
$list = ActivityAreaLogic::goodsLists($get);
$this->_success('',$list);
}
}
/**
* note 添加活动专区
* create_time 2020/11/25 10:37
*/
public function addActivity(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = $this->validate($post,'app\admin\validate\ActivityArea.add');
if($result === true){
ActivityAreaLogic::addActivity($post);
$this->_success('新增成功',[]);
}
$this->_error($result);
}
return $this->fetch();
}
/**
* note 编辑活动专区
* create_time 2020/11/25 10:37
*/
public function editActivity($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post,'app\admin\validate\ActivityArea');
if($result === true){
ActivityAreaLogic::editActivity($post);
$this->_success('新增成功',[]);
}
$this->_error($result);
}
$this->assign('info',ActivityAreaLogic::getActivity($id));
return $this->fetch();
}
/**
* note 删除活动专区
* create_time 2020/11/25 10:37
*/
public function delActivity(){
$id = $this->request->post('id');
ActivityAreaLogic::delActivity($id);
$this->_success('删除成功',[]);
}
/**
* note 添加活动商品
* create_time 2020/11/25 10:37
*/
public function addGoods(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['goods_list'] = form_to_linear($post);
$result = $this->validate($post,'app\admin\validate\ActivityGoods.add');
if($result === true){
ActivityAreaLogic::addGoods($post);
$this->_success('新增成功',[]);
}
$this->_error($result);
}
$this->assign('activity_list',ActivityAreaLogic::getActivityList());
return $this->fetch();
}
/**
* note 编辑活动商品
* create_time 2020/11/25 10:37
*/
public function editGoods(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post,'app\admin\validate\ActivityGoods');
if($result === true){
ActivityAreaLogic::editGoods($post);
$this->_success('新增成功',[]);
}
$this->_error($result);
}
$goods_id = $this->request->get('goods_id');
$activity_id = $this->request->get('activity_id');
$this->assign('activity_list',ActivityAreaLogic::getActivityList());
$this->assign('info',ActivityAreaLogic::getActivityGoods($goods_id,$activity_id));
return $this->fetch();
}
/**
* note 删除活动商品
* create_time 2020/11/25 10:38
*/
public function delGoods(){
$goods_id = $this->request->post('goods_id');
$activity_id = $this->request->post('activity_id');
$result = ActivityAreaLogic::delGoods($goods_id,$activity_id);
if($result == true){
$this->_success('删除成功','');
}
return $this->_error('删除失败','');
}
}

View File

@@ -0,0 +1,142 @@
<?php
namespace app\admin\controller;
use app\admin\logic\AdLogic;
class Ad extends AdminBase
{
/**
* 广告管理列表
* @return mixed
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdLogic::lists($get));
}
$type = \app\common\model\Ad::getAdTypeDesc(true);
$this->assign('type', $type);
return $this->fetch();
}
/**
* 添加
* @return mixed
*/
public function add($client = '')
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\Ad.add');
if ($result === true) {
$result = AdLogic::add($post);
if ($result) {
$this->_success('添加成功!');
} else {
$this->_error('添加失败');
}
}
$this->_error($result);
}
$this->assign('category_list',AdLogic::getGoodsCategory());
$this->assign('link_page', \app\common\model\Ad::getLinkPage($client));
$this->assign('position_list', AdLogic::infoPosition($client));
return $this->fetch();
}
/**
* 编辑
* @param string $id
* @return mixed
*/
public function edit($id = '')
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\Ad');
if ($result === true) {
$result = AdLogic::edit($post);
if ($result) {
$this->_success('编辑成功!');
} else {
$this->_error('编辑失败');
}
}
$this->_error($result);
}
$info = AdLogic::info($id);
$this->assign('position_list', AdLogic::infoPosition($info['client']));
$this->assign('category_list',AdLogic::getGoodsCategory());
$this->assign('link_page', \app\common\model\Ad::getLinkPage($info['client']));
$this->assign('info', $info);
return $this->fetch();
}
/**
* 删除
* @param $delData
*/
public function del($id, $client)
{
if ($this->request->isAjax()) {
$result = AdLogic::del($id, $client);
if ($result) {
$this->_success('删除成功');
}
$this->_error('删除失败');
}
}
/**
* 修改状态
*/
public function switchStatus()
{
$post = $this->request->post();
$result = AdLogic::switchStatus($post);
if ($result) {
$this->_success('修改成功');
}
$this->_error('修改失败');
}
/**
* 获取相应广告位置尺寸
*/
public function imgSize()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$result = AdLogic::imgSize($get);
if ($result) {
$this->_success('', $result);
}
$this->_error($result);
}
}
/**
* 获取对应终端的广告位置列表
*/
public function getPosition()
{
if ($this->request->isAjax()) {
$client = $this->request->get('client');
$result = AdLogic::infoPosition($client);
if ($result) {
$this->_success('', $result);
}
$this->_error($result);
}
}
}

View File

@@ -0,0 +1,135 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\AdPositionLogic;
use app\common\model\Ad;
class AdPosition extends AdminBase
{
/**
* 广告管理列表
* @return mixed
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$result = AdPositionLogic::lists($get);
$this->_success('获取成功', $result);
}
$type = \app\common\model\Ad::getAdTypeDesc(true);
$this->assign('type', $type);
return $this->fetch();
}
/**
* 添加
* @return mixed
*/
public function add($client = '')
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\AdPosition.add');
if ($result === true) {
$result = AdPositionLogic::addAdPosition($post);
if ($result) {
$this->_success('添加成功!');
} else {
$this->_error('添加失败');
}
}
$this->_error($result);
}
return $this->fetch();
}
/**
* 编辑
* @param string $id
* @return mixed
*/
public function edit($id = '')
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\AdPosition.edit');
if ($result === true) {
$result = AdPositionLogic::editAdPosition($post);
if ($result) {
$this->_success('编辑成功!');
} else {
$this->_error('编辑失败');
}
}
$this->_error($result);
}
$this->assign('info', AdPositionLogic::info($id));
return $this->fetch();
}
/**
* 删除
* @param $delData
*/
public function del()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$delData = $this->request->post('delData');
$attr = $this->request->post('attr');
$client = $this->request->post('client');
$result = $this->validate($post, 'app\admin\validate\AdPosition.del');
if ($result === true) {
// dd($result);
$result = AdPositionLogic::del($delData, $client, $attr);
if ($result) {
$this->_success('删除成功');
}
$this->_error('删除失败');
}
$this->_error($result);
}
}
/**
* 修改状态
*/
public function switchStatus()
{
$post = $this->request->post();
$result = AdPositionLogic::switchStatus($post);
if ($result) {
$this->_success('修改成功');
}
$this->_error('修改失败');
}
}

View File

@@ -0,0 +1,114 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\AdminLogic;
class Admin extends AdminBase
{
/**
* 管理员列表
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', AdminLogic::lists($get));
}
$this->assign('role_lists', AdminLogic::roleLists());
return $this->fetch();
}
/**
* 添加管理员
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
$result = $this->validate($post, 'app\admin\validate\Admin.add');
if ($result === true) {
AdminLogic::addAdmin($post);
$this->_success('修改成功');
}
$this->_error($result);
}
$this->assign('role_lists', AdminLogic::roleLists());
return $this->fetch();
}
/**
* 编辑管理员
* @param string $admin_id
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function edit($admin_id = '')
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\Admin.edit');
if ($result === true) {
AdminLogic::editAdmin($post);
$this->_success('修改成功');
}
$this->_error($result);
}
$this->assign('info', AdminLogic::info($admin_id));
$this->assign('role_lists', AdminLogic::roleLists());
return $this->fetch();
}
/**
* 删除管理员
* @param $admin_id
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function del($admin_id)
{
if ($this->request->isAjax()) {
$result = AdminLogic::delAdmin($admin_id);
if ($result) {
$this->_success('删除成功');
}
$this->_error('删除失败');
}
}
}

View File

@@ -0,0 +1,181 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\server\AuthServer;
use app\BaseController;
use app\common\server\UrlServer;
use think\Controller;
use think\exception\HttpResponseException;
use think\facade\Config;
use think\facade\Debug;
use think\facade\Url;
use think\Response;
class AdminBase extends Controller
{
public $like_not_need_login = [];
protected $js_data = [];
public $admin_info = [];
public $admin_id;
public $view_theme_color = '';
public $page_no = 1;
public $page_size = 15;
public function __construct()
{
parent::__construct();
$this->setValue();
self::setViewValue();
}
public function setValue()
{
$this->admin_info = session('admin_info');
$this->admin_id = session('admin_info.id');
//分页参数
$page_no = (int)$this->request->get('page_no');
$this->page_no = $page_no && is_numeric($page_no) ? $page_no : $this->page_no;
$page_size = (int)$this->request->get('page_size');
$this->page_size = $page_size && is_numeric($page_size) ? $page_size : $this->page_size;
$this->page_size = min($this->page_size, 100);
}
/**
* 设置视图全局变量
*/
private function setViewValue()
{
$app = Config::get('project.');
$this->assign('view_env_name', $app['env_name']);
$this->assign('view_admin_name', $app['admin_name']);
$this->assign('view_theme_color', $app['theme_color']);
$this->assign('view_theme_button', $app['theme_button']);
$this->assign('version', $app['version']);
$this->assign('front_version', $app['front_version']);
$this->assign('storageUrl', UrlServer::getFileUrl('/'));
$this->assignJs('image_upload_url', Url::build('file/image'));
}
/**
* User: 意象信息科技 lr
* Desc: 请求成功
* @param string $msg
* @param array $data
* @param int $code
* @param int $show
* @param array $header
*/
protected function _success($msg = '', $data = [], $code = 1, $show = 0, $wait = 3, $url = '', array $header = [])
{
$type = $this->getResponseType();
$time = Debug::getUseTime();
$result = [
'code' => $code,
'msg' => $msg,
'data' => $data,
'show' => $show,
'time' => $time,
'wait' => $wait,
'url' => $url,
];
$type = $this->getResponseType();
// 把跳转模板的渲染下沉,这样在 response_send 行为里通过getData()获得的数据是一致性的格式
if ('html' == strtolower($type)) {
$type = 'jump';
}
$response = Response::create($result, $type)->header($header)->options(['jump_template' => $this->app['config']->get('dispatch_success_tmpl')]);
throw new HttpResponseException($response);
}
/**
* User: 意象信息科技 lr
* Desc: 请求失败
* @param string $msg
* @param array $data
* @param int $code
* @param int $show
* @param array $header
*/
protected function _error($msg = '', $data = [], $code = 0, $show = 1, $wait = 3, $url = '', array $header = [])
{
$type = $this->getResponseType();
$time = Debug::getUseTime();
$result = [
'code' => $code,
'msg' => $msg,
'data' => $data,
'show' => $show,
'time' => $time,
'wait' => $wait,
'url' => $url,
];
if ('html' == strtolower($type)) {
$type = 'jump';
}
$response = Response::create($result, $type)->header($header)->options(['jump_template' => $this->app['config']->get('dispatch_error_tmpl')]);
throw new HttpResponseException($response);
}
/**
* User: 意象信息科技 lr
* Desc: 通过返回
* @param $data
*/
protected function successOrError($data)
{
if ($data['code'] == 1) {
$this->_success($data['msg'], $data['data'], $data['code'], $data['show']);
}
$this->_error($data['msg'], $data['data'], $data['code'], $data['show']);
}
protected function assignJs($name, $value)
{
$this->js_data[$name] = $value;
$js_code = "<script>";
foreach ($this->js_data as $name => $value) {
if (is_array($value)) {
$value = json_encode($value);
} elseif (!is_integer($value)) {
$value = '"' . $value . '"';
}
$js_code .= $name . '=' . $value . ';';
}
$js_code .= "</script>";
$this->assign('js_code', $js_code);
}
}

View File

@@ -0,0 +1,349 @@
<?php
namespace app\admin\controller;
use app\admin\logic\AdminorderLogic;
use app\admin\logic\StatcubLogic;
use app\common\model\Order as CommonOrder;
use app\common\model\Pay;
use app\common\model\Client_;
use think\Db;
class Adminorder extends AdminBase
{
/**
* Notes: 保洁订单列表
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function cleaning(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::cleaning($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('num',StatcubLogic::Usercleaning());
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 收纳整理
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function storage(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::storage($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 深度清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function depth(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::depth($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 宠物保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function pet(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::pet($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 做饭到家
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function cooking(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::cooking($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 粗开荒保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function thick(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::thick($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 细开荒保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function fine(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::fine($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 搬家货运
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function move(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::move($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 搬家货运
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function detection(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::detection($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 空气治理
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function governance(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::governance($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 家电清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function wash(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::wash($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 家电清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function linen(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::linen($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 宠物保洁订单
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function pets(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::pets($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
}

View File

@@ -0,0 +1,142 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\AfterSaleLogic;
use app\common\model\AfterSale as CommonAfterSale;
class AfterSale extends AdminBase
{
/**
* User: 意象信息科技 mjf
* Desc: 列表
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', AfterSaleLogic::lists($get));
}
$this->assign('status', CommonAfterSale::getStatusDesc(true));
return $this->fetch();
}
/**
* User: 意象信息科技 mjf
* Desc: 详情
*/
public function detail()
{
$id = $this->request->get('id');
$detail = AfterSaleLogic::getDetail($id);
$this->assign('detail', $detail);
return $this->fetch();
}
/**
* User: 意象信息科技 mjf
* Desc: 同意
*/
public function agree()
{
if ($this->request->isAjax()) {
$post = $this->request->post('');
$check = $this->validate($post, 'app\admin\validate\AfterSale.agree');
if (true !== $check) {
$this->_error($check);
}
AfterSaleLogic::agree($post['id'],$this->admin_id);
$this->_success('操作成功');
}
}
/**
* User: 意象信息科技 mjf
* Desc: 拒绝
*/
public function refuse()
{
if ($this->request->isAjax()) {
$post = $this->request->post('');
$check = $this->validate($post, 'app\admin\validate\AfterSale.refuse');
if (true !== $check) {
$this->_error($check);
}
AfterSaleLogic::refuse($post,$this->admin_id);
$this->_success('操作成功');
}
}
/**
* User: 意象信息科技 mjf
* Desc: 收货
*/
public function take()
{
if ($this->request->isAjax()) {
$post = $this->request->post('');
$check = $this->validate($post, 'app\admin\validate\AfterSale.take');
if (true !== $check) {
$this->_error($check);
}
AfterSaleLogic::takeGoods($post,$this->admin_id);
$this->_success('操作成功');
}
}
/**
* User: 意象信息科技 mjf
* Desc: 拒绝收货
*/
public function refuseGoods()
{
if ($this->request->isAjax()) {
$post = $this->request->post('');
$check = $this->validate($post, 'app\admin\validate\AfterSale.refuse_goods');
if (true !== $check) {
$this->_error($check);
}
AfterSaleLogic::refuseGoods($post,$this->admin_id);
$this->_success('操作成功');
}
}
/**
* User: 意象信息科技 mjf
* Desc: 确认退款
*/
public function confirm()
{
if ($this->request->isAjax()) {
$post = $this->request->post('');
$check = $this->validate($post, 'app\admin\validate\AfterSale.confirm');
if (true !== $check) {
$this->_error($check);
}
$res = AfterSaleLogic::confirm($post,$this->admin_id);
if ($res === true){
$this->_success('操作成功');
}
$this->_error($res);
}
}
}

View File

@@ -0,0 +1,117 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\{
ArticleLogic,
ArticleCategoryLogic
};
class Article extends AdminBase
{
/**
* 文章列表
* @return mixed
*/
public function lists()
{
$category = ArticleCategoryLogic::getArticleCategory();
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', ArticleLogic::lists($get, $category));
}
$this->assign('category_list', $category);
return $this->fetch();
}
/**
* 添加文章
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\Article.add');
if ($result === true) {
ArticleLogic::addArticle($post);
$this->_success('添加成功!');
}
$this->_error($result);
}
$acticle_category = ArticleCategoryLogic::getArticleCategory();
$this->assign('category_list', $acticle_category);
return $this->fetch();
}
/**
* 编辑文章
*/
public function edit($id)
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\Article.edit');
if ($result === true) {
ArticleLogic::editArticle($post);
$this->_success('编辑成功!');
}
$this->_error($result);
}
$article = ArticleLogic::getArticle($id);
$category_list = ArticleCategoryLogic::getArticleCategory();
$this->assign('article', $article);
$this->assign('category_list', $category_list);
return $this->fetch();
}
/**
* 删除文章
*/
public function del($id)
{
if ($this->request->isAjax()) {
$result = $this->validate(['id' => $id], 'app\admin\validate\Article.del');
if ($result === true) {
ArticleLogic::delArticle($id);
$this->_success('删除成功');
}
$this->_error($result);
}
}
/**
* 修改状态
*/
public function switchStatus()
{
$post = $this->request->post();
ArticleLogic::switchStatus($post);
$this->_success('修改成功');
}
}

View File

@@ -0,0 +1,99 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\{
ArticleCategoryLogic
};
class ArticleCategory extends AdminBase {
/**
* 文章分类列表
* @return mixed
*/
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', ArticleCategoryLogic::lists($get));
}
return $this->fetch();
}
/**
* 添加文章分类
* @return mixed
*/
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\ArticleCategory');
if($result === true){
ArticleCategoryLogic::addArticleCategory($post);
$this->_success('添加成功!');
}
$this->_error($result);
}
return $this->fetch();
}
/**
* 编辑文章分类
* @return mixed
*/
public function edit($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\ArticleCategory.edit');
if($result === true){
ArticleCategoryLogic::editArticleCategory($post);
$this->_success('编辑成功!');
}
$this->_error($result);
}
$category= ArticleCategoryLogic::getArticleCategory($id);
$this->assign('category',array_values($category)[0]);
return $this->fetch();
}
/**
* 删除文章分类
* @return mixed
*/
public function del($id)
{
if ($this->request->isAjax()) {
$result = $this->validate(['id' => $id], 'app\admin\validate\ArticleCategory.del');
if ($result === true) {
ArticleCategoryLogic::delArticleCategory($id);
$this->_success('删除成功');
}
$this->_error($result);
}
}
/**
* 修改状态
*/
public function switchStatus(){
$post = $this->request->post();
ArticleCategoryLogic::switchStatus($post);
$this->_success('修改成功');
}
}

View File

@@ -0,0 +1,158 @@
<?php
namespace app\admin\controller;
use app\admin\logic\AuthLogic;
use think\facade\Hook;
use think\facade\Url;
class Auth extends AdminBase
{
/**
* 菜单列表
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function lists()
{
$lists = json_encode(AuthLogic::lists());
$this->assign('lists', $lists);
return $this->fetch();
}
/**
* 添加菜单
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
$result = $this->validate($post, 'app\admin\validate\Auth');
if ($result === true) {
$result = AuthLogic::addMenu($post);
if (!is_string($result)) {
$this->_success('添加成功');
} else {
$this->_error($result);
}
}
$this->_error($result);
}
$this->assign('menu_lists', AuthLogic::chooseMenu());
return $this->fetch();
}
/**
* 编辑菜单
* @param $id
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function edit($id)
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
$result = $this->validate($post, 'app\admin\validate\Auth');
if ($result === true) {
$result = AuthLogic::updateMenu($post);
if (!is_string($result)) {
$this->_success('修改成功');
} else {
$this->_error($result);
}
}
$this->_error($result);
}
$this->assign('info', AuthLogic::info($id));
$this->assign('menu_lists', AuthLogic::chooseMenu($id));
return $this->fetch();
}
/**
* 设置状态
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function status()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
AuthLogic::setStatus($post);
Hook::listen('menu_auth');
$this->_success('修改成功');
}
}
/**
* 删除菜单
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function del()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if (empty($post['ids'])) {
$this->_error('删除失败');
}
AuthLogic::delMenu($post['ids']);
Hook::listen('menu_auth');
$this->_success('删除成功');
}
}
/**
* 获取员工所有权限
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function stafflists(){
$lists = json_encode(AuthLogic::stafflists());
$this->assign('lists', $lists);
return $this->fetch();
}
/**
* 增加员工权限
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function add_staffauth(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
$result = AuthLogic::add_staffauth($post);
$this->_success('修改成功');
}
$this->assign('menu_lists', AuthLogic::staffchooseMenu());
return $this->fetch();
}
/**
* 修改员工权限
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function edit_staffauth($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
$result = AuthLogic::edit_staffauth($post);
$this->_success('修改成功');
}
$this->assign('menu_lists', AuthLogic::staffchooseMenu());
$this->assign('info', AuthLogic::staffauthinfo($id));
return $this->fetch();
}
}

View File

@@ -0,0 +1,204 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\BargainLogic;
use app\common\model\BargainLaunch;
use app\common\server\ConfigServer;
class Bargain extends AdminBase
{
/**
* Notes: 砍价活动 商品列表
* @author 张无忌(2021/1/30 15:06)
* @return mixed
*/
public function activity()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = BargainLogic::activity($get);
$this->_success('获取成功', $lists);
}
return $this->fetch();
}
/**
* Notes: 新增活动 商品
* @author 张无忌(2021/1/30 15:21)
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$check = $this->validate($post, 'app\admin\validate\Bargain.add');
if ($check !== true) {
$this->_error($check);
}
if (BargainLogic::add($post)) {
$this->_success('新增成功');
} else {
$error = BargainLogic::getError() ?? '新增失败';
$this->_error($error);
}
}
return $this->fetch();
}
/**
* Notes: 编辑活动 商品
* @author 张无忌(2021/1/30 15:21)
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$check = $this->validate($post, 'app\admin\validate\Bargain');
if ($check !== true) {
$this->_error($check);
}
if (BargainLogic::edit($post)) {
$this->_success('编辑成功');
} else {
$error = BargainLogic::getError() ?? '编辑失败';
$this->_error($error);
}
}
$id = $this->request->get('id');
$detail = BargainLogic::getDetail($id);
$this->assign('detail', $detail);
return $this->fetch();
}
/**
* Notes: 删除
* @author 张无忌(2021/1/12 15:52)
* @return mixed
*/
public function del()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id');
if (BargainLogic::softDelete($id)) {
$this->_success('删除成功');
} else {
$error = BargainLogic::getError() ?? '删除失败';
$this->_error($error);
}
}
}
/**
* Notes: 切换状态
* @author 张无忌(2021/1/13 18:01)
*/
public function switchStatus()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if (BargainLogic::switchStatus($post)) {
$this->_success('更新成功');
} else {
$error = BargainLogic::getError() ?? '更新失败';
$this->_error($error);
}
}
}
/**
* Notes: 发起砍价列表
* @author 张无忌(2021/1/30 16:51)
*/
public function launch()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = BargainLogic::getLaunch($get);
$this->_success('Ok', $lists);
}
$bargain_id = $this->request->get('bargain_id', 0);
$this->assign('bargain_id', $bargain_id);
return $this->fetch();
}
/**
* Notes: 砍价详细
* @author 张无忌(2021/1/30 17:13)
* @return mixed
*/
public function detail()
{
$id = $this->request->get('id');
$detail = BargainLogic::getLaunchDetail($id);
$this->assign('detail', $detail);
return $this->fetch();
}
/**
* Notes: 砍价订单记录
* @author 张无忌(2021/2/24 15:59)
*/
public function knifeOrderRecord() {
$launch_id = $this->request->get('launch_id');
$get = $this->request->get();
$lists = BargainLogic::getKnifeOrderRecord($launch_id, $get);
$this->_success('获取成功', $lists);
}
/**
* Notes: 砍价助力记录
* @author 张无忌(2021/2/24 15:58)
*/
public function knifeRecord()
{
$launch_id = $this->request->get('launch_id');
$get = $this->request->get();
$lists = BargainLogic::getKnifeRecord($launch_id, $get);
$this->_success('获取成功', $lists);
}
/**
* Notes: 砍价设置
* @author 张无忌(2021/2/24 18:16)
* @return mixed
*/
public function set()
{
if ($this->request->isAjax()) {
$payment_limit_time = $this->request->post('payment_limit_time', 0);
try {
ConfigServer::set('bargain', 'payment_limit_time', $payment_limit_time);
} catch (\Exception $e) {
$this->_error('设置失败');
}
$this->_success('设置成功');
}
$payment_limit_time = ConfigServer::get('bargain', 'payment_limit_time', 0);
$this->assign('payment_limit_time', $payment_limit_time);
return $this->fetch();
}
}

View File

@@ -0,0 +1,242 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\server\ConfigServer;
use app\common\server\UrlServer;
class Basic extends AdminBase
{
/**
* 网站配置
* @return mixed
*/
public function website()
{
$config = [
'file_url' => UrlServer::getFileUrl('/'),
'name' => ConfigServer::get('website', 'name'),
'login_logo' => ConfigServer::get('website', 'login_logo'),
'keyword' => ConfigServer::get('website', 'keyword'),
'slogan_status' => ConfigServer::get('website', 'slogan_status'),
'slogan' => ConfigServer::get('website', 'slogan'),
'backstage_logo' => ConfigServer::get('website', 'backstage_logo'),
'admin_image' => ConfigServer::get('website', 'admin_image'),
'admin_title' => ConfigServer::get('website', 'admin_title'),
'partner_image' => ConfigServer::get('website', 'partner_image'),
'partner_title' => ConfigServer::get('website', 'partner_title'),
'shop_logo' => ConfigServer::get('website', 'shop_logo'),
'shop_login_logo' =>ConfigServer::get('website', 'shop_login_logo'),
'pc_logo' => ConfigServer::get('website', 'pc_logo'),
'user_image' => ConfigServer::get('website', 'user_image'),
'goods_image' =>ConfigServer::get('website', 'goods_image'),
'web_favicon' =>ConfigServer::get('website', 'web_favicon'),
];
$this->assign('config', $config);
return $this->fetch('');
}
/**
* 设置网站
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function setWebsite()
{
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\Basic');
if ($result === true) {
ConfigServer::set('website', 'name', $post['name']);
ConfigServer::set('website', 'login_logo', $post['login_logo']);
ConfigServer::set('website', 'web_favicon', $post['web_favicon']);
ConfigServer::set('website', 'backstage_logo', $post['backstage_logo']);
ConfigServer::set('website', 'admin_image', $post['admin_image']);
ConfigServer::set('website', 'admin_title', $post['admin_title']);
ConfigServer::set('website', 'shop_logo', $post['shop_logo']);
ConfigServer::set('website', 'shop_login_logo', $post['shop_login_logo']);
ConfigServer::set('website', 'pc_logo', $post['pc_logo']);
ConfigServer::set('website', 'user_image', $post['user_image']);
ConfigServer::set('website', 'goods_image', $post['goods_image']);
$this->_success('修改成功');
}
$this->_error($result);
}
/**
* 版权备案
* @return mixed
*/
public function copyright()
{
$config = [
'company_name' => ConfigServer::get('copyright', 'company_name'),
'number' => ConfigServer::get('copyright', 'number'),
'link' => ConfigServer::get('copyright', 'link'),
];
$this->assign('config', $config);
return $this->fetch();
}
/**
* 设置版权备案
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function setCopyright()
{
$post = $this->request->post();
ConfigServer::set('copyright', 'company_name', $post['company_name']);
// ConfigServer::set('copyright', 'logo',$post['logo']);
ConfigServer::set('copyright', 'number', $post['number']);
ConfigServer::set('copyright', 'link', $post['link']);
return $this->_success('修改成功');
}
/**
* 上传设置
*/
public function upload()
{
$config = [
'way' => ConfigServer::get('upload', 'way'),
'size' => ConfigServer::get('upload', 'size'),
'type' => ConfigServer::get('upload', 'type'),
'mime_type' => ConfigServer::get('upload', 'mime_type'),
'status' => ConfigServer::get('watermark', 'status'),
'mark_type' => ConfigServer::get('watermark', 'mark_type'),
'mark' => ConfigServer::get('watermark', 'mark'),
'location' => ConfigServer::get('watermark', 'location'),
'transparency' => ConfigServer::get('watermark', 'transparency'),
'slope' => ConfigServer::get('watermark', 'slope'),
'offset_x' => ConfigServer::get('watermark', 'offset_x'),
'offset_y' => ConfigServer::get('watermark', 'offset_y'),
];
$this->assign('config', $config);
return $this->fetch();
}
public function setUpload()
{
$post = $this->request->post();
if ($post) {
ConfigServer::set('upload', 'way', $post['way']);
ConfigServer::set('upload', 'size', $post['size']);
ConfigServer::set('upload', 'type', $post['type']);
ConfigServer::set('upload', 'mime_type', $post['mime_type']);
ConfigServer::set('watermark', 'status', $post['status']);
ConfigServer::set('watermark', 'mark_type', $post['mark_type']);
ConfigServer::set('watermark', 'mark', $post['mark']);
ConfigServer::set('watermark', 'location', $post['location']);
ConfigServer::set('watermark', 'transparency', $post['transparency']);
ConfigServer::set('watermark', 'slope', $post['slope']);
ConfigServer::set('watermark', 'offset_x', $post['offset_x']);
ConfigServer::set('watermark', 'offset_y', $post['offset_y']);
return $this->_success('修改成功');
}
}
/**
* APP设置
* @return mixed
*/
public function app()
{
$config = [
'line_ios' => ConfigServer::get('app', 'line_ios', ''),
'line_android' => ConfigServer::get('app', 'line_android', ''),
'download_doc' => ConfigServer::get('app', 'download_doc', ''),
'agreement' => ConfigServer::get('app', 'agreement', 0),
'wechat_login' => ConfigServer::get('app', 'wechat_login', 0),
];
$this->assign('config',$config);
return $this->fetch();
}
public function setApp()
{
$post = $this->request->post();
$post['agreement'] = isset($post['agreement']) && $post['agreement'] == 'on' ? 1 : 0;
$post['wechat_login'] = isset($post['wechat_login']) && $post['wechat_login'] == 'on' ? 1 : 0;
ConfigServer::set('app', 'line_ios',$post['line_ios']);
ConfigServer::set('app', 'line_android',$post['line_android']);
ConfigServer::set('app', 'download_doc',$post['download_doc']);
ConfigServer::set('app', 'agreement',$post['agreement']);
ConfigServer::set('app', 'wechat_login',$post['wechat_login']);
$this->_success('修改成功');
}
/**
* 分享设置
*/
public function share()
{
$config = [
'file_url' => UrlServer::getFileUrl('/'),
'h5' => ConfigServer::get('share', 'h5', [
'h5_share_title' => '',
'h5_share_intro' => '',
'h5_share_image' => ''
]),
'mnp' => ConfigServer::get('share', 'mnp', [
'mnp_share_title' => ''
])
];
$this->assign('config', $config);
return $this->fetch();
}
public function setShare()
{
$post = $this->request->post();
$h5 = json_encode([
'h5_share_title' => $post['h5_share_title'],
'h5_share_intro' => $post['h5_share_intro'],
'h5_share_image' => $post['h5_share_image'],
], JSON_UNESCAPED_UNICODE);
$mnp = json_encode([
'mnp_share_title' => $post['mnp_share_title'],
], JSON_UNESCAPED_UNICODE);
ConfigServer::set('share', 'h5', $h5);
ConfigServer::set('share', 'mnp', $mnp);
$this->_success('修改成功');
}
}

View File

@@ -0,0 +1,39 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
/**
* 系统缓存
* Class Cache
* @package app\admin\controller
*/
class Cache extends AdminBase
{
public function cache()
{
if ($this->request->isAjax()) {
\think\facade\Cache::clear();
$this->_success('清除成功');
}
return $this->fetch();
}
}

View File

@@ -0,0 +1,980 @@
<?php
namespace app\admin\controller;
use app\admin\logic\ChartLogic;
use think\Db;
/**
* 数据的统计
* Class Cache
* @package app\admin\controller
*/
class Chart extends AdminBase
{
/**
* 总订单数据统计
* Class Cache
* @package app\admin\controller
*/
public function order_chart()
{
if ($this->request->isAjax()) {
$get = input();
$year = empty($get['date']) ? date('Y') : $get['date'];
$_year = $year;
$year = $this->getYearStartAndEnd($year);
$data = [
'zdd'=>0,//总订单
'xse'=>0,//销售额
'ys'=>0,//已收
'ys2'=>0,//应收
'yxse'=>[],//月销售额
'xlph'=>[],//销量排行
'xszb'=>[],//销售占比
];
$zdd_where = [
['del','=',0],
['create_time','>=',$year['start_timestamp']],
['create_time','<=',$year['end_timestamp']],
];
$data['zdd'] = Db::name('order')->where($zdd_where)->count();
$data['xse'] = Db::name('order')->where($zdd_where)->sum('total_amount');
$data['ys'] = Db::name('order')->where($zdd_where)->where('pay_zd',1)->sum('total_amount');
$data['ys2'] = Db::name('order')->where($zdd_where)->where('pay_zd',0)->sum('total_amount');
$query = "
SELECT
m.month,
COALESCE(SUM(o.total_amount), 0) AS total_sales
FROM (
SELECT 1 AS month UNION ALL
SELECT 2 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 5 UNION ALL
SELECT 6 UNION ALL
SELECT 7 UNION ALL
SELECT 8 UNION ALL
SELECT 9 UNION ALL
SELECT 10 UNION ALL
SELECT 11 UNION ALL
SELECT 12
) m
LEFT JOIN ls_order o
ON MONTH(FROM_UNIXTIME(o.create_time)) = m.month
AND YEAR(FROM_UNIXTIME(o.create_time)) = :year
GROUP BY m.month
ORDER BY m.month;
";
$yxse_list = Db::query($query,['year'=>$_year]);
$yxse_data = [];
foreach ($yxse_list as $v){
$yxse_data[] = $v['total_sales'];
}
$yxse = [
'list'=>$yxse_list,
'data'=>$yxse_data
];
$data['yxse'] = $yxse;
$query = "
SELECT
goods_id,
SUM(total_amount) AS sales_count
FROM
ls_order
WHERE
create_time >= {$year['start_timestamp']}
AND
create_time <= {$year['end_timestamp']}
GROUP BY
goods_id
ORDER BY
sales_count DESC
";
$xlph_list = Db::query($query);
$xlph_data_data = [];
$xlph_data_goods = [];
foreach ($xlph_list as $v){
$xlph_data_data[] = $v['sales_count'];
$xlph_data_goods[] = Db::name('goods')->where('id',$v['goods_id'])->value('name');
}
$xlph_data = [
'goods'=>$xlph_data_goods,
'data'=>$xlph_data_data
];
$xlph = [
'list'=>$xlph_list,
'data'=>$xlph_data
];
$data['xlph'] =$xlph;
//销售占比
$query = "
SELECT
admin_id,
SUM(total_amount) AS sales_count
FROM
ls_order
WHERE
create_time >= {$year['start_timestamp']}
AND
create_time <= {$year['end_timestamp']}
GROUP BY
admin_id
ORDER BY
sales_count DESC
";
$xszb_list = Db::query($query);
$xszb_data_data = [];
$xszb_data_goods = [];
foreach ($xszb_list as $v){
$xszb_data_data[] = $v['sales_count'];
$name = Db::name('admin')->where('id',$v['admin_id'])->value('name');
$xszb_data_goods[] = $name?$name:'其它';
}
// $xszb_data = [
// 'goods'=>$xszb_data_goods,
// 'data'=>$xszb_data_data
// ];
$xszb_data = [];
foreach ($xszb_data_goods as $k=>$v){
$xszb_data[] = ['value'=>$xszb_data_data[$k],'name'=>$v];
}
$xszb = [
'list'=>$xszb_list,
'data'=>$xszb_data
];
$data['xszb'] =$xszb;
$this->_success('获取成功',$data);
}
return $this->fetch();
}
function getYearStartAndEnd($year) {
// 创建年份的开始时间
$startDateTime = new \DateTime("$year-01-01 00:00:00");
$startTimestamp = $startDateTime->getTimestamp();
// 创建年份的结束时间
$endDateTime = new \DateTime("$year-12-31 23:59:59");
$endTimestamp = $endDateTime->getTimestamp();
return [
'start' => $startDateTime,
'end' => $endDateTime,
'start_timestamp' => $startTimestamp,
'end_timestamp' => $endTimestamp,
];
}
/**
* 财务中心数据统计
* Class Cache
* @package app\admin\controller
*/
public function finance_chart()
{
if ($this->request->isAjax()) {
$get = input();
$year = empty($get['date']) ? date('Y') : $get['date'];
$admin_id = empty($get['admin_id']) ?null : $get['admin_id'];
$admin_id2 = empty($get['admin_id2']) ?null : $get['admin_id2'];
$admin_id4 = empty($get['admin_id4']) ?null : $get['admin_id4'];
$_year = $year;
$year = $this->getYearStartAndEnd($year);
$data = [
'zdd'=>0,//总订单
'xse'=>0,//销售额
'ys'=>0,//已收
'ys2'=>0,//应收
'xse_ys'=>[],//销售额-应收-已收
];
$zdd_where = [
['del','=',0],
['create_time','>=',$year['start_timestamp']],
['create_time','<=',$year['end_timestamp']],
];
$data['zdd'] = Db::name('order')->where($zdd_where)->count();
$data['xse'] = Db::name('order')->where($zdd_where)->sum('total_amount');
$data['ys'] = Db::name('order')->where($zdd_where)->where('pay_zd',0)->sum('total_amount');
$data['ys2'] = Db::name('order')->where($zdd_where)->where('pay_zd',1)->sum('total_amount');
//销售额-应收-已收
$query = "
SELECT
m.month,
COALESCE(SUM(o.total_amount), 0) AS total_sales
FROM (
SELECT 1 AS month UNION ALL
SELECT 2 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 5 UNION ALL
SELECT 6 UNION ALL
SELECT 7 UNION ALL
SELECT 8 UNION ALL
SELECT 9 UNION ALL
SELECT 10 UNION ALL
SELECT 11 UNION ALL
SELECT 12
) m
LEFT JOIN ls_order o
ON MONTH(FROM_UNIXTIME(o.create_time)) = m.month
AND YEAR(FROM_UNIXTIME(o.create_time)) = :year
GROUP BY m.month
ORDER BY m.month;
";
$xse_list = Db::query($query,['year'=>$_year]);
$xse_data = [];
$xse = [];
foreach ($xse_list as $v){
$xse_data[] = $v['total_sales'];
}
$xse['xse'] = $xse_data;
$query = "
SELECT
o.pay_zd,
m.month,
COALESCE(SUM(o.total_amount), 0) AS total_sales
FROM (
SELECT 1 AS month UNION ALL
SELECT 2 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 5 UNION ALL
SELECT 6 UNION ALL
SELECT 7 UNION ALL
SELECT 8 UNION ALL
SELECT 9 UNION ALL
SELECT 10 UNION ALL
SELECT 11 UNION ALL
SELECT 12
) m
LEFT JOIN ls_order o
ON MONTH(FROM_UNIXTIME(o.create_time)) = m.month
AND YEAR(FROM_UNIXTIME(o.create_time)) = :year
AND o.pay_zd = 0
GROUP BY m.month
ORDER BY m.month;
";
$xse_list = Db::query($query,['year'=>$_year]);
$xse_ys_data = [];
foreach ($xse_list as $v){
$xse_ys_data[] = $v['total_sales'];
}
$xse['ys2'] =$xse_ys_data;
$query = "
SELECT
o.pay_zd,
m.month,
COALESCE(SUM(o.total_amount), 0) AS total_sales
FROM (
SELECT 1 AS month UNION ALL
SELECT 2 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 5 UNION ALL
SELECT 6 UNION ALL
SELECT 7 UNION ALL
SELECT 8 UNION ALL
SELECT 9 UNION ALL
SELECT 10 UNION ALL
SELECT 11 UNION ALL
SELECT 12
) m
LEFT JOIN ls_order o
ON MONTH(FROM_UNIXTIME(o.create_time)) = m.month
AND YEAR(FROM_UNIXTIME(o.create_time)) = :year
AND o.pay_zd = 1
GROUP BY m.month
ORDER BY m.month;
";
$xse_list = Db::query($query,['year'=>$_year]);
$xse_ys_data = [];
foreach ($xse_list as $v){
$xse_ys_data[] = $v['total_sales'];
}
$xse['ys'] =$xse_ys_data;
$data['xse_ys'] = $xse;
//客户渠道 channel_id
$query = "
SELECT
channel_id,
SUM(total_amount) AS value
FROM
ls_order
WHERE
create_time >= {$year['start_timestamp']}
AND
create_time <= {$year['end_timestamp']}
GROUP BY
channel_id
ORDER BY
value DESC
";
if($admin_id2){
$query = "
SELECT
channel_id,
SUM(total_amount) AS value
FROM
ls_order
WHERE
create_time >= {$year['start_timestamp']}
AND
create_time <= {$year['end_timestamp']}
AND admin_id = $admin_id2
GROUP BY
channel_id
ORDER BY
value DESC
";
}
$qd_list = Db::query($query);
foreach ($qd_list as $k=>$v){
$name = Db::name('orderchannel')->where('id',$v['channel_id'])->value('name');
$qd_list[$k]['name'] = $name?$name:'其它';
}
$data['qd'] = $qd_list;
//第二个客户渠道
//客户渠道 channel_id
$query = "
SELECT
brand_id,
count(*) AS value
FROM
ls_user_address
WHERE
createtime >= {$year['start_timestamp']}
AND
createtime <= {$year['end_timestamp']}
GROUP BY
brand_id
ORDER BY
value DESC
";
if($admin_id4){
$query = "
SELECT
brand_id,
count(*) AS value
FROM
ls_user_address
WHERE
createtime >= {$year['start_timestamp']}
AND
createtime <= {$year['end_timestamp']}
AND admin_id = $admin_id4
GROUP BY
brand_id
ORDER BY
value DESC
";
}
$qd2_list = Db::query($query);
foreach ($qd2_list as $k=>$v){
$name = Db::name('staffchannel')->where('id',$v['brand_id'])->value('name');
$qd2_list[$k]['name'] = $name?$name:'其它';
}
$data['qd2'] = $qd2_list;
//月目标完成率// 获取当前日期
$currentDate = new \DateTime();
// 获取当前月份的第一天
$firstDayOfMonth = new \DateTime($currentDate->format('Y-m-01 00:00:00'));
// 获取当前月份的最后一天
$lastDayOfMonth = new \DateTime($currentDate->format('Y-m-t 23:59:59'));
// 获取时间戳
$firstDayTimestamp = $firstDayOfMonth->getTimestamp();
$lastDayTimestamp = $lastDayOfMonth->getTimestamp();
$query = "
SELECT
admin_id,
SUM(total_amount) AS price
FROM
ls_order
WHERE
create_time >= {$firstDayTimestamp}
AND
create_time <= {$lastDayTimestamp}
AND pay_status = 1
GROUP BY
admin_id
ORDER BY
price DESC
";
$mb_list = Db::query($query);
foreach ($mb_list as $k=>$v){
$m = Db::name('admin')->where('id',$v['admin_id'])->find();
if($m){
$mb_list[$k]['index'] = $k+1;
$mb_list[$k]['name'] = $m['name'];
$mb_list[$k]['mb'] = $m['mb'];
$m_where = [
['admin_id','=',$v['admin_id']],
['create_time','>=',$firstDayTimestamp],
['create_time','<=',$lastDayTimestamp],
['pay_status','=',1]
];
$mb_list[$k]['num'] = Db::name('order')->where($m_where)->count('*');
$lv = round($v['price']/$m['mb'],2)*100;
$mb_list[$k]['lv'] = $lv.'%';
}else{
unset($mb_list[$k]);
}
}
$data['ymb'] = $mb_list;
//年卡销量情况
$ka = [
['value'=>'','name'=>'单次服务'],
['value'=>'','name'=>'年卡销量'],
['value'=>'','name'=>'次卡销量'],
['value'=>'','name'=>'其它服务'],
];
$ka_where = [
['del','=',0],
['create_time','>=',$year['start_timestamp']],
['create_time','<=',$year['end_timestamp']],
];
if($admin_id){
$ka_where[] = ['admin_id','=',$admin_id];
}
$ka[0]['value'] = Db::name('order')->where($ka_where)->where([
['number','=',1]
])->sum('total_amount');
$ka[1]['value'] = Db::name('order')->where($ka_where)->where([
['number','>',6]
])->sum('total_amount');
$ka[2]['value'] = Db::name('order')->where($ka_where)->where([
['number','>=',2],
['number','<=',6]
])->sum('total_amount');
$ka[3]['value'] = Db::name('order')->where($ka_where)->where([
['number','=',0]
])->sum('total_amount');
$data['ka'] = $ka;
$this->_success('获取成功',$data);
}
$admin = Db::name('admin')->where('root',0)->select();
$st = empty($input['st']) ? date('Y-m-d') : $input['st'];
$et = empty($input['et']) ? date('Y-m').'-31' : $input['et'];
$this->assign('st',$st);
$this->assign('et',$et);
$st = strtotime($st);
$et = strtotime($et);
$this->assign('admin',$admin);
return $this->fetch();
}
//按时间区间
public function date_range(){
//默认本月
$input = input();
$st = empty($input['st']) ? date('Y-m-d') : $input['st'];
$et = empty($input['et']) ? date('Y-m').'-31 23:59:59' : ($input['et'].' 23:59:59');
$admin_id = empty($input['admin_id']) ?null : $input['admin_id'];
$st = strtotime($st);
$et = strtotime($et);
// echo $st;
// echo '=';
// echo $et;
$data = [
'cn'=>[]
];
//产能
$cn = [];
//客户渠道 channel_id
$query = "
SELECT
admin_id,
SUM(number) AS value
FROM
ls_order
WHERE
create_time >= {$st}
AND
create_time <= {$et}
GROUP BY
admin_id
ORDER BY
value DESC
";
$cn_list = Db::query($query);
$cn_where = [
['create_time','>=',$st],
['create_time','<=',$et]
];
foreach ($cn_list as $k=>$v){
$cn_list[$k]['index'] =$k+1;
$fw = 0;
$yc = 0;
$fw_order_sn = Db::name('order')->where($cn_where)->where('admin_id',$v['admin_id'])->column('order_sn');
if(!empty($fw_order_sn)){
$fw = Db::name('order_exe')->whereIn('order_sn',$fw_order_sn)->where('staff_status',3)->count();
$yc = Db::name('order_exe')->whereIn('order_sn',$fw_order_sn)->where('abnormal',1)->count();
}
$name = Db::name('admin')->where('id',$v['admin_id'])->value('name');
$cn_list[$k]['name'] =$name ? $name:'其它';
// $cn_list[$k]['fw_sn'] = $fw_order_sn;
$cn_list[$k]['fw'] = $fw;
$cn_list[$k]['yc'] = $yc;
$cn_list[$k]['sy'] = $v['value']-$fw;
$cn_list[$k]['$fw_order_sn'] = $fw_order_sn;
//加时
$js = 0;
if(!empty($fw_order_sn)){
$js_exe_ids = Db::name('order_exe')->whereIn('order_sn',$fw_order_sn)->column('id');
$js = Db::name('order_timeadd')->whereIn('orderid',$js_exe_ids)->where('status',2)->sum('minute');
}
$cn_list[$k]['js'] = $js;
//报销
$bx = 0;
if(!empty($fw_order_sn)){
$yq_exe_ids = Db::name('order_exe')->whereIn('order_sn',$fw_order_sn)->column('id');
//报销
if(!empty($yq_exe_ids)){
$bx = Db::name('finance')->whereIn('order_id',$yq_exe_ids)->where('status',2)->sum('pay');
}
}
$cn_list[$k]['bx'] = $bx;
}
$data['cn'] = $cn_list;
//圆圈
$yq = [
'dd'=>0,//订单量
'fw'=>0,
'sy'=>0,
'bx'=>0,
'js'=>0
];
if($admin_id){
$cn_where[] = ['admin_id','=',$admin_id];
}
$yq['dd'] = Db::name('order')->where($cn_where)->sum('number');
$fw_order_sn = Db::name('order')->where($cn_where)->column('order_sn');
$yq['fw'] = Db::name('order_exe')->whereIn('order_sn',$fw_order_sn)->where('staff_status',3)->count();
$yq['sy'] = $yq['dd'] - $yq['fw'];
//加时
$yq_exe_ids = Db::name('order_exe')->whereIn('order_sn',$fw_order_sn)->column('id');
$yq['js'] = Db::name('order_timeadd')->whereIn('orderid',$yq_exe_ids)->where('status',2)->sum('minute');
//报销
$yq['bx'] = Db::name('finance')->whereIn('order_id',$yq_exe_ids)->where('status',2)->sum('pay');
//异常
$yq['yc'] = Db::name('order_exe')->whereIn('order_sn',$fw_order_sn)->where('abnormal',1)->count();
$yq_data = [
['name'=>'总订单量','value'=> $yq['dd']],
['name'=>'服务量','value'=> $yq['fw']],
['name'=>'剩余量','value'=> $yq['sy']],
['name'=>'报销数量','value'=> $yq['bx']],
['name'=>'加时数量','value'=> $yq['js']],
['name'=>'异常','value'=> $yq['yc']],
];
$data['yq'] = $yq_data;
//卡
$ka = [
['value'=>'','name'=>'单次服务'],
['value'=>'','name'=>'年卡销量'],
['value'=>'','name'=>'次卡销量'],
['value'=>'','name'=>'其它服务'],
];
$ka_where = [
['del','=',0],
['create_time','>=',$st],
['create_time','<=',$et],
];
if($admin_id){
$ka_where[] = ['admin_id','=',$admin_id];
}
$ka[0]['value'] = Db::name('order')->where($ka_where)->where([
['number','=',1]
])->sum('total_amount');
$ka[1]['value'] = Db::name('order')->where($ka_where)->where([
['number','>',6]
])->sum('total_amount');
$ka[2]['value'] = Db::name('order')->where($ka_where)->where([
['number','>=',2],
['number','<=',6]
])->sum('total_amount');
$ka[3]['value'] = Db::name('order')->where($ka_where)->where([
['number','=',0]
])->sum('total_amount');
$data['ka'] = $ka;
//排行
$ph = [];
if($admin_id){
$query = "
SELECT
goods_id,
SUM(total_amount) AS value
FROM
ls_order
WHERE
create_time >= {$st}
AND
create_time <= {$et}
AND admin_id = $admin_id
GROUP BY
goods_id
ORDER BY
value DESC
";
}else{
$query = "
SELECT
goods_id,
SUM(total_amount) AS value
FROM
ls_order
WHERE
create_time >= {$st}
AND
create_time <= {$et}
GROUP BY
goods_id
ORDER BY
value DESC
";
}
$ph_list = Db::query($query);
$ph_name = [];
$ph_value = [];
foreach ($ph_list as $k=>$v){
$ph_value[] = $v['value'];
$ph_name[] = Db::name('goods')->where('id',$v['goods_id'])->value('name');
}
$data['ph'] = [
'name'=>$ph_name,
'value'=>$ph_value
];
$this->_success('获取成功',$data);
}
public function orderexe_chart(){
$input = input();
$st = empty($input['st']) ? date('Y-m-d') : $input['st'];
$et = empty($input['et']) ? date('Y-m-d') : $input['et'];
$this->assign('st',$st);
$this->assign('et',$et);
$et = $et.' 23:59:59';
$st = strtotime($st);
$et = strtotime($et);
if ($this->request->isAjax()) {
$data = [
'fwzl'=>0,
'yfwl'=>0,
'wpdl'=>0,
'ycddl'=>0,
'fwqd'=>[]
];
$fwzl_where = [
['create_time','>=',$st],
['create_time','<=',$et],
['pay_status','=',1]
];
$yfwl_where = [
['autotime','>=',$st],
['autotime','<=',$et],
];
$data['fwzl'] = Db::name('order')->where($fwzl_where)->sum('number');
$data['yfwl'] = Db::name('order_exe')->where($yfwl_where)->where('staff_status',3)->count();
//剩余量
$data['sycs'] = $data['fwzl'] - $data['yfwl'];
$query = "
SELECT
count(*)
FROM
ls_order_exe
WHERE
(autotime >= {$st}
AND
autotime <= {$et})
AND
(
staff_status IS NULL
OR
staff_status = 0
)
";
$num = Db::query($query);
if(!empty($num[0]['count(*)'])){
$data['wpdl'] = $num[0]['count(*)'];
}
//服务渠道
$query = "
SELECT
channel_id,
SUM(number) AS value
FROM
ls_order
WHERE
create_time >= {$st}
AND
create_time <= {$et}
AND
pay_status = 1
GROUP BY
channel_id
ORDER BY
value DESC
";
$fwqd_list = Db::query($query);
foreach ($fwqd_list as $k=>$v){
$name = Db::name('orderchannel')->where('id',$v['channel_id'])->value('name');
$fwqd_list[$k]['name'] = $name?$name:'其它 ';
}
$data['fwqd'] = $fwqd_list;
//已服务订单
$query = "
SELECT
channel_id,
count(*) AS value
FROM
ls_order_exe
WHERE
autotime >= {$st}
AND
autotime <= {$et}
AND
staff_status = 3
GROUP BY
channel_id
ORDER BY
value DESC
";
$yfw_list = Db::query($query);
foreach ($yfw_list as $k=>$v){
$name = Db::name('orderchannel')->where('id',$v['channel_id'])->value('name');
$yfw_list[$k]['name'] = $name?$name:'其它 ';
}
$data['yfw'] = $yfw_list;
//未消耗订单
$query = "
SELECT
channel_id,
sum(number) AS value
FROM
ls_order
WHERE
create_time >= {$st}
AND
create_time <= {$et}
AND
pay_status = 1
GROUP BY
channel_id
ORDER BY
value DESC
";
$wxh_list = Db::query($query);
$wxh_where = [
['create_time','>=',$st],
['create_time','<=',$et],
['pay_status','=',1]
];
$wxh_order_sn = Db::name('order')->where($wxh_where)->column('order_sn');
$wxh_order_sn = implode(',',$wxh_order_sn);
$query = "
SELECT
channel_id,
count(*) AS value
FROM
ls_order_exe
WHERE order_sn IN($wxh_order_sn)
AND
staff_status = 3
GROUP BY
channel_id
ORDER BY
value DESC
";
$wxh_list2 = Db::query($query);
foreach ($wxh_list as $k=>$v){
//channel_id
foreach ($wxh_list2 as $k2=>$v2){
if($v['channel_id'] == $v2['channel_id']){
$wxh_list[$k]['value'] = $v['value'] - $v2['value'];
}
}
}
foreach ($wxh_list as $k=>$v){
$name = Db::name('orderchannel')->where('id',$v['channel_id'])->value('name');
$wxh_list[$k]['name'] = $name?$name:'其它 ';
}
$data['wxh'] = $wxh_list;
//产能低于多次
function getnum($num = 1,$st,$et){
$user_where = [
['createtime','>=',$st],
['createtime','<=',$et],
];
$mobiles = Db::name('user_address')->where($user_where)->column('telephone');
if($num == 1) {
$num_where = [
['number','<=',6]
];
}else{
$num_where = [
['number','>',6]
];
}
$cn_list = Db::table('ls_order')
->field('count(*) as num,order_sn,mobile, sum(number) AS value')
->whereIn('mobile', $mobiles)
->where('create_time', '>=', $st)
->where('create_time', '<=', $et)
->where($num_where) //
->where('pay_status', 1)
->group('order_sn')
->order('value', 'DESC')
->select();
$cn_order_sn = [];
foreach ($cn_list as $v){
$cn_order_sn[] = $v['order_sn'];
}
if(empty($cn_order_sn)) return 0;
$cn_order_sn = implode(',',$cn_order_sn);
$query = "
SELECT
order_sn,
count(*) AS value
FROM
ls_order_exe
WHERE order_sn IN ($cn_order_sn)
AND
staff_status = 3
GROUP BY
order_sn
ORDER BY
value DESC
";
$cn_list2 = Db::query($query);
foreach ($cn_list as $k=>$v){
//channel_id
foreach ($cn_list2 as $k2=>$v2){
if($v['order_sn'] == $v2['order_sn']){
$cn_list[$k]['value'] = $v['value'] - $v2['value'];
}
}
}
//次卡低于2次
foreach ($cn_list as $k=>$v){
if($v['value'] >= 2){
unset($cn_list[$k]);
}
}
//user_address
$cn2 = 0;
$cn_list_mobile = [];
foreach ($cn_list as $k=>$v){
$cn_list_mobile[] = $v['mobile'];
}
return Db::name('user_address')->where($user_where)->whereIn('telephone',$cn_list_mobile)->count();
}
$data['cn'] = [
['name'=>'年卡低于3次','value'=>getnum(2,$st,$et)],
['name'=>'次卡低于2次','value'=>getnum(1,$st,$et)]
];
$this->_success('获取成功',$data);
}
return $this->fetch();
}
}

View File

@@ -0,0 +1,347 @@
<?php
namespace app\admin\controller;
use app\admin\logic\ClasorderLogic;
use app\admin\logic\StatcLogic;
use app\common\model\Order as CommonOrder;
use app\common\model\Pay;
use app\common\model\Client_;
use think\Db;
class Clasorder extends AdminBase
{
/**
* Notes: 保洁订单列表
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function cleaning(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::cleaning($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('num', StatcLogic::cleaning());
return $this->fetch();
}
/**
* Notes: 收纳整理
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function storage(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::storage($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 深度清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function depth(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::depth($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 宠物保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function pet(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::pet($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 做饭到家
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function cooking(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::cooking($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 粗开荒保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function thick(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::thick($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 细开荒保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function fine(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::fine($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 搬家货运
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function move(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::move($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 搬家货运
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function detection(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::detection($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 空气治理
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function governance(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::governance($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 家电清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function wash(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::wash($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 家电清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function linen(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::linen($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 宠物保洁订单
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function pets(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::pets($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
}

View File

@@ -0,0 +1,52 @@
<?php
namespace app\admin\controller;
use app\admin\logic\CollectionLogic;
use think\Db;
class Collection extends AdminBase
{
//显示付款的渠道
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists =CollectionLogic::lists($get);
$this->_success('获取数据成功',$lists);
}
return $this->fetch();
}
//增加付款的渠道
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['create_time']=time();
$insert=Db::name('collection')->data($post)->insert();
$this->_success('添加成功!');
}
return $this->fetch();
}
//编辑付款渠道
public function edit($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists =CollectionLogic::edit($post);
$this->_success('修改数据成功',$lists);
}
$info=Db::name('collection')->where('id',$id)->find();
$this->assign('info',$info);
return $this->fetch();
}
//删除付款的渠道
public function del($id){
$del=Db::name('collection')->where('id',$id)->delete();
$this->_success('删除付款渠道成功');
}
}
?>

View File

@@ -0,0 +1,18 @@
<?php
namespace app\admin\controller;
use app\admin\logic\GoodsCategoryLogic;
use app\admin\logic\CommonLogic;
class Common extends AdminBase{
public function selectGoods(){
if ($this->request->isAjax()){
$get = $this->request->get();
$goods_list = CommonLogic::getGoodsList($get,true);
$this->_success('',$goods_list);
}
$category_list = GoodsCategoryLogic::categoryTreeeTree();
$this->assign('category_list', $category_list);
return $this->fetch();
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace app\admin\controller;
use app\admin\logic\CollectionLogic;
use app\admin\logic\StaffLogic;
use think\Db;
class Configura extends AdminBase
{
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = CollectionLogic::stafflists($get);
$this->_success('',$lists);
}
$this->assign('usertype',StaffLogic::staff_beed());
$this->assign('type',StaffLogic::type());
return $this->fetch();
}
public function distance(){
$post = $this->request->post();
$staff=Db::name('staff')->where('id',$post['id'])->update(['distance'=>$post['number']]);
$this->_success('增加距离成功');
}
public function transit(){
$post = $this->request->post();
$staff=Db::name('staff')->where('id',$post['id'])->update(['transit'=>$post['transit']]);
$this->_success('增加员工出行工具成功');
}
}

View File

@@ -0,0 +1,221 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\ControlLogic;
use app\admin\logic\StaffLogic;
class Control extends AdminBase
{
//品控中心的模板
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ControlLogic::lists($get));
}
return $this->fetch();
}
//客户订单回访
public function order_server(){
if ($this->request->isAjax()) {
}
return $this->fetch();
}
//增加回访的内容
public function add(){
if ($this->request->isAjax()) {
$id=$this->request->get('id');
$post = $this->request->post();
$post['order_id']=$id;
$post['createtime']=time();
$orderiofo=Db::name('order_trace')->where('order_id',$id)->find();
if($orderiofo){
$this->_error('订单已经操作回访请勿重复增加');
}
$cumstom=Db::name('order_exe')->where('id',$id)->find();
$post['name']=$cumstom['name'];
$post['phone']=$cumstom['phone'];
$post['staff_id']=$cumstom['staff_id'];
$insert=Db::name('order_trace')->data($post)->insert();
if($insert){
$this->_success('增加反馈成功');
}
$this->_error('增加反馈失败');
}
return $this->fetch();
}
public function edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$list=ControlLogic::edit($post);
$this->_success('修改反馈成功');
}
$get=$this->request->get('id');
$this->assign('info', ControlLogic::info($get));
return $this->fetch();
}
public function visit_order(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ControlLogic::visit_order($get));
}
return $this->fetch();
}
//增加投诉的内容
public function sale_adds(){
$post = $this->request->post();
$list=ControlLogic::sale_add($post);
$this->_success('增加成功');
}
public function sale_add(){
if ($this->request->isAjax()) {
$this->_success('增加成功');
}
$id=$this->request->get('id');
$this->assign('id', $id);
return $this->fetch();
}
public function sale_edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$list=ControlLogic::sale_edit($post);
$this->_success('修改成功');
}
$get=$this->request->get('id');
$this->assign('info',ControlLogic::sale_info($get));
return $this->fetch();
}
public function done(){
$get=$this->request->post('id');
$list=ControlLogic::sale_status($get);
$this->_success('售后订单完成');
}
public function sale_del(){
$get=$this->request->post('id');
$list=ControlLogic::sale_del($get);
$this->_success('删除成功');
}
public function follow(){
$id=$this->request->get('id');
$result['comment']=Db::name('order_sale_log')->where('saly_id',$id)->limit(6)->order('id desc')->select();
foreach($result['comment'] as &$item){
$admin=Db::name('admin')->where('id',$item['admin_id'])->find();
$item['name']=$admin['name'];
$item['phone']=$admin['phone'];
}
$this->assign('result',$result);
$this->assign('id',$id);
return $this->fetch();
}
public function follow_add(){
$post=$this->request->post();
$data=[
'connect'=>$post['reply_msg'],
'saly_id'=>$post['custom_id'],
'admin_id'=>session('admin_info.id'),
'createtime'=>time()
];
$insert=Db::name('order_sale_log')->insertGetId($data);
$datas=Db::name('custom')->where('id',$insert)->find();
$datas['create_time']=date("Y年m月d日 H:i", $datas['create_time']);
$custom=Db::name('admin')->where('id', $datas['admin_id'])->find();
$datas['name']= $custom['name'];
$datas['phone']= $custom['phone'];
if($insert){
$this->_success('增加成功',$datas);
}
}
public function abnormal(){
if ($this->request->isAjax()) {
$id=$this->request->get('id');
$post = $this->request->post();
$post['order_id']=$id;
$post['create_time']=time();
$orderiofo=Db::name('order_abnormal')->where('order_id',$id)->find();
if($orderiofo){
$this->_error('订单已经设置异常');
}
$cumstom=Db::name('order_exe')->where('id',$id)->find();
if(!$cumstom){
$this->_error('订单未设置保洁人员');
}
$post['staff_id']=$cumstom['staff_id'];
$insert=Db::name('order_abnormal')->data($post)->insert();
if($insert){
$abnormal=Db::name('order_exe')->where('id',$id)->update(['abnormal'=>1]);
$this->_success('增加异常成功');
}
$this->_error('增加异常失败');
}
return $this->fetch();
}
public function abnormal_lists(){
if ($this->request->isAjax()) {
$get=$this->request->get();
$list=ControlLogic::abnormal_lists($get);
$this->_success('获取数据成功',$list);
}
$this->assign('staff',StaffLogic::serverstaff());
return $this->fetch();
}
public function abnormal_eidt(){
if ($this->request->isAjax()) {
$post=$this->request->post();
$list=ControlLogic::abnormal_eidt($post);
$this->_success('修改成功');
}
$id=$this->request->get('id');
$this->assign('info',ControlLogic::abnormal_info($id));
return $this->fetch();
}
public function abnormal_del(){
$post=$this->request->post('id');
$del=ControlLogic::abnormal_del($post);
$this->_success('删除成功');
}
//查看图片
public function controlimg(){
$post=$this->request->post('id');
$list=ControlLogic::controlimg($post);
return $this->fetch();
}
//查看图片
public function images(){
$id=$this->request->get('id');
$this->assign('info',ControlLogic::images($id));
return $this->fetch();
}
//处罚的内容
public function punish(){
$id=$this->request->get('id');
$list=ControlLogic::punish($id);
$this->_success('修改成功');
}
}

View File

@@ -0,0 +1,149 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\CouponLogic;
class Coupon extends AdminBase{
/**
* note 优惠券列表
* create_time 2020/10/22 10:14
*/
public function lists(){
if($this->request->isAjax()){
$get = $this->request->get();
$lists = CouponLogic::lists($get);
$this->_success('',$lists);
}
return $this->fetch();
}
/**
* note 添加优惠券
* create_time 2020/10/22 10:14
*/
public function add(){
if($this->request->isAjax()){
$post = $this->request->post();
$result = $this->validate($post,'app\admin\validate\Coupon');
if($result === true){
$result = CouponLogic::add($post);
if($result == true){
$this->_success('新增成功','');
}
$result = '新增失败';
}
return $this->_error($result,'');
}
return $this->fetch();
}
/**
* note 编辑优惠券
* create_time 2020/10/22 10:15
*/
public function edit($id){
if($this->request->isAjax()){
$post = $this->request->post();
$result = $this->validate($post,'app\admin\validate\Coupon');
if($result === true){
$result = CouponLogic::edit($post);
if($result == true){
$this->_success('编辑成功','');
}
$result = '编辑失败';
}
return $this->_error($result,'');
}
$detail = CouponLogic::getCoupon($id,true);
$this->assign('detail',json_encode($detail,JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
/**
* note 删除优惠券
* create_time 2020/10/22 10:15
*/
public function del($id){
if($this->request->isAjax()){
$result = CouponLogic::del($id);
if($result == true){
$this->_success('删除成功','');
}
return $this->_error('删除失败','');
}
}
/**
* note 优惠券发放记录
* create_time 2020/10/22 10:18
*/
public function log($id){
if($this->request->isAjax()){
$get = $this->request->get();
$lists = CouponLogic::log($get);
$this->_success('',$lists);
}
$this->assign('id',$id);
return $this->fetch();
}
/**
* note 优惠券详情
* create_time 2020/10/22 10:18
*/
public function detail($id){
$detail = CouponLogic::getCoupon($id,true);
$this->assign('detail',json_encode($detail,JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
/**
* note 关闭优惠券
* create_time 2020/10/22 10:19
*/
public function close($id){
if($this->request->isAjax()){
$result = CouponLogic::close($id);
if($result == true){
$this->_success('优惠券关闭成功','');
}
return $this->_error('优惠券关闭失败,请重新关闭','');
}
}
public function sendCouponList(){
if($this->request->isAjax()){
$list = CouponLogic::sendCouponList();
$this->_success('',$list);
}
return $this->fetch();
}
public function sendCoupon(){
if($this->request->isAjax()){
$post = $this->request->post();
$result = $this->validate($post,'app\admin\validate\SendCoupon');
if($result === true){
CouponLogic::sendCoupon($post);
return $this->_success('发放成功',[]);
}
return $this->_error($result,'');
}
}
}

View File

@@ -0,0 +1,118 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\CrontabLogic;
class Crontab extends AdminBase
{
/**
* 定时任务列表
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function lists()
{
if ($this->request->isAjax()) {
$this->_success('', CrontabLogic::lists());
}
return $this->fetch();
}
/**
* 添加定时任务
* @return mixed
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['status'] = isset($post['status']) && $post['status'] == 'on' ? 1 : 2;
$result = $this->validate($post, 'app\admin\validate\Crontab.add');
if ($result === true) {
CrontabLogic::add($post);
$this->_success('添加成功');
}
$this->_error($result);
}
return $this->fetch();
}
/**
* 编辑定时任务
* @return mixed
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['status'] = isset($post['status']) && $post['status'] == 'on' ? 1 : 2;
$result = $this->validate($post, 'app\admin\validate\Crontab');
if ($result === true) {
CrontabLogic::edit($post);
$this->_success('修改成功');
}
$this->_error($result);
}
$id = $this->request->get('id');
$this->assign('info',CrontabLogic::info($id));
return $this->fetch();
}
public function del()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id');
if (CrontabLogic::del($id) !== true) {
$this->_success('删除成功');
}
}
$this->_error('删除失败');
}
/**
* 定时任务操作
*/
public function operation()
{
$post = $this->request->post();
$result = CrontabLogic::operation($post['operation'], $post['id']);
if ($result !== true) {
$this->_error('操作失败:' . $result);
}
$this->_success('操作成功');
}
/**
* 获取接下来执行时间
*/
public function expression()
{
$get = $this->request->get();
$this->_success('', CrontabLogic::expression($get));
}
}

View File

@@ -0,0 +1,244 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\AuthLogic;
use think\facade\Hook;
use app\admin\logic\UserLogic;
use app\admin\logic\StaffLogic;
use app\admin\logic\CustomLogic;
use think\facade\Url;
class Custom extends AdminBase
{
/**
* 菜单列表
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function staff_channel()
{
$lists = json_encode(CustomLogic::staff_channel());
$this->assign('lists', $lists);
return $this->fetch();
}
/**
* order: 哆啦猫客户来源渠道
* Desc: 增加渠道
*/
public function channel_add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = CustomLogic::channel_add($post);
$this->_success('增加渠道成功');
}
$this->assign('menu_lists', CustomLogic::Menu());
return $this->fetch();
}
public function staff_del($id){
$del=Db::name('staffchannel')->where('pid',$id)->find();
if($del){
$this->_error('请先删除下级分类');
}else{
$del=Db::name('staffchannel')->where('id',$id)->delete();
$this->_success('删除成功');
}
}
public function staff_edit($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = CustomLogic::ordertypeedit($post);
$this->_success('修改客户渠道成功');
}
$this->assign('info', CustomLogic::info($id));
$this->assign('menu_lists', CustomLogic::Menu($id));
return $this->fetch();
}
//公海客户列表
public function list(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = CustomLogic::list($get);
$this->_success('',$lists);
}
return $this->fetch();
}
//修改派单人员信息
public function dispatch(){
if ($this->request->isAjax()) {
$id=$this->request->get('id');
$custom=Db::name('user_address')->where('id',$id)->update(['admin_id'=>$this->request->post('admin_id')]);
$this->_success('修改跟踪人员成功');
}
$user=Db::name('admin')->select();
$this->assign('user',$user);
return $this->fetch();
}
public function custom(){
$id=$this->request->get('id');
$result['comment']=Db::name('custom')->where('custom_id',$id)->limit(7)->order('id desc')->select();
foreach($result['comment'] as &$item){
$admin=Db::name('admin')->where('id',$item['admin_id'])->find();
$item['name']=$admin['name'];
$item['phone']=$admin['phone'];
}
$this->assign('result',$result);
$this->assign('id',$id);
return $this->fetch();
}
//我的客户
public function usercustomlist(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = CustomLogic::userlist($get);
$this->_success('',$lists);
}
$label_id=Db::name('user_label')->where('del','<>',1)->select();
$this->assign('label_id', $label_id);
return $this->fetch();
}
//写入跟进的消息
public function comment(){
$data['admin_id'] = session('admin_info.id'); //获取员工的id
$data['custom_id']=$this->request->post('custom_id');
$data['connect']=$this->request->post('reply_msg');
$data['create_time'] = time();
$insert_id=Db::name('custom')->insertGetId($data);
$datas=Db::name('custom')->where('id',$insert_id)->find();
$datas['create_time']=date("Y年m月d日 H:i", $datas['create_time']);
$custom=Db::name('admin')->where('id', $datas['admin_id'])->find();
$datas['name']= $custom['name'];
$datas['phone']= $custom['phone'];
if($insert_id){
$this->_success('增加成功',$datas);
}
}
//客户的备注的信息
public function user_remarks()
{
// 获取的
if ($this->request->isAjax() && $this->request->isGet()){
$get = $this->request->get();
$detail = CustomLogic::user_remarks($get, 'get');
$this->_success('获取成功', $detail);
}
// 提交的
if ($this->request->isAjax() && $this->request->isPost()) {
$post = $this->request->post();
$result = CustomLogic::user_remarks($post, 'post');
if ($result) {
$this->_success('保存成功');
}
$this->error('保存失败');
}
}
//管理员备注
public function admin_remarks()
{
// 获取的
if ($this->request->isAjax() && $this->request->isGet()){
$get = $this->request->get();
$detail = CustomLogic::admin_remarks($get, 'get');
$this->_success('获取成功', $detail);
}
// 提交的
if ($this->request->isAjax() && $this->request->isPost()) {
$post = $this->request->post();
$result = CustomLogic::admin_remarks($post, 'post');
if ($result) {
$this->_success('保存成功');
}
$this->error('保存失败');
}
}
//保洁师备注信息
public function staff_remarks()
{
// 获取的
if ($this->request->isAjax() && $this->request->isGet()){
$get = $this->request->get();
$detail = CustomLogic::staff_remarks($get, 'get');
$this->_success('获取成功', $detail);
}
// 提交的
if ($this->request->isAjax() && $this->request->isPost()) {
$post = $this->request->post();
$result = CustomLogic::staff_remarks($post, 'post');
if ($result) {
$this->_success('保存成功');
}
$this->error('保存失败');
}
}
//编辑客户的档案
public function edit($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$detail = CustomLogic::edit($post);
$this->_success('修改成功');
}
$this->assign('info', json_encode(UserLogic::adders($id), JSON_UNESCAPED_UNICODE));
$this->assign('category_lists', json_encode(StaffLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
$brand_lists=Db::name('staffchannel')->where('deletetime','NULL')->select();
$this->assign('brand_lists', json_encode($brand_lists, JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
//查看客户档案的信息
public function infolist(){
if ($this->request->isAjax()) {
}
return $this->fetch();
}
//客户的下单详情
public function Customlist(){
$post = $this->request->get('');
$list = CustomLogic::Customlist($post);
$this->_success('',$list);
}
//删除客户的基本信息
public function del(){
$post = $this->request->post();
if($this->admin_id==5){
$list = CustomLogic::del($post);
$this->_success('删除客户数据成功');
}else{
$this->error('无权限删除');
}
}
}

View File

@@ -0,0 +1,33 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
class Dispatch extends AdminBase
{
public function dispatch_error($msg)
{
return $this->_error($msg);
}
}

View File

@@ -0,0 +1,74 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\server\ConfigServer;
use app\common\server\UrlServer;
/**
* 分销设置
* Class Distribution
* @package app\admin\controller
*/
class Distribution extends AdminBase
{
/**
* 分销会员列表/审核会员列表
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function setting()
{
$config = [
'is_open' => ConfigServer::get('distribution', 'is_open', 1),
'member_apply' => ConfigServer::get('distribution', 'member_apply', 1),
'show_commission' => ConfigServer::get('distribution', 'show_commission', 0),
'share_poster' => ConfigServer::get('distribution', 'share_poster'),//分享海报
];
$config['share_poster'] = UrlServer::getFileUrl($config['share_poster']);
$this->assign('config', $config);
return $this->fetch('');
}
/**
* 设置分销配置
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function setDistribution()
{
$post = $this->request->post();
if ($post) {
ConfigServer::set('distribution', 'is_open', $post['is_open']);
ConfigServer::set('distribution', 'member_apply', $post['member_apply']);
ConfigServer::set('distribution', 'show_commission', $post['show_commission']);
ConfigServer::set('distribution', 'share_poster', UrlServer::setFileUrl($post['share_poster']));
$this->_success('修改成功');
}
}
}

View File

@@ -0,0 +1,184 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\DistributionMemberLogic;
use app\common\model\DistributionMember as DistributionMemberModel;
class DistributionMember extends AdminBase
{
/**
* 分销会员列表/审核会员列表
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function index()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$type = $get['type'] ?? 'member';
if ($type == 'member') {
$this->_success('获取成功', DistributionMemberLogic::memberLists($get));
}
$this->_success('获取成功', DistributionMemberLogic::auditLists($get));
}
$this->assign('status', DistributionMemberModel::getApplyStatus(true));
return $this->fetch('index');
}
/**
* 审核分销会员
*/
public function audit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$check = $this->validate($post, 'app\admin\validate\DistributionMember.audit');
if (true !== $check) {
$this->_error($check);
}
if ($post['type'] == 'pass') {
$res = DistributionMemberLogic::auditPass($post);
} else {
$res = DistributionMemberLogic::auditRefuse($post);
}
if ($res !== true) {
$this->_error('操作失败');
}
$this->_success('操作成功');
}
}
//冻结/解冻分销资格
public function freeze()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$check = $this->validate($post, 'app\admin\validate\DistributionMember.freeze');
if (true !== $check) {
$this->_error($check);
}
DistributionMemberLogic::freeze($post);
$this->_success('操作成功');
}
$this->_error('操作失败');
}
/**
* 分销会员详情(分销资料)
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function info()
{
$get = $this->request->get();
$info = DistributionMemberLogic::getMemberInfo($get);
$this->assign('detail', $info);
return $this->fetch();
}
/**
* 推广会员
* @return mixed
*/
public function fans()
{
$user_id = $this->request->get('id');
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', DistributionMemberLogic::getFansLists($get));
}
$this->assign('user_id', $user_id);
return $this->fetch();
}
/**
* 分销收入明细
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function earningsDetail()
{
$user_id = $this->request->get('id');
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', DistributionMemberLogic::getEarningsDetail($get));
}
$this->assign('user_id', $user_id);
return $this->fetch();
}
//修改上级
public function updateLeader()
{
$user_id = $this->request->get('id');
if ($this->request->isAjax()) {
$post = $this->request->post();
$check = $this->validate($post, 'app\admin\validate\DistributionMember.updateLeader');
if (true !== $check) {
$this->_error($check);
}
$res = DistributionMemberLogic::updateRelation($post);
if ($res === true){
$this->_success('操作成功');
}
$this->_error($res);
}
$this->assign('first_leader',DistributionMemberLogic::getLeaderInfo($user_id));
$this->assign('user_id', $user_id);
return $this->fetch();
}
/**
* Notes: 添加分销会员
* @author 张无忌(2021/1/11 16:32)
*/
public function addMember()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$check = $this->validate($post, 'app\admin\validate\DistributionMember.addMember');
if (true !== $check) {
$this->_error($check);
}
$result = DistributionMemberLogic::addMember($post);
if ($result === true) {
$this->_success('添加成功');
} else {
$this->_error($result);
}
}
return $this->fetch('distribution_member/add_member');
}
}

View File

@@ -0,0 +1,122 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\server\ConfigServer;
use app\admin\logic\ExpressLogic;
use think\db;
class Express extends AdminBase
{
/**
* lists
* @return mixed
* @throws \think\exception\DbException
* @throws db\exception\DataNotFoundException
* @throws db\exception\ModelNotFoundException
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', ExpressLogic::lists($get));
}
}
/**
* 添加
* @return mixed
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\Express.add');
if ($result === true) {
$result = ExpressLogic::addExpress($post);
if ($result) {
$this->_success('添加成功');
}
}
$this->_error($result);
}
return $this->fetch();
}
/**
* 编辑
* @param $id
* @return mixed
*/
public function edit($id)
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\Express.edit');
if ($result === true) {
$result = ExpressLogic::editExpress($post);
if ($result) {
$this->_success('修改成功');
}
}
$this->_error($result);
}
$this->assign('info', ExpressLogic::info($id));
return $this->fetch();
}
/**
* 删除
* @param $delData
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function del($delData)
{
if ($this->request->isAjax()) {
$result = ExpressLogic::delExpress($delData);
if ($result) {
$this->_success('删除成功');
}
$this->_error('删除失败');
}
}
//查询配置
public function setExpress()
{
$post = $this->request->post();
if($post){
ConfigServer::set('express', 'way', $post['way']);
ConfigServer::set('kd100', 'appkey', $post['kd100_appkey']);
ConfigServer::set('kd100', 'appsecret', $post['kd100_customer']);
ConfigServer::set('kdniao', 'appkey', $post['kdniao_appkey']);
ConfigServer::set('kdniao', 'appsecret', $post['kdniao_ebussinessid']);
ConfigServer::set('kdniao', 'type', $post['kdniao_type']);
}
$this->_success('操作成功');
}
}

View File

@@ -0,0 +1,101 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\logic\FileCateLogic;
use app\common\server\FileServer;
class File extends AdminBase
{
/**
* 图片列表
* @param string $type
*/
public function lists($type = '')
{
$cate_id = $this->request->get('cate', 0);
$this->_success('', FileServer::lists($this->page_no, $this->page_size, $cate_id, $type));
}
/**
* User: 意象信息科技 mjf
* Desc: 删除图片
*/
public function del()
{
$ids = $this->request->post('ids');
FileServer::del($ids);
$this->_success('操作成功');
}
/**
* Notes: 上传图片
* @author 张无忌(2021/2/19 16:39)
* @return mixed
*/
public function image()
{
if ($this->request->isPost()) {
$cate_id = $this->request->post('cate',0);
$result = FileServer::image($cate_id);
$this->successOrError($result);
}
$auth_tree = FileCateLogic::cateTree();
$this->assign('list', json_encode($auth_tree));
return $this->fetch();
}
/**
* 视频上传
*/
public function video(){
if ($this->request->isPost()) {
$result = FileServer::video('uploads/video');
$this->successOrError($result);
}
}
/**
* 其他文件上传
*/
public function other()
{
if ($this->request->isPost()) {
$local = $this->request->get('local',0);
$sub_dir = $this->request->get('sub_dir','');
$local = $local == 0 ? false : true;
$save_path = 'uploads/other';
if ($local && $local !== '') {
$save_path = 'uploads/other/'.$sub_dir;
}
$result = FileServer::other($save_path, $local);
$this->successOrError($result);
}
$this->_success();
}
}

View File

@@ -0,0 +1,85 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\logic\FileCateLogic;
/**
* 图片分类
* Class FileCate
* @package app\admin\controller
*/
class FileCate extends AdminBase
{
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\FileCate.add');
if ($result !== true) {
$this->_error($result);
}
$result = FileCateLogic::add($post);
if ($result !== true) {
$this->_error($result);
}
$this->_success('添加成功');
}
$tree = FileCateLogic::categoryToSelect();
$this->assign('cate_tree', $tree);
return $this->fetch();
}
public function edit($id = '')
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\FileCate.edit');
if ($result !== true) {
$this->_error($result);
}
$result = FileCateLogic::edit($post);
if ($result !== true) {
$this->_error($result);
}
$this->_success('编辑成功');
}
$tree = FileCateLogic::categoryToSelect();
$this->assign('cate_tree', $tree);
$this->assign('detail', FileCateLogic::info($id));
return $this->fetch();
}
public function del()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\FileCate.del');
if ($result !== true) {
$this->_error($result);
}
FileCateLogic::del($post['id']);
$this->_success('删除成功');
}
}
}

View File

@@ -0,0 +1,138 @@
<?php
namespace app\admin\controller;
use app\admin\controller\AdminBase;
use app\admin\logic\FileNewLogic;
use app\common\model\FileCate;
use app\admin\validate\FileCateNew as FileCateNewValidate;
use app\common\server\FileServer;
class FileNew extends AdminBase
{
public function lists()
{
$get = $this->request->get();
$get['type'] = $get['type'] ?? 'image';
$get['partner_id'] = $get['partner_id'] ?? 0;
$get['page_no'] = $get['page_no'] ?? 1;
$get['page_size'] = $get['page_size'] ?? 20;
$get['cate_id'] = $get['cate_id'] ?? 0;
switch($get['type']) {
case 'video':
$title = '上传视频';
break;
case 'image':
$title = '上传图片';
break;
case 'other':
$title = '上传';
break;
}
$menu = FileCate::getTreeMenu($get);
$data = FileNewLogic::lists($get);
$this->assign('type', $get['type']);
$this->assign('title', $title);
$this->assign('menu', json_encode($menu));
$this->assign('data', $data);
return $this->fetch();
}
public function pagelists()
{
$get = $this->request->get();
$get['type'] = $get['type'] ?? 'image';
$get['partner_id'] = $get['partner_id'] ?? 0;
$get['page_no'] = $get['page_no'] ?? 1;
$get['page_size'] = $get['page_size'] ?? 20;
$get['cate_id'] = $get['cate_id'] ?? 0;
$data = FileNewLogic::pagelists($get);
return $this->_success('', $data);
}
public function addCate()
{
if($this->request->isPost()) {
$post = $this->request->post();
$validate = new FileCateNewValidate;
if(!$validate->check($post)) {
return $this->_error($validate->getError());
}
$result = FileNewLogic::addCate($post);
if($result['flag']) {
return $this->_success($result['msg']);
}
return $this->_error($result['msg']);
}
$get = $this->request->get();
$get['type'] = $get['type'] ?? 'image';
$get['partner_id'] = $get['partner_id'] ?? 0;
$menu = FileCate::getMenu($get);
$this->assign('menu', $menu);
$this->assign('type', $get['type']);
return $this->fetch();
}
public function editCate()
{
if($this->request->isPost()) {
$post = $this->request->post();
$validate = new FileCateNewValidate;
if(!$validate->check($post)) {
return $this->_error($validate->getError());
}
$result = FileNewLogic::editCate($post);
if($result['flag']) {
return $this->_success($result['msg']);
}
return $this->_error($result['msg']);
}
$get = $this->request->get();
$get['type'] = $get['type'] ?? 'image';
$get['partner_id'] = $get['partner_id'] ?? 0;
$cate = FileCate::getCateById($get['id']);
$menu = FileCate::getMenu($get);
$this->assign('menu', $menu);
$this->assign('type', $get['type']);
$this->assign('cate', $cate);
return $this->fetch();
}
public function delCate()
{
$post = $this->request->post();
$result = FileNewLogic::delCate($post);
if($result['flag']) {
return $this->_success($result['msg']);
}
return $this->_error($result['msg']);
}
/**
* 新视频上传
*/
public function videoNew(){
if ($this->request->isPost()) {
$post = $this->request->post();
$result = FileServer::videoNew($post['cate_id']);
$this->successOrError($result);
}
}
public function showVideo()
{
$uri = $this->request->get('uri');
$this->assign('uri', $uri);
return $this->fetch();
}
public function delFile()
{
$post = $this->request->post();
$result = FileNewLogic::delFile($post);
if($result) {
return $this->_success('删除成功');
}
return $this->_error('删除失败');
}
}

View File

@@ -0,0 +1,177 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\FinanceLogic;
use app\admin\logic\StaffLogic;
class Finance extends AdminBase
{
public function lists()
{
$data = FinanceLogic::lists();
$this->assign('data', $data);
return $this->fetch();
}
public function acctypelist(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = FinanceLogic::acctypelist($get);
$this->_success('',$lists);
}
return $this->fetch();
}
public function acctypeadd(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = FinanceLogic::acctypeadd($post);
$this->_success('增加成功');
}
return $this->fetch();
}
public function acctypedit($id){
if ($this->request->isAjax()) {
$get = $this->request->post();
$data=Db::name('finance_type')->where('id',$get['id'])->data(['name'=>$get['name']])->update();
$this->_success('更改分类成功');
}
$detail=Db::name('finance_type')->where('id',$id)->find();
$this->assign('detail',$detail);
return $this->fetch();
}
public function acctypedel($id){
$data=Db::name('finance_type')->where('id',$id)->delete();
$this->_success('删除成功');
}
public function fidlists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = FinanceLogic::fidlists($get);
$this->_success('',$lists);
}
$this->assign('satff',StaffLogic::serverstaff());
$this->assign('type',FinanceLogic::typelist());
return $this->fetch();
}
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = FinanceLogic::add($post);
$this->_success('增加报销单据成功');
}
$this->assign('brand_lists', json_encode(FinanceLogic::typelist(), JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
public function examine(){
$id = $this->request->post('id');
$data=Db::name('finance')->where('id',$id)->update(['status'=>2,'reason'=>'']);
$this->_success('审核成功');
}
public function examines(){
$post = $this->request->post();
$data=Db::name('finance')->where('id',$post['id'])->update(['status'=>3,'reason'=>$post['code']]);
$this->_success('审核不通过');
}
//获取报销的内容的内容
public function infos(){
$id = $this->request->get('id');
$data=Db::name('finance')->where('id',$id)->find();
$this->_success('获取数据成功', $data);
}
public function edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = FinanceLogic::eidt($post);
$this->_success('编辑报销单据成功');
}
$id = $this->request->get('id');
$this->assign('info', json_encode(FinanceLogic::info($id),JSON_UNESCAPED_UNICODE));
$this->assign('brand_lists', json_encode(FinanceLogic::typelist(), JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
//员工加时申请
public function stafftime(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = FinanceLogic::stafftime($get);
$this->_success('',$lists);
}
$this->assign('satff',StaffLogic::serverstaff());
$data=Db::name('admin')->where('id','<>',1)->select();
$this->assign('admin',$data);
return $this->fetch();
}
//修改员工加时间
public function editaddtim(){
if ($this->request->isAjax()) {
$get=$this->request->post();
$lists = FinanceLogic::editaddtimup($get);
if($lists){
$this->_success('修改成功');
}else{
$this->_error('修改失败请检查金额');
}
}
$id=$this->request->get('id');
$this->assign('info',FinanceLogic::stafftimeinfo($id));
return $this->fetch();
}
//加时结算费用
public function order_pay(){
$get = $this->request->get();
$this->_success('');
}
public function order_pays(){
$post = $this->request->post();
$data=Db::name('order_timeadd')->where('id',$post['id'])->update(['pay_status'=>1,'status'=>2]);
$this->_success('审核成功');
}
public function editsd(){
$post = $this->request->post();
$data=Db::name('order_timeadd')->where('id',$post['id'])->update(['pay_status'=>0,'status'=>3,'reason'=>$post['code']]);
$this->_success('修改成功');
}
public function infoeditsd(){
$post = $this->request->get();
$lists = FinanceLogic::stafftimeinfo($post['id']);
$this->_success('',$lists);
}
public function del_addtime(){
$post = $this->request->post();
$data=Db::name('order_timeadd')->where('id',$post['id'])->delete();
$this->_success('删除成功');
}
//处罚审核通过
}

View File

@@ -0,0 +1,93 @@
<?php
namespace app\admin\controller;
use app\admin\logic\FineLogic;
use app\admin\logic\StaffLogic;
class Fine extends AdminBase
{
//员工罚款类型
public function type(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取数据成功', FineLogic::type($get));
}
return $this->fetch();
}
public function type_add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$this->_success('增加罚款类别成功', FineLogic::type_add($post));
}
return $this->fetch();
}
public function type_eidt(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$this->_success('修改成功', FineLogic::type_eidt($post));
}
$id = $this->request->get('id');
$this->assign('detail', FineLogic::type_fineinfo($id));
return $this->fetch();
}
public function type_del(){
$id = $this->request->post('id');
$date=FineLogic::type_del($id);
$this->_success('删除成功');
}
//罚款的列表
public function lists(){
if($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取数据成功', FineLogic::lists($get));
}
$this->assign('staff',StaffLogic::serverstaff());
return $this->fetch();
}
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$this->_success('增加成功', FineLogic::add($post));
}
$this->assign('staff',StaffLogic::stafflist());
$this->assign('type',FineLogic::type_lists());
return $this->fetch();
}
public function edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$this->_success('修改成功', FineLogic::edit($post));
}
$id=$this->request->get('id');
$this->assign('info',FineLogic::fineinfo($id));
$this->assign('staff',StaffLogic::stafflist());
$this->assign('type',FineLogic::type_lists());
return $this->fetch();
}
public function del(){
$id=$this->request->post('id');
$del=FineLogic::finedel($id);
$this->_success('删除罚款成功');
}
public function proposal(){
return $this->fetch();
}
//处罚审核的内容
public function done(){
$post=$this->request->post();
$del=FineLogic::done($post);
$this->_success('成功');
}
}

View File

@@ -0,0 +1,69 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\FootprintLogic;
use app\common\server\ConfigServer;
/**
* 访问足迹(气泡足迹)
* Class Footprint
* @package app\admin\controller
*/
class Footprint extends AdminBase
{
public function index()
{
$set['footprint_duration'] = ConfigServer::get('footprint','footprint_duration',60);
$set['footprint_status'] = ConfigServer::get('footprint','footprint_status',0);
$this->assign('set', $set);
$this->assign('footprint', FootprintLogic::lists());
return $this->fetch();
}
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = FootprintLogic::edit($post);
if ($result) {
$this->_success('编辑成功');
}
$this->_error('编辑失败');
}
$id = $this->request->get('id', 0, 'intval');
$this->assign('info', FootprintLogic::info($id));
return $this->fetch();
}
public function set()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = FootprintLogic::set($post);
if ($result) {
$this->_success('更新成功');
}
$this->_error('更新失败');
}
}
}

View File

@@ -0,0 +1,143 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\ExpressLogic;
use app\common\server\ConfigServer;
use app\admin\logic\FreightLogic;
use app\admin\model\Freight as FreightModel;
class Freight extends AdminBase
{
/**
* User: 意象信息科技 mjf
* Desc: 设置快递方式
*/
public function set()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['type'] = isset($post['type']) && $post['type'] == 'on' ? 1 : 0;
ConfigServer::set('express', 'is_express', $post['type']);
$this->_success('操作成功');
}
$type = ConfigServer::get('express', 'is_express');
$this->assign('type', $type);
return $this->fetch();
}
/**
* User: 意象信息科技 mjf
* Desc: 运费模板列表
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', FreightLogic::lists($get));//运费模板页
}
$this->assign('charge_way_lists', FreightModel::getChargeWay(true));
$this->assign('config', ExpressLogic::getExpress());
return $this->fetch('index');
}
/**
* User: 意象信息科技 mjf
* Desc: 添加运费模板
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\Freight.add');
if ($result === true) {
FreightLogic::add($post);
$this->_success('添加成功!');
}
$this->_error($result);
}
return $this->fetch();
}
/**
* User: 意象信息科技 mjf
* Desc: 删除运费模板
*/
public function del()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\Freight.del');
if ($result === true) {
FreightLogic::del($post);
$this->_success('删除成功!');
}
$this->_error($result);
}
return $this->fetch();
}
/**
* User: 意象信息科技 mjf
* Desc: 运费模板详情
*/
public function detail()
{
$id = $this->request->get('id');
$detail = FreightLogic::detail($id);
$this->assign('detail', $detail);
return $this->fetch();
}
/**
* User: 意象信息科技 mjf
* Desc: 运费模板编辑
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\Freight.edit');
if ($result !== true) {
$this->_error($result);
}
FreightLogic::edit($post);
$this->_success('编辑成功!');
}
$id = $this->request->get('id');
$detail = FreightLogic::detail($id);
$this->assign('detail', $detail);
return $this->fetch();
}
public function area()
{
return $this->fetch();
}
//编辑页的地区选择
public function areaEdit()
{
return $this->fetch();
}
}

View File

@@ -0,0 +1,311 @@
<?php
namespace app\admin\controller;
use app\admin\logic\{GoodsBrandLogic, GoodsCategoryLogic, GoodsLogic, SupplierLogic,FreightLogic,CommonLogic};
use think\Db;
class Goods extends AdminBase
{
// TODO 商品发布
// TODO 编辑
// TODO 复制
/**
* 商品列表
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', GoodsLogic::lists($get));
}
$this->assign('statistics',GoodsLogic::statistics());
$this->assign('category_list', GoodsCategoryLogic::categoryTreeeTree());
$this->assign('supplier_list',SupplierLogic::getSupplierList());
return $this->fetch();
}
/**
* 列表导出
*/
public function exportFile()
{
$get = $this->request->get();
$this->_success('', GoodsLogic::exportFile($get));
}
/**
* Notes: 获取Tab统计数据
* @author 张无忌(2021/1/19 18:49)
*/
public function totalCount()
{
if ($this->request->isAjax()) {
$this->_success('获取成功', GoodsLogic::statistics());
}
}
/**
* 添加商品
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function add()
{
if ($this->request->isAjax() && $this->request->isPost()) {
$post = $this->request->post();
$post['del'] = 0;
//主表验证
$result = $this->validate($post, 'app\admin\validate\Goods.add');
if ($result !== true) {
$this->_error($result);
}
//单规格验证
if ($post['spec_type'] == 1) {
$result = $this->validate($post, 'app\admin\validate\GoodsOneSpec');
if ($result !== true) {
$this->_error($result);
}
}
//多规格验证
$spec_lists = [];
if ($post['spec_type'] == 2) {
$spec_lists = $post;
// 规格值验证长度验证
foreach($spec_lists['spec_value_str'] as $key => $item) {
$itemArr = explode(',', $item);
foreach($itemArr as $subItem) {
if(mb_strlen($subItem) > 64) {
return $this->_error('第'. ($key+1) .'个SKU规格值超过了64个字符');
}
}
}
unset($spec_lists['goods_image']);
unset($spec_lists['spec_name']);
unset($spec_lists['spec_values']);
unset($spec_lists['spec_id']);
unset($spec_lists['spec_value_ids']);
$spec_lists = form_to_linear($spec_lists);
//规格验证
if (empty($spec_lists)) {
$this->_error('至少添加一个规格');
}
$result = $this->validate($post, 'app\admin\validate\GoodsMoreSpec');
if ($result !== true) {
$this->_error($result);
}
//规格商品列表验证
foreach ($spec_lists as $v) {
$result = $this->validate($v, 'app\admin\validate\GoodsMoreSpecLists');
if ($result !== true) {
$this->_error($result);
}
}
}
//添加商品
$result = GoodsLogic::add($post, $spec_lists);
if ($result !== true) {
$this->_error('添加失败:' . $result);
}
$this->_success('添加成功');
}
$this->assign('category_lists', json_encode(GoodsCategoryLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
$this->assign('brand_lists',json_encode(GoodsBrandLogic::getGoodsBrandList(),JSON_UNESCAPED_UNICODE));
$this->assign('supplier_lists',json_encode(SupplierLogic::getSupplierList(),JSON_UNESCAPED_UNICODE));
$this->assign('freight_lists',json_encode(FreightLogic::getFreightList(),JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
/**
* Notes:编辑商品
* @param $goods_id int 商品id
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function edit($goods_id)
{
if ($this->request->isAjax() && $this->request->isPost()) {
$post = $this->request->post();
$post['del'] = 0;
$post['id'] = $post['goods_id'];
//主表验证
$result = $this->validate($post, 'app\admin\validate\Goods');
if ($result !== true) {
$this->_error($result);
}
//单规格验证
if ($post['spec_type'] == 1) {
$result = $this->validate($post, 'app\admin\validate\GoodsOneSpec');
if ($result !== true) {
$this->_error($result);
}
}
//多规格验证
$spec_lists = [];
if ($post['spec_type'] == 2) {
$spec_lists = $post;
unset($spec_lists['goods_image']);
unset($spec_lists['spec_name']);
unset($spec_lists['spec_values']);
unset($spec_lists['spec_id']);
unset($spec_lists['spec_value_ids']);
$spec_lists = form_to_linear($spec_lists);
//规格验证
if (empty($spec_lists)) {
$this->_error('至少添加一个规格');
}
$result = $this->validate($post, 'app\admin\validate\GoodsMoreSpec');
if ($result !== true) {
$this->_error($result);
}
//规格商品列表验证
foreach ($spec_lists as $v) {
$result = $this->validate($v, 'app\admin\validate\GoodsMoreSpecLists');
if ($result !== true) {
$this->_error($result);
}
}
}
if ($post['status'] == 0) {
$status = Db::name('goods')
->where(['id' => $post['goods_id']])
->value('status');
if ($status == 1) {
$res = Db::name('team_activity')
->where(['status' => 1, 'goods_id'=> $post['goods_id']])
->find();
if ($res) {
$this->_error('该商品正在参与拼团,请先关闭后才允许下架');
}
}
}
//添加商品
$result = GoodsLogic::edit($post, $spec_lists);
if ($result !== true) {
$this->_error('添加失败:' . $result);
}
$this->_success('修改成功');
}
$this->assign('category_lists', json_encode(GoodsCategoryLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
$this->assign('info', json_encode(GoodsLogic::info($goods_id),JSON_UNESCAPED_UNICODE));
$this->assign('brand_lists',json_encode(GoodsBrandLogic::getGoodsBrandList(),JSON_UNESCAPED_UNICODE));
$this->assign('supplier_lists',json_encode(SupplierLogic::getSupplierList(),JSON_UNESCAPED_UNICODE));
$this->assign('freight_lists',json_encode(FreightLogic::getFreightList(),JSON_UNESCAPED_UNICODE));
return $this->fetch('goods/add');
}
/**
* Notes:删除商品
* @param $id int 商品id
*/
public function del($id)
{
if ($this->request->isAjax()) {
//todo 商品删除验证
$result = GoodsLogic::del($id); //逻辑层处理删除信息
if ($result) {
$this->_success('删除成功');
}
$this->_error('删除失败');
}
}
/**
* Notes:修改商品字段(上下架、新品推荐、好物优选、猜你喜欢)
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function changeFields(){
$table = $this->request->controller();
$pk_name = 'id';
$pk_value = $this->request->post('id');
$field = $this->request->post('field');
$field_value = $this->request->post('value');
$result = CommonLogic::changeTableValue($table,$pk_name,$pk_value,$field,$field_value);
if($result === true){
$this->_success('修改成功');
}
$this->_error($result);
}
/**
* Notes: 下架商品
* @author 张无忌(2021/1/11 14:33)
*/
public function lowerStatus()
{
if ($this->request->isAjax()) {
$ids = $this->request->post('ids', []);
$result = GoodsLogic::upperOrLower($ids, 0);
if ($result === true) {
$this->_success('下架成功');
}
$this->_error($result);
}
}
/**
* Notes: 上架商品
* @author 张无忌(2021/1/11 14:33)
*/
public function upperStatus()
{
if ($this->request->isAjax()) {
$ids = $this->request->post('ids', []);
$result = GoodsLogic::upperOrLower($ids, 1);
if ($result === true) {
$this->_success('上架成功');
}
$this->_error('上架失败');
}
}
/**
* Notes: 获取服务套餐商品
* @author 张无忌(2021/1/11 14:33)
*/
public function gooslist(){
if ($this->request->isAjax()){
$get = $this->request->get();
$goods_list = GoodsLogic::goodsList($get);
$this->_success('',$goods_list);
}
return $this->fetch();
}
}

View File

@@ -0,0 +1,110 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\GoodsBrandLogic;
use app\common\model\Capital_;
class GoodsBrand extends AdminBase {
/**
* note 品牌列表
*/
public function lists()
{
if ($this->request->isAjax())
{
$get = $this->request->get();
$list = GoodsBrandLogic::lists($get);
$this->_success('',$list);
}
return $this->fetch();
}
/**
* note 添加品牌
*/
public function add()
{
if ($this->request->isAjax()){
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post,'app\admin\validate\GoodsBrand.add');
if ($result === true){
GoodsBrandLogic::add($post);
$this->_success('添加成功!');
}
$this->_error($result);
}
$capital = Capital_::getData();
$this->assign('capital',$capital);
return $this->fetch();
}
/**
* note 编辑品牌
*/
public function edit($id)
{
if ($this->request->isAjax()){
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post,'app\admin\validate\GoodsBrand.edit');
if ($result === true){
GoodsBrandLogic::edit($post,$id);
$this->_success('修改成功');
}
$this->_error($result);
}
$info = GoodsBrandLogic::getGoodsBrand($id);
$capital = Capital_::getData();
$this->assign('info',$info);
$this->assign('capital',$capital);
return $this->fetch();
}
/**
* note 删除品牌
*/
public function del($delData)
{
if ($this->request->isAjax()) {
$result = GoodsBrandLogic::del($delData);
if ($result) {
$this->_success('删除成功');
}
$this->_error('删除失败');
}
}
/**
* note 修改品牌的显示状态
*/
public function switchStatus(){
$post = $this->request->post();
$result =GoodsBrandLogic::switchStatus($post);
if ($result) {
$this->_success('修改成功');
}
$this->_success('修改失败');
}
}

View File

@@ -0,0 +1,118 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\{
GoodsCategoryLogic
};
use app\common\logic\CommonLogic;
class GoodsCategory extends AdminBase
{
/**
* 商品分类列表
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function lists(){
$category_tree = GoodsCategoryLogic::categoryThirdTree();
$this->assign('category_tree', json_encode($category_tree));
return $this->fetch();
}
/**
* 添加商品分类
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\GoodsCategory.add');
if ($result === true) {
GoodsCategoryLogic::add($post);
$this->_success('添加成功!');
}
$this->_error($result);
}
$category_list = GoodsCategoryLogic::categoryTwoTree();
$this->assign('category_list', $category_list);
return $this->fetch();
}
/**
* 编辑商品分类
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function edit($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\GoodsCategory.edit');
if ($result === true) {
GoodsCategoryLogic::edit($post);
$this->_success('修改成功');
}
$this->_error($result);
}
$category_info = GoodsCategoryLogic::getCategory($id);
$category_list = GoodsCategoryLogic::categoryTwoTree();
$this->assign('info',$category_info);
$this->assign('category_list', $category_list);
return $this->fetch();
}
/**
* 删除商品分类
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function del(){
$id = $this->request->post('ids');
$result = $this->validate(['id'=>[$id]], 'app\admin\validate\GoodsCategory.del');
if ($result === true) {
GoodsCategoryLogic::del($id);
$this->_success('删除成功!');
}
$this->_error($result);
}
/**
* note 修改品牌的显示状态
*/
public function switchStatus(){
$post = $this->request->post();
$result =GoodsCategoryLogic::switchStatus($post);
if ($result) {
$this->_success('修改成功');
}
$this->_success('修改失败');
}
}

View File

@@ -0,0 +1,76 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\GoodsCommentLogic;
class GoodsComment extends AdminBase{
/**
* 列表
*/
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', GoodsCommentLogic::lists($get));
}
return $this->fetch();
}
/**
* 删除
*/
public function del($delData)
{
if ($this->request->isAjax()) {
$result = GoodsCommentLogic::del($delData); //逻辑层处理删除信息
if ($result) {
$this->_success('删除成功');
}
$this->_error('删除失败');
}
}
/**
* 修改状态
*/
public function switchStatus(){
$get = $this->request->get();
GoodsCommentLogic::switchStatus($get);
$this->_success('修改成功');
}
//回复
public function reply($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\GoodsComment');
if($result === true){
GoodsCommentLogic::reply($post);
$this->_success('回复成功!');
}
$this->_error($result);
}
$this->assign('res',GoodsCommentLogic::info($id));
return $this->fetch();
}
}

View File

@@ -0,0 +1,111 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\{
HelpLogic,
HelpCategoryLogic
};
class Help extends AdminBase
{
/**
* 帮助列表
* @return mixed
*/
public function lists()
{
$category = HelpCategoryLogic::getHelpCategory();
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', HelpLogic::lists($get, $category));
}
$this->assign('category_list', $category);
return $this->fetch();
}
/**
* 添加帮助
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\Help.add');
if ($result === true) {
HelpLogic::addHelp($post);
$this->_success('添加成功!');
}
$this->_error($result);
}
$acticle_category = HelpCategoryLogic::getHelpCategory();
$this->assign('category_list', $acticle_category);
return $this->fetch();
}
/**
* 编辑帮助
*/
public function edit($id)
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\Help.edit');
if ($result === true) {
HelpLogic::editHelp($post);
$this->_success('编辑成功!');
}
$this->_error($result);
}
$help = HelpLogic::getHelp($id);
$category_list = HelpCategoryLogic::getHelpCategory();
$this->assign('help', $help);
$this->assign('category_list', $category_list);
return $this->fetch();
}
/**
* 删除帮助
*/
public function del($id)
{
if ($this->request->isAjax()) {
$result = $this->validate(['id' => $id], 'app\admin\validate\Help.del');
if ($result === true) {
HelpLogic::delHelp($id);
$this->_success('删除成功');
}
$this->_error($result);
}
}
/**
* 修改状态
*/
public function switchStatus()
{
$post = $this->request->post();
HelpLogic::switchStatus($post);
$this->_success('修改成功');
}
}

View File

@@ -0,0 +1,104 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\{HelpCategoryLogic};
class HelpCategory extends AdminBase
{
/**
* 帮助分类列表
* @return mixed
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', HelpCategoryLogic::lists($get));
}
return $this->fetch();
}
/**
* 添加帮助分类
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\HelpCategory');
if ($result === true) {
HelpCategoryLogic::addHelpCategory($post);
$this->_success('添加成功!');
}
$this->_error($result);
}
return $this->fetch();
}
/**
* 编辑帮助分类
*/
public function edit($id)
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\HelpCategory.edit');
if ($result === true) {
HelpCategoryLogic::editHelpCategory($post);
$this->_success('编辑成功!');
}
$this->_error($result);
}
$category = HelpCategoryLogic::getHelpCategory($id);
$this->assign('category', array_values($category)[0]);
return $this->fetch();
}
/**
* 删除帮助分类
*/
public function del($id)
{
if ($this->request->isAjax()) {
$result = $this->validate(['id' => $id], 'app\admin\validate\HelpCategory.del');
if ($result === true) {
HelpCategoryLogic::delHelpCategory($id);
$this->_success('删除成功');
}
$this->_error($result);
}
}
/**
* 修改状态
*/
public function switchStatus()
{
$post = $this->request->post();
HelpCategoryLogic::switchStatus($post);
$this->_success('修改成功');
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace app\admin\controller;
use app\admin\logic\HotSearchLogic;
use app\common\server\ConfigServer;
class HotSearch extends AdminBase
{
public function index() {
$info = HotSearchLogic::info();
$this->assign('info',$info);
return $this->fetch();
}
public function set(){
$post = $this->request->post();
$result = HotSearchLogic::set($post);
if($result == true){
$this->_success('操作成功');
}
$this->_error('操作失败');
}
}

View File

@@ -0,0 +1,82 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\cache\RoleMenuCache;
use app\admin\logic\StatLogic;
use app\admin\server\MenuServer;
use app\common\server\ConfigServer;
use think\Db;
use think\facade\Config;
class Index extends AdminBase
{
/**
* 后台前端全局界面
* @return mixed
*/
public function index()
{
// 菜单渲染
$menu = MenuServer::getMenuTree($this->admin_info['role_id']);
$this->assign('menu', $menu);
//开启右上角前端示例
$app_trace = Config::get('app.app_trace');
$this->assign('view_app_trace', $app_trace);
//管理员名称
$this->assign('admin_name', $this->admin_info['name']);
//角色名称
$role_name = Db::name('role')
->where(['id' => $this->admin_info['role_id']])
->value('name');
$role_name = empty($role_name) ? '系统管理员' : $role_name;
$this->assign('role_name', $role_name);
// 网站配置
$config = [
'name' => ConfigServer::get('website', 'name'),
'backstage_logo' => ConfigServer::get('website', 'backstage_logo'),
'web_favicon' => ConfigServer::get('website', 'web_favicon'),
];
$this->assign('config', $config);
return $this->fetch();
}
/**
* 工作台
* @return mixed
*/
public function stat()
{
if($this->request->isAjax()){
$this->_success('', StatLogic::graphData());
}
$this->assign('res', StatLogic::stat());
$this->assign('company_name',ConfigServer::get('copyright', 'company_name'));
return $this->fetch();
}
}

View File

@@ -0,0 +1,102 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\LabelLogic;
class Label extends AdminBase
{
/**
* 用户分组列表
* @return mixed
*/
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get(); //获取get请求
$this->_success('', LabelLogic::lists($get)); //逻辑层处理渲染数据
}
return $this->fetch(); //渲染
}
/**
* 添加
* @return mixed
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\UserGroup.add');
if ($result === true) {
LabelLogic::addUserGroup($post);
$this->_success('添加成功');
}
$this->_error($result);
}
return $this->fetch();
}
/**
* 编辑
* @param string $id
* @return mixed
*/
public function edit($id)
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\UserGroup.edit');
if ($result === true) {
LabelLogic::editUserGroup($post);
$this->_success('修改成功');
}
$this->_error($result);
}
$this->assign('info', LabelLogic::info($id));
return $this->fetch();
}
/**
* 删除
* @param $id
*/
public function del($id)
{
if ($this->request->isAjax()) {
$result = $this->validate(['id'=>$id], 'app\admin\validate\UserGroup.del');
if($result === true) {
LabelLogic::delUserGroup($id);
$this->_success('删除成功');
}
$this->_error($result);
}
}
}

View File

@@ -0,0 +1,194 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\{
LeaveLogic
};
use app\admin\logic\StaffLogic;
class Leave extends AdminBase {
/**
* 员工请假列表
* @return mixed
*/
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('',LeaveLogic::lists($get));
}
$this->assign('type',LeaveLogic::type());
return $this->fetch();
}
/**
* 增加请假删除
* @return mixed
*/
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
if($post['privilege']==''){
$this->_error('保洁师不能为空');
}
//dump($post);
$start=strtotime($post['start_time']);
$end=strtotime($post['end_time']);
$lent=Db::name('leave')->where('user_id',$post['privilege'])->where('time','>=',$start)->where('time','<=',$end)->find();
if($lent){
$this->_error('占用数据重复');
}else{
$order=Db::name('order_exe')->where('user_id',$post['privilege'])
->where('autotime','>=',$start)
->where('autotime','<=', $end)->find();
if($order){
$this->_error('日期已经存在订单');
}else{
$post['admin_id']=$this->admin_id;
$this->_success('请假成功等待审核',LeaveLogic::add($post));
}
}
}
$this->assign('satff',LeaveLogic::user());
$this->assign('type',LeaveLogic::type());
return $this->fetch();
}
/**
* 编辑文章分类
* @return mixed
*/
public function del($id){
$del=Db::name('leave')->where('id',$id)->delete();
if($del){
$this->_success('删除请假成功');
}else{$this->_error('请假已经通过审核无法删除');}
}
/**
* 删除请假
* @return mixed
*/
public function edit($id)
{
if ($this->request->isAjax()) {
// $result = $this->validate(['id' => $id], 'app\admin\validate\ArticleCategory.del');
// if ($result === true) {
// ArticleCategoryLogic::delArticleCategory($id);
// $this->_success('删除成功');
// }
// $this->_error($result);
}
$this->assign('type',LeaveLogic::type());
$this->assign('detail',LeaveLogic::info($id));
return $this->fetch();
}
/**
* 修改状态
*/
public function Status($id){
$updata=Db::name('leave')->where('id',$id)->update(['status'=>1]);
$this->_success('审核通过');
}
public function nostatus($id){
$updata=Db::name('leave')->where('id',$id)->update(['status'=>2]);
$this->_success('审核不通过');
}
/**
* 保洁师请假列表
*/
public function staff_leave(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取数据成功',LeaveLogic::staff_leave($get));
}
$this->assign('type',LeaveLogic::leave_statype());
$this->assign('staff',StaffLogic::stafflist());
return $this->fetch();
}
/**
* 审核请假通过
*
*/
public function passed(){
$post = $this->request->post();
$data=Db::name('leavesd')->where('id',$post['id'])->find(); //获取订单的基本信息
if($data['addtime']==0){ //判断上午订单
$ord=Db::name('order_exe')
->where('staff_id',$data['staff_id'])
->where('autotime',$data['time'])
->where('addtime',1)
->find();
if($ord){
$this->_error('已有订单占用');
}
}
if($data['addtime']==1){ //判断上午订单
$ord=Db::name('order_exe')
->where('staff_id',$data['staff_id'])
->where('autotime',$data['time'])
->where('addtime',2)
->find();
if($ord){
$this->_error('已有订单占用');
}
}
if($data['addtime']==2){
$date_day=date('Y-m-d',$data['time']);//"2019-10-22"
$beginDay_ts=strtotime($date_day);//1571673600
$endDay_ts=$beginDay_ts+86400-1;
$ord=Db::name('order_exe')
->where('staff_id',$data['staff_id'])
->where('autotime','>=',$data['time'])
->where('autotime','<=',$endDay_ts)
->select();
if($ord){
$this->_error('已有订单占用');
}
}
Db::name('leavesd')->where('id',$post['id'])->update(['status'=>1]);
$this->_success('请假数据审批成功');
}
/**
* 拒绝通过请假的获取内容
*
*/
public function refuse(){
$post = $this->request->get();
$lists = LeaveLogic::refuse($post['id']);
$this->_success('',$lists);
}
/**
* 更新请假的内容
*
*/
public function refusesd(){
$post = $this->request->post();
$lists = LeaveLogic::refusesd($post);
$this->_success('修改数据成功');
}
/**
* 删除请假的数据
*
*/
public function dels($id){
$del=Db::name('leavesd')->where('id',$id)->delete();
if($del){
$this->_success('删除请假成功');
}else{$this->_error('请假已经通过审核无法删除');}
}
}

View File

@@ -0,0 +1,68 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\LogLogic;
use think\helper\Time;
class Log extends AdminBase
{
/**
* 系统日志
* @return mixed
*/
public function lists()
{
if ($this->request->isAjax()) {
$limit = $this->request->get('limit', 20);
$page_no = $this->request->get('page', 1);
$get = $this->request->get();
$this->_success('', LogLogic::lists($page_no, $limit, $get));
}
$today = array_map(function ($time) {
return date('Y-m-d H:i:s', $time);
}, Time::today());
$this->assign('today', $today);
$yesterday = array_map(function ($time) {
return date('Y-m-d H:i:s', $time);
}, Time::yesterday());
$this->assign('yesterday', $yesterday);
$days_ago7 = array_map(function ($time) {
return date('Y-m-d H:i:s', $time);
}, Time::dayToNow(7));
$this->assign('days_ago7', $days_ago7);
$days_ago30 = array_map(function ($time) {
return date('Y-m-d H:i:s', $time);
}, Time::dayToNow(30, true));
$this->assign('days_ago30', $days_ago30);
return $this->fetch();
}
}

View File

@@ -0,0 +1,155 @@
<?php
namespace app\admin\controller;
use app\admin\logic\LuckDrawLogic;
use app\common\server\ConfigServer;
class LuckDraw extends AdminBase
{
/**
* Notes: 查看页面
* @author 张无忌(2021/1/25 11:08)
* @return mixed
*/
public function index()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = LuckDrawLogic::lists($get);
$this->_success('获取成功', $lists);
}
// 获取抽奖设置信息
$this->assign('setConfig', [
'limit' => ConfigServer::get('luckdraw', 'limit', 0),
'rule' => ConfigServer::get('luckdraw', 'rule', ''),
'status' => ConfigServer::get('luckdraw', 'status', 0)
]);
return $this->fetch();
}
/**
* Notes: 添加奖品
* @author 张无忌(2021/1/25 11:08)
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$validate = $this->validate($post, 'app\admin\validate\LuckDraw.add');
if ($validate !== true) {
$this->_error($validate);
}
if (LuckDrawLogic::add($post)) {
$this->_success('新增成功');
}
$error = LuckDrawLogic::getError() ?: '新增失败';
$this->_error($error);
}
return $this->fetch();
}
/**
* Notes: 编辑奖品
* @author 张无忌(2021/1/25 11:08)
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$validate = $this->validate($post, 'app\admin\validate\LuckDraw');
if ($validate !== true) {
$this->_error($validate);
}
if (LuckDrawLogic::edit($post)) {
$this->_success('编辑成功');
}
$error = LuckDrawLogic::getError() ?: '编辑失败';
$this->error($error);
}
$id = $this->request->get('id');
$this->assign('detail', LuckDrawLogic::detail($id));
return $this->fetch();
}
/**
* Notes: 删除
* @author 张无忌(2021/1/26 11:19)
*/
public function del()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id', 0, 'intval');
if (LuckDrawLogic::del($id)) {
$this->_success('删除成功');
}
$error = LuckDrawLogic::getError() ?: '删除失败';
$this->_error($error);
}
}
public function switchStatus()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if (LuckDrawLogic::switchStatus($post)) {
$this->_success('更新成功');
} else {
$error = LuckDrawLogic::getError() ?? '更新失败';
$this->_error($error);
}
}
}
/**
* Notes: 更新排序
* @author 张无忌(2021/1/28 10:21)
*/
public function sort()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if (LuckDrawLogic::updateSort($post)) {
$this->_success('更新成功');
} else {
$error = LuckDrawLogic::getError() ?? '更新失败';
$this->_error($error);
}
}
}
/**
* Notes: 设置抽奖规则
* @author 张无忌(2021/1/25 11:08)
*/
public function set()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = LuckDrawLogic::set($post);
if (!$result) {
$error = LuckDrawLogic::getError() ?: '设置失败';
$this->_error($error);
}
$this->_success('更新成功');
}
}
/**
* Notes: 抽奖记录
* @author 张无忌(2021/1/25 11:08)
*/
public function record()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = LuckDrawLogic::record($get);
$this->_success('OK', $lists);
}
}
}

View File

@@ -0,0 +1,94 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\MarketingConfigLogic;
class MarketingConfig extends AdminBase{
/**
* note 邀请奖励
* create_time 2020/12/2 16:18
*/
public function invitedAwardConfig(){
if($this->request->isAjax()){
$post = $this->request->post();
MarketingConfigLogic::setConfig($post);
return $this->_success('设置成功',[]);
}
$this->assign('config',MarketingConfigLogic::getConfig(['invited_award_integral']));
return $this->fetch();
}
/**
* note 下单奖励
* create_time 2020/12/2 16:19
*/
public function orderAwardConfig(){
if($this->request->isAjax()){
$post = $this->request->post();
MarketingConfigLogic::setConfig($post);
return $this->_success('设置成功',[]);
}
$this->assign('config',MarketingConfigLogic::getConfig(['order_award_integral']));
return $this->fetch();
}
/**
* note 会员注册
* create_time 2020/12/2 16:22
*/
public function registerAwardConfig(){
if($this->request->isAjax()){
$post = $this->request->post();
MarketingConfigLogic::setConfig($post);
return $this->_success('设置成功',[]);
}
$config = [
'register_award_integral_status',
'register_award_integral',
'register_award_coupon_status',
'register_award_coupon',
];
$this->assign('config',MarketingConfigLogic::getConfig($config));
$this->assign('coupon_list',MarketingConfigLogic::getCouponList());
return $this->fetch();
}
/**
* Notes: 积分抵扣
* @author 段誉(2021/3/30 17:43)
* @return mixed
*/
public function integralDeduction()
{
if($this->request->isAjax()){
$post = $this->request->post();
MarketingConfigLogic::setConfig($post);
$this->_success('设置成功',[]);
}
$config = [
'integral_deduction_status',//积分抵扣状态
'integral_deduction_money',//积分抵扣比例
'integral_deduction_limit',//积分使用需超过多少才可使用
];
$this->assign('config',MarketingConfigLogic::getConfig($config));
return $this->fetch();
}
}

View File

@@ -0,0 +1,154 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\MaterialLogic;
use app\admin\logic\StaffLogic;
use app\common\server\ConfigServer;
class Material extends AdminBase
{
/**
* 原料库存列表
* @param $get
* @return array
*/
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = MaterialLogic::lists($get);
$this->_success('',$lists);
}
return $this->fetch();
}
/**
* 增加库存列表
* @param $get
* @return array
*/
public function add(){
if ($this->request->isAjax()) {
$get = $this->request->post();
$lists = MaterialLogic::add($get);
$this->_success('增加原料库存成功');
}
$this->assign('staff_bellist', json_encode(StaffLogic::staff_bellist(), JSON_UNESCAPED_UNICODE));
$this->assign('brand_lists', json_encode(MaterialLogic::typelists(), JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
/**
* 编辑原料库存
* @param $get
* @return array
*/
public function edit(){
if ($this->request->isAjax()) {
$get = $this->request->post();
$lists = MaterialLogic::edit($get);
$this->_success('更新成功');
}
$id = $this->request->get('id');
$this->assign('info', json_encode(MaterialLogic::infolist($id),JSON_UNESCAPED_UNICODE));
$this->assign('brand_lists', json_encode(MaterialLogic::typelists(), JSON_UNESCAPED_UNICODE));
$this->assign('staff_bellist', json_encode(StaffLogic::staff_bellist(), JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
/**
* 原料类型
* @param $get
* @return array
*/
public function typelist(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = MaterialLogic::typelist($get);
$this->_success('',$lists);
}
return $this->fetch();
}
/**
*增加原料类型
* @param $get
* @return array
*/
public function typeadd(){
if ($this->request->isAjax()) {
$get = $this->request->post('name');
$data=Db::name('material_type')->data(['name'=>$get,'time'=>time()])->insert();
$this->_success('增加原料分类成功');
}
return $this->fetch();
}
/**
*修改原料分类名称
* @param $get
* @return array
*/
public function typeidt($id){
if ($this->request->isAjax()) {
$get = $this->request->post();
$data=Db::name('material_type')->where('id',$get['id'])->data(['name'=>$get['name']])->update();
$this->_success('更改分类成功');
}
$detail=Db::name('material_type')->where('id',$id)->find();
$this->assign('detail',$detail);
return $this->fetch();
}
/**
*删除原料分类
* @param $get
* @return array
*/
public function typedel($id){
$data=Db::name('material_type')->where('id',$id)->delete();
$this->_success('删除成功');
}
/**
*删除原料库存
* @param $get
* @return array
*/
public function del($id){
$data=Db::name('epr')->where('id',$id)->delete();
$this->_success('删除成功');
}
//员工申请物料
public function usermaterial(){
if ($this->request->isAjax()) {
$post = $this->request->get();
$this->_success('获取数据成功',MaterialLogic::usermaterial($post));
}
$this->assign('satff',StaffLogic::serverstaff());
return $this->fetch();
}
//删除员工申请
public function delusermaterial(){
$id = $this->request->post('id');
$this->_success('获取数据成功',MaterialLogic::delusermaterial($id));
}
//物料申请审核通过
public function audit(){
$id = $this->request->post('id');
$this->_success('审核通过',MaterialLogic::audit($id));
}
//拒绝通过
public function noaudit(){
$id = $this->request->post('id');
$this->_success('修改成功',MaterialLogic::noaudit($id));
}
}

View File

@@ -0,0 +1,317 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\CommonLogic;
use app\admin\logic\MenuDecorateLogic;
use app\common\model\Menu_;
use app\common\server\ConfigServer;
use app\common\server\UrlServer;
class MenuDecorate extends AdminBase{
/**
* note 首页导航装修页面
*/
public function indexList(){
if($this->request->isAjax()) {
$get = $this->request->get();
return $this->_success('', MenuDecorateLogic::indexList($get));
}
$index_setting_logo = ConfigServer::get('decoration', 'index_setting_logo',1);
$index_setting_hots = ConfigServer::get('decoration', 'index_setting_hots',1);
$index_setting_news = ConfigServer::get('decoration', 'index_setting_news', 1);
$index_setting_top_bg_image = ConfigServer::get('decoration', 'index_setting_top_bg_image', '');
if(!empty($index_setting_top_bg_image)) {
$index_setting_top_bg_image = UrlServer::getFileUrl($index_setting_top_bg_image);
}
$this->assign('index_setting_logo', $index_setting_logo);
$this->assign('index_setting_hots', $index_setting_hots);
$this->assign('index_setting_news', $index_setting_news);
$this->assign('index_setting_top_bg_image', $index_setting_top_bg_image);
return $this->fetch();
}
/**
* note 个人中心装修页面
*/
// public function centerList(){
// $this->assign('type',2);
// return $this->fetch('lists');
// }
/**
* note 个人中心装修页面
*/
public function centerList(){
if($this->request->isAjax()) {
$get = $this->request->get();
return $this->_success('', MenuDecorateLogic::centerList($get));
}
$center_setting_top_bg_image = ConfigServer::get('decoration', 'center_setting_top_bg_image', '');
if(!empty($center_setting_top_bg_image)) {
$center_setting_top_bg_image = UrlServer::getFileUrl($center_setting_top_bg_image);
}
$this->assign('center_setting_top_bg_image', $center_setting_top_bg_image);
return $this->fetch();
}
/**
* note 获取数据列表
* create_time 2020/12/1 11:14
*/
public function lists(){
$get = $this->request->get('');
if($this->request->isAjax()){
$this->_success('', MenuDecorateLogic::lists($get));
}
}
/**
* note 添加菜单
* create_time 2020/12/1 11:00
*/
public function add(){
if($this->request->isAjax()){
$post_data = $this->request->post();
$post_data['del'] = 0;
$result = $this->validate($post_data, 'app\admin\validate\MenuDecorate.add');
if($result === true){
MenuDecorateLogic::add($post_data); //逻辑层处理添加数据
$this->_success('修改成功');
}
$this->_error($result);
}
$type = $this->request->param('type',1);
$menu_list = Menu_::getMenuContent($type,true);
$this->assign('menu_list',$menu_list);
return $this->fetch();
}
/**
* note 编辑菜单
* create_time 2020/12/1 11:00
*/
public function edit(){
if($this->request->isAjax()){
$post_data = $this->request->post();
$post_data['del'] = 0;
$result = $this->validate($post_data, 'app\admin\validate\MenuDecorate.edit');
if($result === true){
MenuDecorateLogic::edit($post_data); //逻辑层处理添加数据
$this->_success('修改成功');
}
$this->_error($result);
}
$id = $this->request->get('id');
$decorate = MenuDecorateLogic::getMenuDecorate($id);
$menu_list = Menu_::getMenuContent($decorate['decorate_type'],true);
$this->assign('menu_list',$menu_list);
$this->assign('decorate',$decorate);
return $this->fetch();
}
/**
* note 删除菜单
* create_time 2020/12/1 11:00
*/
public function del($id){
if ($this->request->isAjax()) {
$result = $this->validate(['id' => $id], 'app\admin\validate\MenuDecorate.del');
if ($result === true) {
MenuDecorateLogic::del($id);
$this->_success('删除成功');
}
$this->_error($result);
}
}
/*
* 批量删除菜单
*/
public function batchDel(){
if ($this->request->isAjax()) {
$ids = $this->request->post('id');
$result = $this->validate(['id' => $ids], 'app\admin\validate\MenuDecorate.del');
if ($result === true) {
MenuDecorateLogic::batchDelMenuDecorate($ids);
$this->_success('删除成功');
}
$this->_error($result);
}
}
/*
* 复制菜单
*/
public function copy(){
$id = $this->request->get('id');
$decorate = MenuDecorateLogic::getMenuDecorate($id);
$menu_list = Menu_::getIndexMenu(true);
if($decorate['decorate_type'] == 2){
$menu_list = Menu_::getCentreMenu(true);
}
$this->assign('menu_list',$menu_list);
$this->assign('decorate',$decorate);
return $this->fetch();
}
/*
* 修改字段
*/
public function changeFields(){
$table = $this->request->controller();
$pk_name = 'id';
$pk_value = $this->request->post('id');
$field = $this->request->post('field');
$field_value = $this->request->post('value');
$result = CommonLogic::changeTableValue($table, $pk_name, $pk_value, $field, $field_value);
if ($result) {
$this->_success('修改成功');
}
$this->_error('修改失败');
}
/**
* 商品分类布局页
*/
public function categoryLayout() {
if($this->request->isPost()) {
$post = $this->request->post();
// 这里设置值要与显示时取值不同,这里相当于所有的
ConfigServer::set('decoration', 'layout_no', $post['layout_no']);
$this->_success('设置成功');
}
$category_layouts = ConfigServer::get('decoration', 'category_layout');
$category_layouts_tips = ConfigServer::get('decoration', 'category_layout_tips');
$layout_no = ConfigServer::get('decoration', 'layout_no', '');
$this->assign('category_layouts', $category_layouts);
$this->assign('category_layouts_tips', $category_layouts_tips);
$this->assign('layout_no', $layout_no);
return $this->fetch();
}
/**
* 首页 - 其它设置
*/
public function setIndexSetting()
{
$post = $this->request->post();
ConfigServer::set('decoration', 'index_setting_logo', $post['logo']);
ConfigServer::set('decoration', 'index_setting_hots', $post['hots']);
ConfigServer::set('decoration', 'index_setting_news', $post['news']);
ConfigServer::set('decoration', 'index_setting_top_bg_image', $post['top_bg_image']);
$this->_success('设置成功');
}
/**
* 我的 - 其它设置
*/
public function setCenterSetting()
{
$post = $this->request->post();
ConfigServer::set('decoration', 'center_setting_top_bg_image', $post['top_bg_image']);
$this->_success('设置成功');
}
/**
* 底部导航
*/
public function bottomNavigation()
{
if($this->request->isAjax()) {
$get = $this->request->get();
$result = MenuDecorateLogic::bottomNavigation($get);
return $this->_success('', $result);
}
$unSelectedTextColor = ConfigServer::get('decoration', 'navigation_setting_ust_color', '#000000');
$selectedTextColor = ConfigServer::get('decoration', 'navigation_setting_st_color', '#000000');
// $top_bg_image = ConfigServer::get('decoration', 'navigation_setting_top_bg_image', '');
// if(!empty($top_bg_image)) {
// $top_bg_image = UrlServer::getFileUrl($top_bg_image);
// }
$this->assign('unSelectedTextColor', $unSelectedTextColor);
$this->assign('selectedTextColor', $selectedTextColor);
// $this->assign('top_bg_image', $top_bg_image);
return $this->fetch();
}
/**
* 添加底部导航
*/
public function addNavigation()
{
if($this->request->isAjax()) {
$post = $this->request->post();
$result = MenuDecorateLogic::addNavigation($post);
if($result['flag']) {
$this->_success($result['msg']);
}else{
$this->_error($result['msg']);
}
}
return $this->fetch();
}
/**
* 编辑底部导航
*/
public function editNavigation()
{
if($this->request->isAjax()) {
$post = $this->request->post();
$result = MenuDecorateLogic::editNavigation($post);
if($result['flag']) {
$this->_success($result['msg']);
}else{
$this->_error($result['msg']);
}
}
$id = $this->request->get('id');
$navigation = MenuDecorateLogic::getNavigation($id);
$this->assign('navigation', $navigation);
return $this->fetch();
}
/**
* 删除底部导航
*/
public function delNavigation()
{
if($this->request->isPost()) {
$id = $this->request->post('id', '', 'intval');
$result = MenuDecorateLogic::delNavigation($id);
if($result) {
return $this->_success('删除成功');
}else{
return $this->_error('删除失败');
}
}
}
/**
* 底部导航 - 其他设置
*/
public function setNavigationSetting()
{
$post = $this->request->post();
ConfigServer::set('decoration', 'navigation_setting_ust_color', $post['unSelectedTextColor']);
ConfigServer::set('decoration', 'navigation_setting_st_color', $post['selectedTextColor']);
// ConfigServer::set('decoration', 'navigation_setting_top_bg_image', $post['top_bg_image']);
$this->_success('设置成功');
}
}

View File

@@ -0,0 +1,62 @@
<?php
namespace app\admin\controller;
use app\admin\logic\MessageLogic;
use think\Db;
class Message extends AdminBase{
public function config(){
$config = MessageLogic::config();
$this->assign('config',$config);
return $this->fetch();
}
public function set(){
$id = $this->request->get('id',1);
if($this->request->isAjax()){
$post = $this->request->post();
MessageLogic::setConfig($post);
$this->_success('设置成功');
}
$info = MessageLogic::getMessage($id);
$this->assign('info',$info);
return $this->fetch();
}
//短信推广通知设置
public function Message(){
if($this->request->isAjax()){
$post = $this->request->post();
MessageLogic::addmess($post);
$this->_success('设置成功');
}
$config=Db::name('user_message')->where('id',1)->find();
$this->assign('config', $config);
return $this->fetch();
}
public function messageadd(){
$post = $this->request->post('user_ids');
$useradder=Db::name('user_address')->where('id',$post[0])->find(); //查询用户的电话
$smsapi = "http://api.smsbao.com/";
$user = "connoryz"; //短信平台帐号
$pass = md5("90625110aa"); //短信平台密码
$content="【哆啦猫日式家政】短信内容";//要发送的短信内容
$phone = $useradder['telephone'];//要发送短信的手机号码
$sendurl = $smsapi."sms?u=".$user."&p=".$pass."&m=".$phone."&c=".urlencode($content);
$result =file_get_contents($sendurl) ;
if($result==0){
$this->_success('发送短信成功,请勿重新发送',$result);
}else{
$this->_error('短信发送失败');
}
}
}

View File

@@ -0,0 +1,44 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\MnpLogic;
use think\Request;
class Mnp extends AdminBase
{
/**
* 设置小程序
* @return mixed
*/
public function setMnp()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
MnpLogic::SetMnp($post);
$this->_success('设置成功');
}
$mnp = MnpLogic::getMnp();
$this->assign('mnp', $mnp);
return $this->fetch();
}
}

View File

@@ -0,0 +1,77 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\MnpMessageLogic;
class MnpMessage extends AdminBase
{
/**
* Notes: 模板消息管理
*/
public function lists()
{
if($this->request->isAjax()){
$get = $this->request->get();
$list = MnpMessageLogic::lists($get);
$this->_success('', $list);
}
return $this->fetch();
}
/**
* Notes: 编辑模板消息
* @param $id
* @return mixed
*/
public function edit($id)
{
$info = MnpMessageLogic::getTemplateMessage($id);
$this->assign('info',$info);
return $this->fetch();
}
/**
* Notes: 修改消息模板使用状态
*/
public function switchStatus()
{
$get = $this->request->get();
$result = MnpMessageLogic::switchStatus($get);
if ($result) {
$this->_success('修改成功');
}
$this->_success('修改失败');
}
/**
* Notes: 同步消息模板
*/
public function synchro()
{
$post = $this->request->post();
$result = MnpMessageLogic::synchro($post);
if ($result === true) {
$this->_success('同步成功');
}
$this->_error('同步失败,请检查配置信息');
}
}

View File

@@ -0,0 +1,108 @@
<?php
// +---
namespace app\admin\controller;
use think\Db;
use app\admin\logic\MpLogic;
use yx\admin\builderClass;
class Mp extends AdminBase
{
public function index(){
$where = [
['lng','<>',''],
['lat','<>',''],
['onwork','=',1]
];
$u = Db::name('staff')->field('name,id,lng,lat,lnglat,mobile')->where($where)->select();
// var_dump($u);
$this->assign('u', json_encode($u));
return $this->fetch();
}
public function map_user(){
$input = input();
if(empty($input['lng'])){
return json(['code'=>0,'msg'=>'lng empty']);
}
if(empty($input['lat'])){
return json(['code'=>0,'msg'=>'lat empty']);
}
$where = [
['lng','<>',''],
['lat','<>',''],
['onwork','=',1]
];
$list = Db::name('staff')->field('name,id,lng,lat,lnglat,mobile')->where($where)->select();
// 函数:将数组转换为 LatLng 对象数组
function convertToLatLngArray($coordArray) {
$latLngArray = [];
for ($i = 0; $i < count($coordArray); $i += 2) {
$lat = floatval($coordArray[$i]);
$lng = floatval($coordArray[$i + 1]);
$latLngArray[] = [$lng,$lat];
}
return $latLngArray;
}
$u = [];
foreach($list as $item=>$k){
//获取用户的范围
if( !$list[$item]['lnglat']){
unset($list[$item]);
continue;
}
$points = convertToLatLngArray(explode(',',$list[$item]['lnglat']));
// // var_dump($points);
if(!$this->is_ptin_poly($input['lng'],$input['lat'],$points)){
unset($list[$item]);
continue;
}
$u[] = $k;
}
$this->_success('获取数据成功',$u);
}
//是否再范围内
public function is_ptin_poly($aLon, $aLat, $pointList = array())
{
$iSum = 0;
$iCount = count($pointList);
if ($iCount < 3) {
return false;
}
foreach ($pointList as $key => $row) {
$pLon1 = $row[0];
$pLat1 = $row[1];
if ($key === $iCount - 1) {
$pLon2 = $pointList[0][0];
$pLat2 = $pointList[0][1];
} else {
$pLon2 = $pointList[$key + 1][0];
$pLat2 = $pointList[$key + 1][1];
}
if ((($aLat >= $pLat1) && ($aLat < $pLat2)) || (($aLat >= $pLat2) && ($aLat < $pLat1))) {
if (abs($pLat1 - $pLat2) > 0) {
$pLon = $pLon1 - (($pLon1 - $pLon2) * ($pLat1 - $aLat)) / ($pLat1 - $pLat2);
if ($pLon < $aLon) {
$iSum += 1;
}
}
}
}
if ($iSum % 2 != 0) {
return true;
} else {
return false;
}
}
}

View File

@@ -0,0 +1,51 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\MyLogic;
use yx\admin\builderClass;
class My extends AdminBase
{
/**
* 修改个人密码
* @return mixed
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function password()
{
if ($this->request->post()) {
$post = input('post.');
$post['admin_id'] = $this->admin_id;
$result = $this->validate($post, 'app\admin\validate\Password');
if ($result === true) {
MyLogic::updatePassword($post['password'], $this->admin_id);
$this->_success('修改密码成功');
}
$this->_error($result);
}
return $this->fetch();
}
}

View File

@@ -0,0 +1,107 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\NoticeSettingLogic;
use app\common\model\NoticeSetting as NoticeSettingModel;
use think\Db;
class NoticeSetting extends AdminBase
{
/**
* Notes: 消息设置列表
* @author 段誉(2021/4/27 17:17)
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function index()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$type = $get['type'] ?? NoticeSettingModel::NOTICE_USER;
$this->_success('获取成功', NoticeSettingLogic::lists($type));
}
return $this->fetch();
}
/**
* Notes: 设置系统通知模板
* @author 段誉(2021/4/27 17:18)
* @return mixed
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function set()
{
$id = $this->request->get('id');
$type = $this->request->get('type');
if ($this->request->isAjax()) {
$post = $this->request->post();
NoticeSettingLogic::set($post);
$this->_success('操作成功');
}
$this->assign('info', NoticeSettingLogic::info($id, $type));
$this->assign('type', $type);
return $this->fetch('set_'.$type);
}
/**
* 通知记录
*/
public function record()
{
if($this->request->isAjax()) {
$get = $this->request->get();
$data = NoticeSettingLogic::record($get);
$this->_success('', $data);
}
$param = $this->request->get();
$this->assign('param', $param);
return $this->fetch();
}
/**
* 删除记录,直接删除(非软删除)
*/
public function delRecord()
{
$id = $this->request->post('id', '', 'intval');
if(empty($id)) {
return $this->_error('参数缺失,删除失败');
}
$res = Db::name('notice')->delete($id);
if($res) {
return $this->_success('删除成功');
}else{
return $this->_error('删除失败');
}
}
}

View File

@@ -0,0 +1,138 @@
<?php
namespace app\admin\controller;
use app\admin\logic\OaLogic;
use app\admin\logic\WeChatLogic;
use think\Db;
use app\common\server\ConfigServer;
class Number extends AdminBase {
public function list(){
if($this->request->isAjax()){
$get = $this->request->get();
$list=OaLogic::data($get);
$this->_success('',$list);
}
return $this->fetch();
}
public function date($id){
$order=Db::name('order_yearcard')->where('id',$id)->find();
if($order['yearcard_id']==1){
$goods_id=8;
}
if($order['yearcard_id']==9){
$goods_id=10;
}
if($order['yearcard_id']==10){
$goods_id=11;
}
if($order['yearcard_id']==12){
$goods_id=9;
}
if($order['yearcard_id']==14){
$goods_id=38;
}
if($order['yearcard_id']==17){
$goods_id=39;
}
if($order['yearcard_id']==18){
$goods_id=40;
}
if($order['yearcard_id']==19){
$goods_id=49;
}
if($order['yearcard_id']==20){
$goods_id=50;
}
if($order['yearcard_id']==21){
$goods_id=41;
}
if($order['yearcard_id']==22){
$goods_id=42;
}
if($order['yearcard_id']==24){
$goods_id=51;
}
if($order['yearcard_id']==25){
$goods_id=52;
}
if($order['yearcard_id']==26){
$goods_id=58;
}
if($order['yearcard_id']==27){
$goods_id=44;
}
if($order['yearcard_id']==28){
$goods_id=53;
}
if($order['yearcard_id']==29){
$goods_id=54;
}
if($order['yearcard_id']==30){
$goods_id=55;
}
if($order['yearcard_id']==31){
$goods_id=57;
}
if($order['yearcard_id']==32){
$goods_id=45;
}
if($order['yearcard_id']==33){
$goods_id=46;
}
if($order['yearcard_id']==34){
$goods_id=56;
}
if($order['yearcard_id']==35){
$goods_id=58;
}
if($order['yearcard_id']==36){
$goods_id=59;
}
if($order['yearcard_id']==37){
$goods_id=60;
}
$user=Db::name('user_address')->where('user_id',$order['user_id'])->find();
$order_sn=createSn('order', 'order_sn', '', 4);
$data=[
'order_sn'=> $order_sn,
'goods_id'=>$goods_id,
'user_id'=>$order['user_id'],
'code'=>$order['surplus_count'],
'order_status'=>1,
'pay_status'=>1,
'pay_way'=>3,
'pay_time'=>$order['paytime'],
'consignee'=>$user['contact'],
'province'=>$user['province_id'],
'city'=>$user['city_id'],
'district'=>$user['district_id'],
'lat'=>$user['lat'],
'lng'=>$user['lng'],
'mobile'=>$user['telephone'],
'address'=>$user['address'],
'goods_price'=>$order['pay_fee'],
'order_amount'=>$order['pay_fee'],
'total_amount'=>$order['pay_fee'],
'total_num'=>1,
'type'=>0,
'number'=>$order['count'],
'create_time'=>$order['createtime'],
'update_time'=>$order['updatetime'],
];
$inser=Db::name('order')->data($data)->insert();
if($inser){
$order=Db::name('order_yearcard')->where('id',$id)->update(['static'=>1]);
$this->_success('添加成功');
}
}
}

View File

@@ -0,0 +1,66 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\OaLogic;
use app\admin\logic\WeChatLogic;
use app\common\server\ConfigServer;
class Oa extends AdminBase {
/**
* note 设置公众号
* create_time 2020/12/11 11:28
*/
public function setOa(){
if($this->request->isAjax()){
$post = $this->request->post();
OaLogic::setOa($post);
$this->_success('设置成功');
}
$oa = OaLogic::getOa();
$this->assign('oa',$oa);
return $this->fetch();
}
/**
* note 微信菜单
* create_time 2020/12/11 11:28
*/
public function oaMenu(){
$wechat_menu = ConfigServer::get('menu', 'wechat_menu',[]);
$this->assign('menu',$wechat_menu);
return $this->fetch();
}
/**
* note 发布菜单
* create_time 2020/12/11 11:28
*/
public function pulishMenu(){
$menu = $this->request->post('button');
if(empty($menu)){
$this->_error('请设置菜单');
}
$result = OaLogic::pulishMenu($menu);
if($result['code'] == 1){
$this->_success($result['msg']);
}
$this->_error($result['msg']);
}
}

View File

@@ -0,0 +1,78 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\OaMessageLogic;
class OaMessage extends AdminBase
{
/**
* Notes: 模板消息管理
*/
public function lists()
{
if($this->request->isAjax()){
$get = $this->request->get();
$list = OaMessageLogic::lists($get);
$this->_success('', $list);
}
return $this->fetch();
}
/**
* Notes: 编辑模板消息
* @param $id
* @return mixed
*/
public function edit($id)
{
$info = OaMessageLogic::getTemplateMessage($id);
$this->assign('info',$info);
return $this->fetch();
}
/**
* Notes: 修改消息模板使用状态
*/
public function switchStatus()
{
$get = $this->request->get();
$result = OaMessageLogic::switchStatus($get);
if ($result) {
$this->_success('修改成功');
}
$this->_success('修改失败');
}
/**
* Notes: 同步消息模板到公众号
*/
public function synchro()
{
$post = $this->request->post();
$result = OaMessageLogic::synchro($post);
if ($result === true) {
$this->_success('同步成功');
}
$this->_error('同步失败,请检查配置信息');
}
}

View File

@@ -0,0 +1,16 @@
<?php
namespace app\admin\controller;
use app\admin\logic\OpLogic;
class Op extends Admin{
public function config(){
if($this->request->isAjax()){
$post = $this->request->post();
OpLogic::setConfig($post);
$this->_success('设置成功',[]);
}
$this->assign('config',OpLogic::getConfig(['app_id','secret']));
return $this->fetch();
}
}

View File

@@ -0,0 +1,342 @@
<?php
namespace app\admin\controller;
use app\common\model\OrderLog;
use app\admin\logic\OrderLogic;
use app\admin\logic\StatcLogic;
use app\admin\logic\UserLogic;
use app\admin\logic\OrderchanelLogic;
use app\admin\logic\StaffLogic;
use app\common\model\Client_;
use app\common\model\Order as CommonOrder;
use app\common\model\Pay;
use think\Db;
class Order extends AdminBase
{
/**
* User: 意象信息科技 mjf
* Desc: 订单列表
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', OrderLogic::lists($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('num', StatcLogic::Numorder());
return $this->fetch();
}
public function exportFile()
{
$get = $this->request->get();
$this->_success('', OrderLogic::exportorder($get));
}
public function exportFilestaff()
{
$get = $this->request->get();
$this->_success('', OrderLogic::exportFilestaff($get));
}
/**
* User: 杨左
* Desc: 用户订单导出功能
*/
public function exportFilesuser()
{
$get = $this->request->get();
$this->_success('', OrderLogic::userexport($get));
}
/**
* User: 意象信息科技 mjf
* Desc: 订单详情
*/
public function detail()
{
$id = $this->request->get('id');
$detail = OrderLogic::getDetail($id);
$this->assign('detail', $detail);
// $this->assign('logs', OrderLog::getOrderLog($id));
return $this->fetch();
}
/**
* User: 意象信息科技 mjf
* Desc: 取消订单
*/
public function cancel()
{
if ($this->request->isAjax()) {
$post = $this->request->post('');
$check = $this->validate($post, 'app\admin\validate\Order.cancel');
if (true !== $check) {
$this->_error($check);
}
$res = OrderLogic::cancel($post['order_id'], $this->admin_id);
if ($res === true) {
$this->_success('取消成功');
}
$this->_error($res);
}
}
/**
* User: 意象信息科技 mjf
* Desc: 删除订单
*/
public function del()
{
if ($this->request->isAjax()) {
dump(123);die;
// $post = $this->request->post('');
// $order=Db::name('order')->where('id',$post['order_id'])->find();//查询订单信息
// if($this->admin_id!=6){
// $this->_error('无权限删除');
// }else{
// $orderdel=Db::name('order_exe')->where('order_sn',$order['order_sn'])->find();
// if($orderdel){
// $this->_error('无法删除,存在主订单');
// }else{
// $del=Db::name('order')->where('id',$post['order_id'])->delete();
// $this->_success('删除成功');
// }
// }
}
}
/**
* User: 意象信息科技 mjf
* Desc: 发货
*/
public function delivery()
{
$id = $this->request->get('id');
$detail = OrderLogic::getDetail($id);
$this->assign('detail', $detail);
$this->assign('express', OrderLogic::express());
return $this->fetch();
}
/**
* User: 意象信息科技 mjf
* Desc: 发货操作
*/
public function deliveryHandle()
{
if ($this->request->isAjax()) {
$post = $this->request->post('');
$check = $this->validate($post, 'app\admin\validate\Order.delivery');
if (true !== $check) {
$this->_error($check);
}
OrderLogic::deliveryHandle($post, $this->admin_id);
$this->_success('发货成功');
}
}
/**
* User: 意象信息科技 mjf
* Desc: 确认收货
*/
public function confirm()
{
if ($this->request->isAjax()) {
$post = $this->request->post('');
$check = $this->validate($post, 'app\admin\validate\Order.confirm');
if (true !== $check) {
$this->_error($check);
}
OrderLogic::confirm($post['order_id'], $this->admin_id);
$this->_success('确认成功');
}
}
/**
* User: 意象信息科技 mjf
* Desc: 物流信息
*/
public function express()
{
$id = $this->request->get('id');
$detail = OrderLogic::getDetail($id);
$detail['shipping'] = OrderLogic::shippingInfo($detail['id']);
$this->assign('detail', $detail);
return $this->fetch();
}
public function remarks()
{
// 获取的
if ($this->request->isAjax() && $this->request->isGet()){
$get = $this->request->get();
$detail = OrderLogic::remarks($get, 'get');
$this->_success('获取成功', $detail);
}
// 提交的
if ($this->request->isAjax() && $this->request->isPost()) {
$post = $this->request->post();
$result = OrderLogic::remarks($post, 'post');
if ($result) {
$this->_success('保存成功');
}
$this->error('保存失败');
}
}
/**
* Notes:打印接口
*/
public function orderPrint(){
$id = $this->request->post('id');
$result = $this->validate(['id'=>$id],'app\admin\validate\OrderPrint');
if(true === $result){
$result = OrderLogic::orderPrint($id);
if(true === $result){
$this->success('打印机成功,如未出小票,请检查打印机是否在线');
}
}
$this->_error($result);
}
/**
* Notes:增加客户订单
*/
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
if($post['goods_id']==''){
$this->_error('服务套餐不能为空');
}else if($post['user_id']==''){
$this->_error('请选择用户');
}
$list=OrderLogic::add($post);
$this->_success('增加订单成功', $list);
}
$this->assign('ordertype', OrderchanelLogic::infolist(true));
$this->assign('user', UserLogic::userlist(true));
$collection=Db::name('collection')->select();
$this->assign('collection',$collection);
return $this->fetch();
}
public function remarksd(){
}
public function userorder(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', OrderLogic::userlists($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$this->assign('ceenl',$ceenl);
$this->assign('num', StatcLogic::UserNumorder());
return $this->fetch();
}
public function eidt($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$this->_success('修改订单成功', OrderLogic::edit($post));
}
$this->assign('info', json_encode(OrderLogic::orderinfoid($id), JSON_UNESCAPED_UNICODE));
$brand_lists=Db::name('orderchannel')->select();
$this->assign('brand_lists', json_encode($brand_lists, JSON_UNESCAPED_UNICODE));
$this->assign('category_lists', json_encode(StaffLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
$collection=Db::name('collection')->select();
$this->assign('gord_id', json_encode($collection, JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
//后台操作划卡次数
public function delnumber()
{
// 获取的
if ($this->request->isAjax() && $this->request->isGet()){
$get = $this->request->get();
$detail = OrderLogic::delnumber($get, 'get');
$this->_success('获取成功', $detail);
}
// 提交的
if ($this->request->isAjax() && $this->request->isPost()) {
$post = $this->request->post();
$result = OrderLogic::delnumber($post, 'post');
$order=Db::name('order')->where('id',$post['id'])->find();
$admin=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admin,
'order_sn'=>$order['order_sn'],
'show'=>'操作划卡次数',
'cram_time'=>$time
];
$log=Db::name('log_order')->data($logdate)->insert();
if ($result) {
$this->_success('保存成功');
}
$this->error('保存失败');
}
}
//修改订单的分配人员
public function allocation(){
if ($this->request->isAjax()) {
$id=$this->request->get('id');
$post = $this->request->post();
$admin_id=Db::name('order')->where('id',$id)->update(['admin_id'=>$post['admin_id']]);
$this->_success('修改订单归属人成功');
}
$admin_user=Db::name('admin')->select();
$this->assign('admin_user',$admin_user);
return $this->fetch();
}
//修改订单渠道
public function channel(){
if ($this->request->isAjax()) {
$post=$this->request->get();
$post['channel_id']=$this->request->post('channel_id');
$data=OrderLogic::channel_update($post);
if($data){
$this->_success('修改成功');
}
$this->error('保存失败');
}
$id=$this->request->get('id');
$this->assign('channel',OrderchanelLogic::infolist());
return $this->fetch();
}
}

View File

@@ -0,0 +1,509 @@
<?php
namespace app\admin\controller;
use app\admin\logic\OrderautoLogic;
use app\admin\logic\OrderchanelLogic;
use app\admin\logic\{ LeaveLogic};
use app\admin\logic\GoodsCategoryLogic;
use app\admin\logic\StaffLogic;
use app\admin\logic\UserLogic;
use app\common\server\WeChatServer;
use app\common\model\NoticeSetting;
use EasyWeChat\Factory;
use think\Db;
class Orderautomatic extends AdminBase
{
/**
* 等待预排
* @return mixed
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', OrderautoLogic::lists($get));
}
$type = \app\common\model\Ad::getAdTypeDesc(true);
$this->assign('ordertypelist',OrderchanelLogic::infolist());
$admin=Db::name('admin')->select();
$this->assign('admin', $admin);
$this->assign('type', $type);
return $this->fetch();
}
/**
* 增加预排的订单
* @return mixed
*/
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$admin=$this->admin_id;
$list= OrderautoLogic::add($post,$admin);
if($list==3){
$this->_error('预排参数错误');
}
$this->_success('增加预排订单成功',$list);
}
$get=$this->request->get('id');
$this->assign('ordertype', OrderchanelLogic::infolist());
$this->assign('satff',LeaveLogic::user($get));
$this->assign('order_sn', $get);
return $this->fetch();
}
public function userlist(){
if ($this->request->isAjax()){
$get = $this->request->get();
$goods_list = OrderautoLogic::getUserList($get,true);
$this->_success('',$goods_list);
}
return $this->fetch();
}
/**
* 查看预排的订单
* @return mixed
*/
public function infolist(){
if ($this->request->isAjax()){
$get = $this->request->get();
$infolist=OrderautoLogic::infolist($get);
$this->_success('',$infolist);
}
$get = $this->request->get();
$this->assign('info', OrderautoLogic::info($get['id']));
return $this->fetch();
}
public function edit(){
$id= $this->request->get('id');
$info = OrderautoLogic::info($id);
$this->assign('position_list', OrderautoLogic::infoPosition($info['pid']));
$this->assign('info',$info);
$this->assign('ordertype', OrderchanelLogic::infolist());
$this->assign('satff',LeaveLogic::user());
return $this->fetch();
}
/**
* 修改排单的时间
* @return mixed
*/
public function eitdata(){
if ($this->request->isAjax()){
$id= $this->request->get('id');
$post= $this->request->post();
$date=Db::name('order_exe')->where('id',$id)->find(); //获取订单的信息
$custom=Db::name('order')->where('order_sn',$date['order_sn'])->find(); //获取客户的信息
if($date['addtime']==1){
$timesw="上午";
}else{
$timesw="下午";
}
$currentTime = date('H');
if( $currentTime>17){
if($date['staff_id']!=0){
$staff=Db::name('staff')->where('id',$date['staff_id'])->find();
$openids=Db::name('user_auth')->where('user_id', $staff['user_id'])->find(); //获取用户的ID
$timesd=date('Y-m-d',$date['autotime']);
$timedd=date('Y-m-d',time());
$openid = $openids['openid'];
if($post['privilege']==""){
$time= date('Y-m-d', strtotime($post['end_time']));
if($post['type']==1){
$sw="上午";
}else{
$sw="下午";
}
$data = [
'touser'=>$openid,
'url'=>'',
'template_id'=>'ZTmrioGnhIsZMeK7UElzRyTw-_743VslGvEP5TWopzc', //模板id
'data'=>[
'character_string1'=>[
'value'=>$custom['order_sn']
],
'time3'=>[
'value'=>$time
],
'thing5'=>[
'value'=>$custom['address']
],
'thing2'=>[
'value'=>$sw
]
]
];
$config = WeChatServer::getOaConfig();
$app = Factory::officialAccount($config);
$r = $app->template_message->send($data);
}
else{
//微信的自己通知
$data = [
'touser'=>$openid,
'url'=>'',
'template_id'=>'k1dPNVhKOBTgSWe7Ha4BjZ96yUF11uSfOn0IwBkRx4c', //模板id
'data'=>[
'thing11'=>[
'value'=>$custom['consignee'].$timesw
],
'phone_number9'=>[
'value'=>$custom['mobile']
],
'thing19'=>[
'value'=>$custom['address']
],
'time18'=>[
'value'=>$timesd
],
'time14'=>[
'value'=>$timedd
//'value'=> $time.$timesw
]
]
];
$config = WeChatServer::getOaConfig();
$app = Factory::officialAccount($config);
$r = $app->template_message->send($data);
//通知对方修改的的人
$user=Db::name('staff')->where('id',$post['privilege'])->find(); //修改的人员信息
$auth=Db::name('user_auth')->where('user_id', $user['user_id'])->find(); //获取用户的openid
$goods=Db::name('goods')->where('id', $custom['goods_id'])->find();
if($post['type']=1){
$ties= '.8:00-12:00';
}else{
$ties= '.14:00-16:00';
}
//$openid = $openids['openid'];
$data = [
'touser'=>$auth['openid'],
'url'=>'',
'template_id'=>'uTFzkTScwMfMJtqQNGTNbpRuItpJwliVtJtMoobfqBQ', //模板id
'data'=>[
'keyword1'=>[
'value'=>$custom['order_sn']
],
'keyword2'=>[
'value'=> $goods['name']
],
'keyword3'=>[
'value'=>$timesd. $ties
],
'keyword4'=>[
'value'=>$custom['mobile']
]
]
];
$config = WeChatServer::getOaConfig();
$app = Factory::officialAccount($config);
$r = $app->template_message->send($data);
}
}
$count=count(explode(',',$post['privilege']));
}
$list=OrderautoLogic::eittime($id,$post);
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'修改保洁师',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$this->_success('修改预约时间成功',$list);
}
$id= $this->request->get('id');
$this->assign('info',OrderautoLogic::orderexeinfo($id));
$this->assign('satff',LeaveLogic::user());
return $this->fetch();
}
/**
* 更换保洁师
* @return mixed
*/
public function staff(){
if($this->request->isAjax()){
$id= $this->request->get('id');
$post= $this->request->post();
$list=OrderautoLogic::staff($id,$post);
if($list==2){
$this->error('只能选择一个保洁师');
}else{
$this->_success('修改保洁师成功',$list);
}
}
$id= $this->request->get('id');
$order=Db::name('order_exe')->where('id',$id)->find();
$order_sn=Db::name('order')->where('order_sn',$order['order_sn'])->find();
$orders=Db::name('order_exe')->where('addtime', $order['addtime'])->where('autotime','>=',$order['autotime'])->where('autotime','<',$order['autotime']+(24 * 3600))->whereNotNull('staff_id')->field('staff_id')->group('staff_id')->select(); //查询有订单的保洁师傅
$oneDimensionalArray = array_column($orders, 'staff_id'); // 根据自己的表格字段名修改'字段名'部分
$lent=Db::name('leave')->where('addtime',$order['addtime'])->where('time','>=',$order['autotime'])->where('time','<',$order['autotime']+(24 * 3600))->whereNotNull('user_id')->field('user_id')->group('user_id')->select();
$lentuser = array_column($lent,'user_id');
$staff=Db::name('staff')
->whereNotIn('id',$oneDimensionalArray) // $array为要比较的数组
->whereNotIn('id',$lentuser) // $array为要比较的数组
->where('onwork',1)
->select();
foreach($staff as $item=>$k){
$staff[$item]['june']=number_format(UserLogic::haversine_distance($order_sn['lng'],$order_sn['lat'], $staff[$item]['lng'],$staff[$item]['lat'])/1000,1);
}
$this->assign('satff',$staff);
return $this->fetch();
}
/**
* 单次订单暂停服务
* @return mixed
*/
public function dels($id){
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'订单暂停服务',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$list=DB::name('order_exe')->where('id',$id)->update(['status'=>3,'staff_id'=>null,'staff_status'=>0]);
$this->_success('暂停订单成功');
}
/**
* 取消暂停服务
* @return mixed
*/
public function delsd($id){
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'订单取消暂停',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$list=DB::name('order_exe')->where('id',$id)->update(['status'=>0]);
$this->_success('取消暂停成功');
}
/**
* 主订单暂停服务
* @return mixed
*/
public function prent($id){
//增加订单的日志
$order=Db::name('order')->where('id',$id)->find();
$admin=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admin,
'order_sn'=>$order['order_sn'],
'show'=>'暂停主订单',
'cram_time'=>$time
];
$log=Db::name('log_order')->data($logdate)->insert();
$list=OrderautoLogic::prent($id);
$this->_success('暂停订单成功');
}
/**
* 取消订单的暂停服务
* @return mixed
*/
public function prentsd($id){
//增加订单的日志
$order=Db::name('order')->where('id',$id)->find();
$admin=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admin,
'order_sn'=>$order['order_sn'],
'show'=>'取消暂停订单',
'cram_time'=>$time
];
$log=Db::name('log_order')->data($logdate)->insert();
$list=OrderautoLogic::prentsd($id);
$this->_success('取消暂停成功');
}
/**
* 修改订单的备注
* @return mixed
*/
public function remarks(){
// 获取的
if ($this->request->isAjax() && $this->request->isGet()){
$get = $this->request->get();
$detail = OrderautoLogic::remarks($get, 'get');
$this->_success('获取成功', $detail);
}
// 提交的
if ($this->request->isAjax() && $this->request->isPost()) {
$post = $this->request->post();
$result = OrderautoLogic::remarks($post, 'post');
if ($result) {
$this->_success('保存成功');
}
$this->error('保存失败');
}
}
/**
* 删除子订单的排单
* @return mixed
*/
public function delss($id){
$del=Db::name('order_exe')->where('id',$id)->delete();
$this->_success('删除成功');
}
/**
* 修改订单已经完成状态
* @return mixed
*/
public function complete($id){
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'修改订单已完成',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$del=Db::name('order_exe')->where('id',$id)->update(['status'=>1, 'staff_status'=>3]);
$this->_success('订单已完成');
}
/**
*锁定订单
* @return mixed
*/
public function lock($id){
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'锁定订单状态',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$del=Db::name('order_exe')->where('id',$id)->update(['lock'=>1]);
$this->_success('订单锁定成功');
}
/**
*解锁订单
* @return mixed
*/
public function unlock($id){
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'取消订单锁定',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$del=Db::name('order_exe')->where('id',$id)->update(['lock'=>0]);
$this->_success('订单锁定成功');
}
public function log(){
if($this->request->isAjax()){
$get= $this->request->get();
$lists=OrderautoLogic::log($get);
$this->_success('获取数据成功',$lists);
}
$id= $this->request->get('id');
$this->assign('ids',$id);
return $this->fetch();
}
public function orderlog(){
if($this->request->isAjax()){
$get= $this->request->get();
$lists=OrderautoLogic::orderlog($get);
$this->_success('获取数据成功',$lists);
}
$id= $this->request->get('id');
$this->assign('ids',$id);
return $this->fetch();
}
/**
*订单进入异常
* @return mixed
*/
public function abnormal($id){
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'设置订单进入异常',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$del=Db::name('order_exe')->where('id',$id)->update(['abnormal'=>1]);
$this->_success('订单异常成功');
}
/**
*订单进入异常
* @return mixed
*/
public function notabnormal($id){
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'取消订单进入异常',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$del=Db::name('order_exe')->where('id',$id)->update(['abnormal'=>0]);
$this->_success('取消订单异常成功');
}
public function orderinfo(){
$get= $this->request->get();
$info=OrderautoLogic::orderinfo($get);
if($info){
$this->assign('info',$info);
return $this->fetch();
}
}
}

View File

@@ -0,0 +1,61 @@
<?php
namespace app\admin\controller;
use app\admin\logic\OrderchanelLogic;
use app\common\server\ConfigServer;
use think\Db;
class Orderchanel extends AdminBase {
/**
* order: 哆啦猫订单渠道
* Desc: 订单列表
*/
public function ordertypelist(){
$lists = json_encode(OrderchanelLogic::ordertypelist());
$this->assign('lists', $lists);
return $this->fetch();
}
/**
* order: 哆啦猫订单渠道
* Desc: 增加渠道
*/
public function ordertypeadd(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = OrderchanelLogic::ordertypeadd($post);
$this->_success('增加渠道成功');
}
$this->assign('menu_lists', OrderchanelLogic::Menu());
return $this->fetch();
}
/**
* order: 哆啦猫订单渠道
* Desc: 修改渠道名称
*/
public function ordertypeedit($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = OrderchanelLogic::ordertypeedit($post);
$this->_success('修改订单渠道成功');
}
$this->assign('info', OrderchanelLogic::info($id));
$this->assign('menu_lists', OrderchanelLogic::Menu($id));
return $this->fetch();
}
/**
* order: 哆啦猫订单渠道
* Desc: 删除渠道
*/
public function ordertypedel($id){
$del=Db::name('orderchannel')->where('pid',$id)->find();
if($del){
$this->_error('请先删除下级分类');
}else{
$del=Db::name('orderchannel')->where('id',$id)->delete();
$this->_success('删除成功');
}
}
}
?>

View File

@@ -0,0 +1,176 @@
<?php
namespace app\admin\controller;
use app\admin\logic\OrderserLogic;
use app\common\model\Order as CommonOrder;
use app\common\model\Pay;
use app\admin\logic\StaffLogic;
use app\common\server\ConfigServer;
use think\Db;
class Ordersel extends AdminBase {
/**
* order: 哆啦猫订单渠道
* Desc: 服务订单管理
*/
public function Orderselists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists=OrderserLogic::lists($get);
$this->_success('',$lists);
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', OrderserLogic::stafftype(true));
return $this->fetch();
}
/**
* order: 哆啦猫订单渠道
* Desc: 服务订单的详情
*/
public function Orderinfo(){
$get = $this->request->get();
$this->assign('info',OrderserLogic::info($get));
return $this->fetch();
}
public function getList(){
$post = $this->request->get('');
$lists = OrderserLogic::getList($post);
$this->_success('',$lists);
}
public function edit(){
$get = $this->request->get();
$this->assign('info',OrderserLogic::info($get));
return $this->fetch();
}
public function orderstaffadd(){
$get= $this->request->get('id');
$this->assign('info',OrderserLogic::orderinfo($get));
$this->assign('order_id',$get);
return $this->fetch();
}
public function staffadd(){
$post= $this->request->post();
$staff=Db::name('order_cleaner')->where('cleaner_id',$post['id'])->where('order_id',$post['order_id'])->find();
if($staff){
$this->_error('已经派单,不能重复派单');
}else{
$data=[
'cleaner_id'=>$post['id'],
'order_id'=>$post['order_id'],
'status'=>0,
'createtime'=>time(),
'send_message'=>0,
];
$datas = Db::name('order_cleaner')->insertGetId($data);
$this->_success('增加保洁成功');
}
}
//删除订单绑定的保洁师
public function staffdel(){
$post = $this->request->post();
$lists = OrderserLogic::staffdel($post);
if($lists){
$this->_success('取消保洁成功');
}else{
$this->_error('无法取消,订单服务之中或已完成');
}
}
//保洁列表 不包含请假和离职员工
public function stafflist(){
$get = $this->request->get();
$lists = OrderserLogic::stafflist($get);
$this->_success('',$lists);
}
//恢复保洁数据
public function date(){
$id = $this->request->post('order_id');
$order=Db::name('order_service')->where('id',$id)->find();
$user=Db::name('user_address')->where('telephone',$order['phone'])->find();
if($order['goods_amount']==419){
$goods_id=18;
}
if($order['goods_amount']==199){
$goods_id=17;
}
if($order['goods_amount']==259){
$goods_id=16;
}
if($order['goods_amount']==239){
$goods_id=21;
}
if($order['goods_amount']==269){
$goods_id=19;
}
if($order['goods_amount']==299){
$goods_id=27;
}
if($order['goods_amount']==159){
$goods_id=26;
}
if($order['goods_amount']==89){
$goods_id=25;
}
if($order['goods_amount']==149){
$goods_id=24;
}
if($order['goods_amount']==799){
$goods_id=61;
}
if($order['status']==-1){
return 20;
}
$order_sn=createSn('order', 'order_sn', '', 4);
$data=[
'order_sn'=> $order_sn,
'goods_id'=>$goods_id,
'user_id'=>$order['user_id'],
'code'=>0,
'order_status'=>1,
'pay_status'=>1,
'pay_way'=>3,
'pay_time'=>$order['paytime'],
'consignee'=>$user['contact'],
'province'=>$user['province_id'],
'city'=>$user['city_id'],
'district'=>$user['district_id'],
'lat'=>$user['lat'],
'lng'=>$user['lng'],
'mobile'=>$user['telephone'],
'address'=>$user['address'],
'goods_price'=>$order['goods_amount'],
'order_amount'=>$order['goods_amount'],
'total_amount'=>$order['goods_amount'],
'total_num'=>1,
'type'=>0,
'number'=>1,
'create_time'=>$order['createtime'],
'update_time'=>$order['updatetime'],
];
$inser=Db::name('order')->data($data)->insert();
if($inser){
$order=Db::name('order_service')->where('id',$id)->update(['static'=>1]);
$this->_success('添加成功');
}
}
}
?>

View File

@@ -0,0 +1,82 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\AdminLogic;
use app\admin\logic\OrderstaffLogic;
use app\admin\logic\StatcubLogic;
use app\admin\logic\StaffLogic;
use app\admin\logic\GoodsBrandLogic;
class Orderstaff extends AdminBase
{
/**
* 保洁产能
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', AdminLogic::lists($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$this->assign('type',GoodsBrandLogic::getGoodsBrandLists());
return $this->fetch();
}
/**
* 获取产能订单
* @param $admin_id
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function orederlist(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取数据成功', OrderstaffLogic::orderlist($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
$this->assign('num', StatcubLogic::Numorder());
return $this->fetch();
}
/**
* 查看全部的子订单
* @param $admin_id
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function allorder(){
if ($this->request->isAjax()) {
// $get = $this->request->get();
// $this->_success('', OrderstaffLogic::orderlist($get));
}
return $this->fetch();
}
public function stafflist(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', OrderstaffLogic::stafflist($get));
}
return $this->fetch();
}
}

View File

@@ -0,0 +1,113 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\PayConfigLogic;
use app\common\server\ConfigServer;
use think\db;
class PayConfig extends AdminBase
{
/**
* Notes: 支付列表
* @author 段誉(2021/3/10 11:46)
* @return mixed
*/
public function lists()
{
if ($this->request->isAjax()) {
$this->_success('', PayConfigLogic::lists());
}
return $this->fetch();
}
/**
* Notes: 余额支付
* @author 段誉(2021/3/8 10:57)
* @return mixed
*/
public function editBalance()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if (empty($post['icon']) && $post['status'] == 1) {
$this->_error('请选择支付图标');
}
PayConfigLogic::editBalance($post);
$this->_success('修改成功');
}
$this->assign('info', PayConfigLogic::info('balance'));
return $this->fetch();
}
/**
* Notes: 编辑微信
* @author 段誉(2021/3/8 11:16)
* @return mixed
*/
public function editWechat()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if ($post['status'] == 1) {
if (empty($post['icon'])) {
$this->_error('请选择支付图标');
}
if ($post['apiclient_cert'] == '' || $post['apiclient_key'] == '') {
$this->_error('apiclient_cert或apiclient_key不能为空');
}
}
PayConfigLogic::editWechat($post);
$this->_success('修改成功');
}
$domain_name = ConfigServer::get('website', 'domain_name', '');
$domain_name = $domain_name ? $domain_name : request()->domain();
$this->assign('domain', $domain_name);
$this->assign('info', PayConfigLogic::info('wechat'));
return $this->fetch();
}
/**
* Notes: 支付宝
* @author 段誉(2021/3/10 11:47)
* @return mixed
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function editAlipay()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if (empty($post['icon']) && $post['status'] == 1) {
$this->_error('请选择支付图标');
}
PayConfigLogic::editAlipay($post);
$this->_success('修改成功');
}
$this->assign('info', PayConfigLogic::info('alipay'));
return $this->fetch();
}
}

View File

@@ -0,0 +1,124 @@
<?php
namespace app\admin\controller;
use think\facade\Url;
use app\admin\logic\PointsLogic;
class Points extends AdminBase
{
/**
* 积分商品的列表
* @return mixed
*/
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', PointsLogic::lists($get));
}
return $this->fetch();
}
/**
* 增加积分商城商品
* @return mixed
*/
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$data=PointsLogic::add($post);
if($data){
$this->_success('增加商品成功');
}else{
$this->_error('增加失败');
}
}
$this->assign('brand_lists', json_encode(PointsLogic::typelist(), JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
/**
* 编辑积分商城商品
* @return mixed
*/
public function edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$data=PointsLogic::edit($post);
$this->_success('修改成功');
}
$id = $this->request->get('id');
$this->assign('info', json_encode(PointsLogic::info($id), JSON_UNESCAPED_UNICODE));
$this->assign('brand_lists', json_encode(PointsLogic::typelist(), JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
/**
* 删除积分商品
* @return mixed
*/
public function del(){
$id = $this->request->post('id');
$del=PointsLogic::del($id);
$this->_success('删除成功');
}
/**
* 积分商品的分类
* @return mixed
*/
public function type(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', PointsLogic::type($get));
}
return $this->fetch();
}
/**
* 增加积分商品的分类
* @return mixed
*/
public function typeadd(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['create_time']=time();
$data=PointsLogic::typeadd($post);
if($data){
$this->_success('增加分类成功');
}else{
$this->_error('增加失败');
}
}
return $this->fetch();
}
/**
* 修改商品的分类
* @return mixed
*/
public function typeedit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$data=PointsLogic::typeedit($post);
if($data){
$this->_success('增加分类成功');
}else{
$this->_error('增加失败');
}
}
$id = $this->request->get('id');
$this->assign('detail',PointsLogic::typeinfo($id));
return $this->fetch();
}
/**
* 修改分类名称
* @return mixed
*/
public function typedel(){
$id = $this->request->post('id');
$del=PointsLogic::typedel($id);
$this->_success('删除成功');
}
}

View File

@@ -0,0 +1,143 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\PrinterLogic;
class Printer extends AdminBase{
/**
* Notes:打印机列表
* @return mixed
*/
public function lists(){
if($this->request->isAjax()){
$get = $this->request->get();
$list = PrinterLogic::lists($get);
$this->_success('',$list);
}
return $this->fetch();
}
/**
* Notes:添加打印机
* @return mixed
*/
public function add(){
if($this->request->isAjax()){
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post,'app\admin\validate\Printer.add');
if(true === $result){
$result = PrinterLogic::add($post);
if(true === $result){
$this->_success('添加成功');
}
}
$this->_error($result);
}
$this->assign('type_list',PrinterLogic::getTypeList());
return $this->fetch();
}
/**
* Notes:编辑打印机
* @param $id 打印机id
* @return mixed
*/
public function edit($id){
if($this->request->isAjax()){
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post,'app\admin\validate\Printer');
if(true === $result){
$result = PrinterLogic::edit($post);
if(true === $result){
$this->_success('添加成功');
}
}
$this->_error($result);
}
$this->assign('type_list',PrinterLogic::getTypeList());
$this->assign('detail',PrinterLogic::getPrinter($id));
return $this->fetch();
}
/**
* Notes:设置打印机配置
* @return mixed
*/
public function setConfig(){
$id = $this->request->get('id');
if($this->request->isAjax()){
$post = $this->request->post();
$result = $this->validate($post,'app\admin\validate\SetConfig');
if(true === $result){
PrinterLogic::setConfig($post);
$this->_success('设置成功');
}
$this->_error($result);
}
$this->assign('detail',PrinterLogic::getConfig($id));
return $this->fetch('config');
}
/**
* Notes:设置打印机配置
*/
public function setTemplate(){
$post = $this->request->post();
$result = PrinterLogic::setTemplate($post);
if(true === $result){
$this->_success('模板设置成功');
}
$this->_error($result);
}
/**
* Notes:测试打印
*/
public function testPrint(){
$post = $this->request->post();
$result = $this->validate($post,'app\admin\validate\Printer.config');
if(true === $result){
$result = PrinterLogic::testPrint($post);
if(true === $result){
$this->_success('打印成功');
}
}
$this->_error($result);
}
public function del(){
$id = $this->request->post('id');
$result = $this->validate(['id'=>$id],'app\admin\validate\Printer.del');
if(true === $result){
$result = PrinterLogic::del($id);
if($result === true){
$this->_success('删除成功');
}
$this->error($result);
}
$this->_error($result);
}
}

View File

@@ -0,0 +1,122 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\CommonLogic;
use app\admin\logic\RechargeLogic;
class Recharge extends AdminBase {
/**
* note 充值模板列表
* create_time 2020/10/23 16:21
*/
public function lists(){
$get = $this->request->get();
if($this->request->isAjax()){
if($get['type'] == 1){
$list = RechargeLogic::templatelists($get['type']);
}else{
$list = RechargeLogic::getRechargeConfig();
}
$this->_success('',$list);
}
return $this->fetch();
}
/**
* note 设置充值
* create_time 2020/10/24 11:34
*/
public function setRecharge(){
$post = $this->request->post();
if($this->request->isAjax()){
RechargeLogic::setRecharge($post);
$this->_success('设置成功');
}
}
/**
* note 添加充值模板
* create_time 2020/10/23 17:52
*/
public function add(){
if ($this->request->isAjax()){
$post = $this->request->post();
$result = $this->validate($post,'app\admin\validate\RechargeTemplate');
if ($result === true){
RechargeLogic::add($post);
$this->_success('添加成功!');
}
$this->_error($result);
}
return $this->fetch();
}
/**
* note 编辑充值模板
* create_time 2020/10/23 17:51
*/
public function edit($id){
if ($this->request->isAjax()){
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post,'app\admin\validate\RechargeTemplate');
if ($result === true){
RechargeLogic::edit($post);
$this->_success('修改成功');
}
$this->_error($result);
}
$info = RechargeLogic::getRechargeTemplate($id);
$this->assign('info',$info);
return $this->fetch();
}
/**
* note 删除充值模板
*/
public function del($id)
{
if ($this->request->isAjax()) {
$result = RechargeLogic::del($id);
if ($result) {
$this->_success('删除成功');
}
$this->_error('删除失败');
}
}
public function changeFields(){
$table = 'recharge_template';
$pk_name = 'id';
$pk_value = $this->request->get('id');
$field = $this->request->get('field');
$field_value = $this->request->get('value');
$result = CommonLogic::changeTableValue($table,$pk_name,$pk_value,$field,$field_value);
if($result){
$this->_success('修改成功');
}
$this->_error('修改失败');
}
}

View File

@@ -0,0 +1,59 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\RechargeLogLogic;
use think\helper\Time;
class RechargeLog extends AdminBase{
/**
* note 充值记录
* create_time 2020/11/18 10:05
*/
public function lists(){
if($this->request->isAjax()){
$get = $this->request->get();
$list = RechargeLogLogic::lists($get);
$this->_success('', $list);
}
$today = array_map(function ($time) {
return date('Y-m-d H:i:s', $time);
}, Time::today());
$this->assign('today', $today);
$yesterday = array_map(function ($time) {
return date('Y-m-d H:i:s', $time);
}, Time::yesterday());
$this->assign('yesterday', $yesterday);
$days_ago7 = array_map(function ($time) {
return date('Y-m-d H:i:s', $time);
}, Time::dayToNow(7));
$this->assign('days_ago7', $days_ago7);
$days_ago30 = array_map(function ($time) {
return date('Y-m-d H:i:s', $time);
}, Time::dayToNow(30, true));
$this->assign('days_ago30', $days_ago30);
return $this->fetch();
}
}

View File

@@ -0,0 +1,73 @@
<?php
namespace app\admin\controller;
use app\admin\logic\OpLogic;
use think\Db;
use app\admin\logic\UserLogic;
class Record extends Admin{
//获取线索记录列表
public function lists(){
if($this->request->isAjax()){
$post = $this->request->get();
$this->_success('获取数据成功',UserLogic::Record($post));
}
return $this->fetch();
}
//增加线索跟进人信息
public function add(){
if($this->request->isAjax()){
$post = $this->request->post();
$get = $this->request->get();
$item=Db::name('goods_stay_time')->where('id',$get['id'])->find();
$user=Db::name('user')->where('id',$item['uid'])->find();
if($user['mobile']==''){
$this->_error('访问信息不能为空');
}else{
$data=[
'show'=>$post['remark'],
'add_time'=>time(),
'phone'=>$user['mobile'],
'stour_id'=>$get['id'],
'admin_id'=>$this->admin_id
];
$add=Db::name('goods_add_time')->data($data)->insert();
if($add){
$this->_success('增加记录成功');
}else{
$this->_error('增加记录失败');
}
}
}
return $this->fetch();
}
//查看订单的线索
public function info(){
if($this->request->isAjax()){
$postdd = $this->request->get();
$this->_success('获取数据成功',UserLogic::goods_info($postdd));
}
$post = $this->request->get();
$item=Db::name('goods_stay_time')->where('id',$post['id'])->find();
$user=Db::name('user')->where('id',$item['uid'])->find();
$this->assign('phone',$user['mobile']);
return $this->fetch();
}
}

View File

@@ -0,0 +1,177 @@
<?php
namespace app\admin\controller;
use app\admin\logic\RecruitLogic;
use think\Db;
class Recruit extends Admin{
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = RecruitLogic::lists($get);
$this->_success('',$lists);
}
$department=Db::name('staff_group')->select(); //获取招聘部门的信息
$this->assign('department',$department);
return $this->fetch();
}
//招聘的岗位
public function type(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = RecruitLogic::type($get);
$this->_success('',$lists);
}
return $this->fetch();
}
//招聘
public function typeadd(){
if ($this->request->isAjax()) {
$get = $this->request->post();
$lists = RecruitLogic::typeadd($get);
$this->_success('增加招聘成功');
}
return $this->fetch();
}
public function typedit($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = RecruitLogic::typeedit($post);
$this->_success('修改类别成功');
}
$recruitype=Db::name('recruitype')->where('id',$id)->find();
$this->assign('recruitype',$recruitype);
return $this->fetch();
}
public function typedel(){
$id = $this->request->post('id');
$lists = RecruitLogic::typedel($id);
$this->_success('删除服务类别成功');
}
public function suspend(){
$id = $this->request->post('id');
$data=Db::name('recrui')->where('id',$id)->update(['status'=>1]);
$this->_success('暂停招聘成功');
}
public function cancellation(){
$id = $this->request->post('id');
$data=Db::name('recrui')->where('id',$id)->update(['status'=>0]);
$this->_success('启动招聘成功');
}
//招聘薪资体系
public function salary(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = RecruitLogic::salary($get);
$this->_success('',$lists);
}
return $this->fetch();
}
//增加薪资体系
public function salary_add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$data=[
'name'=>$post['name'],
'status'=>0,
'createtime'=>time()
];
$insert=Db::name('recrui_salary')->data($data)->insert();
if($insert){
$this->_success('添加薪资待遇成功');
}
}
return $this->fetch();
}
//编辑薪资范围
public function salary_edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$update=Db::name('recrui_salary')->where('id',$post['id'])->update(['name'=>$post['name'],'createtime'=>time()]);
$this->_success('更新成功');
}
$get = $this->request->get();
$info=DB::name('recrui_salary')->where('id',$get['id'])->find();
$this->assign('info',$info);
return $this->fetch();
}
//删除员工薪资范围
public function salary_del(){
$post = $this->request->post();
$del=Db::name('recrui_salary')->where('id',$post['id'])->delete();
$this->_success('删除成功');
}
//增加招聘岗位
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$list=RecruitLogic::add($post);
$this->_success('增加招聘成功');
}
$this->assign('tment',RecruitLogic::salary_list());
$this->assign('type_list',RecruitLogic::type_list());
$department=Db::name('staff_group')->select(); //获取招聘部门的信息
$this->assign('department',$department);
return $this->fetch();
}
//前段用户申请列表
public function filed(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$list=RecruitLogic::filed_lists($get);
$this->_success('获取数据成功',$list);
}
$this->assign('tment',RecruitLogic::salary_list());
$this->assign('type_list',RecruitLogic::type_list());
$department=Db::name('staff_group')->select(); //获取招聘部门的信息
$this->assign('department',$department);
return $this->fetch();
}
public function edits(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$list=RecruitLogic::edits($post);
$this->_success('修改招聘内容成功');
}
$get = $this->request->get('id');
$this->assign('tment',RecruitLogic::salary_list());
$this->assign('type_list',RecruitLogic::type_list());
$this->assign('info',RecruitLogic::recruiinfo($get));
$department=Db::name('staff_group')->select(); //获取招聘部门的信息
$this->assign('department',$department);
return $this->fetch();
}
//删除招聘的数据
public function dels(){
$id = $this->request->post('id');
$data=Db::name('recrui')->where('id',$id)->delete();
$this->_success('暂停招聘成功');
}
}

View File

@@ -0,0 +1,87 @@
<?php
namespace app\admin\controller;
use app\admin\logic\AdminLogic;
use app\admin\logic\RoleLogic;
use think\facade\Hook;
class Role extends AdminBase
{
public function lists()
{
if ($this->request->isAjax()) {
$this->_success('', RoleLogic::lists());
}
return $this->fetch();
}
/**
* 添加角色
* @return mixed
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\Role.add');
if ($result !== true) {
$this->_error($result);
}
$result = RoleLogic::addRole($post);
if ($result !== true) {
$this->_error($result);
}
$this->_success('添加成功');
}
$auth_tree = RoleLogic::authTree();
$this->assign('auth_tree', json_encode($auth_tree));
return $this->fetch();
}
/**
* 编辑角色
* @param string $role_id
* @return mixed
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function edit($role_id = '')
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\Role.edit');
if ($result !== true) {
$this->_error($result);
}
$result = RoleLogic::editRole($post);
if ($result !== true) {
$this->_error($result);
}
Hook::listen('menu_auth');
$this->_success('修改成功');
}
$auth_tree = RoleLogic::authTree($role_id);
$this->assign('info', RoleLogic::roleInfo($role_id));
$this->assign('auth_tree', json_encode($auth_tree));
return $this->fetch();
}
/**
* 删除角色
* @param $role_id
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function del($role_id)
{
if ($this->request->isAjax()) {
$result = $this->validate(['id' => $role_id], 'app\admin\validate\Role.del');
if ($result === true) {
RoleLogic::delRole($role_id);
Hook::listen('menu_auth');
$this->_success('删除成功');
}
$this->_error($result);
}
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace app\admin\controller;
use app\admin\logic\SalesLogic;
class Sales extends AdminBase
{
//订单售后反馈内容
public function lists()
{
return $this->fetch();
}
}

View File

@@ -0,0 +1,175 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\SeckillLogic;
class Seckill extends AdminBase{
public function lists(){
$seckill_time = SeckillLogic::getTimeAll();
$this->assign('seckill',$seckill_time);
return $this->fetch();
}
/**
* note 秒杀商品
* create_time 2020/11/13 16:01
*/
public function goodsLists(){
if($this->request->isAjax()){
$get = $this->request->get();
$list = SeckillLogic::goodsList($get);
$this->_success('',$list);
}
}
/**
* note 秒杀时间
* create_time 2020/11/13 16:01
*/
public function timeLists(){
if($this->request->isAjax()){
$get= $this->request->get();
$list = SeckillLogic::timeList($get);
$this->_success('',$list);
}
}
/**
* note 添加秒杀时间段
* create_time 2020/11/13 16:01
*/
public function addTime(){
if($this->request->isAjax()){
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\SeckillTime');
if($result === true){
SeckillLogic::addTime($post);
$this->_success('新增成功','');
}
$this->_error($result,'');
}
return $this->fetch();
}
/**
* note 编辑秒杀时间段
* create_time 2020/11/13 16:02
*/
public function editTime($id){
if($this->request->isAjax()){
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\SeckillTime');
if($result === true){
SeckillLogic::editTime($post);
$this->_success('编辑成功','');
}
$this->_error($result,'');
}
$this->assign('detail',SeckillLogic::getTime($id));
return $this->fetch();
}
/**
* note 删除秒杀时间段
* create_time 2020/11/13 16:02
*/
public function delTime(){
if($this->request->isAjax()){
$id = $this->request->post('id');
$result = SeckillLogic::delTime($id);
if($result == true){
$this->_success('删除成功','');
}
return $this->_error('删除失败','');
}
}
/**
* note 添加秒杀商品
* create_time 2020/11/13 16:02
*/
public function addGoods(){
if($this->request->isAjax()){
$post = $this->request->post();
$post['item'] = form_to_linear($post);
$result = $this->validate($post,'app\admin\validate\SeckillGoods.add');
if($result === true){
$result = SeckillLogic::addGoods($post);
if($result){
$this->_success('新增成功','');
}
$result = '新增失败';
}
$this->_error($result);
}
$seckill_time = SeckillLogic::getTimeAll();
$this->assign('seckill',$seckill_time);
return $this->fetch();
}
/**
* note 编辑秒杀商品
* create_time 2020/11/13 16:02
*/
public function editGoods(){
if($this->request->isAjax()){
$post = $this->request->post();
$post['item'] = form_to_linear($post);
$result = $this->validate($post,'app\admin\validate\SeckillGoods.edit');
if($result === true){
$result = SeckillLogic::editGoods($post);
if($result){
$this->_success('编辑成功','');
}
$result = '编辑失败';
}
$this->_error($result);
}
$id = $this->request->get('id');
$seckill_id = $this->request->get('seckill_id');
$detail = SeckillLogic::getSeckillGoods($id,$seckill_id);
$seckill_time = SeckillLogic::getTimeAll();
$this->assign('seckill',$seckill_time);
$this->assign('detail',$detail);
return $this->fetch();
}
/**
* note 删除秒杀商品
* create_time 2020/11/13 16:05
*/
public function delGoods(){
if($this->request->isAjax()){
$id = $this->request->post('id');
$seckill_id = $this->request->post('seckill_id');
$result = SeckillLogic::delGoods($id,$seckill_id);
if($result == true){
$this->_success('删除成功','');
}
return $this->_error('删除失败','');
}
}
}

View File

@@ -0,0 +1,32 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\ServiceConfigLogic;
class ServiceConfig extends AdminBase{
public function config(){
if($this->request->isAjax()){
$post = $this->request->post();
ServiceConfigLogic::setConfig($post);
return $this->_success('设置成功',[]);
}
$this->assign('config',ServiceConfigLogic::getConfig());
return $this->fetch();
}
}

View File

@@ -0,0 +1,158 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\server\ConfigServer;
class ShopSetting extends AdminBase
{
/**
* 交易设置
*/
public function trading()
{
$config = [
'order_contact' => ConfigServer::get('order_message', 'order_contact' ),//订单管理联系人
'order_contact_mobile' => ConfigServer::get('order_message', 'order_contact_mobile'),//订单管理联系人手机
'order_cancel' => ConfigServer::get('trading', 'order_cancel', 30),//未付款订单多久时间后自动关闭
'customer_cancel_limit' => ConfigServer::get('trading', 'customer_cancel_limit', 0),//已支付订单多长时间内允许客户主动取消订单
'order_finish' => ConfigServer::get('trading', 'order_finish', 7),//已发货订单多久时间后自动收货完成订单
'refund_days' => ConfigServer::get('after_sale', 'refund_days', 7),//已完成订单多久时间内允许售后退款
'deduct_type' => ConfigServer::get('trading', 'deduct_type', 1),//订单库存扣减方式
'growth_ratio' => ConfigServer::get('trading', 'growth_ratio', 0),//成长值比例
'contact' => ConfigServer::get('shop', 'contact' ),//联系人
'mobile' => ConfigServer::get('shop', 'mobile'),//联系手机号
'province_id' => ConfigServer::get('shop', 'province_id'),//省份id
'city_id' => ConfigServer::get('shop', 'city_id'),//市id
'district_id' => ConfigServer::get('shop', 'district_id'),//区id
'address' => ConfigServer::get('shop', 'address'),//详细地址
'give_integral_scene' => ConfigServer::get('trading', 'give_integral_scene', 1), //赠送积分时机
'give_growth_scene' => ConfigServer::get('trading', 'give_growth_scene', 1) //赠送成长值时机
];
$this->assign('config', $config);
return $this->fetch();
}
public function setTrading()
{
$post = $this->request->post();
if ($post) {
ConfigServer::set('trading', 'order_cancel', $post['order_cancel']);
ConfigServer::set('trading', 'customer_cancel_limit', $post['customer_cancel_limit']);
ConfigServer::set('trading', 'order_finish', $post['order_finish']);
ConfigServer::set('after_sale', 'refund_days', $post['refund_days']);
ConfigServer::set('trading', 'deduct_type', $post['deduct_type']);//订单库存扣减方式
ConfigServer::set('trading', 'growth_ratio', $post['growth_ratio']);//成长值比例
ConfigServer::set('shop', 'contact', $post['contact']);//店铺联系人
ConfigServer::set('shop', 'mobile', $post['mobile']);//店铺联系手机号
ConfigServer::set('shop', 'province_id', $post['province_id']);//店铺省份id
ConfigServer::set('shop', 'city_id', $post['city_id']);//店铺市id
ConfigServer::set('shop', 'district_id', $post['district_id']);//店铺地区id
ConfigServer::set('shop', 'address', $post['address']);//店铺详细地址
ConfigServer::set('order_message', 'order_contact', $post['order_contact']);//订单管理联系人
ConfigServer::set('order_message', 'order_contact_mobile', $post['order_contact_mobile']);//订单管理联系人手机
ConfigServer::set('trading', 'give_integral_scene', $post['give_integral_scene']);//赠送积分时机
ConfigServer::set('trading', 'give_growth_scene', $post['give_growth_scene']);//赠送成长值时机
$this->_success('修改成功');
}
}
/**
* 售后退款
*/
public function policy()
{
$config = [
'service' => ConfigServer::get('policy', 'service'),
'privacy' => ConfigServer::get('policy', 'privacy'),
'after_sale' => ConfigServer::get('policy', 'after_sale'),
];
$this->assign('config', $config);
return $this->fetch();
}
public function setPolicy()
{
$post = $this->request->post();
if ($post) {
ConfigServer::set('policy', 'service', $post['service']);
ConfigServer::set('policy', 'privacy', $post['privacy']);
ConfigServer::set('policy', 'after_sale', $post['after_sale']);
$this->_success('修改成功');
}
}
/**
* 会员提现设置
*/
public function withdraw()
{
$config = [
'min_withdraw' => ConfigServer::get('withdraw', 'min_withdraw'),
'max_withdraw' => ConfigServer::get('withdraw', 'max_withdraw'),
'poundage' => ConfigServer::get('withdraw', 'poundage'),
'type' => ConfigServer::get('withdraw', 'type') ? ConfigServer::get('withdraw', 'type') : []
];
$this->assign('config', $config);
return $this->fetch();
}
public function setWithdraw()
{
$post = $this->request->post();
if(empty($post['type'])) {
return $this->_error('至少选择一种提现方式');
}
if ($post) {
ConfigServer::set('withdraw', 'min_withdraw', $post['min_withdraw']);//最低提现
ConfigServer::set('withdraw', 'max_withdraw', $post['max_withdraw']);//最高提现
ConfigServer::set('withdraw', 'poundage', $post['poundage']);//提现手续费
ConfigServer::set('withdraw', 'type', $post['type']);//提现方式
$this->_success('操作成功');
}
}
/**
* Notes: 注册设置
* @author 段誉(2021/2/25 15:14)
* @return mixed
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function setRegister()
{
if ($this->request->isAjax()){
$post = $this->request->post();
ConfigServer::set('register_setting', 'open', $post['open']);
$this->_success('操作成功');
}
$config = ConfigServer::get('register_setting', 'open', 0);
$this->assign('config', $config);
return $this->fetch('register');
}
}

View File

@@ -0,0 +1,151 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\SignDailyLogic;
/**
* 天天签到
* Class SignDaily
* @package app\admin\controller
*/
class SignDaily extends AdminBase
{
/**
* 连续签到奖励列表
* @return mixed
*/
public function lists()
{
if ($this->request->isAjax()){
$get = $this->request->get();
$list = SignDailyLogic::lists($get);
$this->_success('',$list);
}
$config = SignDailyLogic::getSignRule();
$this->assign('config',$config);
return $this->fetch();
}
/**
* 签到记录列表
*/
public function record()
{
if ($this->request->isAjax()){
$get = $this->request->get();
$this->_success('',SignDailyLogic::record($get));
}
return $this->fetch();
}
/**
* 添加连续签到奖励
* @return mixed
*/
public function add()
{
if ($this->request->isAjax()){
$post = $this->request->post();
$result =$this->validate($post,'app\admin\validate\SignDaily.add');
if ($result === true){
$post['integral_status'] = isset($post['integral_status']) && $post['integral_status'] =='on'?1:0;
$post['growth_status'] = isset($post['growth_status']) && $post['growth_status'] =='on'?1:0;
SignDailyLogic::add($post);
$this ->success('添加成功');
}
$this->_error($result);
}
return $this->fetch();
}
/**
* 编辑连续签到奖励
* @return mixed
*/
public function edit($id)
{
if ($this->request->isAjax()){
$post = $this->request->post();
$result = $this->validate($post,'app\admin\validate\SignDaily.edit');
if ($result === true){
$post['integral_status'] = isset($post['integral_status']) && $post['integral_status'] == 'on'?1:0;
$post['growth_status'] = isset($post['growth_status']) && $post['growth_status'] == 'on'?1:0;
SignDailyLogic::edit($post,$id);
$this->_success('修改成功');
}
$this->_error($result);
}
$info = SignDailyLogic::getSignDaily($id);
$this->assign('info',$info);
return $this->fetch();
}
/**
* 删除连续签到奖励
* @return mixed
*/
public function del($id)
{
if ($this->request->isAjax()){
SignDailyLogic::del($id);
$this->_success('删除成功');
}
return $this->fetch();
}
/**
* 签到规则说明设置
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function signRule()
{
if ($this->request->isAjax()){
$post = $this->request->post();
$result = $this->validate($post,'app\admin\validate\SignDaily.sign');
if ($result === true){
$post['integral_status'] = isset($post['integral_status']) && $post['integral_status'] =='on'?1:0;
$post['growth_status'] = isset($post['growth_status']) && $post['growth_status'] =='on'?1:0;
SignDailyLogic::setSignRule($post);
$this ->success('保存成功');
}
$this->_error($result);
}
}
}

View File

@@ -0,0 +1,31 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
class Sites extends AdminBase
{
public function index()
{
return '网站设置';
}
}

View File

@@ -0,0 +1,60 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\SmsLogic;
use app\common\model\SmsLog;
class Sms extends AdminBase{
public function lists(){
if($this->request->isAjax()){
$list = SmsLogic::configLists();
return $this->_success('',$list);
}
$status_list = SmsLog::getSendStatusDesc(true);
$this->assign('status_list',$status_list);
return $this->fetch();
}
public function logLists(){
if($this->request->isAjax()){
$get = $this->request->get();
$list = SmsLogic::logLists($get);
return $this->_success('',$list);
}
}
public function config(){
$id = $this->request->get('id');
if($this->request->isAjax()){
$post = $this->request->post();
SmsLogic::setConfig($post);
return $this->_success('设置成功');
}
$info = SmsLogic::getConfig($id);
$this->assign('info',$info);
return $this->fetch();
}
public function detail(){
$id = $this->request->get('id');
$info = SmsLogic::detail($id);
$this->assign('info',$info);
return $this->fetch();
}
}

View File

@@ -0,0 +1,690 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\StaffLogic;
use app\admin\logic\RoleLogic;
use app\admin\logic\UserLogic;
use app\common\server\UrlServer;
use app\common\server\ConfigServer;
use think\facade\Hook;
class Staff extends AdminBase
{
/**
* 员工的列表
* @param 杨左
* @param 哆啦猫家政
*/
public function lists(){ //显示列表
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = StaffLogic::lists($get);
$this->_success('',$lists);
}
$grouping=Db::name('staff_grouping')->select();
$this->assign('grouping',$grouping);
$this->assign('usertype',StaffLogic::staff_beed());
$this->assign('type',StaffLogic::type());
return $this->fetch();
}
/**
* 员工列表的分组
* @param 杨左
* @param 哆啦猫家政
*/
public function staff_bellist(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = StaffLogic::staff_bellistgoic($get);
$this->_success('',$lists);
}
return $this->fetch();
}
public function getList(){
$post = $this->request->get('');
// $list = StaffLogic::getList($post);
$this->_success('');
}
/**
* 编辑员工分组
* @param 杨左
* @param 哆啦猫家政
*/
public function staff_beedit($id){
if ($this->request->isAjax()) {
$get = $this->request->post();
$get['auth_ids'] = implode(',', $get['auth_ids']);
$lists = StaffLogic::staff_beedit($get);
$this->_success('编辑成功');
}
$this->assign('info', RoleLogic::staffroleInfo($id));
$auth_tree = RoleLogic::staffauthTree($id);
$this->assign('auth_tree', json_encode($auth_tree));
return $this->fetch();
}
/**
* 增加员工分组
* @param 杨左
* @param 哆啦猫家政
*/
public function staff_beeadd(){
if ($this->request->isAjax()) {
$get = $this->request->post();
$lists = StaffLogic::staff_beeadd($get);
$this->_success('增加员工分组成功');
}
return $this->fetch();
}
public function staff_beedel(){
$id = $this->request->post('id');
$lists = StaffLogic::staff_beedel($id);
$this->_success('删除员工分组成功');
}
/**
* 增加员工的类别
* @param 杨左
* @param 哆啦猫家政
*/
public function staff_typelist(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = StaffLogic::staff_typelist($get);
$this->_success('',$lists);
}
return $this->fetch();
}
/**
* 增加员工的类别
* @param 杨左
* @param 哆啦猫家政
*/
public function staff_typeadd(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = StaffLogic::staff_typeadd($post);
$this->_success('',$lists);
}
return $this->fetch();
}
/**
* 增加修改员工服务类别
* @param 杨左
* @param 哆啦猫家政
*/
public function staff_typeedit($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = StaffLogic::staff_typeedit($post);
$this->_success('修改类别成功');
}
$detail=Db::name('staff_type')->where('id',$id)->find();
$this->assign('detail',$detail);
return $this->fetch();
}
/**
* 删除员工服务类别
* @param 杨左
* @param 哆啦猫家政
*/
public function staff_typedel(){
$id = $this->request->post('id');
$lists = StaffLogic::staff_typedel($id);
$this->_success('删除服务类别成功');
}
/**
* 员工的档案
* @param 杨左
* @param 哆啦猫家政
*/
public function staffinfo($id){
if ($this->request->isAjax()) {
$post= $this->request->post();
$staff=Db::name('staff')->where('id',$post['id'])->find();
if($post['money_handle']==1){
$number=Db::name('staff')->where('id',$post['id'])->update(['number'=>$staff['number']+$post['money']]);
$data=[
'staff_id'=>$post['id'],
'number'=>+$post['money'],
'money_remark'=>$post['money_remark'],
'time'=>time(),
];
$instr=Db::name('staff_jf')->data($data)->insert();
$piont=[
'staff_id'=>$post['id'],
'type' =>1,
'bdjf' =>$post['money'],
'add_time'=>time(),
'type_name'=>$post['money_remark']
];
Db::name('staff_points')->data($piont)->insert();
$staffsd=Db::name('staff')->where('id',$post['id'])->find();
Db::name('staff')->where('id', $post['id'])->update([
'state' => $staffsd['number'] >= 14 ? 0 : 1
]);
$this->_success('增加积分成功');
}else if($post['money_handle']==0){
$number=Db::name('staff')->where('id',$post['id'])->update(['number'=>$staff['number']-$post['money']]);
$data=[
'staff_id'=>$post['id'],
'number'=>-$post['money'],
'money_remark'=>$post['money_remark'],
'time'=>time(),
];
$instr=Db::name('staff_jf')->data($data)->insert();
$piont=[
'staff_id'=>$post['id'],
'type' =>0,
'bdjf' =>$post['money'],
'add_time'=>time(),
'type_name'=>'后台操作'
];
Db::name('staff_points')->data($piont)->insert();
$staffsd=Db::name('staff')->where('id',$post['id'])->find();
Db::name('staff')->where('id', $post['id'])->update([
'state' => $staffsd['number'] < 14 ? 1 : 0
]);
$this->_success('减少积分成功');
}
return $post;
}
$detail=Db::name('staff')->where('id',$id)->find();
$this->assign('info',$detail);
return $this->fetch();
}
/**
* 增加员工列表
* @param 杨左
* @param 哆啦猫家政
*/
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = StaffLogic::add($post);
$this->_success('增加员工成功',$lists);
}
$this->assign('brand_lists', json_encode(StaffLogic::staff_beed(), JSON_UNESCAPED_UNICODE));
$this->assign('category_lists', json_encode(StaffLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
$this->assign('group_id',StaffLogic::staff_beed());
$this->assign('type',StaffLogic::type());
return $this->fetch();
}
/**
* 编辑员工列表
* @param 杨左
* @param 哆啦猫家政
*/
public function edit(){
if ($this->request->isAjax() && $this->request->isPost()) {
$post= $this->request->post(); //接受传递过来的员工数据
$lists =StaffLogic::edits($post);
$this->_success('修改员工数据成功',$lists);
}
$id = $this->request->get('id');
$infos=Db::name('staff')->where('id',$id)->find();
$this->assign('info', json_encode(StaffLogic::info($id),JSON_UNESCAPED_UNICODE));
$this->assign('brand_lists', json_encode(StaffLogic::staff_beed(), JSON_UNESCAPED_UNICODE));
$this->assign('category_lists', json_encode(StaffLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
$this->assign('group_id',json_encode(StaffLogic::staff_beed(),JSON_UNESCAPED_UNICODE)); //获取员工的部门
$this->assign('goods_id',json_encode(StaffLogic::goods_type(),JSON_UNESCAPED_UNICODE)); //获取员工的技能
$this->assign('grouping_id',json_encode(StaffLogic::grouping(),JSON_UNESCAPED_UNICODE)); //获取员工的分组
$this->assign('infos',$infos);
return $this->fetch();
}
/**
* 删除员工的数据
* @param 杨左
* @param 哆啦猫家政
*/
public function del($id){
$list=Db::name('staff')->where('id',$id)->delete();
$this->_success('删除成功');
}
/**
* 员工数据统计
* @param 杨左
* @param 哆啦猫家政
*/
public function info($id){
$detail=Db::name('staff')->where('id',$id)->find(); //获取员工的基本信息
$detail['image']=UrlServer::getFileUrl($detail['image']);
if($detail['sex']==1){
$detail['sex']='男';
}elseif($detail['sex']==2){
$detail['sex']='女';
}
$this->assign('detail',$detail);
return $this->fetch('',$detail);
}
//增加权限列表
public function add_staffauth(){
if ($this->request->isAjax()) {
$sn = $this->request->post('sn');
$remarks=$this->request->post('remarks');
$time=time();
$insert=Db::name('staff_auth')->data(['name'=>$sn,'remarks'=>$remarks,'time'=>$time])->insert();
$this->_success('增加成功');
}
return $this->fetch();
}
//编辑员工权限名称
public function updata_staffauth(){
$id = $this->request->get('id');
if ($this->request->isAjax()) {
$sn = $this->request->post('sn');
$remarks=$this->request->post('remarks');
$aupdate=Db::name('staff_auth')->where('id',$id)->data(['name'=>$sn,'remarks'=>$remarks])->update();
$this->_success('更新成功');
}
$name=Db::name('staff_auth')->where('id',$id)->find();
$this->assign('name',$name);
return $this->fetch();
}
//员工排班情况
public function stafflist(){
$txt = trim(input('txt'));
$where = [];
if($txt && !is_numeric($txt)){
$where = [
['name','like','%'.$txt.'%'],
// ['mobile','like','%'.$txt.'%']
];
}
if($txt && is_numeric($txt)){
$where = [
['mobile','=',$txt],
// ['mobile','like','%'.$txt.'%']
];
}
// var_dump($where);
$list=Db::name('staff')->where('onwork',1)->where($where)->select();
foreach($list as $item=>$k){
$list[$item]['marry']=Db::name('order_exe')->where('staff_id', $list[$item]['id'])->count();
}
$this->_success('获取成功',$list);
}
//服务人员排期
public function Scheduling(){
$id = $this->request->get('uid'); //获取到用户的ID
$staff=Db::name('order_exe')->where('staff_id',$id)->select();
$lendt=Db::name('leave')->where('user_id',$id)->select();
if($staff){
foreach($staff as $k=> $v){
$staff[$k]['date'] = date('Y-m-d',strtotime($v['date']));
$custom=Db::name('order')->where('order_sn', $staff[$k]['order_sn'])->find();
if( $custom){
$staff[$k]['custom']= $custom['consignee'];
$staff[$k]['mobile']= $custom['mobile'];
$staff[$k]['address']= $custom['address'];
}
}
}
if($lendt){
foreach($lendt as$k=> $v){
$lendt[$k]['time'] = date('Y-m-d',$v['time']);
}
}
$qj2 = Db::name('leavesd')->where('staff_id',$id)->where('status',1)->select();
if(!empty($qj2)){
foreach($qj2 as$k=> $v){
$qj2[$k]['time'] = date('Y-m-d',$v['time']);
}
}
// var_dump($lendt);die;
$list['pb'] = $staff;
$list['qj'] = $lendt;
$list['qj2'] = $qj2;
// $list= array_merge($staff, $lendt);
$list['now'] = date('Y-m',time());
$this->_success('获取成功',$list);
}
//是否再范围内
public function is_ptin_poly($aLon, $aLat, $pointList = array())
{
$iSum = 0;
$iCount = count($pointList);
if ($iCount < 3) {
return false;
}
foreach ($pointList as $key => $row) {
$pLon1 = $row[0];
$pLat1 = $row[1];
if ($key === $iCount - 1) {
$pLon2 = $pointList[0][0];
$pLat2 = $pointList[0][1];
} else {
$pLon2 = $pointList[$key + 1][0];
$pLat2 = $pointList[$key + 1][1];
}
if ((($aLat >= $pLat1) && ($aLat < $pLat2)) || (($aLat >= $pLat2) && ($aLat < $pLat1))) {
if (abs($pLat1 - $pLat2) > 0) {
$pLon = $pLon1 - (($pLon1 - $pLon2) * ($pLat1 - $aLat)) / ($pLat1 - $pLat2);
if ($pLon < $aLon) {
$iSum += 1;
}
}
}
}
if ($iSum % 2 != 0) {
return true;
} else {
return false;
}
}
/**
* 根据时间查询等待派单的人工
* @param 传递时间
* @param 查询请假和派单
*/
//判断用户接单
public function havestaff(){
$postadd = $this->request->post(); //获取到用户的ID
$addtime=$postadd['data']['addtime'];
$time=strtotime($postadd['data']['end_time']);
$timestamp=$time+(24*3600);
$order=Db::name('order')->where('order_sn',$postadd['data']['order'])->find();
$goods=Db::name('goods')->where('id',$order['goods_id'])->find();
$order=Db::name('order_exe')->where('addtime',$addtime)
->where('autotime','>=',$time)
->where('autotime','<',$timestamp)
->whereNotNull('staff_id','>',0)
->whereNotNull('staff_id')
->field('staff_id')
->group('staff_id')
->select(); //查询有订单的保洁师傅
$oneDimensionalArray = array_column($order, 'staff_id'); // 根据自己的表格字段名修改'字段名'部分
$lent=Db::name('leave')
->where('addtime',$addtime)
->where('time','>=',$time)
->where('time','<',$timestamp)
->whereNotNull('user_id')
->field('user_id')->group('user_id')->select();
$lentuser = array_column($lent, 'user_id');
$ads=$postadd['data']['addtime']-1;
$lent2 = Db::name('leavesd')
->where('status','=',1)
->where('time','>=',$time)
->where('time','<',$timestamp)
->whereNotNull('staff_id')
->where('addtime','=',$postadd['data']['addtime']-1)
//->having('addtime',$postadd['data']['addtime']-1)
->field('staff_id,addtime')->group('staff_id')->select();
$lentuser2 = array_column($lent2, 'staff_id');
$lent3=Db::name('leavesd')
->where('status','=',1)
->where('time','>=',$time)
->where('time','<',$timestamp)
->where('addtime','=',2)
->whereNotNull('staff_id')
->field('staff_id,addtime')->group('staff_id')->select();
$lentuser3 = array_column($lent3, 'staff_id');
$list=Db::name('staff')
->where('goods_id',$goods['brand_id'])
->whereNotIn('id',$oneDimensionalArray) // $array为要比较的数组
->whereNotIn('id',$lentuser) // $array为要比较的数组
->whereNotIn('id',$lentuser2) // $array为要比较的数组
->whereNotIn('id',$lentuser3) // $array为要比较的数组
->where('onwork',1)
->where('state', '=', 0) // 也可以这样写
->select();
// 函数:将数组转换为 LatLng 对象数组
function convertToLatLngArray($coordArray) {
$latLngArray = [];
for ($i = 0; $i < count($coordArray); $i += 2) {
$lat = floatval($coordArray[$i]);
$lng = floatval($coordArray[$i + 1]);
$latLngArray[] = [$lng,$lat];
}
return $latLngArray;
}
foreach($list as $item=>$k){
//获取用户的范围
if( !$list[$item]['lnglat']){
unset($list[$item]);
continue;
}
$points = convertToLatLngArray(explode(',',$list[$item]['lnglat']));
if(!$this->is_ptin_poly($postadd['data']['lat'],$postadd['data']['lng'],$points)){
unset($list[$item]);
continue;
}
$june = number_format(UserLogic::haversine_distance($postadd['data']['lng'],$postadd['data']['lat'], $list[$item]['lng'],$list[$item]['lat'])/1000,1);
if($k['distance'] < $june){
unset($list[$item]);
}else{
$list[$item]['june']=number_format(UserLogic::haversine_distance($postadd['data']['lat'],$postadd['data']['lng'], $list[$item]['lng'],$list[$item]['lat'])/1000,1);
$order_exe=Db::name('order_exe')
->where('staff_id',$list[$item]['id'])
->where('autotime','>=',$time)
->where('autotime','<',$timestamp)
->find();
if($order_exe){
$order=Db::name('order')->where('order_sn',$order_exe['order_sn'])->find();
$list[$item]['order_adder']= $order['address'] ;
}else{
$list[$item]['order_adder']='无';
}
}
//根据员工iD查询地址
}
return $list;
}
//员工分组
public function group_list(){
if ($this->request->isAjax()) {
$post = $this->request->get(); //获取到传递过来的参数
$lists =StaffLogic::group_list($post);
$this->_success('获取数据成功',$lists);
}
return $this->fetch();
}
//增加员工的分组
public function group_add(){
if ($this->request->isAjax()) {
$post = $this->request->post(); //获取到传递过来的参数
$staff=Db::name('staff')->where('id',$post['admin_id'])->find();
$group=Db::name('staff')->where('id',$post['group_id'])->find();
$data=[
'name'=>$post['name'],
'admin_id'=>$post['admin_id'],
'staff_name'=>$staff['name'],
'staff_phone'=>$staff['mobile'],
'group_id'=>$post['group_id'],
'group_name'=>$group['name'],
'group_phone'=>$group['mobile'],
'create_time'=>time(),
];
$insert=Db::name('staff_grouping')->data($data)->insert();
if($insert){
$this->_success('增加数据成功');
}
}
$staff=Db::name('staff')->where('onwork',1)->select();
$this->assign('staff',$staff);
return $this->fetch();
}
//编辑员工分组
public function group_edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$staff=Db::name('staff')->where('id',$post['admin_id'])->find();
$group=Db::name('staff')->where('id',$post['group_id'])->find();
$data=[
'name'=>$post['name'],
'admin_id'=>$post['admin_id'],
'staff_name'=>$staff['name'],
'staff_phone'=>$staff['mobile'],
'group_id'=>$post['group_id'],
'group_name'=>$group['name'],
'group_phone'=>$group['mobile'],
'create_time'=>time(),
];
$insert=Db::name('staff_grouping')->where('id',$post['id'])->data($data)->update();
$this->_success('增加数据成功');
}
$get = $this->request->get();
$info=DB::name('staff_grouping')->where('id',$get['id'])->find();
$this->assign('info',$info);
$group=Db::name('staff')->where('onwork',1)->select();
$this->assign('group',$group);
$staff=Db::name('staff')->where('onwork',1)->select();
$this->assign('staff',$staff);
return $this->fetch();
}
//获取员工分组下面的员工
public function group_info(){
$id = $this->request->get('id');
$this->assign('id',$id);
return $this->fetch();
}
public function infolist(){
$get= $this->request->get();
$infolist =StaffLogic::infolist($get);
$this->_success('获取数据成功',$infolist);
}
//删除员工的分组
public function group_del(){
$post = $this->request->post();
$del=Db::name('staff_grouping')->where('id',$post['id'])->delete();
$this->_success('删除数据成功');
}
//员工端口公告
public function staff_notice(){
if ($this->request->isAjax()) {
$get = $this->request->get(); //获取到传递过来的参数
$lists =StaffLogic::staff_notice($get);
$this->_success('获取数据成功',$lists);
}
return $this->fetch();
}
//增加员端口公告
public function staff_noticeadd(){
if ($this->request->isAjax()) {
$post = $this->request->post(); //获取到传递过来的参数
$noticeadd =StaffLogic::staff_noticeadd($post);
$this->_success('增加公告成功');
}
return $this->fetch();
}
//修改员工端口的公告
public function staff_noticedit(){
if ($this->request->isAjax()) {
$get = $this->request->post(); //获取到传递过来的参数
$lists =StaffLogic::staff_noticedit($get);
$this->_success('修改数据成功');
}
$get = $this->request->get();
$noticeinfo=DB::name('staff_notice')->where('id',$get['id'])->find();
$this->assign('noticeinfo',$noticeinfo);
return $this->fetch();
}
//删除员工端口公告
public function staff_noticedel(){
$post = $this->request->post();
$del=Db::name('staff_notice')->where('id',$post['id'])->delete();
$this->_success('删除数据成功');
}
//员工的工资
public function wages(){
if ($this->request->isAjax()) {
$get = $this->request->get(); //获取到传递过来的参数
$lists=StaffLogic::wages($get);
$this->_success('获取数据成功',$lists);
}
$this->assign('staff',StaffLogic::serverstaff());
$this->assign('goods_brand',StaffLogic::goods_brand());
return $this->fetch();
}
//删除员工的工资
public function wagesdel(){
$post = $this->request->post('id'); //获取到传递过来的参数
$this->_success('删除工资成功',StaffLogic::wagesdel($post));
}
//修改定位功能
public function adder(){
if ($this->request->isAjax()) {
$post = $this->request->post(); //获取到传递过来的参数
$list=StaffLogic::adder($post);
$this->_success('修改定位成功');
}
return $this->fetch();
}
//员工积分记录
public function points(){
if ($this->request->isAjax()) {
$get = $this->request->get(); //获取到传递过来的参数
$list=StaffLogic::points($get);
$this->_success('获取数据成功',$list);
}
return $this->fetch();
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\OrderstaffLogic;
use app\admin\logic\UserLogic;
use app\common\server\ConfigServer;
class Stafforder extends AdminBase
{
//展示保洁产能查询
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = OrderstaffLogic::lists($get);
$this->_success('获取数据成功',$lists);
}
return $this->fetch();
}
}

View File

@@ -0,0 +1,60 @@
<?php
namespace app\admin\controller;
use app\admin\logic\StatisticsLogic;
class Statistics extends AdminBase
{
/**
* 会员统计
*/
public function member()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$this->_success('', StatisticsLogic::member($post));
}
$this->assign('res', StatisticsLogic::member(['days' => 'today']));
return $this->fetch();
}
/**
* 商品统计
*/
public function goods()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$this->_success('', StatisticsLogic::goods($post));
}
$this->assign('res', StatisticsLogic::goods(['days' => 'today']));
return $this->fetch();
}
/**
* 访问
*/
public function visit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$this->_success('', StatisticsLogic::visit($post));
}
$this->assign('res', StatisticsLogic::visit(['days' => 'today']));
return $this->fetch();
}
/**
* 交易
*/
public function deal()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$this->_success('', StatisticsLogic::deal($post));
}
$this->assign('res', StatisticsLogic::deal(['days' => 'today']));
return $this->fetch();
}
}

View File

@@ -0,0 +1,171 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\server\ConfigServer;
class StorageConfig extends AdminBase
{
/**
* Notes: 存储引擎列表
* @author 张无忌(2021/2/22 11:43)
* @return mixed
*/
public function lists()
{
if ($this->request->isAjax()) {
$default = ConfigServer::get('storage', 'default', '');
$data = [
[
'name' => '本地存储',
'path' => '存储在本地服务器',
'engine' => 'local',
'status' => $default == 'local' ? 1 : 0
],
[
'name' => '七牛云存储',
'path' => '存储在七牛云,请前往七牛云开通存储服务',
'engine' => 'qiniu',
'status' => $default == 'qiniu' ? 1 : 0
],
[
'name' => '阿里云OSS',
'path' => '存储在阿里云,请前往阿里云开通存储服务',
'engine' => 'aliyun',
'status' => $default == 'aliyun' ? 1 : 0
],
[
'name' => '腾讯云OSS',
'path' => '存储在腾讯云,请前往腾讯云开通存储服务',
'engine' => 'qcloud',
'status' => $default == 'qcloud' ? 1 : 0
]
];
$this->_success('获取成功', $data);
}
return $this->fetch();
}
/**
* Notes: 编辑存储引擎
* @author 张无忌(2021/2/22 11:43)
* @return mixed
*/
public function edit()
{
if ($this->request->isAjax()) {
$engine= $this->request->post('engine');
$post = $this->request->post();
if ($engine === 'qiniu') {
try {
ConfigServer::set('storage_engine', 'qiniu', [
'bucket' => $post['qiniu_bucket'],
'access_key' => $post['qiniu_ak'],
'secret_key' => $post['qiniu_sk'],
'domain' => $post['qiniu_domain']
]);
} catch (\Exception $e) {
$this->_error('设置失败:'.$e->getMessage());
}
$this->_success('设置成功');
} elseif ($engine === 'aliyun') {
try {
ConfigServer::set('storage_engine', 'aliyun', [
'bucket' => $post['aliyun_bucket'],
'access_key_id' => $post['aliyun_ak'],
'access_key_secret' => $post['aliyun_sk'],
'domain' => $post['aliyun_domain']
]);
} catch (\Exception $e) {
$this->_error('设置失败:'.$e->getMessage());
}
$this->_success('设置成功');
} elseif ($engine === 'qcloud') {
try {
ConfigServer::set('storage_engine', 'qcloud', [
'bucket' => $post['qcloud_bucket'],
'region' => $post['qcloud_region'],
'secret_id' => $post['qcloud_ak'],
'secret_key' => $post['qcloud_sk'],
'domain' => $post['qcloud_domain']
]);
} catch (\Exception $e) {
$this->_error('设置失败:'.$e->getMessage());
}
$this->_success('设置成功');
}
$this->_error('您设置的存储引擎不存在!');
}
$engine = $this->request->get('engine');
$storage = [
'qiniu' => ConfigServer::get('storage_engine', 'qiniu', [
'bucket' => '',
'access_key' => '',
'secret_key' => '',
'domain' => 'http://'
]),
'aliyun' => ConfigServer::get('storage_engine', 'aliyun', [
'bucket' => '',
'access_key_id' => '',
'access_key_secret' => '',
'domain' => 'http://'
]),
'qcloud' => ConfigServer::get('storage_engine', 'qcloud', [
'bucket' => '',
'region' => '',
'secret_id' => '',
'secret_key' => '',
'domain' => 'http://'
])
];
$this->assign('engine', $engine);
$this->assign('storage', $storage);
return $this->fetch();
}
/**
* Notes: 切换存储引擎
* @author 张无忌(2021/2/22 11:43)
*/
public function changeEngine()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
try {
ConfigServer::set('storage', 'default', $post['engine']);
} catch (\Exception $e) {
$this->_error('切换失败: ' . $e->getMessage());
}
$this->_success('切换成功');
}
}
}

View File

@@ -0,0 +1,280 @@
<?php
namespace app\admin\controller;
use app\admin\logic\SuborderLogic;
use app\common\model\Order as CommonOrder;
use app\admin\logic\StaffLogic;
use app\common\model\Pay;
use app\common\model\Client_;
use think\Db;
class Suborder extends AdminBase
{
/**
* Notes: 全部子订单
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SuborderLogic::lists($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
/**
* Notes: 保洁订单列表
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function cleaning(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SuborderLogic::cleaning($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
/**
* Notes: 收纳整理
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function storage(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SuborderLogic::storage($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
/**
* Notes: 深度清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function depth(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SuborderLogic::depth($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
/**
* Notes: 宠物保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function pet(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SuborderLogic::pet($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
/**
* Notes: 做饭到家
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function cooking(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SuborderLogic::cooking($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
/**
* Notes: 粗开荒保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function thick(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SuborderLogic::thick($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
/**
* Notes: 细开荒保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function fine(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SuborderLogic::fine($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
/**
* Notes: 搬家货运
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function move(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SuborderLogic::move($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
/**
* Notes: 搬家货运
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function detection(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SuborderLogic::detection($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
/**
* Notes: 空气治理
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function governance(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SuborderLogic::governance($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
/**
* Notes: 家电清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function wash(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SuborderLogic::wash($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
/**
* Notes: 家电清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function linen(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SuborderLogic::linen($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
/**
* Notes: 宠物保洁订单
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function pets(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SuborderLogic::pets($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
}

View File

@@ -0,0 +1,303 @@
<?php
namespace app\admin\controller;
use app\admin\logic\SudorderLogic;
use app\admin\logic\SonstatisLogic;
use app\common\model\Order as CommonOrder;
use app\admin\logic\StaffLogic;
use app\common\model\Pay;
use app\common\model\Client_;
use think\Db;
class Sudorder extends AdminBase
{
/**
* Notes: 全部子订单
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SudorderLogic::lists($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
return $this->fetch();
}
/**
* Notes: 保洁订单列表
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function cleaning(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SudorderLogic::cleaning($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
$this->assign('num',SonstatisLogic::cleaning());
return $this->fetch();
}
/**
* Notes: 收纳整理
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function storage(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SudorderLogic::storage($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
$this->assign('num',SonstatisLogic::storage());
return $this->fetch();
}
/**
* Notes: 深度清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function depth(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SudorderLogic::depth($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
$this->assign('num',SonstatisLogic::depth());
return $this->fetch();
}
/**
* Notes: 宠物保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function pet(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SudorderLogic::pet($get));
}
$this->assign('order_status', CommonOrder::getOrderStatus(true));
$this->assign('order_type', CommonOrder::getOrderType(true));
$this->assign('pay_way', Pay::getPayWay(true));
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
$this->assign('order_source', Client_::getClient(true));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 做饭到家
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function cooking(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SudorderLogic::cooking($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
$this->assign('num',SonstatisLogic::cooking());
return $this->fetch();
}
/**
* Notes: 粗开荒保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function thick(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SudorderLogic::thick($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
$this->assign('num',SonstatisLogic::thick());
return $this->fetch();
}
/**
* Notes: 细开荒保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function fine(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SudorderLogic::fine($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
$this->assign('num',SonstatisLogic::fine());
return $this->fetch();
}
/**
* Notes: 搬家货运
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function move(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SudorderLogic::move($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
$this->assign('num',SonstatisLogic::move());
return $this->fetch();
}
/**
* Notes: 空气检测
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function detection(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SudorderLogic::detection($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
$this->assign('num',SonstatisLogic::detection());
return $this->fetch();
}
/**
* Notes: 空气治理
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function governance(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SudorderLogic::governance($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
$this->assign('num',SonstatisLogic::governance());
return $this->fetch();
}
/**
* Notes: 家电清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function wash(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SudorderLogic::wash($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
$this->assign('num',SonstatisLogic::wash());
return $this->fetch();
}
/**
* Notes: 布草清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function linen(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SudorderLogic::linen($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
$this->assign('num',SonstatisLogic::linen());
return $this->fetch();
}
/**
* Notes: 宠物保洁订单
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function pets(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', SudorderLogic::pets($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
$this->assign('num',SonstatisLogic::pets());
return $this->fetch();
}
}

View File

@@ -0,0 +1,82 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\SupplierLogic;
class Supplier extends AdminBase{
/**
*列表
*/
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get(); //获取get请求
$this->_success('', SupplierLogic::lists($get)); //逻辑层处理渲染数据
}
return $this->fetch(); //渲染
}
/**
*添加
*/
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\Supplier'); //验证信息
if($result=== true){
SupplierLogic::add($post); //逻辑层处理添加数据
$this->_success('添加成功');
}
$this->_error($result);
}
return $this->fetch(); //渲染
}
/**
*编辑
*/
public function edit($id = ''){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$result = $this->validate($post, 'app\admin\validate\Supplier'); //验证信息
if($result=== true){
SupplierLogic::edit($post); //逻辑层处理添加数据
$this->_success('修改成功');
}
$this->_error($result);
}
$this->assign('info', SupplierLogic::info($id)); //逻辑层处理数据,返回已有信息
return $this->fetch(); //渲染
}
/**
*删除
*/
public function del($id)
{
if ($this->request->isAjax()) {
$result = SupplierLogic::del($id); //逻辑层处理删除信息
if ($result) {
$this->_success('删除成功');
}
$this->_error('删除失败');
}
}
}

View File

@@ -0,0 +1,151 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\TeamActivityLogic;
use app\common\model\Team;
use think\helper\Time;
/**
* 拼团商品管理 - 控制器
* Class TeamActivity
* @package app\admin\controller
*/
class TeamActivity extends AdminBase
{
/**
* Notes: 列表
* @author 张无忌(2021/1/12 15:51)
* @return mixed
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = TeamActivityLogic::lists($get);
$this->_success('获取成功', $lists);
}
return $this->fetch('team_activity/lists');
}
/**
* Notes: 添加
* @author 张无忌(2021/1/12 15:52)
* @return mixed
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$check = $this->validate($post, 'app\admin\validate\TeamActivity.add');
if ($check !== true) {
$this->_error($check);
}
if (TeamActivityLogic::add($post)) {
$this->_success('新增成功');
} else {
$error = TeamActivityLogic::getError() ?? '新增失败';
$this->_error($error);
}
}
return $this->fetch('team_activity/add');
}
/**
* Notes: 编辑
* @author 张无忌(2021/1/12 15:52)
* @return mixed
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$check = $this->validate($post, 'app\admin\validate\TeamActivity');
if ($check !== true) {
$this->_error($check);
}
if (TeamActivityLogic::edit($post)) {
$this->_success('更新成功');
} else {
$error = TeamActivityLogic::getError() ?? '更新失败';
$this->_error($error);
}
}
$id = $this->request->get('id');
$this->assign('detail', TeamActivityLogic::getDetail($id));
return $this->fetch('team_activity/edit');
}
/**
* Notes: 删除
* @author 张无忌(2021/1/12 15:52)
* @return mixed
*/
public function del()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id');
if (TeamActivityLogic::softDelete($id)) {
$this->_success('删除成功');
} else {
$error = TeamActivityLogic::getError() ?? '删除失败';
$this->_error($error);
}
}
}
/**
* Notes: 切换状态
* @author 张无忌(2021/1/13 18:01)
*/
public function switchStatus()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if (TeamActivityLogic::switchStatus($post)) {
$this->_success('更新成功');
} else {
$error = TeamActivityLogic::getError() ?? '更新失败';
$this->_error($error);
}
}
}
/**
* Notes: 参团订单
* @author 张无忌(2021/1/13 18:21)
*/
public function teamOrder()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = TeamActivityLogic::teamOrder($get);
$this->_success('获取成功', $lists);
}
$team_id = $this->request->get('id', 0, 'intval');
$this->assign('team_id', $team_id);
$this->assign('team_status', Team::getStatusDesc(true));
return $this->fetch('team_activity/team_order');
}
}

View File

@@ -0,0 +1,88 @@
<?php
namespace app\admin\controller;
use app\admin\logic\TeamFoundLogic;
use app\common\model\Team;
use think\helper\Time;
class TeamFound extends AdminBase
{
/**
* Notes: 列表
* @author 张无忌(2021/1/15 17:24)
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = TeamFoundLogic::lists($get);
$this->_success('获取成功', $lists);
}
$days_ago7 = array_map(function ($time) {
return date('Y-m-d H:i:s', $time);
}, Time::dayToNow(7));
$days_ago30 = array_map(function ($time) {
return date('Y-m-d H:i:s', $time);
}, Time::dayToNow(30, true));
$this->assign('days_ago7', $days_ago7);
$this->assign('days_ago30', $days_ago30);
$this->assign('team_status', Team::getStatusDesc(true));
return $this->fetch('team_found/lists');
}
/**
* Notes: 拼团详细
* @author 张无忌(2021/1/15 17:24)
*/
public function detail()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = TeamFoundLogic::teamOrderListById($get);
$this->_success('获取成功', $lists);
}
$found_id = $this->request->get('found_id', 0, 'intval');
$this->assign('found_id', $found_id);
$this->assign('detail', TeamFoundLogic::getDetail($found_id));
return $this->fetch('team_found/detail');
}
/**
* Notes: 退款列表
* @author 张无忌(2021/1/19 9:55)
* @return mixed
*/
public function refundDetail()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = TeamFoundLogic::getRefundDetail($get);
$this->_success('获取成功', $lists);
}
$found_id = $this->request->get('found_id', 0, 'intval');
$this->assign('found_id', $found_id);
return $this->fetch('team_found/refund');
}
/**
* Notes: 实现-原路退款
* @author 张无忌(2021/1/18 17:43)
*/
public function handlerRefund()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if (TeamFoundLogic::handleRefund($post, $this->admin_id)) {
$this->_success('退款成功');
}
$error = TeamFoundLogic::getError() ?: '退款失败';
$this->_error($error);
}
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace app\admin\controller;
use app\common\server\ConfigServer;
/**
* 拼团设置
* Class TeamSet
* @package app\admin\controller
*/
class TeamSet extends AdminBase
{
public function index()
{
$automatic = ConfigServer::get('team', 'automatic', 0);
$this->assign('automatic', $automatic);
return $this->fetch('team_set/index');
}
public function set()
{
if ($this->request->isAjax()) {
$automatic = $this->request->post('automatic', 0, 'intval');
ConfigServer::set('team', 'automatic', $automatic);
$this->_success('设置成功');
}
}
}

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