mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-15 04:52:50 +00:00
后台升级
This commit is contained in:
parent
eababc3fdf
commit
ba6917448a
@ -19,19 +19,19 @@ return [
|
||||
// 是否自动开启 SESSION
|
||||
'auto_start' => true,
|
||||
],
|
||||
'app_debug' => false,
|
||||
'app_debug' => true,
|
||||
// 应用Trace
|
||||
'app_trace' => false,
|
||||
|
||||
'exception_handle' =>\basic\AdminException::class,
|
||||
'exception_handle' => app\admin\controller\AdminException::class,
|
||||
'empty_controller' =>'Index',
|
||||
// 视图输出字符串内容替换
|
||||
'view_replace_str' => [
|
||||
'{__ADMIN_PATH}' => PUBILC_PATH.'system/',//后台
|
||||
'{__FRAME_PATH}' => PUBILC_PATH.'system/frame/',//H+框架
|
||||
'{__PLUG_PATH}' => PUBILC_PATH.'static/plug/',//前后台通用
|
||||
'{__MODULE_PATH}' => PUBILC_PATH.'system/module/',//后台功能模块
|
||||
'{__STATIC_PATH}' => PUBILC_PATH.'static/',//全站通用
|
||||
'{__PUBLIC_PATH}' => PUBILC_PATH,//静态资源路径
|
||||
'{__PUBLIC_PATH}' => PUBILC_PATH, //public 目录
|
||||
'{__STATIC_PATH}' => PUBILC_PATH.'static/', //全局静态目录
|
||||
'{__PLUG_PATH}' => PUBILC_PATH.'static/plug/', //全局静态插件
|
||||
'{__ADMIN_PATH}' => PUBILC_PATH.'system/', //后台目录
|
||||
'{__FRAME_PATH}' => PUBILC_PATH.'system/frame/', //后台框架
|
||||
'{__MODULE_PATH}' => PUBILC_PATH.'system/module/',//后台模块
|
||||
]
|
||||
];
|
||||
|
||||
57
application/admin/controller/AdminException.php
Normal file
57
application/admin/controller/AdminException.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author: xaboy<365615158@qq.com>
|
||||
* @day: 2018/01/10
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
|
||||
use Exception;
|
||||
use service\JsonService;
|
||||
use think\exception\Handle;
|
||||
use think\exception\HttpException;
|
||||
use think\exception\ValidateException;
|
||||
use think\Log;
|
||||
use think\Request;
|
||||
use think\Url;
|
||||
|
||||
/**后台异常处理
|
||||
* Class AdminException
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class AdminException extends Handle
|
||||
{
|
||||
|
||||
public function render(Exception $e){
|
||||
// 参数验证错误
|
||||
if ($e instanceof ValidateException) {
|
||||
return json($e->getError(), 422);
|
||||
}
|
||||
// 请求异常
|
||||
if ($e instanceof HttpException && request()->isAjax()) {
|
||||
return JsonService::fail('系统错误');
|
||||
}else{
|
||||
if(config("app_debug")==true){ //如是开启调试,就走原来的方法
|
||||
return parent::render($e);
|
||||
}else {
|
||||
$title = '系统错误';
|
||||
$msg = addslashes($e->getMessage());
|
||||
$this->recordErrorLog($e);
|
||||
exit(view('public/500', compact('title', 'msg'))->getContent());
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 将异常写入日志
|
||||
*/
|
||||
private function recordErrorLog(Exception $e) {
|
||||
Log::init([
|
||||
'type' => 'File',
|
||||
'path' => LOG_PATH,
|
||||
'level' => ['error'],
|
||||
]);
|
||||
Log::record($e->getMessage(), 'error');
|
||||
}
|
||||
}
|
||||
@ -4,9 +4,8 @@ namespace app\admin\controller;
|
||||
|
||||
use app\admin\model\system\SystemAdmin;
|
||||
use app\admin\model\system\SystemMenus;
|
||||
use app\admin\model\system\SystemRole;
|
||||
use basic\SystemBasic;
|
||||
use behavior\system\SystemBehavior;
|
||||
use app\admin\model\system\SystemRole;;
|
||||
use behavior\admin\SystemBehavior;
|
||||
use service\HookService;
|
||||
use think\Url;
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ class Index extends AuthController
|
||||
->count();
|
||||
//库存预警
|
||||
$replenishment_num = SystemConfig::getValue('store_stock') > 0 ? SystemConfig::getValue('store_stock') : 20;//库存预警界限
|
||||
$topData['stockProduct'] = StoreProduct::where('stock','<=',$replenishment_num)->where('is_del',0)->count();
|
||||
$topData['stockProduct'] = StoreProduct::where('stock','<=',$replenishment_num)->where('is_show',1)->where('is_del',0)->count();
|
||||
//待处理提现
|
||||
$topData['treatedExtract'] = UserExtractModel::where('status',0)->count();
|
||||
|
||||
@ -567,7 +567,7 @@ class Index extends AuthController
|
||||
$data = [];
|
||||
$data['ordernum'] = StoreOrderModel::statusByWhere(1)->count();//待发货
|
||||
$replenishment_num = SystemConfig::getValue('store_stock') > 0 ? SystemConfig::getValue('store_stock') : 2;//库存预警界限
|
||||
$data['inventory'] = ProductModel::where('stock','<=',$replenishment_num)->where('is_del',0)->count();//库存
|
||||
$data['inventory'] = ProductModel::where('stock','<=',$replenishment_num)->where('is_show',1)->where('is_del',0)->count();//库存
|
||||
$data['commentnum'] = StoreProductReplyModel::where('is_reply',0)->count();//评论
|
||||
$data['reflectnum'] = UserExtractModel::where('status',0)->count();;//提现
|
||||
$data['msgcount'] = intval($data['ordernum'])+intval($data['inventory'])+intval($data['commentnum'])+intval($data['reflectnum']);
|
||||
|
||||
117
application/admin/controller/SystemBasic.php
Normal file
117
application/admin/controller/SystemBasic.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author: xaboy<365615158@qq.com>
|
||||
* @day: 2017/10/09
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use service\JsonService;
|
||||
use think\Controller;
|
||||
|
||||
|
||||
class SystemBasic extends Controller
|
||||
{
|
||||
/**
|
||||
* 操作失败提示框
|
||||
* @param string $msg 提示信息
|
||||
* @param string $backUrl 跳转地址
|
||||
* @param string $title 标题
|
||||
* @param int $duration 持续时间
|
||||
* @return mixed
|
||||
*/
|
||||
protected function failedNotice($msg = '操作失败', $backUrl = 0, $info = '', $duration = 3)
|
||||
{
|
||||
$type = 'error';
|
||||
$this->assign(compact('msg','backUrl','info','duration','type'));
|
||||
return $this->fetch('public/notice');
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败提示一直持续
|
||||
* @param $msg
|
||||
* @param int $backUrl
|
||||
* @param string $title
|
||||
* @return mixed
|
||||
*/
|
||||
protected function failedNoticeLast($msg = '操作失败', $backUrl = 0, $info = '')
|
||||
{
|
||||
return $this->failedNotice($msg,$backUrl,$info,0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作成功提示框
|
||||
* @param string $msg 提示信息
|
||||
* @param string $backUrl 跳转地址
|
||||
* @param string $title 标题
|
||||
* @param int $duration 持续时间
|
||||
* @return mixed
|
||||
*/
|
||||
protected function successfulNotice($msg = '操作成功',$backUrl = 0,$info = '',$duration = 3)
|
||||
{
|
||||
$type = 'success';
|
||||
$this->assign(compact('msg','backUrl','info','duration','type'));
|
||||
return $this->fetch('public/notice');
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功提示一直持续
|
||||
* @param $msg
|
||||
* @param int $backUrl
|
||||
* @param string $title
|
||||
* @return mixed
|
||||
*/
|
||||
protected function successfulNoticeLast($msg = '操作成功',$backUrl = 0,$info = '')
|
||||
{
|
||||
return $this->successfulNotice($msg,$backUrl,$info,0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 错误提醒页面
|
||||
* @param string $msg
|
||||
* @param int $url
|
||||
*/
|
||||
protected function failed($msg = '哎呀…亲…您访问的页面出现错误', $url = 0)
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
exit(JsonService::fail($msg,$url)->getContent());
|
||||
}else{
|
||||
$this->assign(compact('msg','url'));
|
||||
exit($this->fetch('public/error'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功提醒页面
|
||||
* @param string $msg
|
||||
* @param int $url
|
||||
*/
|
||||
protected function successful($msg, $url = 0)
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
exit(JsonService::successful($msg,$url)->getContent());
|
||||
}else{
|
||||
$this->assign(compact('msg','url'));
|
||||
exit($this->fetch('public/success'));
|
||||
}
|
||||
}
|
||||
/**异常抛出
|
||||
* @param $name
|
||||
*/
|
||||
protected function exception($msg = '无法打开页面')
|
||||
{
|
||||
$this->assign(compact('msg'));
|
||||
exit($this->fetch('public/exception'));
|
||||
}
|
||||
|
||||
/**找不到页面
|
||||
* @param $name
|
||||
*/
|
||||
public function _empty($name)
|
||||
{
|
||||
exit($this->fetch('public/404'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -75,7 +75,7 @@ class AgentManage extends AuthController
|
||||
->order('u.add_time DESC')
|
||||
->select()
|
||||
->toArray();
|
||||
foreach ($list as $key=>$value) $list[$key]['orderCount'] = StoreOrder::getOrderCount($value['uid']);
|
||||
foreach ($list as $key=>$value) $list[$key]['orderCount'] = StoreOrder::getOrderCount($value['uid'])?:0;
|
||||
$this->assign('list',$list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
1
application/admin/controller/order/combinationOrder.php
Normal file
1
application/admin/controller/order/combinationOrder.php
Normal file
File diff suppressed because one or more lines are too long
@ -174,13 +174,13 @@ class SystemAdmin extends AuthController
|
||||
/**
|
||||
* 个人资料 展示
|
||||
* */
|
||||
public function admininfo(){
|
||||
public function adminInfo(){
|
||||
$adminInfo = $this->adminInfo;//获取当前登录的管理员
|
||||
$this->assign('adminInfo',$adminInfo);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**保存个人资料
|
||||
/**保存信息
|
||||
* @param Request $request
|
||||
*/
|
||||
public function setAdminInfo(Request $request){
|
||||
|
||||
@ -38,7 +38,8 @@ class SystemMenus extends AuthController
|
||||
['pid',$pid]
|
||||
],$this->request);
|
||||
$this->assign(MenusModel::getAdminPage($params));
|
||||
$this->assign(compact('params'));
|
||||
$addurl = Url::build('create',['cid'=>input('pid')]);
|
||||
$this->assign(compact('params','addurl'));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
@ -50,7 +51,9 @@ class SystemMenus extends AuthController
|
||||
*/
|
||||
public function create($cid = 0)
|
||||
{
|
||||
$form = Form::create(Url::build('save'),[
|
||||
$controller = '';
|
||||
if($cid)$controller = MenusModel::where('id',$cid)->value('controller')?:'';
|
||||
$field = [
|
||||
Form::input('menu_name','按钮名称')->required('按钮名称必填'),
|
||||
Form::select('pid','父级id',$cid)->setOptions(function(){
|
||||
$list = (Util::sortListTier(MenusModel::all()->toArray(),'顶级','pid','menu_name'));
|
||||
@ -61,14 +64,14 @@ class SystemMenus extends AuthController
|
||||
return $menus;
|
||||
})->filterable(1),
|
||||
Form::select('module','模块名')->options([['label'=>'总后台','value'=>'admin']]),
|
||||
Form::input('controller','控制器名'),
|
||||
Form::input('controller','控制器名',$controller),
|
||||
Form::input('action','方法名'),
|
||||
Form::input('params','参数')->placeholder('举例:a/123/b/234'),
|
||||
Form::frameInputOne('icon','图标',Url::build('admin/widget.widgets/icon',array('fodder'=>'icon')))->icon('ionic'),
|
||||
Form::number('sort','排序',0),
|
||||
Form::radio('is_show','是否菜单',1)->options([['value'=>0,'label'=>'隐藏'],['value'=>1,'label'=>'显示(菜单只显示三级)']]),
|
||||
]);
|
||||
$form->setMethod('post')->setTitle('添加权限');
|
||||
Form::radio('is_show','是否菜单',0)->options([['value'=>0,'label'=>'隐藏'],['value'=>1,'label'=>'显示(菜单只显示三级)']])
|
||||
];
|
||||
$form = Form::make_post_form('添加权限',$field,Url::build('save'),3);
|
||||
$this->assign(compact('form'));
|
||||
return $this->fetch('public/form-builder');
|
||||
}
|
||||
@ -107,7 +110,7 @@ class SystemMenus extends AuthController
|
||||
{
|
||||
$menu = MenusModel::get($id);
|
||||
if(!$menu) return Json::fail('数据不存在!');
|
||||
$form = Form::create(Url::build('update',array('id'=>$id)),[
|
||||
$field = [
|
||||
Form::input('menu_name','按钮名称',$menu['menu_name']),
|
||||
Form::select('pid','父级id',(string)$menu->getData('pid'))->setOptions(function()use($id){
|
||||
$list = (Util::sortListTier(MenusModel::where('id','<>',$id)->select()->toArray(),'顶级','pid','menu_name'));
|
||||
@ -117,15 +120,15 @@ class SystemMenus extends AuthController
|
||||
}
|
||||
return $menus;
|
||||
})->filterable(1),
|
||||
Form::select('module','模块名',$menu['module'])->options([['label'=>'总后台','value'=>'admin'],['label'=>'总后台1','value'=>'admin1']]),
|
||||
Form::select('module','模块名',$menu['module'])->options([['label'=>'总后台','value'=>'admin']]),
|
||||
Form::input('controller','控制器名',$menu['controller']),
|
||||
Form::input('action','方法名',$menu['action']),
|
||||
Form::input('params','参数',MenusModel::paramStr($menu['params']))->placeholder('举例:a/123/b/234'),
|
||||
Form::frameInputOne('icon','图标',Url::build('admin/widget.widgets/icon',array('fodder'=>'icon')),$menu['icon'])->icon('ionic'),
|
||||
Form::number('sort','排序',$menu['sort']),
|
||||
Form::radio('is_show','是否菜单',$menu['is_show'])->options([['value'=>0,'label'=>'隐藏'],['value'=>1,'label'=>'显示(菜单只显示三级)']])
|
||||
]);
|
||||
$form->setMethod('post')->setTitle('编辑权限');
|
||||
];
|
||||
$form = Form::make_post_form('添加权限',$field,Url::build('update',array('id'=>$id)),3);
|
||||
$this->assign(compact('form'));
|
||||
return $this->fetch('public/form-builder');
|
||||
}
|
||||
|
||||
@ -72,6 +72,7 @@ class StoreProduct extends AuthController
|
||||
['store_name',''],
|
||||
['cate_id',''],
|
||||
['excel',0],
|
||||
['order',''],
|
||||
['type',$this->request->param('type')]
|
||||
]);
|
||||
return JsonService::successlayui(ProductModel::ProductList($where));
|
||||
@ -138,27 +139,22 @@ class StoreProduct extends AuthController
|
||||
$menus[] = ['value'=>$menu['id'],'label'=>$menu['html'].$menu['cate_name'],'disabled'=>$menu['pid']== 0];//,'disabled'=>$menu['pid']== 0];
|
||||
}
|
||||
return $menus;
|
||||
})->filterable(1)->multiple(1)->required(),
|
||||
Form::input('store_name','产品名称')->col(Form::col(24))->validateFn(function($validate){
|
||||
$validate->min(5)->max(32);
|
||||
})->required(),
|
||||
})->filterable(1)->multiple(1),
|
||||
Form::input('store_name','产品名称')->col(Form::col(24)),
|
||||
Form::input('store_info','产品简介')->type('textarea'),
|
||||
Form::input('keyword','产品关键字')->placeholder('多个用英文状态下的逗号隔开'),
|
||||
Form::input('unit_name','产品单位','件')->required(),
|
||||
Form::frameImageOne('image','产品主图片(305*305px)',Url::build('admin/widget.images/index',array('fodder'=>'image')))->icon('image')->width('100%')->height('500px')->required(),
|
||||
Form::frameImages('slider_image','产品轮播图(640*640px)',Url::build('admin/widget.images/index',array('fodder'=>'slider_image')))->maxLength(5)->icon('images')->width('100%')->height('500px')->spin(0)
|
||||
->required()->validateFn(function($validate){
|
||||
$validate->min(1)->max(5);
|
||||
}),
|
||||
Form::number('price','产品售价')->min(0)->col(8)->required(),
|
||||
Form::input('unit_name','产品单位','件'),
|
||||
Form::frameImageOne('image','产品主图片(305*305px)',Url::build('admin/widget.images/index',array('fodder'=>'image')))->icon('image')->width('100%')->height('500px'),
|
||||
Form::frameImages('slider_image','产品轮播图(640*640px)',Url::build('admin/widget.images/index',array('fodder'=>'slider_image')))->maxLength(5)->icon('images')->width('100%')->height('500px')->spin(0),
|
||||
Form::number('price','产品售价')->min(0)->col(8),
|
||||
Form::number('ot_price','产品市场价')->min(0)->col(8),
|
||||
Form::number('give_integral','赠送积分')->min(0)->precision(0)->col(8),
|
||||
Form::number('postage','邮费')->min(0)->col(Form::col(8))->required(),
|
||||
Form::number('postage','邮费')->min(0)->col(Form::col(8)),
|
||||
Form::number('sales','销量',0)->min(0)->precision(0)->col(8)->readonly(1),
|
||||
Form::number('ficti','虚拟销量')->min(0)->precision(0)->col(8),
|
||||
Form::number('stock','库存')->min(0)->precision(0)->col(8)->required(),
|
||||
Form::number('stock','库存')->min(0)->precision(0)->col(8),
|
||||
Form::number('cost','产品成本价')->min(0)->col(8),
|
||||
Form::number('sort','排序',0)->col(8)->required(),
|
||||
Form::number('sort','排序')->col(8),
|
||||
Form::radio('is_show','产品状态',0)->options([['label'=>'上架','value'=>1],['label'=>'下架','value'=>0]])->col(8),
|
||||
Form::radio('is_hot','热卖单品',0)->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8),
|
||||
Form::radio('is_benefit','促销单品',0)->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8),
|
||||
@ -204,13 +200,13 @@ class StoreProduct extends AuthController
|
||||
['unit_name','件'],
|
||||
['image',[]],
|
||||
['slider_image',[]],
|
||||
'postage',
|
||||
'ot_price',
|
||||
'price',
|
||||
'sort',
|
||||
'stock',
|
||||
['postage',0],
|
||||
['ot_price',0],
|
||||
['price',0],
|
||||
['sort',0],
|
||||
['stock',100],
|
||||
'sales',
|
||||
'ficti',
|
||||
['ficti',100],
|
||||
['give_integral',0],
|
||||
['is_show',0],
|
||||
['cost',0],
|
||||
@ -224,17 +220,11 @@ class StoreProduct extends AuthController
|
||||
if(count($data['cate_id']) < 1) return Json::fail('请选择产品分类');
|
||||
$data['cate_id'] = implode(',',$data['cate_id']);
|
||||
if(!$data['store_name']) return Json::fail('请输入产品名称');
|
||||
// if(!$data['store_info']) return Json::fail('请输入产品简介');
|
||||
// if(!$data['keyword']) return Json::fail('请输入产品关键字');
|
||||
if(count($data['image'])<1) return Json::fail('请上传产品图片');
|
||||
if(count($data['slider_image'])<1) return Json::fail('请上传产品轮播图');
|
||||
if($data['price'] == '' || $data['price'] < 0) return Json::fail('请输入产品售价');
|
||||
if($data['ot_price'] == '' || $data['ot_price'] < 0) return Json::fail('请输入产品市场价');
|
||||
if($data['postage'] == '' || $data['postage'] < 0) return Json::fail('请输入邮费');
|
||||
if($data['stock'] == '' || $data['stock'] < 0) return Json::fail('请输入库存');
|
||||
if($data['cost'] == '' || $data['ot_price'] < 0) return Json::fail('请输入产品成本价');
|
||||
if($data['sales'] == '' || $data['sales'] < 0) return Json::fail('请输入销量');
|
||||
if($data['give_integral'] < 0) return Json::fail('请输入赠送积分');
|
||||
$data['image'] = $data['image'][0];
|
||||
$data['slider_image'] = json_encode($data['slider_image']);
|
||||
$data['add_time'] = time();
|
||||
@ -322,13 +312,12 @@ class StoreProduct extends AuthController
|
||||
['unit_name','件'],
|
||||
['image',[]],
|
||||
['slider_image',[]],
|
||||
'postage',
|
||||
'ot_price',
|
||||
'price',
|
||||
'sort',
|
||||
'stock',
|
||||
// 'sales',
|
||||
'ficti',
|
||||
['postage',0],
|
||||
['ot_price',0],
|
||||
['price',0],
|
||||
['sort',0],
|
||||
['stock',0],
|
||||
['ficti',100],
|
||||
['give_integral',0],
|
||||
['is_show',0],
|
||||
['cost',0],
|
||||
@ -342,18 +331,12 @@ class StoreProduct extends AuthController
|
||||
if(count($data['cate_id']) < 1) return Json::fail('请选择产品分类');
|
||||
$data['cate_id'] = implode(',',$data['cate_id']);
|
||||
if(!$data['store_name']) return Json::fail('请输入产品名称');
|
||||
// if(!$data['store_info']) return Json::fail('请输入产品简介');
|
||||
// if(!$data['keyword']) return Json::fail('请输入产品关键字');
|
||||
if(count($data['image'])<1) return Json::fail('请上传产品图片');
|
||||
if(count($data['slider_image'])<1) return Json::fail('请上传产品轮播图');
|
||||
if(count($data['slider_image'])>5) return Json::fail('轮播图最多5张图');
|
||||
if($data['price'] == '' || $data['price'] < 0) return Json::fail('请输入产品售价');
|
||||
if($data['ot_price'] == '' || $data['ot_price'] < 0) return Json::fail('请输入产品市场价');
|
||||
if($data['postage'] == '' || $data['postage'] < 0) return Json::fail('请输入邮费');
|
||||
if($data['cost'] == '' || $data['cost'] < 0) return Json::fail('请输入产品成本价');
|
||||
if($data['stock'] == '' || $data['stock'] < 0) return Json::fail('请输入库存');
|
||||
// if($data['sales'] == '' || $data['sales'] < 0) return Json::fail('请输入销量');
|
||||
if($data['give_integral'] < 0) return Json::fail('请输入赠送积分');
|
||||
$data['image'] = $data['image'][0];
|
||||
$data['slider_image'] = json_encode($data['slider_image']);
|
||||
ProductModel::edit($data,$id);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -32,10 +32,15 @@ class WechatTemplate extends AuthController
|
||||
$this->assign('where',$where);
|
||||
$this->assign(WechatTemplateModel::SystemPage($where));
|
||||
$industry = Cache::tag($this->cacheTag)->remember('_wechat_industry',function(){
|
||||
$cache = WechatTemplateService::getIndustry();
|
||||
if(!$cache) return [];
|
||||
Cache::tag($this->cacheTag,['_wechat_industry']);
|
||||
return $cache->toArray();
|
||||
try{
|
||||
$cache = WechatTemplateService::getIndustry();
|
||||
if(!$cache) return [];
|
||||
Cache::tag($this->cacheTag,['_wechat_industry']);
|
||||
return $cache->toArray();
|
||||
}catch (\Exception $e){
|
||||
return $e->getMessage();
|
||||
}
|
||||
|
||||
},0)?:[];
|
||||
!is_array($industry) && $industry = [];
|
||||
$this->assign('industry',$industry);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -65,7 +65,8 @@ class StoreProduct extends ModelBasic
|
||||
$data = ['p.is_show'=>1,'p.is_del'=>0,'pav.stock|p.stock'=>0];
|
||||
break;
|
||||
case 5:
|
||||
$data = ['p.is_show'=>1,'p.is_del'=>0,'pav.stock|p.stock'=>['elt',1]];
|
||||
$min = SystemConfig::getValue('store_stock');
|
||||
$data = ['p.is_show'=>1,'p.is_del'=>0,'pav.stock|p.stock'=>['elt',$min]];
|
||||
break;
|
||||
case 6:
|
||||
$data = ['p.is_del'=>1];
|
||||
|
||||
@ -10,7 +10,7 @@ namespace app\admin\model\system;
|
||||
|
||||
use traits\ModelTrait;
|
||||
use basic\ModelBasic;
|
||||
use behavior\system\SystemBehavior;
|
||||
use behavior\admin\SystemBehavior;
|
||||
use service\HookService;
|
||||
use think\Session;
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -22,7 +22,13 @@ class UserBill extends ModelBasic
|
||||
{
|
||||
return time();
|
||||
}
|
||||
|
||||
//修改积分减少积分记录
|
||||
public static function expend($title,$uid,$category,$type,$number,$link_id = 0,$balance = 0,$mark = '',$status = 1)
|
||||
{
|
||||
$pm = 0;
|
||||
return self::set(compact('title','uid','link_id','category','type','number','balance','mark','status','pm'));
|
||||
}
|
||||
//修改积分增加积分记录
|
||||
public static function income($title,$uid,$category,$type,$number,$link_id = 0,$balance = 0,$mark = '',$status = 1){
|
||||
$pm = 1;
|
||||
return self::set(compact('title','uid','link_id','category','type','number','balance','mark','status','pm'));
|
||||
|
||||
@ -50,15 +50,17 @@ class UserExtract extends ModelBasic
|
||||
$status = -1;
|
||||
$User= User::find(['uid'=>$uid])->toArray();
|
||||
UserBill::income('提现失败',$uid,'now_money','extract',$extract_number,$id,$User['now_money'],$mark);
|
||||
|
||||
User::bcInc($uid,'now_money',$extract_number,'uid');
|
||||
WechatTemplateService::sendTemplate(WechatUser::uidToOpenid($uid),WechatTemplateService::USER_BALANCE_CHANGE,[
|
||||
'first'=> $mark,
|
||||
'keyword1'=>'佣金提现',
|
||||
'keyword2'=>date('Y-m-d H:i:s',time()),
|
||||
'keyword3'=>$extract_number,
|
||||
'remark'=>'错误原因:'.$fail_msg
|
||||
],Url::build('wap/my/user_pro',[],true,true));
|
||||
if($User['user_type'] == 'wechat'){
|
||||
WechatTemplateService::sendTemplate(WechatUser::uidToOpenid($uid),WechatTemplateService::USER_BALANCE_CHANGE,[
|
||||
'first'=> $mark,
|
||||
'keyword1'=>'佣金提现',
|
||||
'keyword2'=>date('Y-m-d H:i:s',time()),
|
||||
'keyword3'=>$extract_number,
|
||||
'remark'=>'错误原因:'.$fail_msg
|
||||
],Url::build('wap/my/user_pro',[],true,true));
|
||||
}
|
||||
|
||||
return self::edit(compact('fail_time','fail_msg','status'),$id);
|
||||
}
|
||||
|
||||
@ -69,13 +71,16 @@ class UserExtract extends ModelBasic
|
||||
$extract_number=$data['extract_price'];
|
||||
$mark='成功提现佣金'.$extract_number.'元';
|
||||
$uid=$data['uid'];
|
||||
WechatTemplateService::sendTemplate(WechatUser::uidToOpenid($uid),WechatTemplateService::USER_BALANCE_CHANGE,[
|
||||
'first'=> $mark,
|
||||
'keyword1'=>'佣金提现',
|
||||
'keyword2'=>date('Y-m-d H:i:s',time()),
|
||||
'keyword3'=>$extract_number,
|
||||
'remark'=>'点击查看我的佣金明细'
|
||||
],Url::build('wap/my/user_pro',[],true,true));
|
||||
$User= User::find(['uid'=>$uid])->toArray();
|
||||
if($User['user_type'] == 'wechat') {
|
||||
WechatTemplateService::sendTemplate(WechatUser::uidToOpenid($uid), WechatTemplateService::USER_BALANCE_CHANGE, [
|
||||
'first' => $mark,
|
||||
'keyword1' => '佣金提现',
|
||||
'keyword2' => date('Y-m-d H:i:s', time()),
|
||||
'keyword3' => $extract_number,
|
||||
'remark' => '点击查看我的佣金明细'
|
||||
], Url::build('wap/my/user_pro', [], true, true));
|
||||
}
|
||||
return self::edit(compact('status'),$id);
|
||||
}
|
||||
//测试数据
|
||||
|
||||
@ -215,7 +215,11 @@ use service\SystemConfigService;
|
||||
->ExcelSave();
|
||||
}
|
||||
return self::page($model,function ($item){
|
||||
$item['qr_code'] = QrcodeService::getForeverQrcode('spread',$item['uid']);
|
||||
try{
|
||||
$item['qr_code'] = QrcodeService::getForeverQrcode('spread',$item['uid']);
|
||||
}catch (\Exception $e){
|
||||
$item['qr_code'] = '';
|
||||
}
|
||||
$item['extract_count_price'] = UserExtract::getUserCountPrice($item['uid']);//累计提现
|
||||
$item['extract_count_num'] = UserExtract::getUserCountNum($item['uid']);//提现次数
|
||||
},$where);
|
||||
|
||||
@ -10,10 +10,10 @@
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row show-grid">
|
||||
<div class="col-xs-6" >用户昵称: {$userInfo.nickname}</div>
|
||||
<div class="col-xs-6">收货人: {$orderInfo.real_name}</div>
|
||||
<div class="col-xs-6">联系电话: {$orderInfo.user_phone}</div>
|
||||
<div class="col-xs-6">收货地址: {$orderInfo.user_address}</div>
|
||||
<div class="col-xs-12" >用户昵称: {$userInfo.nickname}</div>
|
||||
<div class="col-xs-12">收货人: {$orderInfo.real_name}</div>
|
||||
<div class="col-xs-12">联系电话: {$orderInfo.user_phone}</div>
|
||||
<div class="col-xs-12">收货地址: {$orderInfo.user_address}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -46,11 +46,12 @@
|
||||
<div class="col-xs-6">商品总数: {$orderInfo.total_num}</div>
|
||||
<div class="col-xs-6">商品总价: ¥{$orderInfo.total_price}</div>
|
||||
<div class="col-xs-6">支付邮费: ¥{$orderInfo.total_postage}</div>
|
||||
<div class="col-xs-6">优惠券金额: ¥{$orderInfo.coupon_price}</div>
|
||||
<div class="col-xs-6">实际支付: ¥{$orderInfo.pay_price}</div>
|
||||
{if condition="$orderInfo['refund_price'] GT 0"}
|
||||
<div class="col-xs-6" style="color: #f1a417">退款金额: ¥{$orderInfo.refund_price}</div>
|
||||
{/if}
|
||||
{if condition="$orderInfo['deduction_price'] GT 0"}
|
||||
{if condition="$orderInfo['use_integral'] GT 0"}
|
||||
<div class="col-xs-6" style="color: #f1a417">使用积分: {$orderInfo.use_integral}积分(抵扣了¥{$orderInfo.deduction_price})</div>
|
||||
{/if}
|
||||
{if condition="$orderInfo['back_integral'] GT 0"}
|
||||
@ -59,15 +60,15 @@
|
||||
<div class="col-xs-6">创建时间: {$orderInfo.add_time|date="Y/m/d H:i",###}</div>
|
||||
<div class="col-xs-6">支付方式:
|
||||
{if condition="$orderInfo['paid'] eq 1"}
|
||||
{if condition="$orderInfo['pay_type'] eq 'weixin'"}
|
||||
微信支付
|
||||
{elseif condition="$orderInfo['pay_type'] eq 'yue'"}
|
||||
余额支付
|
||||
{elseif condition="$orderInfo['pay_type'] eq 'offline'"}
|
||||
线下支付
|
||||
{else/}
|
||||
其他支付
|
||||
{/if}
|
||||
{if condition="$orderInfo['pay_type'] eq 'weixin'"}
|
||||
微信支付
|
||||
{elseif condition="$orderInfo['pay_type'] eq 'yue'"}
|
||||
余额支付
|
||||
{elseif condition="$orderInfo['pay_type'] eq 'offline'"}
|
||||
线下支付
|
||||
{else/}
|
||||
其他支付
|
||||
{/if}
|
||||
{else/}
|
||||
{if condition="$orderInfo['pay_type'] eq 'offline'"}
|
||||
线下支付
|
||||
@ -80,8 +81,9 @@
|
||||
<div class="col-xs-6">支付时间: {$orderInfo.pay_time|date="Y/m/d H:i",###}</div>
|
||||
{/notempty}
|
||||
<div class="col-xs-6" style="color: #ff0005">用户备注: {$orderInfo.mark?:'无'}</div>
|
||||
<div class="col-xs-6" style="color: #733b5c">商家备注: {$orderInfo.remark?:'无'}</div>
|
||||
<div class="col-xs-6" style="color: #733AF9">推广人: {if $spread}{$spread}{else}无{/if}</div>
|
||||
<div class="col-xs-6" style="color: #733b5c">商家备注: {$orderInfo.remark?:'无'}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<script src="https://cdn.jsdelivr.net/npm/iview@2.14.3/dist/iview.min.js"></script>
|
||||
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/form-create/district/province_city.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/form-create@1.5.1/dist/form-create.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/form-create@1.5.4/dist/form-create.min.js"></script>
|
||||
<style>
|
||||
/*弹框样式修改*/
|
||||
.ivu-modal-body{padding: 5;}
|
||||
|
||||
131
application/admin/view/setting/system_admin/admin_info.php
Normal file
131
application/admin/view/setting/system_admin/admin_info.php
Normal file
@ -0,0 +1,131 @@
|
||||
{extend name="public/container"}
|
||||
{block name="head"}
|
||||
<style>
|
||||
label.error{
|
||||
color: #a94442;
|
||||
margin-bottom: 0;
|
||||
display: inline-block;
|
||||
font: normal normal normal 14px/1 FontAwesome;
|
||||
font-size: inherit;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
</style>
|
||||
<link href="{__FRAME_PATH}css/plugins/iCheck/custom.css" rel="stylesheet">
|
||||
<script src="{__ADMIN_PATH}plug/validate/jquery.validate.js"></script>
|
||||
<script src="{__ADMIN_PATH}frame/js/plugins/iCheck/icheck.min.js"></script>
|
||||
<script src="{__ADMIN_PATH}frame/js/ajaxfileupload.js"></script>
|
||||
{/block}
|
||||
{block name="content"}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox">
|
||||
<div class="ibox-title">
|
||||
<div class="text-left">个人资料</div>
|
||||
<div class="ibox-tools">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<form method="post" class="form-horizontal" id="signupForm" action="">
|
||||
<input type="hidden" value="{$adminInfo.id}" name="id"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">账号</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" name="account" value="{$adminInfo.account}" validate="" disabled/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">姓名</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" name="real_name" value="{$adminInfo.real_name}" validate="required:true" id="real_name"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">原始密码</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<input type="password" class="form-control" name="pwd" id="pwd"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">新密码</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<input type="password" class="form-control" name="new_pwd" id="new_pwd"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">确认新密码</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<input type="password" class="form-control" name="new_pwd_ok" id="new_pwd_ok"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group" style="text-align: center;">
|
||||
<div class="col-sm-4 col-sm-offset-2">
|
||||
<button class="btn btn-primary add" type="button">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
|
||||
<script>
|
||||
$eb = parent._mpApi;
|
||||
$().ready(function() {
|
||||
$("#signupForm").validate();
|
||||
})
|
||||
$('.add').on('click',function (e) {
|
||||
var list = [];
|
||||
list.real_name = $('#real_name').val();
|
||||
list.pwd = $('#pwd').val();
|
||||
list.new_pwd = $('#new_pwd').val();
|
||||
list.new_pwd_ok = $('#new_pwd_ok').val();
|
||||
if(list.real_name.length < 1) return $eb.message('error','请填写姓名');
|
||||
var url = "{:Url('setAdminInfo')}";
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:{real_name:list.real_name,pwd:list.pwd,new_pwd:list.new_pwd,new_pwd_ok:list.new_pwd_ok},
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
success:function (re) {
|
||||
if(re.code == 400)
|
||||
return $eb.message('error',re.msg);
|
||||
else
|
||||
return $eb.message('success',re.msg);
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
{/block}
|
||||
@ -5,7 +5,7 @@
|
||||
<div class="ibox">
|
||||
<div class="ibox-title">
|
||||
<a type="button" class="btn btn-w-m btn-primary" href="{:Url('index')}">规则首页</a>
|
||||
<button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create',array('cid'=>0))}')">添加规则</button>
|
||||
<button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{$addurl}')">添加规则</button>
|
||||
<div class="ibox-tools">
|
||||
|
||||
</div>
|
||||
|
||||
143
extend/behavior/admin/OrderBehavior.php
Normal file
143
extend/behavior/admin/OrderBehavior.php
Normal file
@ -0,0 +1,143 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author: xaboy<365615158@qq.com>
|
||||
* @day: 2017/12/18
|
||||
*/
|
||||
|
||||
namespace behavior\admin;
|
||||
|
||||
use app\admin\model\user\User;
|
||||
use app\admin\model\user\UserAddress;
|
||||
use app\admin\model\user\UserBill;
|
||||
use app\admin\model\wechat\WechatUser;
|
||||
use basic\ModelBasic;
|
||||
use app\admin\model\order\StoreOrder;
|
||||
use service\SystemConfigService;
|
||||
use service\WechatTemplateService;
|
||||
|
||||
class OrderBehavior
|
||||
{
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改发货状态 为送货
|
||||
* @param $data
|
||||
* $data array 送货方式 送货人姓名 送货人电话
|
||||
* @param $oid
|
||||
* $oid string store_order表中的id
|
||||
*/
|
||||
public static function storeProductOrderDeliveryAfter($data,$oid){
|
||||
StoreOrder::orderPostageAfter($oid,$data);
|
||||
StoreOrder::sendOrderGoods($oid,$data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发货状态 为发货
|
||||
* @param $data
|
||||
* $data array 发货方式 送货人姓名 送货人电话
|
||||
* @param $oid
|
||||
* $oid string store_order表中的id
|
||||
*/
|
||||
public static function storeProductOrderDeliveryGoodsAfter($data,$oid){
|
||||
StoreOrder::orderPostageAfter($oid,$data);
|
||||
StoreOrder::sendOrderGoods($oid,$data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改状态为 已退款
|
||||
* @param $data
|
||||
* $data array type 1 直接退款 2 退款后返回原状态 refund_price 退款金额
|
||||
* @param $oid
|
||||
* $oid string store_order表中的id
|
||||
*/
|
||||
public static function storeProductOrderRefundYAfter($data,$oid){
|
||||
StoreOrder::refundTemplate($data,$oid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态为 不退款
|
||||
* @param $data
|
||||
* $data string 退款原因
|
||||
* @param $oid
|
||||
* $oid string store_order表中的id
|
||||
*/
|
||||
public static function storeProductOrderRefundNAfter($data,$oid){
|
||||
|
||||
}
|
||||
/**
|
||||
* 线下付款
|
||||
* @param $id
|
||||
* $id 订单id
|
||||
*/
|
||||
public static function storeProductOrderOffline($id){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单状态
|
||||
* @param $data
|
||||
* data total_price 商品总价 pay_price 实际支付
|
||||
* @param $oid
|
||||
* oid 订单id
|
||||
*/
|
||||
public static function storeProductOrderEditAfter($data,$oid){
|
||||
|
||||
}
|
||||
/**
|
||||
* 修改送货信息
|
||||
* @param $data
|
||||
* $data array 送货人姓名/快递公司 送货人电话/快递单号
|
||||
* @param $oid
|
||||
* $oid string store_order表中的id
|
||||
*/
|
||||
public static function storeProductOrderDistributionAfter($data,$oid){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户申请退款
|
||||
* @param $oid
|
||||
* @param $uid
|
||||
*/
|
||||
public static function storeProductOrderApplyRefundAfter($oid, $uid)
|
||||
{
|
||||
$order = StoreOrder::where('id',$oid)->find();
|
||||
WechatTemplateService::sendAdminNoticeTemplate([
|
||||
'first'=>"亲,您有一个订单申请退款 \n订单号:{$order['order_id']}",
|
||||
'keyword1'=>'申请退款',
|
||||
'keyword2'=>'待处理',
|
||||
'keyword3'=>date('Y/m/d H:i',time()),
|
||||
'remark'=>'请及时处理'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 评价产品
|
||||
* @param $replyInfo
|
||||
* @param $cartInfo
|
||||
*/
|
||||
public static function storeProductOrderReply($replyInfo, $cartInfo)
|
||||
{
|
||||
//StoreOrder::checkOrderOver($cartInfo['oid']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 退积分
|
||||
* @param $product
|
||||
* $product 商品信息
|
||||
* @param $back_integral
|
||||
* $back_integral 退多少积分
|
||||
*/
|
||||
public static function storeOrderIntegralBack($product,$back_integral){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
39
extend/behavior/admin/SystemBehavior.php
Normal file
39
extend/behavior/admin/SystemBehavior.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author: xaboy<365615158@qq.com>
|
||||
* @day: 2017/11/30
|
||||
*/
|
||||
|
||||
namespace behavior\admin;
|
||||
|
||||
use app\admin\model\system\SystemAdmin;
|
||||
use app\admin\model\system\SystemLog;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 系统后台行为
|
||||
* Class SystemBehavior
|
||||
* @package behavior\system
|
||||
*/
|
||||
class SystemBehavior
|
||||
{
|
||||
public static function adminVisit($adminInfo,$type = 'system')
|
||||
{
|
||||
if(strtolower(Request::instance()->controller()) != 'index') SystemLog::adminVisit($adminInfo->id,$adminInfo->account,$type);
|
||||
}
|
||||
|
||||
public static function systemAdminLoginAfter($adminInfo)
|
||||
{
|
||||
SystemAdmin::edit(['last_ip'=>Request::instance()->ip(),'last_time'=>time()],$adminInfo['id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户注册成功之后
|
||||
*/
|
||||
public static function merchantRegisterAfter($merchantInfo)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
159
extend/behavior/product/ProductBehavior.php
Normal file
159
extend/behavior/product/ProductBehavior.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author: xaboy<365615158@qq.com>
|
||||
* @day: 2017/12/18
|
||||
*/
|
||||
|
||||
namespace behavior\product;
|
||||
|
||||
|
||||
class ProductBehavior
|
||||
{
|
||||
|
||||
/**
|
||||
* 取消点赞产品后
|
||||
* @param $productId
|
||||
* @param $uid
|
||||
*/
|
||||
public static function storeProductUnLikeAfter($productId, $uid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 收藏产品后
|
||||
* @param $product
|
||||
* @param $uid
|
||||
*/
|
||||
public static function storeProductCollecAfter($product, $uid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消收藏产品后
|
||||
* @param $productId
|
||||
* @param $uid
|
||||
*/
|
||||
public static function storeProductUnCollecAfter($productId, $uid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 点赞产品后
|
||||
* @param $product
|
||||
* @param $uid
|
||||
*/
|
||||
public static function storeProductLikeAfter($product, $uid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单创建成功后
|
||||
* @param $oid
|
||||
*/
|
||||
public static function storeProductOrderCreate($order,$group)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改状态 为已收货
|
||||
* @param $data
|
||||
* $data array status 状态为 已收货
|
||||
* @param $oid
|
||||
* $oid string store_order表中的id
|
||||
*/
|
||||
public static function storeProductOrderTakeDeliveryAfter($order,$oid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户确认收货
|
||||
* @param $order
|
||||
* @param $uid
|
||||
*/
|
||||
public static function storeProductOrderUserTakeDelivery($order, $uid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 线下付款
|
||||
* @param $id
|
||||
* $id 订单id
|
||||
*/
|
||||
public static function storeProductOrderOffline($id){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态为 已退款
|
||||
* @param $data
|
||||
* $data array type 1 直接退款 2 退款后返回原状态 refund_price 退款金额
|
||||
* @param $oid
|
||||
* $oid string store_order表中的id
|
||||
*/
|
||||
public static function storeProductOrderRefundYAfter($data,$oid){
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改送货信息
|
||||
* @param $data
|
||||
* $data array 送货人姓名/快递公司 送货人电话/快递单号
|
||||
* @param $oid
|
||||
* $oid string store_order表中的id
|
||||
*/
|
||||
public static function storeProductOrderDistributionAfter($data,$oid){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户申请退款
|
||||
* @param $oid
|
||||
* @param $uid
|
||||
*/
|
||||
public static function storeProductOrderApplyRefundAfter($oid, $uid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 评价产品
|
||||
* @param $replyInfo
|
||||
* @param $cartInfo
|
||||
*/
|
||||
public static function storeProductOrderReply($replyInfo, $cartInfo)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单全部产品评价完
|
||||
* @param $oid
|
||||
*/
|
||||
public static function storeProductOrderOver($oid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 加入购物车成功之后
|
||||
* @param array $cartInfo 购物车信息
|
||||
* @param array $userInfo 用户信息
|
||||
*/
|
||||
public static function storeProductSetCartAfterAfter($cartInfo, $userInfo)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -19,6 +19,25 @@ use service\WechatTemplateService;
|
||||
|
||||
class StoreProductBehavior
|
||||
{
|
||||
/**
|
||||
* 取消点赞产品后
|
||||
* @param $productId
|
||||
* @param $uid
|
||||
*/
|
||||
public static function storeProductUnLikeAfter($productId, $uid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 点赞产品后
|
||||
* @param $product
|
||||
* @param $uid
|
||||
*/
|
||||
public static function storeProductLikeAfter($product, $uid)
|
||||
{
|
||||
|
||||
}
|
||||
/**
|
||||
* 用户确认收货
|
||||
* @param $order
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
|
||||
namespace behavior\wap;
|
||||
|
||||
use app\wap\model\seckill\StoreSeckill;
|
||||
class WapBehavior
|
||||
{
|
||||
public static function wapInit()
|
||||
|
||||
@ -20,6 +20,9 @@ class UserBehavior
|
||||
*/
|
||||
public static function wechatOauthAfter($openid,$wechatInfo)
|
||||
{
|
||||
// echo "调试中";
|
||||
// var_dump($wechatInfo);
|
||||
$wechatInfo['nickname'] = filterEmoji($wechatInfo['nickname']);
|
||||
Cookie::set('is_login',1);
|
||||
if(isset($wechatInfo['unionid']) && $wechatInfo['unionid'] != '' && WechatUser::be(['unionid'=>$wechatInfo['unionid']])){
|
||||
WechatUser::edit($wechatInfo,$wechatInfo['unionid'],'unionid');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user