You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
BIN
hyhproject/admin/controller/.DS_Store
vendored
Executable file
BIN
hyhproject/admin/controller/.DS_Store
vendored
Executable file
Binary file not shown.
BIN
hyhproject/admin/controller/._.DS_Store
Executable file
BIN
hyhproject/admin/controller/._.DS_Store
Executable file
Binary file not shown.
50
hyhproject/admin/controller/Accreds.php
Executable file
50
hyhproject/admin/controller/Accreds.php
Executable file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Accreds as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 商家认证控制器
|
||||
*/
|
||||
class Accreds extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/*
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById(Input("id/d",0));
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
|
||||
|
||||
}
|
181
hyhproject/admin/controller/Addons.php
Executable file
181
hyhproject/admin/controller/Addons.php
Executable file
@ -0,0 +1,181 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Addons as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 插件控制器
|
||||
*/
|
||||
class Addons extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById(Input("id/d",0));
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置插件页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$m = new M();
|
||||
$addon = $m->getById();
|
||||
if(!$addon) $this->error('插件未安装');
|
||||
$addon_class = get_addon_class($addon['name']);
|
||||
if(!class_exists($addon_class)){
|
||||
trace("插件{$addon['name']}无法实例化,",'ADDONS','ERR');
|
||||
}
|
||||
$data = new $addon_class;
|
||||
$addon['addons_path'] = $data->addons_path;
|
||||
$this->meta_title = '设置插件-'.$data->info['title'];
|
||||
$db_config = $addon['config'];
|
||||
$addon['config'] = include $data->config_file;
|
||||
|
||||
if($db_config){
|
||||
$db_config = json_decode($db_config, true);
|
||||
foreach ($addon['config'] as $key => $value) {
|
||||
if($value['type'] != 'group'){
|
||||
$addon['config'][$key]['value'] = isset($db_config[$key])?$db_config[$key]:"";
|
||||
}else{
|
||||
foreach ($value['options'] as $gourp => $options) {
|
||||
foreach ($options['options'] as $gkey => $value) {
|
||||
$addon['config'][$key]['options'][$gourp]['options'][$gkey]['value'] = $db_config[$gkey];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->assign('data',$addon);
|
||||
$this->assign('addonId',(int)input("id"));
|
||||
return $this->fetch("config");
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存插件设置
|
||||
*/
|
||||
public function saveConfig(){
|
||||
$m = new M();
|
||||
$m->saveConfig();
|
||||
|
||||
$addon = $m->getById();
|
||||
$addonName = $addon["name"];
|
||||
$class = get_addon_class($addonName);
|
||||
if(!class_exists($class)){
|
||||
return WSTReturn("插件不存在",-1);
|
||||
}
|
||||
$addons = new $class;
|
||||
$addons->saveConfig();
|
||||
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 卸载插件
|
||||
*/
|
||||
public function install(){
|
||||
$m = new M();
|
||||
$addon = $m->getById();
|
||||
$addonName = $addon["name"];
|
||||
$class = get_addon_class($addonName);
|
||||
if(!class_exists($class)){
|
||||
return WSTReturn("插件不存在",-1);
|
||||
}
|
||||
$addons = new $class;
|
||||
$flag = $addons->install();
|
||||
if(!$flag){
|
||||
return WSTReturn("安装失败",-1);
|
||||
}else{
|
||||
return $m->editStatus(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 卸载插件
|
||||
*/
|
||||
public function uninstall(){
|
||||
$m = new M();
|
||||
$addon = $m->getById();
|
||||
$addonName = $addon["name"];
|
||||
$class = get_addon_class($addonName);
|
||||
if(!class_exists($class)){
|
||||
return WSTReturn("插件不存在",-1);
|
||||
}
|
||||
$addons = new $class;
|
||||
$flag = $addons->uninstall();
|
||||
if(!$flag){
|
||||
return WSTReturn("卸载失败",-1);
|
||||
}else{
|
||||
return $m->del();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用插件
|
||||
*/
|
||||
public function enable(){
|
||||
$m = new M();
|
||||
$addon = $m->getById();
|
||||
$addonName = $addon["name"];
|
||||
$class = get_addon_class($addonName);
|
||||
if(!class_exists($class)){
|
||||
return WSTReturn("插件不存在",-1);
|
||||
}
|
||||
$addons = new $class;
|
||||
$flag = $addons->enable();
|
||||
if(!$flag){
|
||||
return WSTReturn("启用失败",-1);
|
||||
}else{
|
||||
return $m->editStatus(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁用插件
|
||||
*/
|
||||
public function disable(){
|
||||
|
||||
$m = new M();
|
||||
$addon = $m->getById();
|
||||
$addonName = $addon["name"];
|
||||
$class = get_addon_class($addonName);
|
||||
if(!class_exists($class)){
|
||||
return WSTReturn("插件不存在",-1);
|
||||
}
|
||||
$addons = new $class;
|
||||
$flag = $addons->disable();
|
||||
if(!$flag){
|
||||
return WSTReturn("禁用失败",-1);
|
||||
}else{
|
||||
return $m->editStatus(2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
68
hyhproject/admin/controller/Adgoods.php
Executable file
68
hyhproject/admin/controller/Adgoods.php
Executable file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Adgoods as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 广告控制器
|
||||
*/
|
||||
class Adgoods extends Base{
|
||||
|
||||
public function index(){
|
||||
$result=db('ads')->field('adName,adId')->order('adId desc')->select();
|
||||
return $this->fetch("list",['result'=>$result]);
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$m = new M();
|
||||
$data = $m->getById(Input("id/d",0));
|
||||
if($data) $data['adName']=db('ads')->where('adId',$data['adId'])->value('adName');
|
||||
$result=db('ads')->field('adName,adId')->order('adId desc')->select();
|
||||
return $this->fetch("edit",['data'=>$data,'result'=>$result]);
|
||||
}
|
||||
/*
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById(Input("id/d",0));
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
/**
|
||||
* 修改广告排序
|
||||
*/
|
||||
public function changeSort(){
|
||||
$m = new M();
|
||||
return $m->changeSort();
|
||||
}
|
||||
|
||||
|
||||
}
|
63
hyhproject/admin/controller/Adpositions.php
Executable file
63
hyhproject/admin/controller/Adpositions.php
Executable file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\AdPositions as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 广告位置控制器
|
||||
*/
|
||||
class Adpositions extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$m = new M();
|
||||
$assign = ['data'=>$m->getById(Input("get.id/d",0))];
|
||||
return $this->fetch("edit",$assign);
|
||||
}
|
||||
/*
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById(Input("id/d",0));
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
/**
|
||||
* 获取位置信息(用于广告)
|
||||
*/
|
||||
public function getPositon(){
|
||||
$m = new M();
|
||||
return $m->getPositon((int)input('post.positionType/d'));
|
||||
}
|
||||
}
|
65
hyhproject/admin/controller/Ads.php
Executable file
65
hyhproject/admin/controller/Ads.php
Executable file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Ads as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 广告控制器
|
||||
*/
|
||||
class Ads extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$m = new M();
|
||||
$data = $m->getById(Input("id/d",0));
|
||||
return $this->fetch("edit",['data'=>$data]);
|
||||
}
|
||||
/*
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById(Input("id/d",0));
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
/**
|
||||
* 修改广告排序
|
||||
*/
|
||||
public function changeSort(){
|
||||
$m = new M();
|
||||
return $m->changeSort();
|
||||
}
|
||||
|
||||
|
||||
}
|
92
hyhproject/admin/controller/Areas.php
Executable file
92
hyhproject/admin/controller/Areas.php
Executable file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Areas as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 地区控制器
|
||||
*/
|
||||
class Areas extends Base{
|
||||
|
||||
public function index(){
|
||||
$m = new M();
|
||||
$pArea=array('areaId'=>0,'parentId'=>0);
|
||||
$parentId = Input("get.parentId/d",0);
|
||||
if($parentId>0){
|
||||
$pArea = $m->getFieldsById($parentId,['areaName,areaId,parentId']);
|
||||
}
|
||||
$this->assign("pArea",$pArea);
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
$rs = $m->pageQuery();
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否显示/隐藏
|
||||
*/
|
||||
public function editiIsShow(){
|
||||
$m = new M();
|
||||
$rs = $m->editiIsShow();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取地区
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
$rs = $m->getById((int)Input("post.id"));
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 排序字母
|
||||
*/
|
||||
public function letterObtain(){
|
||||
$m = new M();
|
||||
$rs = $m->letterObtain();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
$rs = $m->add();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
$rs = $m->edit();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
$rs = $m->del();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
public function listQuery(){
|
||||
$m = new M();
|
||||
$list = $m->listQuery(Input("post.parentId/d",0));
|
||||
return WSTReturn("", 1,$list);
|
||||
}
|
||||
}
|
96
hyhproject/admin/controller/Articlecats.php
Executable file
96
hyhproject/admin/controller/Articlecats.php
Executable file
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\ArticleCats as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 文章分类控制器
|
||||
*/
|
||||
class ArticleCats extends Base{
|
||||
|
||||
public function index(){
|
||||
$m = new M();
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
$rs = $m->pageQuery();
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
public function listQuery(){
|
||||
$m = new M();
|
||||
$rs = $m->listQuery(input('parentId/d',0));
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 设置是否显示/隐藏
|
||||
*/
|
||||
public function editiIsShow(){
|
||||
$m = new M();
|
||||
$rs = $m->editiIsShow();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章分类
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
$rs = $m->getById((int)Input("post.id"));
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章分类列表
|
||||
*/
|
||||
public function listQuery2(){
|
||||
$m = new M();
|
||||
$rs = $m->listQuery2();
|
||||
if((int)input('id')==0 && (int)input('hasRoot')==1){
|
||||
$rs = ['id'=>0,'name'=>'全部','pId'=>0,'isParent'=>true,'children'=>$rs,'open'=>true];
|
||||
}
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
$rs = $m->add();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
$rs = $m->edit();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分类名称
|
||||
*/
|
||||
public function editName(){
|
||||
$m = new M();
|
||||
$rs = $m->editName();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
$rs = $m->del();
|
||||
return $rs;
|
||||
}
|
||||
}
|
94
hyhproject/admin/controller/Articles.php
Executable file
94
hyhproject/admin/controller/Articles.php
Executable file
@ -0,0 +1,94 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Articles as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 文章控制器
|
||||
*/
|
||||
class Articles extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
$rs = $m->pageQuery();
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
$rs = $m->get(Input("post.id/d",0));
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否显示/隐藏
|
||||
*/
|
||||
public function editiIsShow(){
|
||||
$m = new M();
|
||||
$rs = $m->editiIsShow();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳去新增/编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$id = Input("get.id/d",0);
|
||||
$m = new M();
|
||||
if($id>0){
|
||||
$object = $m->getById($id);
|
||||
}else{
|
||||
$object = $m->getEModel('articles');
|
||||
$object['catName'] = '';
|
||||
}
|
||||
$this->assign('object',$object);
|
||||
$this->assign('articlecatList',model('Article_Cats')->listQuery(0));
|
||||
return $this->fetch("edit");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
$rs = $m->add();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
$rs = $m->edit();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
$rs = $m->del();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
public function delByBatch(){
|
||||
$m = new M();
|
||||
$rs = $m->delByBatch();
|
||||
return $rs;
|
||||
}
|
||||
}
|
83
hyhproject/admin/controller/Attributes.php
Executable file
83
hyhproject/admin/controller/Attributes.php
Executable file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Attributes as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 属性控制器
|
||||
*/
|
||||
class Attributes extends Base{
|
||||
|
||||
public function index(){
|
||||
$this->assign('catId', input("catId/d"));
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
$rs = $m->pageQuery();
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function listQuery(){
|
||||
$m = new M();
|
||||
$rs = $m->listQuery();
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
//获取该记录信息
|
||||
$this->assign('data', $this->get());
|
||||
$m = new M();
|
||||
$this->assign('catId', input("catId/d",0));
|
||||
return $this->fetch("edit");
|
||||
}
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
$rs = $m->getById(input("attrId/d"));
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 显示隐藏
|
||||
*/
|
||||
public function setToggle(){
|
||||
$m = new M();
|
||||
$rs = $m->setToggle();
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
$rs = $m->add();
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
$rs = $m->edit();
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
$rs = $m->del();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
}
|
56
hyhproject/admin/controller/Banks.php
Executable file
56
hyhproject/admin/controller/Banks.php
Executable file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Banks as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 银行控制器
|
||||
*/
|
||||
class Banks extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
$rs = $m->pageQuery();
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
/*
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
$rs = $m->getById(Input("id/d",0));
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
$rs = $m->add();
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
|
||||
$m = new M();
|
||||
$rs = $m->edit();
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
$rs = $m->del();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
|
||||
}
|
33
hyhproject/admin/controller/Base.php
Executable file
33
hyhproject/admin/controller/Base.php
Executable file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 基础控制器
|
||||
*/
|
||||
use think\Controller;
|
||||
class Base extends Controller {
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->assign("v",WSTConf('CONF.wstVersion'));
|
||||
}
|
||||
protected function fetch($template = '', $vars = [], $replace = [], $config = [])
|
||||
{
|
||||
$replace['__ADMIN__'] = str_replace('/index.php','',\think\Request::instance()->root()).'/hyhproject/admin/view';
|
||||
return $this->view->fetch($template, $vars, $replace, $config);
|
||||
}
|
||||
|
||||
public function getVerify(){
|
||||
WSTVerify();
|
||||
}
|
||||
|
||||
public function uploadPic(){
|
||||
return WSTUploadPic(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑器上传文件
|
||||
*/
|
||||
public function editorUpload(){
|
||||
return WSTEditUpload(1);
|
||||
}
|
||||
}
|
86
hyhproject/admin/controller/Brands.php
Executable file
86
hyhproject/admin/controller/Brands.php
Executable file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Brands as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 品牌控制器
|
||||
*/
|
||||
class Brands extends Base{
|
||||
|
||||
public function index(){
|
||||
$g = model('GoodsCats');
|
||||
$this->assign('gcatList',$g->listQuery(0));
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
$rs = $m->pageQuery();
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取品牌
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
$rs = $m->get((int)Input("post.id"));
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳去新增/编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$id = Input("get.id/d",0);
|
||||
$m = new M();
|
||||
if($id>0){
|
||||
$object = $m->getById($id);
|
||||
}else{
|
||||
$object = $m->getEModel('brands');
|
||||
}
|
||||
$this->assign('object',$object);
|
||||
$this->assign('gcatList',model('GoodsCats')->listQuery(0));
|
||||
return $this->fetch("edit");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
$rs = $m->add();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
$rs = $m->edit();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
$rs = $m->del();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改品牌排序
|
||||
*/
|
||||
public function changeSort(){
|
||||
$m = new M();
|
||||
return $m->changeSort();
|
||||
}
|
||||
|
||||
}
|
30
hyhproject/admin/controller/Carts.php
Executable file
30
hyhproject/admin/controller/Carts.php
Executable file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Carts as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 基础控业务处理
|
||||
*/
|
||||
use think\Db;
|
||||
class Carts extends Base{
|
||||
//购物车列表
|
||||
public function cart(){
|
||||
$m = new M();
|
||||
return $this->fetch('carts');
|
||||
}
|
||||
//获取分页
|
||||
public function cartsByPage(){
|
||||
$m=new M();
|
||||
$result=$m->cartsByPage();
|
||||
$result['status'] = 1;
|
||||
return WSTGrid($result);
|
||||
}
|
||||
/**
|
||||
* 导出购物车数据
|
||||
*/
|
||||
public function toExport(){
|
||||
$m = new M();
|
||||
$rs = $m->toExport();
|
||||
$this->assign('rs',$rs);
|
||||
}
|
||||
}
|
198
hyhproject/admin/controller/Cashdraws.php
Executable file
198
hyhproject/admin/controller/Cashdraws.php
Executable file
@ -0,0 +1,198 @@
|
||||
<?php
|
||||
|
||||
namespace wstmart\admin\controller;
|
||||
|
||||
use wstmart\admin\model\CashDraws as M;
|
||||
|
||||
/**
|
||||
|
||||
* ============================================================================
|
||||
|
||||
* 提现控制器
|
||||
|
||||
*/
|
||||
|
||||
class Cashdraws extends Base{
|
||||
|
||||
|
||||
|
||||
public function index(){
|
||||
|
||||
return $this->fetch("list");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* 获取分页
|
||||
|
||||
*/
|
||||
|
||||
public function pageQuery(){
|
||||
|
||||
$m = new M();
|
||||
|
||||
return WSTGrid($m->pageQuery());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* 跳去编辑页面
|
||||
|
||||
*/
|
||||
|
||||
public function toHandle(){
|
||||
|
||||
//获取该记录信息
|
||||
|
||||
$m = new M();
|
||||
|
||||
$this->assign('object', $m->getById());
|
||||
|
||||
return $this->fetch("edit");
|
||||
|
||||
}
|
||||
/**
|
||||
* 查看报表
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function viewReport(){
|
||||
|
||||
$m = new M();
|
||||
$date = input('get.searchDate');
|
||||
if(!$date){
|
||||
$date = date('Y-m-d');
|
||||
}
|
||||
$orders = $m->viewReport($date);
|
||||
$this->assign("searchDate",$date);
|
||||
$this->assign('orders',$orders);
|
||||
return $this->fetch("view_report");
|
||||
}
|
||||
/**
|
||||
* 修改报表信息
|
||||
*/
|
||||
public function setReport(){
|
||||
$data['money'] =(int) session('reData.money');//充值/扣除数量
|
||||
$mobileCode =(int)input('mobileCode');//验证码
|
||||
if($data['money'] <= 0){
|
||||
exit(jsonReturn('请求超时请重试!'));
|
||||
}
|
||||
if(session('reData.reCode') != $mobileCode){
|
||||
exit(jsonReturn('验证码错误'));
|
||||
}
|
||||
$reDate = session('reData.reDate');//充值/扣除日期
|
||||
$reType =(int) session('reData.reType');//1充值2扣除
|
||||
if($reType == 1){
|
||||
$reTypeName = '充值';
|
||||
}else{
|
||||
$data['money']*=-1;
|
||||
$reTypeName = '扣除';
|
||||
}
|
||||
$data['adminId'] = session('WST_STAFF.staffId');
|
||||
$data['logContent'] = session('WST_STAFF.staffName').$reTypeName;
|
||||
$data['setTime'] = strtotime($reDate);
|
||||
$data['createTime'] = time();
|
||||
$m = Model('common/Table');
|
||||
$m->setTable('log_day_money');
|
||||
if(false !== $m->insertInfo($data)){
|
||||
session('reData',null);
|
||||
exit(jsonReturn('操作成功',1));
|
||||
}
|
||||
exit(jsonReturn('操作失败'));
|
||||
}
|
||||
/**
|
||||
* 获取操作验证码
|
||||
*/
|
||||
public function getMobileCode(){
|
||||
$mobile = getAdminPhone();
|
||||
//董事长您好:会计${name}需要修改财务报表,日期:${date},${reType}金额:${money}元,核验码${code},请告之。
|
||||
$data = input('post.');
|
||||
$model_logsms = model('common/LogSms');
|
||||
$phoneVerify = rand(1000,9999);
|
||||
$name = session('WST_STAFF.staffName');
|
||||
$date = $data['reDate'];
|
||||
if($data['reType'] == 1){
|
||||
$reTypeName = '充值';
|
||||
}else{
|
||||
$reTypeName = '扣除';
|
||||
}
|
||||
$money = $data['money'];
|
||||
$data['reCode'] = $phoneVerify;
|
||||
$tpl = WSTMsgTemplates('PHONE_ADMIN_SET_REPORT_NOTICE');
|
||||
$rv['status'] = -1;
|
||||
$rv['msg'] = '发送失败';
|
||||
if( $tpl['tplContent']!='' && $tpl['status']=='1'){
|
||||
$params = ['tpl'=>$tpl,'params'=>['name'=>$name,'date'=>$date,'reType'=>$reTypeName,'money'=>$money,'code'=>$phoneVerify]];
|
||||
$m = Model('common/LogSms');
|
||||
$rv = $m->sendSMS(0,$mobile,$params,'PHONE_ADMIN_SET_REPORT_NOTICE',$phoneVerify);
|
||||
}
|
||||
if(1 == $rv['status']){
|
||||
session('reData',$data);
|
||||
}
|
||||
exit(json_encode($rv));
|
||||
}
|
||||
/**
|
||||
|
||||
* 修改
|
||||
|
||||
*/
|
||||
|
||||
public function handle(){
|
||||
|
||||
$drawsStatus = (int)input('cashSatus',-1);
|
||||
|
||||
$m = new M();
|
||||
|
||||
if($drawsStatus==1){
|
||||
|
||||
return $m->handle();
|
||||
|
||||
}else{
|
||||
|
||||
return $m->handleFail();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* 查看提现内容
|
||||
|
||||
*/
|
||||
|
||||
public function toView(){
|
||||
|
||||
$m = new M();
|
||||
|
||||
$this->assign('object', $m->getById());
|
||||
|
||||
return $this->fetch("view");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
* 导出
|
||||
|
||||
*/
|
||||
|
||||
public function toExport(){
|
||||
|
||||
$m = new M();
|
||||
|
||||
$rs = $m->toExport();
|
||||
|
||||
$this->assign('rs',$rs);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
57
hyhproject/admin/controller/Chargeitems.php
Executable file
57
hyhproject/admin/controller/Chargeitems.php
Executable file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\ChargeItems as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 充值项控制器
|
||||
*/
|
||||
class Chargeitems extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$m = new M();
|
||||
$assign = ['data'=>$m->getById(Input("get.id/d",0))];
|
||||
return $this->fetch("edit",$assign);
|
||||
}
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById(Input("id/d",0));
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
|
||||
}
|
42
hyhproject/admin/controller/Cronjobs.php
Executable file
42
hyhproject/admin/controller/Cronjobs.php
Executable file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\CronJobs as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 定时任务控制器
|
||||
*/
|
||||
class Cronjobs extends Base{
|
||||
/**
|
||||
* 取消未付款订单
|
||||
*/
|
||||
public function autoCancelNoPay(){
|
||||
$m = new M();
|
||||
$rs = $m->autoCancelNoPay();
|
||||
return json($rs);
|
||||
}
|
||||
/**
|
||||
* 自动好评
|
||||
*/
|
||||
public function autoAppraise(){
|
||||
$m = new M();
|
||||
$rs = $m->autoAppraise();
|
||||
return json($rs);
|
||||
}
|
||||
/**
|
||||
* 自动确认收货
|
||||
*/
|
||||
public function autoReceive(){
|
||||
$m = new M();
|
||||
$rs = $m->autoReceive();
|
||||
return json($rs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送队列消息
|
||||
*/
|
||||
public function autoSendMsg(){
|
||||
$m = new M();
|
||||
$rs = $m->autoSendMsg();
|
||||
return json($rs);
|
||||
}
|
||||
}
|
44
hyhproject/admin/controller/Datacats.php
Executable file
44
hyhproject/admin/controller/Datacats.php
Executable file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\DataCats as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 系统数据分类控制器
|
||||
*/
|
||||
class Datacats extends Base{
|
||||
/**
|
||||
* 根据
|
||||
*/
|
||||
public function listQuery(){
|
||||
$m = new M();
|
||||
return $m->listQuery((int)Input("post.id",-1));
|
||||
}
|
||||
/**
|
||||
* 根据catId获取数据分类
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById((int)Input("post.id"));
|
||||
}
|
||||
/**
|
||||
* 新增数据分类
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 编辑数据分类
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除数据分类
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
}
|
55
hyhproject/admin/controller/Datas.php
Executable file
55
hyhproject/admin/controller/Datas.php
Executable file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Datas as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 系统数据控制器
|
||||
*/
|
||||
class Datas extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 根据catId获取子数据
|
||||
*/
|
||||
public function childQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->childQuery());
|
||||
}
|
||||
/**
|
||||
* 获取菜单列表
|
||||
*/
|
||||
public function listQuery(){
|
||||
$m = new M();
|
||||
return $m->dataQuery((int)Input("post.id",-1));
|
||||
}
|
||||
/**
|
||||
* 获取菜单
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById((int)Input("post.id"));
|
||||
}
|
||||
/**
|
||||
* 新增菜单
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 编辑菜单
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除菜单
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
}
|
37
hyhproject/admin/controller/Ectday.php
Executable file
37
hyhproject/admin/controller/Ectday.php
Executable file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\EctDay as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 提现控制器
|
||||
*/
|
||||
class Ectday extends Base{
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
public function toExport(){
|
||||
$m = new M();
|
||||
$rs = $m->toExport();
|
||||
$this->assign('rs',$rs);
|
||||
}
|
||||
//获取查看页面
|
||||
public function ectPage(){
|
||||
$m=new M();
|
||||
$result=$m->ectTarget();
|
||||
$this->assign('result',$result);
|
||||
return $this->fetch('ectpage');
|
||||
|
||||
}
|
||||
}
|
21
hyhproject/admin/controller/Ectdeal.php
Executable file
21
hyhproject/admin/controller/Ectdeal.php
Executable file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\EctDeal as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 提现控制器
|
||||
*/
|
||||
class Ectdeal extends Base{
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
$result=$m->pageQuery();
|
||||
return WSTGrid($result);
|
||||
}
|
||||
}
|
50
hyhproject/admin/controller/Ecttarget.php
Executable file
50
hyhproject/admin/controller/Ecttarget.php
Executable file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\EctTarget as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 提现控制器
|
||||
*/
|
||||
class Ecttarget extends Base{
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
public function toExport(){
|
||||
$m = new M();
|
||||
$rs = $m->toExport();
|
||||
$this->assign('rs',$rs);
|
||||
}
|
||||
//获取记录信息
|
||||
public function toHandle(){
|
||||
$m=new M();
|
||||
$result=$m->toHandle();
|
||||
$this->assign('object',$result);
|
||||
return $this->fetch('ecttarget');
|
||||
}
|
||||
//进行审核操作
|
||||
public function ectTarget(){
|
||||
$m=new M();
|
||||
$result=$m->ectTarget();
|
||||
exit(json_encode($result));
|
||||
}
|
||||
//获取查看页面
|
||||
public function ectPage(){
|
||||
$m=new M();
|
||||
$result=$m->ectTarget();
|
||||
$this->assign('result',$result);
|
||||
return $this->fetch('ectpage');
|
||||
|
||||
}
|
||||
}
|
56
hyhproject/admin/controller/Express.php
Executable file
56
hyhproject/admin/controller/Express.php
Executable file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Express as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 快递控制器
|
||||
*/
|
||||
class Express extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
$rs = $m->pageQuery();
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
/*
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
$rs = $m->getById(Input("id/d",0));
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
$rs = $m->add();
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
|
||||
$m = new M();
|
||||
$rs = $m->edit();
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
$rs = $m->del();
|
||||
return $rs;
|
||||
}
|
||||
|
||||
|
||||
}
|
59
hyhproject/admin/controller/Friendlinks.php
Executable file
59
hyhproject/admin/controller/Friendlinks.php
Executable file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Friendlinks as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 友情链接控制器
|
||||
*/
|
||||
class Friendlinks extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$m = new M();
|
||||
$rs = $m->getById((int)Input("post.id"));
|
||||
$this->assign("object",$rs);
|
||||
return $this->fetch("edit");
|
||||
}
|
||||
/*
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById(Input("id/d",0));
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
|
||||
|
||||
}
|
132
hyhproject/admin/controller/Goods.php
Executable file
132
hyhproject/admin/controller/Goods.php
Executable file
@ -0,0 +1,132 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Goods as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 商品控制器
|
||||
*/
|
||||
class Goods extends Base{
|
||||
/**
|
||||
* 查看上架商品列表
|
||||
*/
|
||||
public function index(){
|
||||
$this->assign("areaList",model('areas')->listQuery(0));
|
||||
return $this->fetch('list_sale');
|
||||
}
|
||||
/**
|
||||
* 批量删除商品
|
||||
*/
|
||||
public function batchDel(){
|
||||
$m = new M();
|
||||
return $m->batchDel();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置违规商品
|
||||
*/
|
||||
public function illegal(){
|
||||
$m = new M();
|
||||
return $m->illegal();
|
||||
}
|
||||
/**
|
||||
* 批量设置违规商品
|
||||
*/
|
||||
public function batchIllegal(){
|
||||
$m = new M();
|
||||
return $m->batchIllegal();
|
||||
}
|
||||
/**
|
||||
* 通过商品审核
|
||||
*/
|
||||
public function allow(){
|
||||
$m = new M();
|
||||
return $m->allow();
|
||||
}
|
||||
/**
|
||||
* 批量通过商品审核
|
||||
*/
|
||||
public function batchAllow(){
|
||||
$m = new M();
|
||||
return $m->batchAllow();
|
||||
}
|
||||
/**
|
||||
* 获取上架商品列表
|
||||
*/
|
||||
public function saleByPage(){
|
||||
$m = new M();
|
||||
$rs = $m->saleByPage();
|
||||
$rs['status'] = 1;
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
/**
|
||||
* 已下架的商品
|
||||
*/
|
||||
public function shelves(){
|
||||
$this->assign("areaList",model('areas')->listQuery(0));
|
||||
return $this->fetch('goods/list_shelves');
|
||||
}
|
||||
/**
|
||||
* 获取已下架的商品
|
||||
*/
|
||||
public function shelvesByPage(){
|
||||
$m = new M();
|
||||
$rs = $m->shelvesByPage();
|
||||
$rs['status'] = 1;
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
/**
|
||||
* 审核中的商品
|
||||
*/
|
||||
public function auditIndex(){
|
||||
$this->assign("areaList",model('areas')->listQuery(0));
|
||||
return $this->fetch('goods/list_audit');
|
||||
}
|
||||
/**
|
||||
* 获取审核中的商品
|
||||
*/
|
||||
public function auditByPage(){
|
||||
$m = new M();
|
||||
$rs = $m->auditByPage();
|
||||
$rs['status'] = 1;
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
/**
|
||||
* 审核中的商品
|
||||
*/
|
||||
public function illegalIndex(){
|
||||
$this->assign("areaList",model('areas')->listQuery(0));
|
||||
return $this->fetch('list_illegal');
|
||||
}
|
||||
/**
|
||||
* 获取违规商品列表
|
||||
*/
|
||||
public function illegalByPage(){
|
||||
$m = new M();
|
||||
$rs = $m->illegalByPage();
|
||||
$rs['status'] = 1;
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
/**
|
||||
* 导出购物车数据
|
||||
*/
|
||||
public function toExportSale(){
|
||||
$m = new M();
|
||||
$rs = $m->toExportSale();
|
||||
$this->assign('rs',$rs);
|
||||
}
|
||||
/**
|
||||
* 商品ECT支付状态
|
||||
*/
|
||||
public function goodsEct(){
|
||||
$m = new M();
|
||||
return $m->goodsEct();
|
||||
}
|
||||
}
|
49
hyhproject/admin/controller/Goodsappraises.php
Executable file
49
hyhproject/admin/controller/Goodsappraises.php
Executable file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\GoodsAppraises as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 商品评价控制器
|
||||
*/
|
||||
class Goodsappraises extends Base{
|
||||
|
||||
public function index(){
|
||||
//获取地区
|
||||
$area1 = model('areas')->listQuery(0);
|
||||
return $this->fetch("list",['area1'=>$area1,]);
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$m = new M();
|
||||
$data = $m->getById(input("get.id/d",0));
|
||||
if($data['images']!='')
|
||||
$data['images'] = explode(',',$data['images']);
|
||||
$assign = ['data'=>$data];
|
||||
return $this->fetch("edit",$assign);
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
|
||||
|
||||
}
|
97
hyhproject/admin/controller/Goodscats.php
Executable file
97
hyhproject/admin/controller/Goodscats.php
Executable file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\GoodsCats as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 商品分类控制器
|
||||
*/
|
||||
class GoodsCats extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return $m->pageQuery();
|
||||
}
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
public function listQuery(){
|
||||
$m = new M();
|
||||
$rs = $m->listQuery(input('parentId/d',0));
|
||||
return WSTReturn("", 1,$rs);
|
||||
}
|
||||
/**
|
||||
* 获取商品分类
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->get((int)Input("post.id"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否自营显示/隐藏
|
||||
*/
|
||||
public function editiIsSelfShow(){
|
||||
$m = new M();
|
||||
return $m->editiIsSelfShow();
|
||||
}
|
||||
/**
|
||||
* 设置是否推荐/不推荐
|
||||
*/
|
||||
public function editiIsFloor(){
|
||||
$m = new M();
|
||||
return $m->editiIsFloor();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否显示/隐藏
|
||||
*/
|
||||
public function editiIsShow(){
|
||||
$m = new M();
|
||||
return $m->editiIsShow();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 编辑分类名
|
||||
*/
|
||||
public function editName(){
|
||||
$m = new M();
|
||||
return $m->editName();
|
||||
}
|
||||
/**
|
||||
* 编辑分类排序
|
||||
*/
|
||||
public function editOrder(){
|
||||
$m = new M();
|
||||
return $m->editOrder();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
}
|
203
hyhproject/admin/controller/Goodsclassify.php
Executable file
203
hyhproject/admin/controller/Goodsclassify.php
Executable file
@ -0,0 +1,203 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\GoodsClassify as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 商品控制器
|
||||
*/
|
||||
class Goodsclassify extends Base{
|
||||
/*查看商品总分类*/
|
||||
public function index(){
|
||||
return $this->fetch('list');
|
||||
}
|
||||
/**获取商品总分类分页*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
$rs = $m->pageQuery();
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
/**获取总分类数据*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
$rs = $m->getById(input("goodsclassifyId/d"));
|
||||
return $rs;
|
||||
}
|
||||
//添加商品总分类
|
||||
public function add(){
|
||||
$m=new M();
|
||||
$rs=$m->add();
|
||||
return $rs;
|
||||
}
|
||||
//修改商品总分类
|
||||
public function edit(){
|
||||
$m=new M();
|
||||
$rs=$m->edit();
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 获取商品分类数据
|
||||
*/
|
||||
public function gets(){
|
||||
$m = new M();
|
||||
$rs = $m->getByIds(input("goodsclassifyId/d"));
|
||||
return $rs;
|
||||
}
|
||||
//获取商品分类详情
|
||||
public function catdetail(){
|
||||
$m=new M();
|
||||
$row= $m->catdetail();
|
||||
$id=input('goodsclassifyId');
|
||||
$this->assign("id",$id);
|
||||
return $this->fetch('catdetail');
|
||||
}
|
||||
//获取商品分类分页
|
||||
public function catdetailPage(){
|
||||
$m = new M();
|
||||
$rs = $m->catdetailPage();
|
||||
$rs['status'] = 1;
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
/**删除商品总分类下的商品分类*/
|
||||
public function catdel(){
|
||||
$m = new M();
|
||||
return $m->catdel();
|
||||
}
|
||||
//获取商品详情
|
||||
public function detail(){
|
||||
$m=new M();
|
||||
$row= $m->detail();
|
||||
$id=input('catId');
|
||||
$this->assign("id",$id);
|
||||
return $this->fetch('detail');
|
||||
}
|
||||
//获取商品详情页面
|
||||
public function detailByPage(){
|
||||
$m = new M();
|
||||
$rs = $m->detailByPage();
|
||||
$rs['status'] = 1;
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
/**删除商品总分类*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
/*添加商品分类*/
|
||||
public function add_cat(){
|
||||
$m = new M();
|
||||
return $m->add_cat();
|
||||
}
|
||||
//获取设置活动页页面
|
||||
public function setdetail(){
|
||||
$id=input('goodsclassifyId');
|
||||
$result=db('goods_classify')->where('goodsclassifyId',$id)->value('goodsclassifyName');
|
||||
$this->assign(["id"=>$id,'result'=>$result]);
|
||||
$classify=db('recom_classify')->where('classifyId',$id)->field('recomId,recomName')->select();
|
||||
$this->assign('classify',$classify);
|
||||
return $this->fetch('setdetail');
|
||||
}
|
||||
//获取商品详情页面
|
||||
public function setdetailPage(){
|
||||
$m = new M();
|
||||
$rs = $m->setdetailPage();
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
//更改活动商品的排序号
|
||||
public function changeSet(){
|
||||
$m = new M();
|
||||
$rs = $m->changeSet();
|
||||
return $rs;
|
||||
}
|
||||
//获取设置活动页页面
|
||||
public function recom(){
|
||||
$id=input('goodsclassifyId');
|
||||
$result=db('goods_classify')->where('goodsclassifyId',$id)->value('goodsclassifyName');
|
||||
$this->assign(["id"=>$id,'result'=>$result]);
|
||||
$classify=db('recom_classify')->where('classifyId',$id)->field('recomId,recomName')->select();
|
||||
$this->assign('classify',$classify);
|
||||
return $this->fetch('recom');
|
||||
}
|
||||
//更改活动商品的排序号
|
||||
public function changeRecom(){
|
||||
$m = new M();
|
||||
$rs = $m->changeRecom();
|
||||
return $rs;
|
||||
}
|
||||
//删除推荐商品
|
||||
public function recomActiveDel(){
|
||||
$m = new M();
|
||||
return $m->recomActiveDel();
|
||||
}
|
||||
/**获取总分类数据*/
|
||||
public function getrecomActive(){
|
||||
$m = new M();
|
||||
$rs = $m->getrecomActiveId(input("recomActiveId/d"));
|
||||
return $rs;
|
||||
}
|
||||
//添加商品总分类
|
||||
public function addrecomActive(){
|
||||
$m=new M();
|
||||
$rs=$m->addrecomActive();
|
||||
return $rs;
|
||||
}
|
||||
//获取商品详情页面
|
||||
public function recomPage(){
|
||||
$m = new M();
|
||||
$rs = $m->recomPage();
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
/*查看活动页的活动分类*/
|
||||
public function cats(){
|
||||
$this->assign('classifyId',input('classifyId'));
|
||||
$classify=db('goods_classify')->where('goodsclassifyId',input('classifyId'))->value('goodsclassifyName');
|
||||
$this->assign('classify',$classify);
|
||||
return $this->fetch('cats');
|
||||
}
|
||||
//查看活动页的活动详情
|
||||
public function catsPage(){
|
||||
$m = new M();
|
||||
$rs = $m->catsPage();
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
/**
|
||||
* 获取活动数据
|
||||
*/
|
||||
public function getCats(){
|
||||
$m = new M();
|
||||
$rs = $m->getCatsId(input("recomId/d"));
|
||||
return $rs;
|
||||
}
|
||||
/*添加分类活动分类*/
|
||||
public function addCats(){
|
||||
$m = new M();
|
||||
return $m->addCats();
|
||||
}
|
||||
/*更改分类活动分类*/
|
||||
public function editCats(){
|
||||
$m = new M();
|
||||
return $m->editCats();
|
||||
}
|
||||
//删除活动页活动分类
|
||||
public function catsDel(){
|
||||
$m = new M();
|
||||
return $m->catsDel();
|
||||
}
|
||||
/**
|
||||
* 获取活动商品详情
|
||||
*/
|
||||
public function getGoods(){
|
||||
$m = new M();
|
||||
$rs = $m->getGoodsId(input("id/d"));
|
||||
return $rs;
|
||||
}
|
||||
/*添加分类活动分类*/
|
||||
public function addGoods(){
|
||||
$m = new M();
|
||||
return $m->addGoods();
|
||||
}
|
||||
//删除活动商品
|
||||
public function goodsDel(){
|
||||
$m = new M();
|
||||
return $m->goodsDel();
|
||||
}
|
||||
}
|
44
hyhproject/admin/controller/Goodsconsult.php
Executable file
44
hyhproject/admin/controller/Goodsconsult.php
Executable file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\GoodsConsult as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 商品咨询控制器
|
||||
*/
|
||||
class GoodsConsult extends Base{
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$m = new M();
|
||||
$data = $m->getById(input("get.id/d",0));
|
||||
$assign = ['data'=>$data];
|
||||
return $this->fetch("edit",$assign);
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
|
||||
|
||||
}
|
65
hyhproject/admin/controller/Homemenus.php
Executable file
65
hyhproject/admin/controller/Homemenus.php
Executable file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\HomeMenus as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 前台菜单控制器
|
||||
*/
|
||||
class Homemenus extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单列表
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return $m->pageQuery();
|
||||
}
|
||||
/**
|
||||
* 获取菜单
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById((int)input("post.menuId"));
|
||||
}
|
||||
/**
|
||||
* 新增菜单
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 编辑菜单
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除菜单
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示隐藏
|
||||
*/
|
||||
public function setToggle(){
|
||||
$m = new M();
|
||||
return $m->setToggle();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排序
|
||||
*/
|
||||
public function changeSort(){
|
||||
$m = new M();
|
||||
return $m->changeSort();
|
||||
}
|
||||
}
|
29
hyhproject/admin/controller/Hooks.php
Executable file
29
hyhproject/admin/controller/Hooks.php
Executable file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Hooks as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 广告控制器
|
||||
*/
|
||||
class Hooks extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById(Input("id/d",0));
|
||||
}
|
||||
|
||||
}
|
102
hyhproject/admin/controller/Images.php
Executable file
102
hyhproject/admin/controller/Images.php
Executable file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Images as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 图片空间控制器
|
||||
*/
|
||||
class Images extends Base{
|
||||
/**
|
||||
* 进入主页面
|
||||
*/
|
||||
public function index(){
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* 获取概况
|
||||
* 后台商城消息 编辑器中的图片只记录上传图片容量 删除相关数据时无法标记图片为已删除状态
|
||||
*/
|
||||
public function summary(){
|
||||
$m = new M();
|
||||
$data = $m->summary();
|
||||
return WSTReturn("", 1,$data);
|
||||
}
|
||||
/**
|
||||
* 进入列表页面
|
||||
*/
|
||||
public function lists(){
|
||||
$datas = model('Datas')->listQuery(3);
|
||||
$this->assign('datas',$datas);
|
||||
$this->assign('keyword',input('get.keyword'));
|
||||
return $this->fetch('list');
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 检测图片信息
|
||||
*/
|
||||
// public function checkImages(){
|
||||
// $imgPath = input('get.imgPath');
|
||||
// $m = WSTConf('CONF.wstMobileImgSuffix');
|
||||
// $imgPath = str_replace($m.'.','.',$imgPath);
|
||||
// $imgPath = str_replace($m.'_thumb.','.',$imgPath);
|
||||
// $imgPath = str_replace('_thumb.','.',$imgPath);
|
||||
// $imgPath_thumb = str_replace('.','_thumb.',$imgPath);
|
||||
// $mimg = '';
|
||||
// $mimg_thumb = '';
|
||||
// if($m!=''){
|
||||
// $mimg = str_replace('.',$m.'.',$imgPath);
|
||||
// $mimg_thumb = str_replace('.',$m.'_thumb.',$imgPath);
|
||||
// }
|
||||
// $data['imgpath']=$imgPath;
|
||||
// $data['img']=file_exists(WSTRootPath()."/".$imgPath)?true:false;
|
||||
// $data['thumb']=file_exists(WSTRootPath()."/".$imgPath_thumb)?true:false;
|
||||
// $data['thumbpath']=$imgPath_thumb;
|
||||
// $data['mimg']=file_exists(WSTRootPath()."/".$mimg)?true:false;
|
||||
// $data['mimgpath']=$mimg;
|
||||
// $data['mthumb']=file_exists(WSTRootPath()."/".$mimg_thumb)?true:false;
|
||||
// $data['mthumbpath']=$mimg_thumb;
|
||||
// return $this->fetch('view',$data);
|
||||
// }
|
||||
/**
|
||||
* 检测图片信息 mark 20180609
|
||||
*/
|
||||
public function checkImages(){
|
||||
$imgPath = input('get.imgPath');
|
||||
$m = WSTConf('CONF.wstMobileImgSuffix');
|
||||
$imgPath = str_replace($m.'.','.',$imgPath);
|
||||
$imgPath = str_replace($m.'_thumb.','.',$imgPath);
|
||||
$imgPath = str_replace('_thumb.','.',$imgPath);
|
||||
$imgPath_thumb = str_replace('.','_thumb.',$imgPath);
|
||||
$mimg = '';
|
||||
$mimg_thumb = '';
|
||||
if($m!=''){
|
||||
$mimg = str_replace('.',$m.'.',$imgPath);
|
||||
$mimg_thumb = str_replace('.',$m.'_thumb.',$imgPath);
|
||||
}
|
||||
$data['imgpath']=$imgPath;
|
||||
$data['img']=file_exists(WSTRootPath()."/".$imgPath)?true:false;
|
||||
//添加判断oss上是否存在 mark 2010608 by zl
|
||||
$data['img_oss']=file_exists_oss($imgPath)?true:false;
|
||||
|
||||
$data['thumb']=file_exists(WSTRootPath()."/".$imgPath_thumb)?true:false;
|
||||
$data['thumbpath']=$imgPath_thumb;
|
||||
$data['mimg']=file_exists(WSTRootPath()."/".$mimg)?true:false;
|
||||
$data['mimgpath']=$mimg;
|
||||
$data['mthumb']=file_exists(WSTRootPath()."/".$mimg_thumb)?true:false;
|
||||
$data['mthumbpath']=$mimg_thumb;
|
||||
return $this->fetch('view',$data);
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
}
|
98
hyhproject/admin/controller/Index.php
Executable file
98
hyhproject/admin/controller/Index.php
Executable file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Staffs;
|
||||
use wstmart\admin\model\Menus;
|
||||
use wstmart\admin\model\Index as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 首页控制器
|
||||
*/
|
||||
class Index extends Base{
|
||||
/**
|
||||
* 跳去登录页
|
||||
*/
|
||||
public function login(){
|
||||
if('quanlianggongmall' == input('key')){
|
||||
model('CronJobs')->autoByAdmin();
|
||||
return $this->fetch("/login");
|
||||
}else{
|
||||
echo 'hello';
|
||||
}
|
||||
}
|
||||
|
||||
public function index(){
|
||||
$m = new Menus();
|
||||
$ms = $m->getMenus();
|
||||
// dump($ms);die;
|
||||
$this->assign("sysMenus",$ms);
|
||||
return $this->fetch("/index");
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
*/
|
||||
public function checkLogin(){
|
||||
$m = new Staffs();
|
||||
return $m->checkLogin();
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出系统
|
||||
*/
|
||||
public function logout(){
|
||||
session('WST_STAFF',null);
|
||||
return WSTReturn("退出成功,正在跳转页面", 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统预览
|
||||
*/
|
||||
public function main(){
|
||||
$m = new M();
|
||||
$rs = $m->summary();
|
||||
$this->assign("object",$rs);
|
||||
return $this->fetch("/main");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户权限
|
||||
*/
|
||||
public function getGrants(){
|
||||
$rs = session('WST_STAFF');
|
||||
if(empty($rs))return WSTReturn("您未登录,请先登录系统",-1);
|
||||
$rs = $rs['privileges'];
|
||||
$grants = [];
|
||||
foreach ($rs as $v){
|
||||
$grants[$v] = true;
|
||||
}
|
||||
return WSTReturn("权限加载成功",1, $grants);
|
||||
}
|
||||
/**
|
||||
* 清除缓存
|
||||
*/
|
||||
public function clearcache(){
|
||||
WSTClearAllCache();
|
||||
return WSTReturn("清除成功!", 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取最新版本提示
|
||||
*/
|
||||
public function getVersion(){
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 输入授权码
|
||||
*/
|
||||
public function enterLicense(){
|
||||
return $this->fetch("/enter_license");
|
||||
}
|
||||
/**
|
||||
* 验证授权码
|
||||
*/
|
||||
public function verifyLicense(){
|
||||
|
||||
}
|
||||
|
||||
}
|
51
hyhproject/admin/controller/Informs.php
Executable file
51
hyhproject/admin/controller/Informs.php
Executable file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Informs as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 订单投诉控制器
|
||||
*/
|
||||
class Informs extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 查看举报信息
|
||||
*/
|
||||
public function view(){
|
||||
$m = model('informs');
|
||||
if((int)Input('cid')>0){
|
||||
$data = $m->getDetail();
|
||||
$this->assign('data',$data);
|
||||
}
|
||||
return $this->fetch('view');
|
||||
}
|
||||
/**
|
||||
* 跳去处理页面
|
||||
*/
|
||||
public function toHandle(){
|
||||
$m = model('informs');
|
||||
if(Input('cid')>0){
|
||||
$data = $m->getDetail();
|
||||
$this->assign('data',$data);
|
||||
}
|
||||
return $this->fetch("handle");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 举报记录
|
||||
*/
|
||||
public function finalHandle(){
|
||||
return model('Informs')->finalHandle();
|
||||
}
|
||||
|
||||
|
||||
}
|
41
hyhproject/admin/controller/Logmoneys.php
Executable file
41
hyhproject/admin/controller/Logmoneys.php
Executable file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\LogMoneys as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 资金流水日志控制器
|
||||
*/
|
||||
class Logmoneys extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户分页
|
||||
*/
|
||||
public function pageQueryByUser(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQueryByUser());
|
||||
}
|
||||
/**
|
||||
* 获取商分页
|
||||
*/
|
||||
public function pageQueryByShop(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQueryByShop());
|
||||
}
|
||||
/**
|
||||
* 获取指定记录
|
||||
*/
|
||||
public function tologmoneys(){
|
||||
$m = new M();
|
||||
$object = $m->getUserInfoByType();
|
||||
$this->assign("object",$object);
|
||||
return $this->fetch("list_log");
|
||||
}
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
}
|
28
hyhproject/admin/controller/Logoperates.php
Executable file
28
hyhproject/admin/controller/Logoperates.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\LogOperates as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 操作日志控制器
|
||||
*/
|
||||
class Logoperates extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 获取指定记录
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById(input('id/d',0));
|
||||
}
|
||||
}
|
22
hyhproject/admin/controller/Logsms.php
Executable file
22
hyhproject/admin/controller/Logsms.php
Executable file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\LogSms as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 登录日志控制器
|
||||
*/
|
||||
class Logsms extends Base{
|
||||
|
||||
public function index(){
|
||||
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
}
|
22
hyhproject/admin/controller/Logstafflogins.php
Executable file
22
hyhproject/admin/controller/Logstafflogins.php
Executable file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\LogStaffLogins as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 登录日志控制器
|
||||
*/
|
||||
class Logstafflogins extends Base{
|
||||
|
||||
public function index(){
|
||||
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
}
|
22
hyhproject/admin/controller/Member.php
Executable file
22
hyhproject/admin/controller/Member.php
Executable file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Member as M;
|
||||
|
||||
class Member extends Base{
|
||||
public function index(){
|
||||
return $this->fetch('member');
|
||||
}
|
||||
//分页获取
|
||||
public function memberByPage(){
|
||||
$m=new M();
|
||||
return WSTGrid($m->memberByPage());
|
||||
}
|
||||
/**
|
||||
* 导出订单
|
||||
*/
|
||||
public function toExport(){
|
||||
$m = new M();
|
||||
$rs = $m->toExport();
|
||||
$this->assign('rs',$rs);
|
||||
}
|
||||
}
|
49
hyhproject/admin/controller/Menus.php
Executable file
49
hyhproject/admin/controller/Menus.php
Executable file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Menus as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 菜单控制器
|
||||
*/
|
||||
class Menus extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单列表
|
||||
*/
|
||||
public function listQuery(){
|
||||
$m = new M();
|
||||
return $m->listQuery((int)Input("post.id",-1));
|
||||
}
|
||||
/**
|
||||
* 获取菜单
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById((int)Input("post.id"));
|
||||
}
|
||||
/**
|
||||
* 新增菜单
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 编辑菜单
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除菜单
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
}
|
78
hyhproject/admin/controller/Messages.php
Executable file
78
hyhproject/admin/controller/Messages.php
Executable file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Messages as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 商城消息控制器
|
||||
*/
|
||||
class Messages extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 查找用户
|
||||
*/
|
||||
public function userQuery(){
|
||||
$m = model('users');
|
||||
return $m->getByName(input('post.loginName'));
|
||||
}
|
||||
/**
|
||||
* 发送消息
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
/**
|
||||
* 查看完整消息
|
||||
*/
|
||||
public function showFullMsg(){
|
||||
$m = new M();
|
||||
$rs = $m->getById(Input("id/d",0));
|
||||
return $this->fetch('msg', ['data'=>$rs]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
49
hyhproject/admin/controller/Mobilebtns.php
Executable file
49
hyhproject/admin/controller/Mobilebtns.php
Executable file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\MobileBtns as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 移动端按钮管理控制器
|
||||
*/
|
||||
class Mobilebtns extends Base{
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/*
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById(Input("id/d",0));
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
|
||||
|
||||
}
|
69
hyhproject/admin/controller/Navs.php
Executable file
69
hyhproject/admin/controller/Navs.php
Executable file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Navs as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 导航控制器
|
||||
*/
|
||||
class Navs extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
//获取省级信息
|
||||
$this->assign('area1',model('areas')->listQuery(0));
|
||||
$m = new M();
|
||||
$rs = $m->getById((int)Input("get.id"));
|
||||
$this->assign("data",$rs);
|
||||
return $this->fetch("edit");
|
||||
}
|
||||
/*
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById((int)Input("id"));
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
/**
|
||||
* 显示隐藏
|
||||
*/
|
||||
public function editiIsShow(){
|
||||
$m = new M();
|
||||
return $m->editiIsShow();
|
||||
}
|
||||
|
||||
|
||||
}
|
120
hyhproject/admin/controller/Ordercomplains.php
Executable file
120
hyhproject/admin/controller/Ordercomplains.php
Executable file
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\OrderComplains as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 订单投诉控制器
|
||||
*/
|
||||
class OrderComplains extends Base{
|
||||
|
||||
public function index(){
|
||||
$areaList = model('areas')->listQuery(0);
|
||||
$this->assign("areaList",$areaList);
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 查看投诉信息
|
||||
*/
|
||||
public function view(){
|
||||
$m = model('OrderComplains');
|
||||
if((int)Input('cid')>0){
|
||||
$data = $m->getDetail();
|
||||
$this->assign('order',$data);
|
||||
$rs = model('orders')->getByView($data['orderId']);
|
||||
$this->assign('object',$rs);
|
||||
}
|
||||
return $this->fetch('view');
|
||||
}
|
||||
/**
|
||||
* 跳去处理页面
|
||||
*/
|
||||
public function toHandle(){
|
||||
$m = model('OrderComplains');
|
||||
if(Input('cid')>0){
|
||||
$data = $m->getDetail();
|
||||
$this->assign('order',$data);
|
||||
$rs = model('orders')->getByView($data['orderId']);
|
||||
$this->assign('object',$rs);
|
||||
}
|
||||
return $this->fetch("handle");
|
||||
}
|
||||
/**
|
||||
* 转交给应诉人回应
|
||||
*/
|
||||
public function deliverRespond(){
|
||||
return model('OrderComplains')->deliverRespond();
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 仲裁投诉记录
|
||||
*/
|
||||
public function finalHandle(){
|
||||
return model('OrderComplains')->finalHandle();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById(Input("id/d",0));
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
|
||||
|
||||
}
|
46
hyhproject/admin/controller/Orderrefunds.php
Executable file
46
hyhproject/admin/controller/Orderrefunds.php
Executable file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\OrderRefunds as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 退款订单控制器
|
||||
*/
|
||||
class Orderrefunds extends Base{
|
||||
/**
|
||||
* 退款列表
|
||||
*/
|
||||
public function refund(){
|
||||
$areaList = model('areas')->listQuery(0);
|
||||
$this->assign("areaList",$areaList);
|
||||
return $this->fetch("list");
|
||||
}
|
||||
public function refundPageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->refundPageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去退款界面
|
||||
*/
|
||||
public function toRefund(){
|
||||
$m = new M();
|
||||
$object = $m->getInfoByRefund();
|
||||
$this->assign("object",$object);
|
||||
return $this->fetch("box_refund");
|
||||
}
|
||||
/**
|
||||
* 退款
|
||||
*/
|
||||
public function orderRefund(){
|
||||
$m = new M();
|
||||
return $m->orderRefund();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出订单
|
||||
*/
|
||||
public function toExport(){
|
||||
$m = new M();
|
||||
$rs = $m->toExport();
|
||||
$this->assign('rs',$rs);
|
||||
}
|
||||
}
|
95
hyhproject/admin/controller/Orders.php
Executable file
95
hyhproject/admin/controller/Orders.php
Executable file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace wstmart\admin\controller;
|
||||
|
||||
use wstmart\admin\model\Orders as M;
|
||||
|
||||
/**
|
||||
|
||||
* ============================================================================
|
||||
|
||||
* 订单控制器
|
||||
|
||||
*/
|
||||
|
||||
class Orders extends Base{
|
||||
|
||||
/**
|
||||
|
||||
* 订单列表
|
||||
|
||||
*/
|
||||
|
||||
public function index(){
|
||||
|
||||
$areaList = model('areas')->listQuery(0);
|
||||
|
||||
$this->assign("areaList",$areaList);
|
||||
|
||||
$this->assign("userId",(int)input('userId'));
|
||||
|
||||
return $this->fetch("list");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
* 获取分页
|
||||
|
||||
*/
|
||||
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery((int)input('orderStatus',10000)));
|
||||
}
|
||||
//凭证列表
|
||||
public function certificate(){
|
||||
return $this->fetch("certificate_list");
|
||||
}
|
||||
//获取凭证列表
|
||||
public function getCertificate(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->getCertificate());
|
||||
}
|
||||
//凭证设置
|
||||
public function certificateSet(){
|
||||
$m = new M();
|
||||
exit(json_encode($m->certificateSet()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
* 获取订单详情
|
||||
|
||||
*/
|
||||
|
||||
public function view(){
|
||||
|
||||
$m = new M();
|
||||
|
||||
$rs = $m->getByView(Input("id/d",0));
|
||||
|
||||
$this->assign("object",$rs);
|
||||
|
||||
return $this->fetch("view");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
* 导出订单
|
||||
|
||||
*/
|
||||
|
||||
public function toExport(){
|
||||
|
||||
$m = new M();
|
||||
|
||||
$rs = $m->toExport();
|
||||
|
||||
$this->assign('rs',$rs);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
64
hyhproject/admin/controller/Payments.php
Executable file
64
hyhproject/admin/controller/Payments.php
Executable file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Payments as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 支付控制器
|
||||
*/
|
||||
class Payments extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$m = new M();
|
||||
$rs = $m->getById((int)Input("get.id"));
|
||||
$payConfig = json_decode($rs['payConfig']);
|
||||
//判断是否为空
|
||||
if(!empty($payConfig)){
|
||||
foreach($payConfig as $k=>$v)
|
||||
$rs[$k]=$v;
|
||||
}
|
||||
$this->assign("object",$rs);
|
||||
return $this->fetch("pay_".input('get.payCode'));
|
||||
}
|
||||
/*
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById((int)Input("id"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
//商家选择支付方式
|
||||
public function pay(){
|
||||
$m=new M();
|
||||
return $m->pay();
|
||||
}
|
||||
|
||||
}
|
213
hyhproject/admin/controller/Platform.php
Executable file
213
hyhproject/admin/controller/Platform.php
Executable file
@ -0,0 +1,213 @@
|
||||
<?php
|
||||
|
||||
namespace wstmart\admin\controller;
|
||||
|
||||
use wstmart\admin\model\Platform as M;
|
||||
|
||||
/**
|
||||
|
||||
* ============================================================================
|
||||
|
||||
* 基础控业务处理
|
||||
|
||||
*/
|
||||
|
||||
|
||||
class Platform extends Base{
|
||||
|
||||
//列表
|
||||
|
||||
public function index(){
|
||||
|
||||
$where=[];
|
||||
|
||||
$map=[];
|
||||
|
||||
$page_map=[];
|
||||
|
||||
//接受时间
|
||||
|
||||
if (Request()->isPost()) {
|
||||
|
||||
$start_date=input('start');
|
||||
|
||||
$end_date=input('end');
|
||||
|
||||
$start=strtotime($start_date);
|
||||
|
||||
$end=strtotime($end_date);
|
||||
|
||||
if($start && $end){
|
||||
|
||||
$where['createTime'] =array('between',[$start,$end]);
|
||||
|
||||
$map['createTime'] =array('between',[$start_date,$end_date]);
|
||||
|
||||
$page_map['create_time']=array('between',[$start,$end]);
|
||||
|
||||
}elseif($start){
|
||||
|
||||
$where['createTime'] =array('egt',$start);
|
||||
|
||||
$map['createTime'] =array('egt',$start_date);
|
||||
|
||||
$page_map['create_time']=array('egt',$start);
|
||||
|
||||
}elseif($end){
|
||||
|
||||
$where['createTime'] =array('elt',$end);
|
||||
|
||||
$page_map['create_time']=array('elt',$end);
|
||||
|
||||
$map['createTime'] =array('egt',$end_date);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//判断时间周期内的注册数量
|
||||
|
||||
$where['loginSrc']=0;
|
||||
|
||||
$result['pcNum'] = db('login_src')->where($where)->count();
|
||||
|
||||
$where['loginSrc']=1;
|
||||
|
||||
$result['webappNum'] = db('login_src')->where($where)->count();
|
||||
|
||||
$where['loginSrc']=2 ;
|
||||
|
||||
$result['appNum'] = db('login_src')->where($where)->count();
|
||||
|
||||
//查询出所有新注册用户
|
||||
|
||||
unset($where['loginSrc']);
|
||||
|
||||
//dump($ids);
|
||||
|
||||
//下过单的用户
|
||||
|
||||
if(Request()->isAjax()){
|
||||
|
||||
$userIds=db('login_src')->where($where)->field('userId')->select();
|
||||
|
||||
$ids=[];
|
||||
|
||||
foreach ($userIds as &$value) {
|
||||
|
||||
$ids[]=$value['userId'];
|
||||
|
||||
}
|
||||
|
||||
$map['userId']=array('in',$ids);
|
||||
|
||||
$page_map['userId']=array('in',$ids);
|
||||
|
||||
}
|
||||
|
||||
$map['isPay']=1;
|
||||
|
||||
$result['validUser']=db('orders')->where($map)->group('userId')->count('userId');
|
||||
|
||||
//总单数
|
||||
|
||||
$orderNum=db('orders')->where($map)->count('orderId');
|
||||
|
||||
//总浏览
|
||||
|
||||
$viewNum=db('page_view')->where($page_map)->count('id');
|
||||
|
||||
// dump($orderNum);
|
||||
|
||||
// dump($viewNum);
|
||||
|
||||
//转换率
|
||||
|
||||
if($orderNum==0 || $viewNum==0){
|
||||
|
||||
$result['orderRade']="0".'%';
|
||||
|
||||
}else{
|
||||
|
||||
$result['orderRade']=(round($orderNum/$viewNum,2)*100).'%';
|
||||
|
||||
}
|
||||
|
||||
//dump($result);
|
||||
|
||||
if (Request()->isAjax()) {
|
||||
|
||||
exit(jsonReturn('',1,$result));
|
||||
|
||||
}
|
||||
|
||||
$this->assign('object',$result);
|
||||
|
||||
//dump($result);
|
||||
|
||||
return $this->fetch('platform');
|
||||
|
||||
}
|
||||
|
||||
// //获取分页
|
||||
|
||||
// public function platformByPage(){
|
||||
|
||||
// $m=new M();
|
||||
|
||||
// $result=$m->platformByPage();
|
||||
|
||||
// $result['status'] = 1;
|
||||
|
||||
// return WSTGrid($result);
|
||||
|
||||
// }
|
||||
//查看券值记录
|
||||
|
||||
public function viewData(){
|
||||
if(Request()->isAjax()){
|
||||
$dataType = input('post.dataType');
|
||||
$start_date = input('start');
|
||||
$end_date = input('end');
|
||||
$start = strtotime($start_date);
|
||||
$end = strtotime($end_date);
|
||||
$m = Model('common/Table');
|
||||
$m->setTable('user_vouchers_notice');
|
||||
$result['num'] = 0;
|
||||
$where = [];
|
||||
$map = [];
|
||||
if($start && $end){
|
||||
$where['createTime'] =array('between',[$start,$end]);
|
||||
$map['createTime'] =array('between',[$start_date,$end_date]);
|
||||
}elseif($start){
|
||||
$where['createTime'] =array('egt',$start);
|
||||
$map['createTime'] =array('egt',$start_date);
|
||||
}elseif($end){
|
||||
$where['createTime'] =array('elt',$end);
|
||||
$map['createTime'] =array('egt',$end_date);
|
||||
}
|
||||
switch ($dataType) {
|
||||
case 1://预获产品券
|
||||
$result['num'] = $m->getSum(array_merge($where,['moneyType'=>1]),'expectedProductNum');
|
||||
$result['num'] -= $m->getSum(array_merge($where,['moneyType'=>0]),'expectedProductNum');
|
||||
break;
|
||||
case 2://预获优惠券
|
||||
$result['num'] = $m->getSum(array_merge($where,['moneyType'=>1]),'expectedCouponsNum');
|
||||
$result['num'] -= $m->getSum(array_merge($where,['moneyType'=>0]),'expectedCouponsNum');
|
||||
break;
|
||||
case 3://产品券
|
||||
case 4://优惠券
|
||||
case 5://旺旺券
|
||||
$dataType-=2;
|
||||
$m->setTable('log_moneys');
|
||||
$result['num'] = $m->getSum(array_merge($map,['dataFlag'=>1,'moneyType'=>1,'moneyName'=>$dataType]),'money');
|
||||
$result['num'] -= $m->getSum(array_merge($map,['dataFlag'=>1,'moneyType'=>0,'moneyName'=>$dataType]),'money');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
exit(jsonReturn('',1,$result));
|
||||
}
|
||||
return $this->fetch('view_data');
|
||||
}
|
||||
}
|
58
hyhproject/admin/controller/Privileges.php
Executable file
58
hyhproject/admin/controller/Privileges.php
Executable file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Privileges as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 权限控制器
|
||||
*/
|
||||
class privileges extends Base{
|
||||
/**
|
||||
* 获取权限列表
|
||||
*/
|
||||
public function listQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->listQuery((int)Input("id")));
|
||||
}
|
||||
/**
|
||||
* 获取权限
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById((int)Input("id"));
|
||||
}
|
||||
/**
|
||||
* 新增权限
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 编辑权限
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除权限
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
/**
|
||||
* 检测权限代码是否存在
|
||||
*/
|
||||
public function checkPrivilegeCode(){
|
||||
$m = new M();
|
||||
return $m->checkPrivilegeCode();
|
||||
}
|
||||
/**
|
||||
* 获取角色的权限
|
||||
*/
|
||||
public function listQueryByRole(){
|
||||
$m = new M();
|
||||
return $m->listQueryByRole((int)Input("id"));
|
||||
}
|
||||
}
|
97
hyhproject/admin/controller/Recommends.php
Executable file
97
hyhproject/admin/controller/Recommends.php
Executable file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Recommends as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 推荐管理控制器
|
||||
*/
|
||||
class Recommends extends Base{
|
||||
/**
|
||||
* 查看商品推荐
|
||||
*/
|
||||
public function goods(){
|
||||
return $this->fetch('goods');
|
||||
}
|
||||
/**
|
||||
* 查询商品
|
||||
*/
|
||||
public function searchGoods(){
|
||||
$rs = model('Goods')->searchQuery();
|
||||
return WSTReturn("", 1,$rs);
|
||||
}
|
||||
/**
|
||||
* 推荐商品
|
||||
*/
|
||||
public function editGoods(){
|
||||
$m = new M();
|
||||
return $m->editGoods();
|
||||
}
|
||||
/**
|
||||
* 获取已选择商品
|
||||
*/
|
||||
public function listQueryByGoods(){
|
||||
$m = new M();
|
||||
$rs= $m->listQueryByGoods();
|
||||
return WSTReturn("", 1,$rs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看店铺推荐
|
||||
*/
|
||||
public function shops(){
|
||||
return $this->fetch('shops');
|
||||
}
|
||||
/**
|
||||
* 查询店铺
|
||||
*/
|
||||
public function searchShops(){
|
||||
$rs = model('Shops')->searchQuery();
|
||||
return WSTReturn("", 1,$rs);
|
||||
}
|
||||
/**
|
||||
* 推荐店铺
|
||||
*/
|
||||
public function editShops(){
|
||||
$m = new M();
|
||||
return $m->editShops();
|
||||
}
|
||||
/**
|
||||
* 获取已选择店铺
|
||||
*/
|
||||
public function listQueryByShops(){
|
||||
$m = new M();
|
||||
$rs= $m->listQueryByShops();
|
||||
return WSTReturn("", 1,$rs);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看品牌推荐
|
||||
*/
|
||||
public function brands(){
|
||||
return $this->fetch('brands');
|
||||
}
|
||||
/**
|
||||
* 查询品牌
|
||||
*/
|
||||
public function searchBrands(){
|
||||
$rs = model('Brands')->searchBrands();
|
||||
return WSTReturn("", 1,$rs);
|
||||
}
|
||||
/**
|
||||
* 推荐品牌
|
||||
*/
|
||||
public function editBrands(){
|
||||
$m = new M();
|
||||
$rs= $m->editBrands();
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 获取已选择品牌
|
||||
*/
|
||||
public function listQueryByBrands(){
|
||||
$m = new M();
|
||||
$rs= $m->listQueryByBrands();
|
||||
return WSTReturn("", 1,$rs);
|
||||
}
|
||||
}
|
159
hyhproject/admin/controller/Reports.php
Executable file
159
hyhproject/admin/controller/Reports.php
Executable file
@ -0,0 +1,159 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Reports as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 报表控制器
|
||||
*/
|
||||
class Reports extends Base{
|
||||
/**
|
||||
* 商品销售排行
|
||||
*/
|
||||
public function toTopSaleGoods(){
|
||||
$this->assign("startDate",date('Y-m-d',strtotime("-1month")));
|
||||
$this->assign("endDate",date('Y-m-d'));
|
||||
return $this->fetch("/reports/top_sale_goods");
|
||||
}
|
||||
/**
|
||||
* 获取商品排行数据
|
||||
*/
|
||||
public function topSaleGoodsByPage(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->topSaleGoodsByPage());
|
||||
}
|
||||
/**
|
||||
* 店铺销售排行
|
||||
*/
|
||||
public function toTopShopSales(){
|
||||
$this->assign("startDate",date('Y-m-d',strtotime("-1month")));
|
||||
$this->assign("endDate",date('Y-m-d'));
|
||||
return $this->fetch("/reports/top_sale_shop");
|
||||
}
|
||||
/**
|
||||
* 获取店铺排行数据
|
||||
*/
|
||||
public function topShopSalesByPage(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->topShopSalesByPage());
|
||||
}
|
||||
/**
|
||||
* 获取销售额
|
||||
*/
|
||||
public function toStatSales(){
|
||||
$this->assign("startDate",date('Y-m-d',strtotime("-1month")));
|
||||
$this->assign("endDate",date('Y-m-d'));
|
||||
return $this->fetch("/reports/stat_sales");
|
||||
}
|
||||
public function statSales(){
|
||||
$m = new M();
|
||||
return $m->statSales();
|
||||
}
|
||||
/**
|
||||
* 获取订单统计
|
||||
*/
|
||||
public function toStatOrders(){
|
||||
$this->assign("startDate",date('Y-m-d',strtotime("-1month")));
|
||||
$this->assign("endDate",date('Y-m-d'));
|
||||
return $this->fetch("/reports/stat_orders");
|
||||
}
|
||||
/*
|
||||
*
|
||||
*/
|
||||
public function getOrders(){
|
||||
$m = new M();
|
||||
return $m->getOrders();
|
||||
}
|
||||
public function statOrders(){
|
||||
$m = new M();
|
||||
return $m->statOrders();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取每日新增用户
|
||||
*/
|
||||
public function toStatNewUser(){
|
||||
$this->assign("startDate",date('Y-m-d',strtotime("-1month")));
|
||||
$this->assign("endDate",date('Y-m-d'));
|
||||
return $this->fetch("/reports/stat_new_user");
|
||||
}
|
||||
public function statNewUser(){
|
||||
$start = date('Y-m-d 00:00:00',strtotime(input('startDate')));
|
||||
$end = date('Y-m-d 23:59:59',strtotime(input('endDate')));
|
||||
$where='dataFlag=1 AND userStatus=1 AND userType=0';
|
||||
$totalNum=db('users')->where($where)->count('userId');
|
||||
if($start!='' && $end!=''){
|
||||
$start = date('Y-m-d 00:00:00',strtotime(input('startDate')));
|
||||
$end = date('Y-m-d 23:59:59',strtotime(input('endDate')));
|
||||
$where.=' AND createTime BETWEEN "'.$start.'" AND "'.$end.'"';
|
||||
}else if($start!=''){
|
||||
$start = date('Y-m-d 00:00:00',strtotime(input('startDate')));
|
||||
$where.= ' AND createTime>="'.$start.'"';
|
||||
}else if($end!=''){
|
||||
$end = date('Y-m-d 00:00:00',strtotime(input('endDate')));
|
||||
$where.= ' AND createTime<="'.$end.'"';
|
||||
}
|
||||
$aa=array('dsad');
|
||||
$groupNum=db('users')->where($where)->count('userId');
|
||||
$groupRate=$groupNum/$totalNum;
|
||||
$m = new M();
|
||||
$a= $m->statNewUser();
|
||||
$a['groupNum']=$groupNum;
|
||||
$a['groupRate']=$groupRate;
|
||||
$this->assign('a',$a);
|
||||
return $a;
|
||||
}
|
||||
/*
|
||||
* 首页获取新增用户
|
||||
*/
|
||||
public function getNewUser(){
|
||||
$m = new M();
|
||||
$data = cache('userNumData');
|
||||
if(empty($data)){
|
||||
$rdata = $m->statNewUser();
|
||||
cache('userNumData',$rdata,7200);
|
||||
}else{
|
||||
$rdata = cache('userNumData');
|
||||
}
|
||||
return $rdata;
|
||||
}
|
||||
/**
|
||||
* 会员登录统计
|
||||
*/
|
||||
public function toStatUserLogin(){
|
||||
$this->assign("startDate",date('Y-m-d',strtotime("-1month")));
|
||||
$this->assign("endDate",date('Y-m-d'));
|
||||
return $this->fetch("/reports/stat_user_login");
|
||||
}
|
||||
public function statUserLogin(){
|
||||
$m = new M();
|
||||
return $m->statUserLogin();
|
||||
}
|
||||
/**
|
||||
* 导出商品销售订单
|
||||
*/
|
||||
public function toExportGoods(){
|
||||
$m = new M();
|
||||
$rs = $m->toExportGoods();
|
||||
$this->assign('rs',$rs);
|
||||
}
|
||||
/**
|
||||
* 导出商家销售订单
|
||||
*/
|
||||
public function toExportShop(){
|
||||
$m = new M();
|
||||
$rs = $m->toExportShop();
|
||||
$this->assign('rs',$rs);
|
||||
}
|
||||
// 店铺商品销售统计
|
||||
public function detail(){
|
||||
$this->assign("startDate",date('Y-m-d',strtotime("-1month")));
|
||||
$this->assign("endDate",date('Y-m-d'));
|
||||
return $this->fetch('detail');
|
||||
}
|
||||
public function detailByPage(){
|
||||
$m=new M();
|
||||
$result=$m->detailByPage();
|
||||
return $result;
|
||||
}
|
||||
}
|
60
hyhproject/admin/controller/Roles.php
Executable file
60
hyhproject/admin/controller/Roles.php
Executable file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Roles as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 角色控制器
|
||||
*/
|
||||
class Roles extends Base{
|
||||
|
||||
public function index(){
|
||||
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 获取菜单
|
||||
*/
|
||||
public function get(){
|
||||
|
||||
$m = new M();
|
||||
return $m->get((int)Input("post.id"));
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$m = new M();
|
||||
$rs = $m->getById((int)Input("get.id"));
|
||||
$this->assign("object",$rs);
|
||||
return $this->fetch("edit");
|
||||
}
|
||||
/**
|
||||
* 新增菜单
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 编辑菜单
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除菜单
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
}
|
102
hyhproject/admin/controller/Settlements.php
Executable file
102
hyhproject/admin/controller/Settlements.php
Executable file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Settlements as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 结算控制器
|
||||
*/
|
||||
class Settlements extends Base{
|
||||
public function index(){
|
||||
return $this->fetch('list');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去结算页面
|
||||
*/
|
||||
public function toHandle(){
|
||||
$m = new M();
|
||||
$object = $m->getById();
|
||||
$this->assign("object",$object);
|
||||
return $this->fetch('edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理订单
|
||||
*/
|
||||
public function handle(){
|
||||
$m = new M();
|
||||
return $m->handle();
|
||||
}
|
||||
/**
|
||||
* 跳去结算详情
|
||||
*/
|
||||
public function toView(){
|
||||
$m = new M();
|
||||
$object = $m->getById();
|
||||
$this->assign("object",$object);
|
||||
return $this->fetch('view');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单商品
|
||||
*/
|
||||
public function pageGoodsQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageGoodsQuery());
|
||||
}
|
||||
|
||||
/*************************************************
|
||||
* 以下是平台主动生成结算单
|
||||
************************************************/
|
||||
/**
|
||||
* 进入平台结算野蛮
|
||||
*/
|
||||
public function toShopIndex(){
|
||||
$this->assign("areaList",model('areas')->listQuery(0));
|
||||
return $this->fetch('list_shop');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取待结算的商家列表
|
||||
*/
|
||||
public function pageShopQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageShopQuery());
|
||||
}
|
||||
/**
|
||||
* 进入订单列表页面
|
||||
*/
|
||||
public function toOrders(){
|
||||
$this->assign("id",(int)input('id'));
|
||||
return $this->fetch('list_order');
|
||||
}
|
||||
/**
|
||||
* 获取商家的待结算订单列表
|
||||
*/
|
||||
public function pageShopOrderQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageShopOrderQuery());
|
||||
}
|
||||
/**
|
||||
* 生成结算单
|
||||
*/
|
||||
public function generateSettleByShop(){
|
||||
$m = new M();
|
||||
return $m->generateSettleByShop();
|
||||
}
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
public function toExport(){
|
||||
$m = new M();
|
||||
$rs = $m->toExport();
|
||||
$this->assign('rs',$rs);
|
||||
}
|
||||
}
|
294
hyhproject/admin/controller/Shops.php
Executable file
294
hyhproject/admin/controller/Shops.php
Executable file
@ -0,0 +1,294 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Shops as M;
|
||||
use wstmart\common\model\Table as TM;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 店铺控制器
|
||||
*/
|
||||
class Shops extends Base{
|
||||
public function index(){
|
||||
$this->assign("areaList",model('areas')->listQuery(0));
|
||||
$this->assign("catList",model('GoodsCats')->listQuery(0));
|
||||
return $this->fetch("list");
|
||||
|
||||
}
|
||||
|
||||
public function stopIndex(){
|
||||
$this->assign("areaList",model('areas')->listQuery(0));
|
||||
return $this->fetch("list_stop");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 停用店铺列表
|
||||
*/
|
||||
public function pageStopQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery(-1));
|
||||
}
|
||||
// 商家登录
|
||||
public function detail(){
|
||||
$this->assign("startDate",date('Y-m-d',strtotime("-1month")));
|
||||
$this->assign("endDate",date('Y-m-d'));
|
||||
return $this->fetch('detail');
|
||||
}
|
||||
public function detailByPage(){
|
||||
$m=new M();
|
||||
$result=$m->detailByPage();
|
||||
return WSTGrid($result);
|
||||
}
|
||||
/**
|
||||
* 获取菜单
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->get((int)Input("post.id"));
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$m = new M();
|
||||
$id = (int)Input("get.id");
|
||||
if($id>0){
|
||||
$object = $m->getById((int)Input("get.id"));
|
||||
$object['auxiliary']=db('shop_auxiliary')->where('shopId',$object['shopId'])->select();
|
||||
$data['object']=$object;
|
||||
}else{
|
||||
$object = $m->getEModel('shops');
|
||||
$object['catshops'] = [];
|
||||
$object['accreds'] = [];
|
||||
$object['loginName'] = '';
|
||||
$data['object']=$object;
|
||||
}
|
||||
$data['goodsCatList'] = model('goodsCats')->listQuery(0);
|
||||
$data['accredList'] = model('accreds')->listQuery(0);
|
||||
$data['bankList'] = model('banks')->listQuery();
|
||||
$data['areaList'] = model('areas')->listQuery(0);
|
||||
if($id>0){
|
||||
return $this->fetch("edit",$data);
|
||||
}else{
|
||||
return $this->fetch("add",$data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增菜单
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 编辑菜单
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除菜单
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测店铺编号是否存在
|
||||
*/
|
||||
public function checkShopSn(){
|
||||
$m = new M();
|
||||
$isChk = $m->checkShopSn(input('post.shopSn'),input('shopId/d'));
|
||||
if(!$isChk){
|
||||
return ['ok'=>'该店铺编号可用'];
|
||||
}else{
|
||||
return ['error'=>'对不起,该店铺编号已存在'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自营店铺后台
|
||||
*/
|
||||
public function inself(){
|
||||
$staffId=session("WST_STAFF");
|
||||
if(!empty($staffId)){
|
||||
$id=1;
|
||||
$s = new M();
|
||||
$r = $s->selfLogin($id);
|
||||
if($r['status']==1){
|
||||
header("Location: ".Url('home/shops/index'));
|
||||
exit();
|
||||
}
|
||||
}
|
||||
header("Location: ".Url('home/shops/selfShop'));
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳去店铺申请列表
|
||||
*/
|
||||
public function apply(){
|
||||
$this->assign("areaList",model('Position')->listQuery());
|
||||
//$this->assign("areaList",model('areas')->listQuery(0));
|
||||
return $this->fetch("list_apply");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQueryByApply(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQueryByApply());
|
||||
}
|
||||
/**
|
||||
* 获取店铺申请列表
|
||||
*/
|
||||
public function shopApplyList(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->shopApplyList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 去处理开店申请
|
||||
*/
|
||||
public function applyEdit(){
|
||||
$data = [];
|
||||
$id = input('get.id/d');
|
||||
// dump($id);
|
||||
$m = new TM();
|
||||
$m->setTable('shops');
|
||||
$data['object'] = $m->getInfo(['shopId'=>$id],'*');
|
||||
$data['object']['applyTime'] = date('Y-m-d H:i:s',$data['object']['createTime']);
|
||||
//改成用户表
|
||||
$m->setTable('users');
|
||||
$data['object']['user'] = $m->getInfo(['userId'=>$data['object']['userId']],'loginName,trueName');
|
||||
$areas=['province','city','county','town','village'];
|
||||
$data['object']['area'] = '';
|
||||
foreach ($areas as $v) {
|
||||
$m->setTable('position_'.$v);
|
||||
$data['object']['area'] .=$m->getField([$v.'_id'=>$data['object'][$v.'Id']],$v.'_name').'-';
|
||||
}
|
||||
|
||||
|
||||
// //改成省表
|
||||
// $m->setTable('position_province');
|
||||
// $data['object']['area'] = $m->getField(['province_id'=>$data['object']['provinceId']],'province_name');
|
||||
// //改成市表
|
||||
// $m->setTable('position_city');
|
||||
// $data['object']['area'] .='-'.$m->getField(['city_id'=>$data['object']['cityId']],'city_name');
|
||||
// //改成区表
|
||||
// $m->setTable('position_county');
|
||||
// $data['object']['area'] .='-'.$m->getField(['county_id'=>$data['object']['countyId']],'county_name');
|
||||
// //改成乡镇表
|
||||
// $m->setTable('position_town');
|
||||
// $data['object']['area'] .='-'.$m->getField(['town_id'=>$data['object']['townId']],'town_name');
|
||||
// //改成村表
|
||||
// $m->setTable('position_village');
|
||||
// $data['object']['area'] .='-'.$m->getField(['village_id'=>$data['object']['villageId']],'village_name');
|
||||
// dump($data);die;
|
||||
return $this->fetch("apply_edit",$data);
|
||||
}
|
||||
/**
|
||||
* 去处理开店申请
|
||||
*/
|
||||
public function toHandleApply(){
|
||||
$data = [];
|
||||
$data['shoplicense']=db('shop_license')
|
||||
->where('shopId',(int)input("get.id"))
|
||||
->find();
|
||||
$data['cashDeposit'] = db('shops_deposit')->where('shopId',(int)input("get.id"))->find();
|
||||
$data['object'] = model('shops')->getShopApply((int)input("get.id"));
|
||||
$data['goodsCatList'] = model('goodsCats')->listQuery(0);
|
||||
$data['accredList'] = model('accreds')->listQuery(0);
|
||||
$data['bankList'] = model('banks')->listQuery();
|
||||
$data['areaList'] = model('areas')->listQuery(0);
|
||||
return $this->fetch("edit_apply",$data);
|
||||
}
|
||||
|
||||
public function delApply(){
|
||||
$m = new M();
|
||||
return $m->delApply();
|
||||
}
|
||||
|
||||
/**
|
||||
* 开店申请处理
|
||||
*/
|
||||
public function handleApply(){
|
||||
$m = new M();
|
||||
return $m->handleApply();
|
||||
}
|
||||
/**
|
||||
* 导出订单
|
||||
*/
|
||||
public function toExport(){
|
||||
$m = new M();
|
||||
$rs = $m->toExport();
|
||||
$this->assign('rs',$rs);
|
||||
}
|
||||
/**
|
||||
* 导出商家登录订单
|
||||
*/
|
||||
public function toExports(){
|
||||
$m = new M();
|
||||
$rs = $m->toExports();
|
||||
$this->assign('rs',$rs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理质保金页面
|
||||
*/
|
||||
public function toDeposit(){
|
||||
$m = new M();
|
||||
return $this->fetch('deposit');
|
||||
}
|
||||
/**
|
||||
* 质保金充值或扣除
|
||||
*/
|
||||
public function topDeposit(){
|
||||
$m = new M();
|
||||
$result = $m->topDeposit();
|
||||
exit(json_encode($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺名称
|
||||
*/
|
||||
public function upShopName(){
|
||||
$m = new M();
|
||||
$res = $m->upShopName();
|
||||
// dump($res);die;
|
||||
exit(json_encode($res));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改佣金扣点
|
||||
*/
|
||||
public function commission(){
|
||||
$m = new M();
|
||||
$obj = $m->commission((int)Input("post.shopId"));
|
||||
exit(json_encode($obj));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置店铺佣金扣点,业务员提成
|
||||
*/
|
||||
public function upCommission(){
|
||||
$m = new M();
|
||||
$result = $m->upCommission();
|
||||
exit(json_encode($result));
|
||||
}
|
||||
/**
|
||||
* 查询业务员信息
|
||||
*/
|
||||
public function staffs(){
|
||||
$m = new M();
|
||||
$data = $m->staffs();
|
||||
exit(json_encode($data));
|
||||
}
|
||||
}
|
76
hyhproject/admin/controller/Speccats.php
Executable file
76
hyhproject/admin/controller/Speccats.php
Executable file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\SpecCats as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 规格类别控制器
|
||||
*/
|
||||
class Speccats extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
//获取该记录信息
|
||||
$this->assign('data', $this->get());
|
||||
return $this->fetch("edit");
|
||||
}
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById(input("catId/d"));
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
/**
|
||||
* 显示隐藏
|
||||
*/
|
||||
public function setToggle(){
|
||||
$m = new M();
|
||||
return $m->setToggle();
|
||||
}
|
||||
|
||||
public function checkCatName(){
|
||||
$m = new M();
|
||||
$rs = $m->checkCatName();
|
||||
if($rs["status"]==1){
|
||||
return array("ok"=>"");
|
||||
}else{
|
||||
return array("error"=>$rs["msg"]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
92
hyhproject/admin/controller/Staffs.php
Executable file
92
hyhproject/admin/controller/Staffs.php
Executable file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Staffs as M;
|
||||
use wstmart\admin\model\Roles as R;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 职员控制器
|
||||
*/
|
||||
class Staffs extends Base{
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 获取
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->get((int)Input("post.id"));
|
||||
}
|
||||
/**
|
||||
* 跳去新增界面
|
||||
*/
|
||||
public function toAdd(){
|
||||
$id = (int)Input("get.id",0);
|
||||
$m = new M();
|
||||
$this->assign("object",['staffId'=>0,'workStatus'=>1,'staffStatus'=>1]);
|
||||
$m = new R();
|
||||
$this->assign("roles",$m->listQuery());
|
||||
return $this->fetch("add");
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$id = (int)Input("get.id",0);
|
||||
$m = new M();
|
||||
$rs = $m->getById($id);
|
||||
$this->assign("object",$rs);
|
||||
$m = new R();
|
||||
$this->assign("roles",$m->listQuery());
|
||||
return $this->fetch("edit");
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 编辑菜单
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除菜单
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
/**
|
||||
* 检测账号是否重复
|
||||
*/
|
||||
public function checkLoginKey(){
|
||||
$m = new M();
|
||||
return $m->checkLoginKey(input('post.key'));
|
||||
}
|
||||
/**
|
||||
* 编辑自己密码
|
||||
*/
|
||||
public function editMyPass(){
|
||||
$m = new M();
|
||||
return $m->editMyPass((int)session('WST_STAFF.staffId'));
|
||||
}
|
||||
/**
|
||||
* 编辑职员密码
|
||||
*/
|
||||
public function editPass(){
|
||||
$m = new M();
|
||||
return $m->editPass((int)input('post.staffId'));
|
||||
}
|
||||
}
|
33
hyhproject/admin/controller/Styles.php
Executable file
33
hyhproject/admin/controller/Styles.php
Executable file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Styles as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 风格配置控制器
|
||||
*/
|
||||
class Styles extends Base{
|
||||
|
||||
public function index(){
|
||||
$m = new M();
|
||||
$rs = $m->getCats();
|
||||
$m->initStyles();
|
||||
$this->assign('cats',$rs);
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* 获取风格列表
|
||||
*/
|
||||
public function listQueryBySys(){
|
||||
$m = new M();
|
||||
$rs = $m->listQuery();
|
||||
return WSTReturn('',1,$rs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
public function changeStyle(){
|
||||
$m = new M();
|
||||
return $m->changeStyle();
|
||||
}
|
||||
}
|
30
hyhproject/admin/controller/Sysconfigs.php
Executable file
30
hyhproject/admin/controller/Sysconfigs.php
Executable file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\SysConfigs as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 商城配置控制器
|
||||
*/
|
||||
class Sysconfigs extends Base{
|
||||
|
||||
public function index(){
|
||||
$m = new M();
|
||||
$object = $m->getSysConfigs();
|
||||
$this->assign("object",$object);
|
||||
$list = model('admin/staffs')->listQuery();
|
||||
$this->assign("list",$list);
|
||||
$tm = Model('common/Table');
|
||||
$tm->setTable('data_configs');
|
||||
$dataConfigs = $tm->getList([],'*');
|
||||
$this->assign("dataConfigs",$dataConfigs);
|
||||
return $this->fetch("edit");
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
}
|
95
hyhproject/admin/controller/Templatemsgs.php
Executable file
95
hyhproject/admin/controller/Templatemsgs.php
Executable file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\TemplateMsgs as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 消息模板控制器
|
||||
*/
|
||||
class Templatemsgs extends Base{
|
||||
|
||||
public function index(){
|
||||
$this->assign('src',(int)input('src'));
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageMsgQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery(0,'TEMPLATE_SYS'));
|
||||
}
|
||||
/**
|
||||
* 设置是否显示/隐藏
|
||||
*/
|
||||
public function editiIsShow(){
|
||||
$m = new M();
|
||||
$rs = $m->editiIsShow();
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 跳转去新增页面
|
||||
*/
|
||||
public function toEditMsg(){
|
||||
$id = (int)input('id');
|
||||
$m = new M();
|
||||
if($id>0){
|
||||
$data = $m->getById($id);
|
||||
}else{
|
||||
$data = $m->getEModel('template_msgs');
|
||||
}
|
||||
$this->assign('object',$data);
|
||||
return $this->fetch("edit_msg");
|
||||
}
|
||||
/**
|
||||
* 跳转去新增页面
|
||||
*/
|
||||
public function toEditEmail(){
|
||||
$id = (int)input('id');
|
||||
$m = new M();
|
||||
if($id>0){
|
||||
$data = $m->getById($id);
|
||||
}else{
|
||||
$data = $m->getEModel('template_email');
|
||||
}
|
||||
$this->assign('object',$data);
|
||||
return $this->fetch("edit_email");
|
||||
}
|
||||
/**
|
||||
* 跳转去新增页面
|
||||
*/
|
||||
public function toEditSMS(){
|
||||
$id = (int)input('id');
|
||||
$m = new M();
|
||||
if($id>0){
|
||||
$data = $m->getById($id);
|
||||
}else{
|
||||
$data = $m->getEModel('template_sms');
|
||||
}
|
||||
$this->assign('object',$data);
|
||||
return $this->fetch("edit_sms");
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageEmailQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageEmailQuery());
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageSMSQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery(2,'TEMPLATE_SMS'));
|
||||
}
|
||||
|
||||
}
|
59
hyhproject/admin/controller/Userranks.php
Executable file
59
hyhproject/admin/controller/Userranks.php
Executable file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\UserRanks as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 会员等级控制器
|
||||
*/
|
||||
class Userranks extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$m = new M();
|
||||
$assign = ['data'=>$this->get(),
|
||||
'object'=>$m->getById((int)Input("post.id"))];
|
||||
return $this->fetch("edit",$assign);
|
||||
}
|
||||
/*
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById((int)Input("id"));
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
|
||||
|
||||
}
|
253
hyhproject/admin/controller/Users.php
Executable file
253
hyhproject/admin/controller/Users.php
Executable file
@ -0,0 +1,253 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Users as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 会员控制器
|
||||
*/
|
||||
class Users extends Base{
|
||||
/**
|
||||
* 个体认证审核
|
||||
*/
|
||||
public function personalReview(){
|
||||
return $this->fetch("personal_review_list");
|
||||
}
|
||||
/**
|
||||
* 个体认证审核列表
|
||||
*/
|
||||
public function getPersonalReview(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->getReview(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* 个体认证操作
|
||||
*/
|
||||
public function personalAction(){
|
||||
$m = new M();
|
||||
return $m->authAction(1);
|
||||
}
|
||||
/**
|
||||
* 个体认证审核
|
||||
*/
|
||||
public function companyReview(){
|
||||
return $this->fetch("company_review_list");
|
||||
}
|
||||
/**
|
||||
* 个体认证审核列表
|
||||
*/
|
||||
public function getCompanyReview(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->getReview(2));
|
||||
}
|
||||
|
||||
/**
|
||||
* 个体认证操作
|
||||
*/
|
||||
public function companyAction(){
|
||||
$m = new M();
|
||||
return $m->authAction(2);
|
||||
}
|
||||
/**
|
||||
* 获取亲人认证/报备列表
|
||||
*/
|
||||
public function authFamilyList(){
|
||||
$m = Model('AuthFamily');
|
||||
if(1 == (int)input( 'post.isPersonal')){//亲人认证
|
||||
$m->setTable('auth_family_personal');
|
||||
}
|
||||
$where['userId'] = (int)input( 'post.userId');
|
||||
$data = $m->getList($where,'*');
|
||||
return WSTReturn('',1,$data);
|
||||
}
|
||||
/**
|
||||
* 获取亲人认证/报备列表
|
||||
*/
|
||||
public function familyList(){
|
||||
$m = Model('AuthFamily');
|
||||
if(1 == (int)input( 'post.isPersonal')){//亲人认证
|
||||
$m->setTable('auth_family_personal');
|
||||
}
|
||||
$where['userId'] = (int)input( 'post.userId');
|
||||
$data = $m->getList($where,'*');
|
||||
return WSTReturn('',1,$data);
|
||||
}
|
||||
/**
|
||||
* 获取合作人列表
|
||||
*/
|
||||
public function authCompanyList(){
|
||||
$m = Model('Table');
|
||||
$m->setTable('auth_company_partner');
|
||||
$where['userId'] = (int)input( 'post.userId');
|
||||
$where['dataFlag'] = 1;
|
||||
$data = $m->getList($where,'*');
|
||||
return WSTReturn('',1,$data);
|
||||
}
|
||||
/**
|
||||
* 获取银行卡
|
||||
*/
|
||||
public function authCompanyBank(){
|
||||
$m = Model('CompanyBank');
|
||||
$where['userId'] = (int)input( 'post.userId');
|
||||
$data = $m->getList($where,'*');
|
||||
return WSTReturn('',1,$data);
|
||||
}
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 申请列表
|
||||
*/
|
||||
public function userUpdateList(){
|
||||
return $this->fetch("update_list");
|
||||
}
|
||||
/**
|
||||
* 获取申请列表
|
||||
*/
|
||||
public function getUserUpdateList(){
|
||||
$m = new M();
|
||||
$data = $m->getUserUpdateList();
|
||||
return WSTGrid($data);
|
||||
}
|
||||
/**
|
||||
* 申请升级操作
|
||||
*/
|
||||
public function setUserUpdate(){
|
||||
$m = new M();
|
||||
$data = $m->setUserUpdate();
|
||||
exit(json_encode($data));
|
||||
}
|
||||
/**
|
||||
* 查看会员定返数据
|
||||
*/
|
||||
public function viewUserDayData(){
|
||||
return $this->fetch("user_day_list");
|
||||
}
|
||||
/**
|
||||
* 获取申请列表
|
||||
*/
|
||||
public function getViewUserDayData(){
|
||||
$m = new M();
|
||||
$data = $m->getViewUserDayData();
|
||||
return WSTGrid($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$m = new M();
|
||||
$data = $this->get();
|
||||
$assign = ['data'=>$data];
|
||||
return $this->fetch("edit",$assign);
|
||||
}
|
||||
/**
|
||||
* 跳去充值页面
|
||||
*/
|
||||
public function toRecharge(){
|
||||
$m = new M();
|
||||
$data = $this->get();
|
||||
$assign = ['data'=>$data];
|
||||
return $this->fetch("recharge",$assign);
|
||||
}
|
||||
/*
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById((int)Input("id"));
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 充值
|
||||
*/
|
||||
public function recharge(){
|
||||
$m = new M();
|
||||
return $m->recharge();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
public function getUserByKey(){
|
||||
$m = new M();
|
||||
return $m->getUserByKey();
|
||||
}
|
||||
/**********************************************************************************************
|
||||
* 账号管理 *
|
||||
**********************************************************************************************/
|
||||
/**
|
||||
* 账号管理页面
|
||||
*/
|
||||
public function accountIndex(){
|
||||
return $this->fetch("account_list");
|
||||
}
|
||||
/**
|
||||
* 判断账号是否存在
|
||||
*/
|
||||
public function checkLoginKey(){
|
||||
$rs = WSTCheckLoginKey(Input('post.loginName'),Input('post.userId/d',0));
|
||||
if($rs['status']==1){
|
||||
return ['ok'=>$rs['msg']];
|
||||
}else{
|
||||
return ['error'=>$rs['msg']];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
public function changeUserStatus($id, $status){
|
||||
$m = new M();
|
||||
return $m->changeUserStatus($id, $status);
|
||||
}
|
||||
public function editAccount(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 获取所有用户id
|
||||
*/
|
||||
public function getAllUserId()
|
||||
{
|
||||
$m = new M();
|
||||
return $m->getAllUserId();
|
||||
}
|
||||
/**
|
||||
* 重置支付密码
|
||||
*/
|
||||
public function resetPayPwd(){
|
||||
$m = new M();
|
||||
return $m->resetPayPwd();
|
||||
}
|
||||
/**
|
||||
* 导出订单
|
||||
*/
|
||||
public function toExport(){
|
||||
$m = new M();
|
||||
$rs = $m->toExport();
|
||||
$this->assign('rs',$rs);
|
||||
}
|
||||
}
|
42
hyhproject/admin/controller/Userscores.php
Executable file
42
hyhproject/admin/controller/Userscores.php
Executable file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\UserScores as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 积分日志控制器
|
||||
*/
|
||||
class Userscores extends Base{
|
||||
|
||||
public function toUserScores(){
|
||||
$m = new M();
|
||||
$object = $m->getUserInfo();
|
||||
$this->assign("object",$object);
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳去新增界面
|
||||
*/
|
||||
public function toAdd(){
|
||||
$m = new M();
|
||||
$object = $m->getUserInfo();
|
||||
$this->assign("object",$object);
|
||||
return $this->fetch("box");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->addByAdmin();
|
||||
}
|
||||
}
|
24
hyhproject/admin/controller/Wsysconfigs.php
Executable file
24
hyhproject/admin/controller/Wsysconfigs.php
Executable file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\SysConfigs as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 微信配置控制器
|
||||
*/
|
||||
class Wsysconfigs extends Base{
|
||||
|
||||
public function index(){
|
||||
$m = new M();
|
||||
$object = $m->getSysConfigs();
|
||||
$this->assign("object",$object);
|
||||
return $this->fetch("edit");
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit(1);
|
||||
}
|
||||
}
|
87
hyhproject/admin/controller/Wxmenus.php
Executable file
87
hyhproject/admin/controller/Wxmenus.php
Executable file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Wxmenus as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 微信自定义列表控制器
|
||||
*/
|
||||
class Wxmenus extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return $m->pageQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
public function listQuery(){
|
||||
$m = new M();
|
||||
return $m->listQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* 与微信菜单同步
|
||||
*/
|
||||
public function synchroWx(){
|
||||
$m = new M();
|
||||
return $m->synchroWx();
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步到微信菜单
|
||||
*/
|
||||
public function synchroAd(){
|
||||
$m = new M();
|
||||
return $m->synchroAd();
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳去新增/编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$menuId = Input("get.menuId/d",0);
|
||||
$parentId = Input("get.parentId/d",0);
|
||||
$m = new M();
|
||||
if($menuId>0){
|
||||
$object = $m->getById($menuId);
|
||||
}else{
|
||||
$object = $m->getEModel('wx_menus');
|
||||
}
|
||||
$this->assign('menuId',$menuId);
|
||||
$this->assign('parentId',$parentId);
|
||||
$this->assign('object',$object);
|
||||
return $this->fetch("edit");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
}
|
85
hyhproject/admin/controller/Wxpassivereplys.php
Executable file
85
hyhproject/admin/controller/Wxpassivereplys.php
Executable file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\WxPassiveReplys as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 微信被动回复管理控制器
|
||||
*/
|
||||
class Wxpassivereplys extends Base{
|
||||
// 文本消息列表
|
||||
public function text(){
|
||||
return $this->fetch("text");
|
||||
}
|
||||
/**
|
||||
* 获取文本消息分页
|
||||
*/
|
||||
public function textPageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->textPageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去文本消息新增/编辑页面
|
||||
*/
|
||||
public function textEdit(){
|
||||
$id = Input("get.id/d",0);
|
||||
$m = new M();
|
||||
$data = $m->getById($id);
|
||||
$this->assign('data',$data);
|
||||
return $this->fetch("text_edit");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 图文消息列表
|
||||
public function news(){
|
||||
return $this->fetch("news");
|
||||
}
|
||||
/**
|
||||
* 获取图文消息分页
|
||||
*/
|
||||
public function newsPageQuery(){
|
||||
$m = new M();
|
||||
return $m->newsPageQuery();
|
||||
}
|
||||
/**
|
||||
* 跳去图文消息新增/编辑页面
|
||||
*/
|
||||
public function newsEdit(){
|
||||
$id = Input("get.id/d",0);
|
||||
$m = new M();
|
||||
$data = $m->getById($id);
|
||||
$this->assign('data',$data);
|
||||
return $this->fetch("news_edit");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
public function sendNews(){
|
||||
$wx = WXAdmin();
|
||||
$wx->_doText();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
}
|
49
hyhproject/admin/controller/Wxtemplatemsgs.php
Executable file
49
hyhproject/admin/controller/Wxtemplatemsgs.php
Executable file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\TemplateMsgs as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 微信消息模板控制器
|
||||
*/
|
||||
class Wxtemplatemsgs extends Base{
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery(3,'TEMPLATE_WX'));
|
||||
}
|
||||
/**
|
||||
* 跳转去新增页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$id = (int)input('id');
|
||||
$m = new M();
|
||||
if($id>0){
|
||||
$data = $m->getById($id);
|
||||
}else{
|
||||
$data = $m->getEModel('template_msgs');
|
||||
}
|
||||
$this->assign('object',$data);
|
||||
return $this->fetch("edit");
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
*/
|
||||
public function edit(){
|
||||
return model('WxTemplateParams')->edit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取参数列表
|
||||
*/
|
||||
public function listQuery(){
|
||||
return model('WxTemplateParams')->listQuery((int)input('post.parentId'));
|
||||
}
|
||||
|
||||
}
|
53
hyhproject/admin/controller/Wxusers.php
Executable file
53
hyhproject/admin/controller/Wxusers.php
Executable file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Wxusers as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 微信用户控制器
|
||||
*/
|
||||
class Wxusers extends Base{
|
||||
public function recodeUnionId(){
|
||||
$m = new M();
|
||||
return json_encode($m->recodeUnionId());
|
||||
}
|
||||
|
||||
public function index(){
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return $m->pageQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* 与微信用户管理同步
|
||||
*/
|
||||
public function synchroWx(){
|
||||
$m = new M();
|
||||
return $m->synchroWx();
|
||||
}
|
||||
public function wxLoad(){
|
||||
$m = new M();
|
||||
return $m->wxLoad();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定对象
|
||||
*/
|
||||
public function getById(){
|
||||
$m = new M();
|
||||
return $m->getById((int)input('id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user