删除无用文件

This commit is contained in:
liuxiaoquan 2023-03-13 10:05:57 +08:00
parent 4b45813ca2
commit 3bd30462d7
4 changed files with 0 additions and 700 deletions

View File

@ -1,216 +0,0 @@
<?php
/**
* @copyright Copyright (c) 2021 勾股工作室
* @license https://opensource.org/licenses/Apache-2.0
* @link https://www.gougucms.com
*/
namespace app\admin\controller\product;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
use app\admin\model\Merchant; // 商户模型
use app\admin\model\StoreCategory; // 商品分类模型
use app\admin\model\StoreProductReply; // 商品评论模型
use app\admin\model\StoreBrandCategory; // 商品品牌分类模型
use app\admin\model\Guarantee as GuaranteeModel; // 商品保障服务模型
use app\admin\model\GeoCity; // 省市模型
use app\admin\model\GeoArea; // 区域模型
use app\admin\model\GeoStreet; // 街道模型
use app\admin\model\SupplyChain; // 供应链模型
use app\api\model\Area as AreaModel; // 市场区域模型
use app\api\model\AreaManager as AreaManagerModel; // 区域负责人模型
/**
*
* 平台商品参数控制器
*
*
*/
class Specs extends BaseController
{
public function __construct()
{
$this->adminInfo = get_login_admin();
$this->category_id=354;
$this->url=[
'/admin/product.priceDescription/index?category_id='.$this->category_id,
'/admin/product.priceDescription/add',
'/admin/product.priceDescription/edit',
'/admin/product.priceDescription/del',
'/admin/product.priceDescription/index',
];
}
/**
*
* 商品价格列表
*
*/
public function index()
{
if (request()->isAjax()) {
$params= get_params();
$where = [];
if (isset($params['keywords']) && !empty($params['keywords'])){
$where[]= ['name','like','%'.$params['keywords'].'%'];
}
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
$www['admin_id'] = $this->adminInfo['id'];
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
if ($user_address){
if($user_address['auth_range'] == 1){
$where[] = ['village_id','=',$user_address['village_id']];
}elseif ($user_address['auth_range'] == 2){
$where[] = ['street_id','=',$user_address['street_id']];
}elseif ($user_address['auth_range'] == 3){
$where[] = ['area_id','=',$user_address['area_id']];
}else{
$where[] = ['village_id','=',$user_address['village_id']];
}
}else{
$where[] = ['village_id','=',''];
}
}
$total = StoreBrandCategory::where($where)->count();
$list = StoreBrandCategory::order('sort desc')->select();
View::assign('url', $this->url);
View::assign('list', $list);
$result = ['total' => $total, 'data' => $list];
return table_assign(0, '', $result);
}else{
$list = StoreBrandCategory::select();
View::assign('url', $this->url);
View::assign('list', $list);
return view();
}
}
/**
*
* 新增
*
*/
public function add()
{
if (request()->isAjax()) {
$params = get_params();
$data['cate_name'] = $params['cate_name']; // 分类名称
$data['is_show'] = isset($params['is_show']) && $params['is_show'] == 'on'? 1:0; // 是否显示
$data['pid'] = $params['pid']; // 上级分类
$data['sort'] = $params['sort']; // 排序
$data['create_time'] = date('Y-m-d H:i:s');
// 数据入库
$res = StoreBrandCategory::create($data);
if ($res){
return to_assign(0,'操作成功',['aid'=>$res]);
}
return to_assign(1, '操作失败,原因:'.$res);
}else{
View::assign('editor', get_system_config('other','editor'));
View::assign('url', $this->url);
return view();
}
}
/**
*
* 编辑
*
*/
public function edit()
{
$id = get_params("id");
if(!$id) return to_assign(1, '非法操作!');
if (request()->isAjax()) {
$params = get_params();
$data['cate_name'] = $params['cate_name']; // 分类名称
$data['is_show'] = isset($params['is_show']) && $params['is_show'] == 'on'? 1:0; // 是否显示
$data['pid'] = $params['pid']; // 上级分类
$data['sort'] = $params['sort']; // 排序
$data['create_time'] = date('Y-m-d H:i:s');
// 数据更新
$res = StoreBrandCategory::where('store_brand_category_id', $params['id'])->update($data);
if ($res){
return to_assign(0,'更新成功',['aid'=>$res]);
}
return to_assign(1, '更新失败,原因:'.$res);
}else{
$storeBrandCtegory = StoreBrandCategory::find($id); // 取出当前品牌分类信息
View::assign('detail', $storeBrandCtegory);
View::assign('url', $this->url);
return view();
}
}
/**
*
* 删除
*
*/
public function del()
{
$id = get_params("id");
if(!$id) return to_assign(1, '非法操作!');
// 验证下面是否有子分类
if(StoreBrandCategory::where('pid', $id)->count())
{
return to_assign(1, '请先删除子分类!');
}
$res = StoreBrandCategory::where('store_brand_category_id', $id)->delete();
if ($res){
return to_assign(0,'操作成功',['aid'=>$res]);
}
return to_assign(1, '操作失败,原因:'.$res);
}
/**
*
* 子分类
*
*/
public function street($pcode)
{
$storeBrandCategory = StoreBrandCategory::order('sort desc')
->where('is_show', 1)
->where('pid', $pcode)
->select();
return json($storeBrandCategory);
}
}

View File

@ -1,167 +0,0 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray {
width: 110px;
}
.addrhelper-ok-btn {
display: none;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">添加</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">上级分类<font>*</font>
</td>
<td>
<select name="" lay-filter="storeBrandCategory" lay-search>
<option value="">选择分类</option>
{volist name='storeBrandCategory' id='vo'}
<option value="{$vo.store_brand_category_id}" >{$vo.cate_name}</option>
{/volist}
</select>
</td>
<td>
<div class="layui-col-md4">
<label class="layui-form-label">子分类</label>
<div class="layui-input-block">
<div id="demo1"></div>
</div>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">品牌名称<font>*</font></td>
<td colspan="4">
<input type="text" name="brand_name" lay-verify="required" lay-reqText="请输入品牌名称"
autocomplete="off" placeholder="请输入品牌名称" class="layui-input">
</td>
</tr>
<tr>
<td>
<div class="layui-form-item">
<label class="layui-form-label">是否显示</label>
<div class="layui-input-block">
<input type="checkbox" name="is_show" lay-skin="switch">
</div>
</div>
</td>
<td class="layui-td-gray">排序</td>
<td>
<input type="text" name="sort" value="0" placeholder="请输入数字,越小越靠前" autocomplete="off"
class="layui-input">
</td>
</tr>
</table>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script src="/static/assets/js/jquery.min.js"></script>
<script src="/static/assets/js/addrHelper.js"></script>
<script src="/static/assets/js/xm-select.js"></script>
<script>
const editorType = '{$editor}';
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, laydate = layui.laydate;
var editor = layui.tinymce;
var edit = editor.render({
selector: "#container_content",
height: 500
});
//上传缩略图
var upload_thumb = layui.upload.render({
elem: '#upload_btn_thumb',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
return layer.msg('上传失败');
}
//上传成功
$('#upload_box_thumb input').attr('value', res.data.filepath);
$('#upload_box_thumb img').attr('src', res.data.filepath);
}
});
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function () {
parent.location.reload();
}, 1000);
}
}
tool.post('/admin/product.band/add', data.field, callback);
return false;
});
form.on('select(storeBrandCategory)', function (data) {
street(data.value);
});
var group_access = "{:session('gougu_admin')['group_access']}";
function street (id) {
if(id == null || id == '')
{
return false;
}
var demo1 = xmSelect.render({
name: 'brand_category_id',
el: '#demo1',
prop: {
name: 'cate_name',
value: 'store_brand_category_id',
},
data: [],
radio: true,
initValue: [],
disabled: group_access == 2 || group_access==4 ? true : false,
});
$.get('/admin/product.brandClassify/street?pcode=' + id, function (result) {
demo1.update({
data: result
});
});
}
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -1,165 +0,0 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
.addrhelper-ok-btn{
display: none;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<input type="hidden" name="id" value="{$detail.brand_id}">
<h3 class="pb-3">编辑</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">上级分类<font>*</font>
</td>
<td>
<select name="" lay-filter="storeBrandCategory" lay-search>
<option value="">选择分类</option>
{volist name='storeBrandCategory' id='vo'}
{if $detail.storeBrandCategory.pid == $vo.store_brand_category_id}
<option value="{$vo.store_brand_category_id}" selected >{$vo.cate_name}</option>
{else /}
<option value="{$vo.store_brand_category_id}" >{$vo.cate_name}</option>
{/if}
{/volist}
</select>
</td>
<td>
<div class="layui-col-md4">
<label class="layui-form-label">子分类</label>
<div class="layui-input-block">
<div id="demo1"></div>
</div>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">品牌名称<font>*</font></td>
<td colspan="4">
<input type="text" name="brand_name" lay-verify="required" lay-reqText="请输入品牌名称"
autocomplete="off" value="{$detail.brand_name}" class="layui-input">
</td>
</tr>
<tr>
<td>
<div class="layui-form-item">
<label class="layui-form-label">是否显示</label>
<div class="layui-input-block">
<input type="checkbox" name="is_show" lay-skin="switch" {$detail.is_show?'checked':''}>
</div>
</div>
</td>
<td class="layui-td-gray">排序</td>
<td>
<input type="text" name="sort" value="{$detail.sort}" placeholder="请输入数字,越小越靠前" autocomplete="off"
class="layui-input">
</td>
</tr>
</table>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script src="/static/assets/js/jquery.min.js"></script>
<script src="/static/assets/js/addrHelper.js"></script>
<script src="/static/assets/js/xm-select.js"></script>
<script>
var moduleInit = ['tool','tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool;
//上传缩略图
var upload_thumb = layui.upload.render({
elem: '#upload_btn_thumb',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
return layer.msg('上传失败');
}
//上传成功
$('#upload_box_thumb input').attr('value', res.data.filepath);
$('#upload_box_thumb img').attr('src', res.data.filepath);
}
});
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
console.log(e);
layer.msg(e.msg);
if (e.code == 0) {
tool.tabRefresh(71);
tool.sideClose(1000);
}
}
tool.post('{$url[2]}', data.field, callback);
return false;
});
form.on('select(storeBrandCategory)', function (data) {
street(data.value);
});
street("{$detail.storeBrandCategory.pid}");
var group_access = "{:session('gougu_admin')['group_access']}";
function street (id) {
if(id == null || id == '')
{
return false;
}
var demo1 = xmSelect.render({
name: 'brand_category_id',
el: '#demo1',
prop: {
name: 'cate_name',
value: 'store_brand_category_id',
},
data: [],
radio: true,
initValue: ['{$detail.storeBrandCategory.store_brand_category_id}'],
disabled: group_access == 2 || group_access==4 ? true : false,
});
$.get('/admin/product.brandClassify/street?pcode=' + id, function (result) {
demo1.update({
data: result
});
});
}
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -1,152 +0,0 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<form class="layui-form gg-form-bar border-t border-x">
<div class="layui-input-inline" style="width:300px;">
<input type="text" name="keywords" placeholder="请输入供应链名称" class="layui-input" autocomplete="off" />
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">搜索</button>
</form>
<table class="layui-hide" id="article" lay-filter="article"></table>
</div>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="is_home">
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="thumb">
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加品牌">+ 添加品牌</span>
{/if}
</div>
</script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group">
<!-- {if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
{/if} -->
{if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
{/if}
{if {:auth_cache(session('gougu_admin')['id'],$url[3])}==true}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
{/if}
</div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#article',
title: '列表',
toolbar: '#toolbarDemo',
url: '{$url[0]}',
page: true,
limit: 20,
cols: [
[
{
fixed: 'left',
field: 'brand_id',
title: '编号',
align: 'center',
width:80,
},{
field: 'brand_name',
title: '品牌名称',
align: 'center',
},{
field: 'sort',
title: '排序',
align: 'center',
},{
field: 'status',
title: '是否显示',
align: 'center',
templet: function (d)
{
return d.is_show ? '显示' : '隐藏';
},
},{
field: 'create_time',
title: '创建时间',
align: 'center',
},{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(article)', function(obj){
if (obj.event === 'add') {
tool.side('{$url[1]}');
return false;
}
});
//监听表格行工具事件
table.on('tool(article)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('{$url[2]}?id='+obj.data.brand_id);
}
else if (obj.event === 'edit') {
tool.side('{$url[2]}?id='+obj.data.brand_id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete('{$url[3]}', { id: data.brand_id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords,
cate_id: data.field.cate_id
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->