Merge pull request !9 from 聆听/develop
This commit is contained in:
聆听 2018-11-28 15:33:19 +08:00
commit 80015a9185
29 changed files with 407 additions and 163 deletions

View File

@ -34,13 +34,19 @@ class Article extends AuthController
$where['merchant'] = 0;//区分是管理员添加的图文显示 0 还是 商户添加的图文显示 1
$catlist = ArticleCategoryModel::where('is_del',0)->select()->toArray();
//获取分类列表
$tree = Phptree::makeTreeForHtml($catlist);
$this->assign(compact('tree'));
if($pid){
$pids = Util::getChildrenPid($tree,$pid);
$where['cid'] = ltrim($pid.$pids);
if($catlist){
$tree = Phptree::makeTreeForHtml($catlist);
$this->assign(compact('tree'));
if($pid){
$pids = Util::getChildrenPid($tree,$pid);
$where['cid'] = ltrim($pid.$pids);
}
}else{
$tree = [];
$this->assign(compact('tree'));
}
$this->assign('cate',ArticleCategoryModel::getTierList());
$this->assign(ArticleModel::getAll($where));
return $this->fetch();

File diff suppressed because one or more lines are too long

View File

@ -52,7 +52,7 @@ class SystemGroupData extends AuthController
$params = explode("\n",$value["param"]);
if(is_array($params) && !empty($params)){
foreach ($params as $index => $v) {
$vl = explode('=',$v);
$vl = explode('=>',$v);
if(!empty($vl[0]) && !empty($vl[1])){
$info[$index]["value"] = $vl[0];
$info[$index]["label"] = $vl[1];
@ -154,7 +154,7 @@ class SystemGroupData extends AuthController
$params = explode("\n",$value["param"]);
if(is_array($params) && !empty($params)){
foreach ($params as $index => $v) {
$vl = explode('=',$v);
$vl = explode('=>',$v);
if(!empty($vl[0]) && !empty($vl[1])){
$info[$index]["value"] = $vl[0];
$info[$index]["label"] = $vl[1];

View File

@ -15,7 +15,7 @@ use app\admin\model\ump\StoreCombinationAttrResult;
use app\admin\model\ump\StoreCombination as StoreCombinationModel;
use think\Url;
use app\admin\model\system\SystemAttachment;
use app\wap\model\store\StorePink;
use app\admin\model\ump\StorePink;
/**
* 拼团管理

View File

@ -65,6 +65,9 @@ class StoreSeckill extends AuthController
return Json::successlayui(['count'=>$seckillList['list']['total'],'data'=>$data]);
}
public function get_seckill_id(){
return Json::successlayui(StoreSeckillModel::getSeckillIdAll());
}
/**
* 添加秒杀产品
* @return form-builder
@ -221,7 +224,7 @@ class StoreSeckill extends AuthController
$f[] = Form::frameImageOne('image','产品主图片(305*305px)',Url::build('admin/widget.images/index',array('fodder'=>'image')),$product->getData('image'))->icon('image');
$f[] = Form::frameImages('images','产品轮播图(640*640px)',Url::build('admin/widget.images/index',array('fodder'=>'images')),json_decode($product->getData('images')))->maxLength(5)->icon('images');
$f[] = Form::number('price','秒杀价',$product->getData('price'))->min(0)->col(12);
$f[] = Form::number('ot_price','原价',$product->getData('price'))->min(0)->col(12);
$f[] = Form::number('ot_price','原价',$product->getData('ot_price'))->min(0)->col(12);
$f[] = Form::number('cost','成本价',$product->getData('cost'))->min(0)->col(12);
$f[] = Form::number('stock','库存',$product->getData('stock'))->min(0)->precision(0)->col(12);
$f[] = Form::number('sales','销量',$product->getData('sales'))->min(0)->precision(0)->col(12);

View File

@ -16,14 +16,15 @@ use think\Request;
*/
class Reply extends AuthController
{
/**关注回复
* @return mixed|void
*/
public function index()
{
if(empty(input('key'))) return $this->failed('请输入参数key');
if(empty(input('title'))) return $this->failed('请输入参数title');
$replay = WechatReply::where('key',input('key'))->find();
$replay_arr =!empty($replay) ? $replay->toArray() : [];
$replay_arr['data'] = json_decode(isset($replay_arr['data']) ? $replay_arr['data'] : '',true);
$this->assign('replay_arr',json_encode($replay_arr));
$replay = WechatReply::getDataByKey(input('key'));
$this->assign('replay_arr',json_encode($replay));
$this->assign('key',input('key'));
$this->assign('title',input('title'));
return $this->fetch();
@ -36,10 +37,8 @@ class Reply extends AuthController
],$this->request);
// dump($where);
// exit();
if(!empty($where['key'])) $replay = WechatReply::where('key',$where['key'])->find();
$replay_arr = $replay->toArray();
if(!empty($where['key'])) $replay_arr = WechatReply::getDataByKey($where['key']);
$replay_arr['code'] = 200;
$replay_arr['data'] = json_decode($replay_arr['data'],true);
if(empty($replay_arr)) {
$replay_arr['code'] = 0;
}
@ -117,10 +116,8 @@ class Reply extends AuthController
public function info_keyword(){
$key = input('key');
if(empty($key)) return $this->failed('参数错误,请重新修改');
$replay = WechatReply::where('key',$key)->find();
$replay_arr = $replay->toArray();
$replay_arr['data'] = json_decode($replay_arr['data'],true);
$this->assign('replay_arr',json_encode($replay_arr));
$replay = WechatReply::getDataByKey($key);
$this->assign('replay_arr',json_encode($replay));
$this->assign('key',$key);
$this->assign('dis',2);
return $this->fetch('add_keyword');

View File

@ -89,7 +89,7 @@ class StoreOrder extends ModelBasic
$item['pay_type_name']='微信支付';
break;
case 'yue':
$item['pay_type_name']='微信支付';
$item['pay_type_name']='余额支付';
break;
case 'offline':
$item['pay_type_name']='线下支付';
@ -118,7 +118,7 @@ class StoreOrder extends ModelBasic
}else if($item['paid']==1 && $item['status']==2 && $item['refund_status']==0){
$item['status_name']='待评价';
}else if($item['paid']==1 && $item['status']==3 && $item['refund_status']==0){
$item['status_name']='待评价';
$item['status_name']='已完成';
}else if($item['paid']==1 && $item['refund_status']==1){
$item['status_name']=<<<HTML
<b style="color:#f124c7">申请退款</b><br/>

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<?php /** * * @author: xaboy<365615158@qq.com> * @day: 2017/11/02 */ namespace app\admin\model\system; use traits\ModelTrait; use basic\ModelBasic; use think\Db; /** * 配置分类model * * Class SystemConfigTab * @package app\admin\model\system */ class SystemConfigTab extends ModelBasic { use ModelTrait; /** * 获取单选按钮或者多选按钮的显示值 * */ public static function getRadioOrCheckboxValueInfo($menu_name,$value){ $parameter = array(); $option = array(); $config_one = SystemConfig::getOneConfig('menu_name',$menu_name); $parameter = explode("\n",$config_one['parameter']); foreach ($parameter as $k=>$v){ if(isset($v) && strlen($v)>0){ $data = explode('=',$v); $option[$data[0]] = $data[1]; } } $str = ''; if(is_array($value)){ foreach ($value as $v){ $str .= $option[$v].','; } }else{ $str .= !empty($value)?$option[$value]:$option[0]; } return $str; } /** * 插入数据到数据库 * */ public static function set($data) { return self::create($data); } /** * 获取全部 * */ public static function getAll($type = 0){ $where['status'] = 1; if($type>-1)$where['type'] = $type; return Db::name('SystemConfigTab')->where($where)->select(); } /** * 获取配置分类 * */ public static function getSystemConfigTabPage($where = array()) { $model = new self; if($where['title'] != '') $model = $model->where('title','LIKE',"%$where[title]%"); if($where['status'] != '') $model = $model->where('status',$where['status']); return self::page($model,$where); } public static function edit($data,$id,$field='id') { return self::update($data,[$field=>$id]); } /** * 更新数据 * @access public * @param array $data 数据数组 * @param array $where 更新条件 * @param array|true $field 允许字段 * @return $this */ public static function update($data = [], $where = [], $field = null) { $model = new static(); if (!empty($field)) { $model->allowField($field); } $result = $model->isUpdate(true)->save($data, $where); return $model; } }
<?php /** * * @author: xaboy<365615158@qq.com> * @day: 2017/11/02 */ namespace app\admin\model\system; use traits\ModelTrait; use basic\ModelBasic; use think\Db; /** * 配置分类model * * Class SystemConfigTab * @package app\admin\model\system */ class SystemConfigTab extends ModelBasic { use ModelTrait; /** * 获取单选按钮或者多选按钮的显示值 * */ public static function getRadioOrCheckboxValueInfo($menu_name,$value){ $parameter = array(); $option = array(); $config_one = SystemConfig::getOneConfig('menu_name',$menu_name); $parameter = explode("\n",$config_one['parameter']); foreach ($parameter as $k=>$v){ if(isset($v) && strlen($v)>0){ $data = explode('=>',$v); $option[$data[0]] = $data[1]; } } $str = ''; if(is_array($value)){ foreach ($value as $v){ $str .= $option[$v].','; } }else{ $str .= !empty($value)?$option[$value]:$option[0]; } return $str; } /** * 插入数据到数据库 * */ public static function set($data) { return self::create($data); } /** * 获取全部 * */ public static function getAll($type = 0){ $where['status'] = 1; if($type>-1)$where['type'] = $type; return Db::name('SystemConfigTab')->where($where)->select(); } /** * 获取配置分类 * */ public static function getSystemConfigTabPage($where = array()) { $model = new self; if($where['title'] != '') $model = $model->where('title','LIKE',"%$where[title]%"); if($where['status'] != '') $model = $model->where('status',$where['status']); return self::page($model,$where); } public static function edit($data,$id,$field='id') { return self::update($data,[$field=>$id]); } /** * 更新数据 * @access public * @param array $data 数据数组 * @param array $where 更新条件 * @param array|true $field 允许字段 * @return $this */ public static function update($data = [], $where = [], $field = null) { $model = new static(); if (!empty($field)) { $model->allowField($field); } $result = $model->isUpdate(true)->save($data, $where); return $model; } }

View File

@ -26,6 +26,15 @@ class WechatReply extends ModelBasic
public static $reply_type = ['text','image','news','voice'];
/**根据关键字查询一条
* @param $key
*/
public static function getDataByKey($key){
$resdata = [];
$resdata = self::where('key',$key)->find();
$resdata['data'] = json_decode($resdata['data'],true);
return $resdata;
}
public function getUrlAttr($value,$data)
{
return $value == '' ? \think\Url::build('index/index/news',['id'=>$data['id']]) : $value;
@ -194,4 +203,5 @@ class WechatReply extends ModelBasic
}
}

View File

@ -8,6 +8,7 @@
/*弹框样式修改*/
.ivu-modal-body{padding: 5;}
.ivu-modal-confirm-footer{display: none;}
.ivu-date-picker {display: inline-block;line-height: normal;width: 280px;}
</style>
</head>
<body>
@ -19,6 +20,8 @@
//关闭当前窗口
// var index = parent.layer.getFrameIndex(window.name);
// parent.layer.close(index);
//提交成功后按钮恢复
$r.btn.finish();
};
(function () {
var create = <?=$form->formScript()?>

View File

@ -51,13 +51,14 @@
<th class="text-center">结束时间</th>
<th class="text-center">状态</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.nickName}/{$vo.uid}
{$vo.nickname}/{$vo.uid}
</td>
<td class="text-center">
{$vo.add_time|date='Y-m-d H:i:s',###}

View File

@ -89,6 +89,26 @@
{block name="script"}
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
<script src="{__FRAME_PATH}js/content.min.js?v=1.0.0"></script>
<script>
setTime();
function setTime() {
setTimeout(function () {
$eb.axios.get("{:Url('get_seckill_id')}").then(function(res){
$.each(res.data.count,function (index,item) {
var time = $('.count-time-'+item).attr('data-time');
if(time != ''){
$('.count-time-'+item).downCount({
date: time,
offset: +8
});
}
})
}).catch(function(err){
console.log(err);
});
},2000);
}
</script>
<script>
layList.form.render();
layList.tableList('seckillList',"{:Url('get_seckill_list')}",function () {
@ -106,18 +126,6 @@
{field: 'right', title: '操作', width: '5%', align: 'center', toolbar: '#barDemo',unresize:true}
]
});
setTime();
window.$seckillId = <?php echo json_encode($seckillId);?>;
function setTime() {
setTimeout(function () {
$.each($seckillId,function (index,item) {
$('.count-time-'+item).downCount({
date: $('.count-time-'+item).attr('data-time'),
offset: +8
});
})
},3000);
}
layList.tool(function (event,data,obj) {
switch (event) {
case 'delstor':

View File

@ -1,101 +1,137 @@
{extend name="public/container"}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-title">
<button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加通知</button>
</div>
<div class="ibox-content">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">编号</th>
<th class="text-center">发送人</th>
<th class="text-center">通知标题</th>
<th class="text-center" width="700">通知内容</th>
<th class="text-center">消息类型</th>
<th class="text-center">是否发送</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">{$vo.id}</td>
<td class="text-center">{$vo.user}</td>
<td class="text-center">{$vo.title}</td>
<td class="text-center">{$vo.content}</td>
<td class="text-center">
{if condition="$vo['type'] eq 1"}
系统消息
{elseif condition="$vo['type'] eq 2" /}
用户通知
{/if}
</td>
<td class="text-center">
{if condition="$vo['is_send'] eq 1"}
状态:<span style="color:green;">已发送</span><br />
时间:{$vo.send_time|date='Y-m-d H:i:s',###}
{else /}
状态:<span style="color:red;">未发送</span> <a class="btn-send" data-url="{:Url('send',array('id'=>$vo['id']))}">立即发送</a>
{/if}
</td>
<td class="text-center">
<button class="btn btn-info btn-xs" type="button" onclick="window.location.href='{:Url('user',array('id'=>$vo['id']))}'"><i class="fa fa-user"></i> 用户信息</button>
{if condition="$vo['is_send'] eq 0"}
<button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}')"><i class="fa fa-paste"></i> 编辑</button>
{/if}
<button class="btn btn-warning btn-xs" data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-warning"></i> 删除</button>
</td>
</tr>
{/volist}
</tbody>
</table>
<div class="layui-fluid">
<div class="layui-row layui-col-space15" id="app">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-header">通知列表</div>
<div class="layui-card-body">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加通知</button>
</div>
<table class="layui-hide" id="List" lay-filter="List"></table>
<!--消息状态-->
<script type="text/html" id="type">
{{# if(d.type==1){ }}
<p>系统消息</p>
{{# }else if(d.type==2){ }}
<p>用户通知</p>
{{# } }}
</script>
<!--消息状态-->
<script type="text/html" id="is_send">
{{# if(d.is_send==1){ }}
状态:<span style="color:green;">已发送</span><br />
时间:{{d.send_time}}
{{# }else{ }}
状态:<span style="color:red;">未发送</span> <a class="layui-btn layui-btn-xs layui-btn-normal" lay-event='send'>立即发送</a>
{{# } }}
</script>
<script type="text/html" id="act">
<button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span class="caret"></span></button>
<ul class="layui-nav-child layui-anim layui-anim-upbit">
<li>
<a href="javascript:;" onclick="window.location.href='{:Url('user')}?id={{d.id}}'"><i class="fa fa-user"></i> 用户信息</a>
</li>
{{# if(d.is_send==0){ }}
<li>
<a href="javascript:;" onclick="$eb.createModalFrame('编辑','{:Url('edit')}?id={{d.id}}')"><i class="fa fa-paste"></i> 编辑</a>
</li>
{{# } }}
<li>
<a href="javascript:;" lay-event='warning'><i class="fa fa-warning"></i> 删除</a>
</li>
</ul>
</script>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
{/block}
{block name="script"}
<script>
$('.btn-warning').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
_this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
})
layList.tableList('List',"{:Url('index')}",function (){
return [
{field: 'id', title: '编号', sort: true,event:'id'},
{field: 'user', title: '发送人'},
{field: 'title', title: '通知标题'},
{field: 'content', title: '通知内容'},
{field: 'type', title: '消息类型',templet:'#type'},
{field: 'is_send', title: '是否发送',templet:'#is_send'},
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'10%'},
];
});
$('.btn-send').on('click',function(){
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
window.location.reload();
}else
return Promise.reject(res.data.msg || '发送失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{
title:"您确定要发送这条信息吗",
text:"发送后将无法修改通知信息,请谨慎操作!",
confirm:"是的,我要发送!",
cancel:"让我再考虑一下"
//下拉框
$(document).click(function (e) {
$('.layui-nav-child').hide();
})
function dropdown(that){
var oEvent = arguments.callee.caller.arguments[0] || event;
oEvent.stopPropagation();
var offset = $(that).offset();
var top=offset.top-$(window).scrollTop();
var index = $(that).parents('tr').data('index');
$('.layui-nav-child').each(function (key) {
if (key != index) {
$(this).hide();
}
})
});
if($(document).height() < top+$(that).next('ul').height()){
$(that).next('ul').css({
'padding': 10,
'top': - ($(that).parents('td').height() / 2 + $(that).height() + $(that).next('ul').height()/2),
'min-width': 'inherit',
'position': 'absolute'
}).toggle();
}else{
$(that).next('ul').css({
'padding': 10,
'top':$(that).parents('td').height() / 2 + $(that).height(),
'min-width': 'inherit',
'position': 'absolute'
}).toggle();
}
}
layList.tool(function (event,data,obj) {
switch (event) {
case 'send':
var url =layList.U({c:'user.user_notice',a:'send',p:{id:data.id}});
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
obj.update({is_send:1,send_time:'{:date("Y-m-d H:i:s",time())}'});
}else
return Promise.reject(res.data.msg || '发送失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{
title:"您确定要发送这条信息吗",
text:"发送后将无法修改通知信息,请谨慎操作!",
confirm:"是的,我要发送!",
cancel:"让我再考虑一下"
})
break;
case 'warning':
window.t = $(this);
var _this = $(this),url =layList.U({a:'delete',p:{id:data.id}});
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
_this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
})
break;
}
})
$('.head_image').on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);

View File

@ -20,8 +20,7 @@ use app\routine\model\user\UserAddress;
use app\routine\model\user\UserBill;
use app\routine\model\user\WechatUser;
use basic\ModelBasic;
use behavior\wap\StoreProductBehavior;
use behavior\routine\StoreProductBehavior as StoreProductBehaviorRoutine;
use behavior\routine\StoreProductBehavior;
use behavior\wechat\PaymentBehavior;
use service\HookService;
use service\RoutineService;
@ -521,7 +520,7 @@ class StoreOrder extends ModelBasic
if(false !== self::edit(['status'=>2],$order['id'],'id') &&
false !== StoreOrderStatus::status($order['id'],'user_take_delivery','用户已收货')){
try{
HookService::listen('store_product_order_user_take_delivery',$order,$uid,false,StoreProductBehaviorRoutine::class);
HookService::listen('store_product_order_user_take_delivery',$order,$uid,false,StoreProductBehavior::class);
}catch (\Exception $e){
return self::setErrorInfo($e->getMessage());
}

View File

@ -41,7 +41,12 @@ class RoutineUser extends ModelBasic
}else if(WechatUser::be(['routine_openid'=>$routineInfo['routine_openid']])){ //根据小程序openid判断
WechatUser::edit($routineInfo,$routineInfo['routine_openid'],'routine_openid');
$uid = WechatUser::where('routine_openid',$routineInfo['routine_openid'])->value('uid');
User::updateWechatUser($routineInfo,$uid);
if(!User::be(['uid'=>$uid])){
$routineInfo = WechatUser::where('uid',$uid)->find();
User::setRoutineUser($routineInfo);
}else{
User::updateWechatUser($routineInfo,$uid);
}
}else{
$routineInfo['add_time'] = time();//用户添加时间
$routineInfo = WechatUser::set($routineInfo);

View File

@ -1,2 +1,2 @@
version=v2.5.2
version=CRMEB-DTKY v2.5.2
version_code=129

View File

@ -15,7 +15,7 @@
<div class="page-index" id="app-index">
<section ref="bsDom">
<div>
<!--<div class="search-wrapper">
<form method="post" @submit.prevent="goSearch">
<div class="search-box flex"><input type="text" v-model="keyword" placeholder="商品搜索: 请输入商品关键词"> <a
@ -93,6 +93,8 @@
<li class="flex">
<div class="picture"><img src="{$vo.image}" alt="">
<div class="count-down flex countdown" data-time="{$vo.stop_time|date='Y/m/d H:i:s',###}">
<span class="days">00</span>
<em>:</em>
<span class="hours">00</span>
<em>:</em>
<span class="minutes">00</span>

View File

@ -78,13 +78,7 @@
</a>
</div>
{/volist}
{eq name="userInfo.is_promoter" value="1"}
<?php /* <div class="item">
<a class="con-cell" href="/wap/my/user_pro.html">
<img src="/public/uploads/common/5abc57ea40c8c.png" alt="">
<p>我的余额</p>
</a>
</div> */ ?>
{if condition="$statu == 2 || $userInfo['is_promoter'] == 1"}
<div class="item">
<a class="con-cell" href="/wap/my/spread_list.html">
<img src="/public/uploads/common/5abc5804670d2.png" alt="">
@ -97,7 +91,7 @@
<p>推广二维码</p>
</a>
</div>
{/eq}
{/if}
</div>
</section>
{include file="public/store_menu"}

View File

@ -25,6 +25,8 @@
<p class="count-wrappr"><span>限量{$vo.stock}件</span> <span class="old-price">市场价:{$vo.ot_price}</span></p>
<div class="time-wrapper">
<div class="countdown" data-time="{$vo.stop_time|date='Y/m/d H:i:s',###}">
<span class="days" style="background-color: #ec0707; width:.40rem;">00</span>
<i>:</i>
<span class="hours" style="background-color: #ec0707; width:.40rem;">00</span>
<i>:</i>
<span class="minutes" style="background-color: #ec0707; width:.40rem;">00</span>

View File

@ -11,7 +11,10 @@ namespace behavior\routine;
use app\routine\model\store\StoreOrder;
use app\routine\model\user\User;
use app\routine\model\user\WechatUser;
use app\routine\model\user\UserAddress;
use app\admin\model\order\StoreOrder as StoreOrderAdminModel;
use service\SystemConfigService;
use service\WechatTemplateService;
class StoreProductBehavior
{
@ -29,4 +32,160 @@ class StoreProductBehavior
if($order['total_price'] >= $giveCouponMinPrice) WechatUser::userTakeOrderGiveCoupon($uid);
if(!($res1 && $res2)) exception('收货失败!');
}
/**
* 订单创建成功后
* @param $oid
*/
public static function storeProductOrderCreate($order,$group)
{
UserAddress::be(['is_default'=>1,'uid'=>$order['uid']]) || UserAddress::setDefaultAddress($group['addressId'],$order['uid']);
}
/**
* 修改发货状态 为送货
* @param $data
* $data array 送货方式 送货人姓名 送货人电话
* @param $oid
* $oid string store_order表中的id
*/
public static function storeProductOrderDeliveryAfter($data,$oid){
StoreOrder::orderPostageAfter($data,$oid);
}
/**
* 修改发货状态 为发货
* @param $data
* $data array 发货方式 送货人姓名 送货人电话
* @param $oid
* $oid string store_order表中的id
*/
public static function storeProductOrderDeliveryGoodsAfter($data,$oid){
StoreOrder::orderPostageAfter($data,$oid);
}
/**
* 修改状态 为已收货
* @param $data
* $data array status 状态为 已收货
* @param $oid
* $oid string store_order表中的id
*/
public static function storeProductOrderTakeDeliveryAfter($order,$oid)
{
$res1 = StoreOrder::gainUserIntegral($order);
$res2 = User::backOrderBrokerage($order);
StoreOrder::orderTakeAfter($order);
if(!($res1 && $res2)) exception('收货失败!');
}
/**
* 线下付款
* @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){
StoreOrderAdminModel::refundTemplate($data,$oid);
}
/**
* 修改状态为 不退款
* @param $data
* $data string 退款原因
* @param $oid
* $oid string store_order表中的id
*/
public static function storeProductOrderRefundNAfter($data,$oid){
}
/**
* 修改订单状态
* @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 $oid
*/
public static function storeProductOrderOver($oid)
{
}
/**
* 退积分
* @param $product
* $product 商品信息
* @param $back_integral
* $back_integral 退多少积分
*/
public static function storeOrderIntegralBack($product,$back_integral){
}
/**
* 加入购物车成功之后
* @param array $cartInfo 购物车信息
* @param array $userInfo 用户信息
*/
public static function storeProductSetCartAfterAfter($cartInfo, $userInfo)
{
}
}

View File

@ -21,7 +21,16 @@ class UserBehavior
public static function wechatOauthAfter($openid,$wechatInfo)
{
Cookie::set('is_login',1);
if(WechatUser::be(['openid'=>$wechatInfo['openid']])){
if($wechatInfo['unionid'] != '' && WechatUser::be(['unionid'=>$wechatInfo['unionid']])){
WechatUser::edit($wechatInfo,$wechatInfo['unionid'],'unionid');
$uid = WechatUser::where('unionid',$wechatInfo['unionid'])->value('uid');
if(!User::be(['uid'=>$uid])){
$wechatInfo = WechatUser::where('uid',$uid)->find();
User::setWechatUser($wechatInfo);
}else{
User::updateWechatUser($wechatInfo,$uid);
}
}else if(WechatUser::be(['openid'=>$wechatInfo['openid']])){
WechatUser::edit($wechatInfo,$wechatInfo['openid'],'openid');
User::updateWechatUser($wechatInfo,WechatUser::openidToUid($wechatInfo['openid']));
}else{

View File

@ -53,10 +53,10 @@ class WechatTemplateService
public static function sendTemplate($openid,$templateId,array $data,$url = null,$defaultColor = '')
{
$templateinfo = WechatTemplateModel::where('tempkey',$templateId)->where('status',1)->find();
if(!$templateinfo) return false;
$tempid = WechatTemplateModel::where('tempkey',$templateId)->where('status',1)->value('tempid');
if(!$tempid) return false;
try{
return WechatService::sendTemplate($openid,$templateinfo['tempid'],$data,$url,$defaultColor);
return WechatService::sendTemplate($openid,$tempid,$data,$url,$defaultColor);
}catch (\Exception $e){
return false;
}

View File

@ -11,6 +11,10 @@ use think\Request;
trait CurdControllerTrait
{
/**保存数据库
* @param $id
* @param $field
*/
public function change_field($id,$field)
{
if(!isset($this->bindModel)) return exception('方法不存在!');

File diff suppressed because one or more lines are too long

View File

@ -33,7 +33,7 @@ $(function(){
$.ajax({
type: "POST",
url: "http://shop.crmeb.net/index.php/admin/server.upgrade_api/updatewebinfo",
data: {host:'<?php echo $host;?>',https:'<?php echo 'http://'.$host;?>',version:'v2.5.8',ip:'<?php echo $_SERVER[HTTP_CLIENT_IP];?>'},
data: {host:'<?php echo $host;?>',https:'<?php echo 'http://'.$host;?>',version:'CRMEB-DTKY v2.5.2',ip:'<?php echo $_SERVER[HTTP_CLIENT_IP];?>'},
dataType: 'json',
success: function(){}
});

View File

@ -981,7 +981,7 @@ label.skin-lable{position:absolute;right:.24rem;top:.33rem;z-index:2}
.page-index .hotspike-list ul li .picture .count-down{position:absolute;bottom:0;left:0;width:100%;height:.5rem;background-color:rgba(238,238,238,.6);font-size:0;-webkit-box-align:center;-moz-box-align:center;-o-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}
.page-index .hotspike-list ul li .picture .count-down em,.page-index .hotspike-list ul li .picture .count-down span{font-size:.22rem}
.page-index .hotspike-list ul li .picture .count-down span{width:.32rem;height:.32rem;border-radius:3px;background-color:#333;color:#fff;text-align:center;line-height:.32rem}
.page-index .hotspike-list ul li .picture .count-down em{width:.22rem;text-align:center}
.page-index .hotspike-list ul li .picture .count-down em{width:.12rem;text-align:center}
.page-index .hotspike-list ul li .text-info{width:4.15rem;height:1.9rem;-webkit-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}
.page-index .hotspike-list ul li .text-info .title{display:-webkit-box;display:-moz-box;overflow:hidden;line-height:1.5;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-line-clamp:2;-moz-line-clamp:2}
.page-index .hotspike-list ul li .text-info .price-wrapper{margin:.2rem 0}
@ -1136,7 +1136,7 @@ label.skin-lable{position:absolute;right:.24rem;top:.33rem;z-index:2}
.page-index .search-wrapper .search-box .home-btn .count-num{position:absolute;right:-5px;top:-2px;display:block;min-width:8px;height:8px;line-height:10px;text-align:center;background-color:#fff;color:#eb2f32;font-size:10px;border-radius:10px;padding:2px}
.page-index .nav{width:100%;padding-bottom:.2rem;background-repeat:no-repeat;-webkit-background-size:100% auto;-moz-background-size:100% auto;background-size:100% auto}
.page-index .nav ul{-webkit-box-align:center;-moz-box-align:center;-o-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;-webkit-box-lines:multiple;-moz-box-lines:multiple;-o-box-lines:multiple;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}
.page-index .nav li{-webkit-box-flex:1;-moz-box-flex:1;-o-box-flex:1;box-flex:1;-webkit-flex:1 25%;-ms-flex:1 25%;flex:1 25%;margin-top:.2rem;text-align:center}
.page-index .nav li{-webkit-box-flex:1;-moz-box-flex:1;-o-box-flex:1;box-flex:1;-webkit-flex:1 20%;-ms-flex:1 20%;flex:1 20%;margin-top:.2rem;text-align:center}
.page-index .nav li img{width:.96rem;height:.96rem;border-radius:50%}
.page-index .nav li p{margin-top:.1rem;font-size:.22rem}
.common-slider-nav{background-color:#fff;overflow:hidden;font-size:.22rem}

View File

@ -103,11 +103,26 @@ alter table eb_store_order modify column is_channel tinyint(1) comment '支付
-- 客服通知
ALTER TABLE `eb_store_service` ADD `notify` INT(2) NULL DEFAULT '0' COMMENT '订单通知1开启0关闭' AFTER `status`;
--
ALTER TABLE `eb_store_service_log` CHANGE COLUMN `type` `type` tinyint(1) DEFAULT '0' COMMENT '是否已读01', CHANGE COLUMN `remind` `remind` tinyint(1) DEFAULT '0' COMMENT '是否提醒过';
--v2.5.2
alter table eb_store_product modify column code_path varchar(64) comment '产品二维码地址(用户小程序海报)';
ALTER TABLE `eb_store_product` ADD COLUMN `code_path` varchar(64) NOT NULL COMMENT '产品二维码地址(用户小程序海报)' AFTER `browse`;
--v2.5.2 eb_system_group表
UPDATE eb_system_group SET fields='[{"name":"\u5206\u7c7b\u540d\u79f0","title":"name","type":"input","param":""},{"name":"\u5206\u7c7b\u56fe\u6807","title":"pic","type":"upload","param":""},{"name":"\u8df3\u8f6c\u8def\u5f84","title":"url","type":"select","param":"\/pages\/index\/index=\u5546\u57ce\u9996\u9875\n\/pages\/spread\/spread=\u4e2a\u4eba\u63a8\u5e7f\n\/pages\/coupon\/coupon=\u4f18\u60e0\u5238\n\/pages\/user\/user=\u4e2a\u4eba\u4e2d\u5fc3\n\/pages\/miao-list\/miao-list=\u79d2\u6740\u5217\u8868\n\/pages\/pink-list\/index=\u62fc\u56e2\u5217\u8868\u9875\n\/pages\/cut-list\/cut-list=\u780d\u4ef7\u5217\u8868\n\/pages\/productSort\/productSort=\u5206\u7c7b\u9875\u9762\n\/pages\/address\/address=\u5730\u5740\u5217\u8868\n\/pages\/cash\/cash=\u63d0\u73b0\u9875\u9762\n\/pages\/extension\/extension=\u63a8\u5e7f\u7edf\u8ba1\n\/pages\/main\/main=\u8d26\u6237\u91d1\u989d\n\/pages\/collect\/collect=\u6211\u7684\u6536\u85cf\n\/pages\/promotion-card\/promotion-card=\u63a8\u5e7f\u4e8c\u7ef4\u7801\u9875\u9762\n\/pages\/buycar\/buycar=\u8d2d\u7269\u8f66\u9875\u9762\n\/pages\/news-list\/news-list=\u6d88\u606f\u5217\u8868\u9875\n\/pages\/orders-list\/orders-list=\u8ba2\u5355\u5217\u8868\u9875\u9762\n\/pages\/new-list\/new-list=\u6587\u7ae0\u5217\u8868\u9875"},{"name":"\u5e95\u90e8\u83dc\u5355","title":"show","type":"radio","param":"\u662f=\u662f\n\u5426=\u5426"}]' where id = 47;
--v2.5.2 --
TRUNCATE table eb_store_pink
TRUNCATE table eb_store_pink
--2018-11-26
ALTER TABLE `eb_user` CHANGE COLUMN `phone` `phone` char(15) COMMENT '手机号码';
ALTER TABLE `eb_store_product` CHANGE COLUMN `is_bargain` `is_bargain`TINYINT(1) UNSIGNED NULL COMMENT '砍价状态 0未开启 1开启';
ALTER TABLE `eb_store_seckill` CHANGE COLUMN `description` `description`TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '内容';
ALTER TABLE `eb_store_bargain` CHANGE COLUMN `add_time` `add_time` INT(11)UNSIGNED NULL COMMENT '添加时间';
ALTER TABLE `eb_store_combination` CHANGE `attr` `attr`VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '活动属性';
ALTER TABLE `eb_store_combination` CHANGE COLUMN `mer_use` `mer_use`TINYINT(1) UNSIGNED NULL COMMENT '商户是否可用1可用0不可用';
ALTER TABLE `eb_store_product_reply` CHANGE COLUMN `merchant_reply_content` `merchant_reply_content` VARCHAR(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '管理员回复内容';
ALTER TABLE `eb_store_product_reply` CHANGE COLUMN `merchant_reply_time` `merchant_reply_time` INT(11) NULL COMMENT '管理员回复时间';
ALTER TABLE `eb_store_cart` CHANGE COLUMN `combination_id` `combination_id` INT(11) UNSIGNED NULL DEFAULT '0' COMMENT '拼团id';
ALTER TABLE `eb_store_order` CHANGE COLUMN `combination_id` `combination_id` int(11) UNSIGNED DEFAULT '0' COMMENT '拼团产品id0一般产品';

View File

@ -48,6 +48,7 @@
success: function (res) {
if (res.code == 200) {
vm.$Message.success(res.msg);
$f.submitStatus({loading: false});
formCreate.formSuccess && formCreate.formSuccess(res, $f, formData);
callback && callback(0, res, $f, formData);
//TODO 表单提交成功!