bug修复

This commit is contained in:
sugar1569 2018-11-02 16:00:31 +08:00
parent 5c6d58d1d1
commit 0bd6c9d3a6
26 changed files with 961 additions and 887 deletions

View File

@ -10,50 +10,7 @@
// +----------------------------------------------------------------------
// 应用公共文件
/**
* 获取用户名称
* @param $uid
* @return mixed
*/
function getUserNickname($uid){
return \app\admin\model\user\User::where('uid',$uid)->value('nickname');
}
/**
* 获取产品名称
* @param $id
* @return mixed
*/
function getProductName($id){
return \app\admin\model\store\StoreProduct::where('id',$id)->value('store_name');
}
/**
* 获取拼团名称
* @param $id
* @return mixed
*/
function getCombinationTitle($id){
return \app\admin\model\store\StoreCombination::where('id',$id)->value('title');
}
/**
* 获取订单编号
* @param $id
*/
function getOrderId($id){
return \app\admin\model\order\StoreOrder::where('id',$id)->value('order_id');
}
/**
* 根据用户uid获取订单数
* @param $uid
* @return int|string
*/
function getOrderCount($uid){
return \app\admin\model\order\StoreOrder::where('uid',$uid)->where('paid',1)->where('refund_status',0)->where('status',2)->count();
}
/**
* 格式化属性
* @param $arr
@ -98,6 +55,12 @@ function attrFormat($arr){
return [$data,$res];
}
/**
* 格式化月份
* @param string $time
* @param int $ceil
* @return array
*/
function getMonth($time='',$ceil=0){
if(empty($time)){
$firstday = date("Y-m-01",time());
@ -118,3 +81,24 @@ function getMonth($time='',$ceil=0){
}
return array($firstday,$lastday);
}
/**删除目录下所有文件
* @param $path 目录或者文件路径
* @param string $ext
* @return bool
*/
function clearfile($path,$ext = '*.log')
{
$files = (array) glob($path.DS.'*');
foreach ($files as $path) {
if (is_dir($path)) {
$matches = glob($path . '/'.$ext);
if (is_array($matches)) {
array_map('unlink', $matches);
}
rmdir($path);
} else {
unlink($path);
}
}
return true;
}

View File

@ -3,6 +3,7 @@
namespace app\admin\controller\agent;
use app\admin\controller\AuthController;
use app\admin\model\order\StoreOrder;
use app\admin\model\user\User;
use app\admin\model\wechat\WechatUser as UserModel;
use app\admin\library\FormBuilder;
@ -74,6 +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']);
$this->assign('list',$list);
return $this->fetch();
}

File diff suppressed because one or more lines are too long

View File

@ -26,11 +26,168 @@ class StoreOrder extends ModelBasic
{
use ModelTrait;
public static function orderCount(){
$data['wz']=self::statusByWhere(0,new self())->count();
$data['wf']=self::statusByWhere(1,new self())->count();
$data['ds']=self::statusByWhere(2,new self())->count();
$data['dp']=self::statusByWhere(3,new self())->count();
$data['jy']=self::statusByWhere(4,new self())->count();
$data['tk']=self::statusByWhere(-1,new self())->count();
$data['yt']=self::statusByWhere(-2,new self())->count();
$data['general']=self::where(['pink_id'=>0,'combination_id'=>0,'seckill_id'=>0])->count();
$data['pink']=self::where('pink_id|combination_id','neq',0)->count();
$data['seckill']=self::where('seckill_id','neq',0)->count();
return $data;
}
public static function OrderList($where){
$model = self::getOrderWhere($where,self::alias('a')->join('user r','r.uid=a.uid','LEFT'),'a.','r')->field('a.*,r.nickname');
if($where['order']!=''){
$model = $model->order(self::setOrder($where['order']));
}else{
$model = $model->order('a.id desc');
}
$data=($data=$model->page((int)$where['page'],(int)$where['limit'])->select()) && count($data) ? $data->toArray() : [];
foreach ($data as &$item){
$_info = db('store_order_cart_info')->where('oid',$item['id'])->field('cart_info')->select();
foreach ($_info as $k=>$v){
$_info[$k]['cart_info'] = json_decode($v['cart_info'],true);
}
$item['_info'] = $_info;
if($item['pink_id'] && $item['combination_id']){
$pinkStatus = StorePink::where('order_id_key',$item['id'])->value('status');
switch ($pinkStatus){
case 1:
$item['pink_name'] = '[拼团订单]正在进行中';
$item['color'] = '#f00';
break;
case 2:
$item['pink_name'] = '[拼团订单]已完成';
$item['color'] = '#00f';
break;
case 3:
$item['pink_name'] = '[拼团订单]未完成';
$item['color'] = '#f0f';
break;
default:
$item['pink_name'] = '[拼团订单]历史订单';
$item['color'] = '#457856';
break;
}
}else{
if($item['seckill_id']){
$item['pink_name'] = '[秒杀订单]';
$item['color'] = '#32c5e9';
}else{
$item['pink_name'] = '[普通订单]';
$item['color'] = '#895612';
}
}
if($item['paid']==1){
switch ($item['pay_type']){
case 'weixin':
$item['pay_type_name']='微信支付';
break;
case 'yue':
$item['pay_type_name']='微信支付';
break;
case 'offline':
$item['pay_type_name']='线下支付';
break;
default:
$item['pay_type_name']='其他支付';
break;
}
}else{
switch ($item['pay_type']){
default:
$item['pay_type_name']='未支付';
break;
case 'offline':
$item['pay_type_name']='线下支付';
$item['pay_type_info']=1;
break;
}
}
if($item['paid']==0 && $item['status']==0){
$item['status_name']='未支付';
}else if($item['paid']==1 && $item['status']==0 && $item['refund_status']==0){
$item['status_name']='未发货';
}else if($item['paid']==1 && $item['status']==1 && $item['refund_status']==0){
$item['status_name']='待收货';
}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']='待评价';
}else if($item['paid']==1 && $item['refund_status']==1){
$item['status_name']=<<<HTML
<b style="color:#f124c7">申请退款</b><br/>
<span>退款原因:{$item['refund_reason_wap']}</span>
HTML;
}else if($item['paid']==1 && $item['refund_status']==2){
$item['status_name']='已退款';
}
if($item['paid']==0 && $item['status']==0 && $item['refund_status']==0){
$item['_status']=1;
}else if($item['paid']==1 && $item['status']==0 && $item['refund_status']==0){
$item['_status']=2;
}else if($item['paid']==1 && $item['refund_status']==1){
$item['_status']=3;
}else if($item['paid']==1 && $item['status']==1 && $item['refund_status']==0){
$item['_status']=4;
}else if($item['paid']==1 && $item['status']==2 && $item['refund_status']==0){
$item['_status']=5;
}else if($item['paid']==1 && $item['status']==3 && $item['refund_status']==0){
$item['_status']=6;
}else if($item['paid']==1 && $item['refund_status']==2){
$item['_status']=7;
}
}
if(isset($where['excel']) && $where['excel']==1){
self::SaveExcel($data);
}
$count=self::getOrderWhere($where,self::alias('a')->join('user r','r.uid=a.uid','LEFT'),'a.','r')->count();
return compact('count','data');
}
/*
* 保存并下载excel
* $list array
* return
*/
public static function SaveExcel($list){
$export = [];
foreach ($list as $index=>$item){
$_info = db('store_order_cart_info')->where('oid',$item['id'])->column('cart_info');
$goodsName = [];
foreach ($_info as $k=>$v){
$v = json_decode($v,true);
$goodsName[] = implode(
[$v['productInfo']['store_name'],
isset($v['productInfo']['attrInfo']) ? '('.$v['productInfo']['attrInfo']['suk'].')' : '',
"[{$v['cart_num']} * {$v['truePrice']}]"
],' ');
}
$item['cartInfo'] = $_info;
$export[] = [
$item['order_id'],$item['pay_type_name'],
$item['total_num'],$item['total_price'],$item['total_postage'],$item['pay_price'],$item['refund_price'],
$item['mark'],$item['remark'],
[$item['real_name'],$item['user_phone'],$item['user_address']],
$goodsName,
[$item['paid'] == 1? '已支付':'未支付','支付时间: '.($item['pay_time'] > 0 ? date('Y/md H:i',$item['pay_time']) : '暂无')]
];
}
PHPExcelService::setExcelHeader(['订单号','支付方式','商品总数','商品总价','邮费','支付金额','退款金额','用户备注','管理员备注','收货人信息','商品信息','支付状态'])
->setExcelTile('订单导出','订单信息'.time(),' 生成时间:'.date('Y-m-d H:i:s',time()))
->setExcelContent($export)
->ExcelSave();
}
/**
* @param $where
* @return array
*/
public static function systemPage($where,$userid){
public static function systemPage($where,$userid=false){
$model = self::getOrderWhere($where,self::alias('a')->join('user r','r.uid=a.uid','LEFT'),'a.','r')->field('a.*,r.nickname');
if($where['order']){
$model = $model->order('a.'.$where['order']);
@ -80,7 +237,6 @@ class StoreOrder extends ModelBasic
->ExcelSave();
}
return self::page($model,function ($item){
$item['nickname'] = WechatUser::where('uid',$item['uid'])->value('nickname');
$_info = db('store_order_cart_info')->where('oid',$item['id'])->field('cart_info')->select();
foreach ($_info as $k=>$v){
$_info[$k]['cart_info'] = json_decode($v['cart_info'],true);
@ -88,29 +244,32 @@ class StoreOrder extends ModelBasic
$item['_info'] = $_info;
if($item['pink_id'] && $item['combination_id']){
$pinkStatus = StorePink::where('order_id_key',$item['id'])->value('status');
if($pinkStatus == 1){
$item['pink_name'] = '[拼团订单]正在进行中';
$item['color'] = '#f00';
}else if($pinkStatus == 2){
$item['pink_name'] = '[拼团订单]已完成';
$item['color'] = '#00f';
}else if($pinkStatus == 3){
$item['pink_name'] = '[拼团订单]未完成';
$item['color'] = '#f0f';
}else{
$item['pink_name'] = '[拼团订单]历史订单';
$item['color'] = '#457856';
switch ($pinkStatus){
case 1:
$item['pink_name'] = '[拼团订单]正在进行中';
$item['color'] = '#f00';
break;
case 2:
$item['pink_name'] = '[拼团订单]已完成';
$item['color'] = '#00f';
break;
case 3:
$item['pink_name'] = '[拼团订单]未完成';
$item['color'] = '#f0f';
break;
default:
$item['pink_name'] = '[拼团订单]历史订单';
$item['color'] = '#457856';
break;
}
}else{
if($item['seckill_id']){
$item['pink_name'] = '[秒杀订单]';
$item['color'] = '#32c5e9';
}else{
$item['pink_name'] = '[普通订单]';
$item['color'] = '#895612';
}
if($item['seckill_id']){
$item['pink_name'] = '[秒杀订单]';
$item['color'] = '#32c5e9';
}else{
$item['pink_name'] = '[普通订单]';
$item['color'] = '#895612';
}
}
},$where);
}
@ -193,27 +352,107 @@ class StoreOrder extends ModelBasic
// $model = $model->where('combination_id',0);
if($where['status'] != '') $model = self::statusByWhere($where['status'],$model,$aler);
if($where['is_del'] != '' && $where['is_del'] != -1) $model = $model->where($aler.'is_del',$where['is_del']);
if($where['combination_id'] =='普通订单'){
$model = $model->where($aler.'combination_id',0)->where($aler.'seckill_id',0);
if(isset($where['combination_id'])){
if($where['combination_id'] =='普通订单'){
$model = $model->where($aler.'combination_id',0)->where($aler.'seckill_id',0);
}
if($where['combination_id'] =='拼团订单'){
$model = $model->where($aler.'combination_id',">",0)->where($aler.'pink_id',">",0);
}
if($where['combination_id'] =='秒杀订单'){
$model = $model->where($aler.'seckill_id',">",0);
}
}
if($where['combination_id'] =='拼团订单'){
$model = $model->where($aler.'combination_id',">",0)->where($aler.'pink_id',">",0);
}
if($where['combination_id'] =='秒杀订单'){
$model = $model->where($aler.'seckill_id',">",0);
if(isset($where['type'])){
switch ($where['type']){
case 1:
$model = $model->where($aler.'combination_id',0)->where($aler.'seckill_id',0);
break;
case 2:
$model = $model->where($aler.'combination_id',">",0)->where($aler.'pink_id',">",0);
break;
case 3:
$model = $model->where($aler.'seckill_id',">",0);
break;
}
}
if($where['real_name'] != ''){
$model = $model->where($aler.'order_id|'.$aler.'real_name|'.$aler.'user_phone'.($join ? '|'.$join.'.nickname|'.$join.'.uid':''),'LIKE',"%$where[real_name]%");
}
if($where['data'] !== ''){
list($startTime,$endTime) = explode(' - ',$where['data']);
$model = $model->where($aler.'add_time','>',strtotime($startTime));
$model = $model->where($aler.'add_time','<',strtotime($endTime));
$model = self::getModelTime($where,$model,$aler.'add_time');
}
return $model;
}
public static function getBadge($where){
$price=self::getOrderPrice($where);
return [
[
'name'=>'订单数量',
'field'=>'件',
'count'=>$price['total_num'],
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'售出商品',
'field'=>'件',
'count'=>$price['total_num'],
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'订单金额',
'field'=>'元',
'count'=>$price['pay_price'],
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'退款金额',
'field'=>'元',
'count'=>$price['refund_price'],
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'微信支付金额',
'field'=>'元',
'count'=>$price['pay_price_wx'],
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'余额支付金额',
'field'=>'元',
'count'=>$price['pay_price_yue'],
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'线下支付金额',
'field'=>'元',
'count'=>$price['pay_price_offline'],
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'积分抵扣',
'field'=>'分',
'count'=>$price['use_integral'].'(抵扣金额:¥'.$price['deduction_price'].')',
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'退回积分',
'field'=>'元',
'count'=>$price['back_integral'],
'background_color'=>'layui-bg-blue',
'col'=>2
]
];
}
/**
* 处理订单金额
* @param $where
@ -655,4 +894,14 @@ class StoreOrder extends ModelBasic
// }
// return $refundlist;
// }
/**
* 获取订单总数
* @param int $uid
* @return int|string
*/
public static function getOrderCount($uid = 0){
if(!$uid) return 0;
return self::where('uid',$uid)->where('paid',1)->where('refund_status',0)->where('status',2)->count();
}
}

View File

@ -28,7 +28,7 @@
{$vo.add_time|date="Y-m-d H:i:s",###}
</td>
<td class="text-center">
{$vo.uid|getOrderCount}
{$vo.orderCount}
</td>
<td class="text-center">
{$vo.now_money}

File diff suppressed because one or more lines are too long

View File

@ -1,26 +1,33 @@
{extend name="public/container"}
{block name="head_top"}
<link href="{__ADMIN_PATH}module/wechat/news/css/index.css" type="text/css" rel="stylesheet">
<link href="/public/system/module/wechat/news/css/index.css" type="text/css" rel="stylesheet">
{/block}
{block name="content"}
<style>
tr td img{height: 80px;}
tr td img{height: 50px;}
</style>
<div class="row">
<div class="col-sm-12">
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-title">分类</div>
<div class="ibox-content">
<ul class="folder-list m-b-md">
{volist name="tree" id="vo"}
<li class="p-xxs"><a href="{:Url('article.article/index',array('pid'=>$vo.id))}">{$vo.level|str_repeat='.....',###}{$vo.title}</a></li>
{/volist}
</ul>
</div>
</div>
</div>
<div class="col-sm-9 m-l-n-md">
<div class="ibox">
<div class="ibox-title">
<button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create',array('cid'=>$cid))}',{w:1000,h:760})">添加文章</button>
<button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create',array('cid'=>$where.cid))}',{w:1100,h:760})">添加文章</button>
<div style="margin-top: 2rem"></div>
<div class="row">
<div class="m-b m-l">
<form action="" class="form-inline">
<select name="cid" aria-controls="editable" class="form-control input-sm">
<option value="">所有分类</option>
{volist name="cate" id="vo"}
<option value="{$vo.id}" {eq name="where.cid" value="$vo.id"}selected="selected"{/eq}>{$vo.html}{$vo.title}</option>
{/volist}
</select>
<div class="input-group">
<input type="text" name="title" value="{$where.title}" placeholder="请输入关键词" class="input-sm form-control"> <span class="input-group-btn"><button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
</div>
@ -33,28 +40,26 @@
<thead>
<tr>
<th class="text-center" width="5%">id</th>
<th class="text-center" width="8%">分类</th>
<th class="text-center" width="10%">图片</th>
<th class="text-center" width="10%">标题</th>
<th class="text-center" width="30%">简介</th>
<th class="text-center" width="10%">操作</th>
<th class="text-left" >[分类]标题</th>
<th class="text-center" width="8%">浏览量</th>
<th class="text-center" width="15%">添加时间</th>
<th class="text-center" width="15%">操作</th>
</tr>
</thead>
<tbody>
{volist name="list" id="vo"}
<tr>
<td class="text-center">{$vo.id}</td>
<td class="text-center">{$vo.catename}</td>
<td class="text-center">
<td>{$vo.id}</td>
<td>
<img src="{$vo.image_input}"/>
</td>
<td>{$vo.title}</td>
<td class="text-center">
{$vo.synopsis}
</td>
<td>[{$vo.catename}]{$vo.title}</td>
<td>{$vo.visit}</td>
<td>{$vo.add_time|date="Y-m-d H:i:s",###}</td>
<td class="text-center">
<button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('create',array('id'=>$vo['id'],'cid'=>$cid))}',{w:1000,h:760})"><i class="fa fa-paste"></i> 编辑</button>
<button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('create',array('id'=>$vo['id'],'cid'=>$where.cid))}',{w:1100,h:760})"><i class="fa fa-paste"></i> 编辑</button>
<button class="btn btn-warning btn-xs del_news_one" data-id="{$vo.id}" type="button" data-url="{:Url('delete',array('id'=>$vo['id']))}" ><i class="fa fa-warning"></i> 删除
@ -65,11 +70,13 @@
</table>
</div>
</div>
<div style="margin-left: 10px">
{include file="public/inner_page"}
</div>
</div>
</div>
<div style="margin-left: 10px">
{include file="public/inner_page"}
</div>
{/block}
{block name="script"}
<script>

File diff suppressed because it is too large Load Diff

View File

@ -98,7 +98,7 @@
<!--产品名称-->
<script type="text/html" id="store_name">
<h4>{{d.store_name}}</h4>
<p>价格:{{d.price}}</p>
<p>价格:<font color="red">{{d.price}}</font> </p>
{{# if(d.cate_name!=''){ }}
<p>分类:{{d.cate_name}}</p>
{{# } }}
@ -159,24 +159,23 @@
switch (parseInt(type)){
case 1:case 3:case 4:case 5:
join=[
{field: 'id', title: 'ID', sort: true,event:'id',width:'4%'},
{field: 'image', title: '产品图片',templet:'#image'},
{field: 'id', title: 'ID', sort: true,event:'id',width:'6%'},
{field: 'image', title: '产品图片',templet:'#image',width:'10%'},
{field: 'store_name', title: '产品名称',templet:'#store_name'},
{field: 'price', title: '产品价格',edit:'price'},
{field: 'ficti', title: '虚拟销量',edit:'ficti'},
{field: 'stock', title: '库存',edit:'stock'},
{field: 'sort', title: '排序',edit:'sort'},
{field: 'sales', title: '销量',sort: true,event:'sales'},
{field: 'collect', title: '点赞',templet:'#like'},
{field: 'like', title: '收藏',templet:'#collect'},
{field: 'status', title: '状态',templet:"#checkboxstatus"},
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'10%'},
{field: 'ficti', title: '虚拟销量',edit:'ficti',width:'8%'},
{field: 'stock', title: '库存',edit:'stock',width:'8%'},
{field: 'sort', title: '排序',edit:'sort',width:'6%'},
{field: 'sales', title: '销量',sort: true,event:'sales',width:'8%'},
{field: 'collect', title: '点赞',templet:'#like',width:'6%'},
{field: 'like', title: '收藏',templet:'#collect',width:'6%'},
{field: 'status', title: '状态',templet:"#checkboxstatus",width:'8%'},
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'14%'},
];
break;
case 2:
join=[
{type:'checkbox'},
{field: 'id', title: 'ID', sort: true,event:'id',width:'4%'},
{field: 'id', title: 'ID', sort: true,event:'id',width:'5%'},
{field: 'image', title: '产品图片',templet:'#image'},
{field: 'store_name', title: '产品名称',templet:'#store_name'},
{field: 'price', title: '产品价格',edit:'price'},
@ -185,7 +184,7 @@
{field: 'sort', title: '排序',edit:'sort'},
{field: 'sales', title: '销量',sort: true,event:'sales'},
{field: 'status', title: '状态',templet:"#checkboxstatus"},
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'10%'},
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'14%'},
];
break;
case 6:
@ -199,7 +198,7 @@
{field: 'sort', title: '排序',edit:'sort'},
{field: 'sales', title: '销量',sort: true,event:'sales'},
{field: 'status', title: '状态',templet:"#checkboxstatus"},
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'10%'},
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'14%'},
];
break;
}

View File

@ -119,21 +119,20 @@
});
layList.tableList('bargainList',"{:Url('get_bargain_list')}",function () {
return [
{field: 'id', title: '编号', sort: true,width:'5%',event:'id',unresize:true},
{field: 'image', title: '砍价图片',event:'open_image',unresize:true, width: '8%',templet: '<p><img src="{{d.image}}" alt="{{d.title}}"></p>'},
{field: 'title', title: '砍价名称',width:'15%',unresize:true},
{field: 'price', title: '砍价价格',width:'6%',unresize:true},
{field: 'bargain_min_price', title: '砍价区间',unresize:true,width:'8%',templet: '<span>{{d.bargain_min_price}}~{{d.bargain_max_price}}</span>'},
{field: 'min_price', title: '最低价',width:'5%',unresize:true},
{field: 'status', title: '砍价状态',width:'8%',unresize:true,templet:"#status"},
{field: 'right', title: '活动状态',width:'8%',unresize:true,templet:"#statusCn"},
{field: 'count_people_all', title: '参与人数',unresize:true,width:'6%',templet: '<span>【{{d.count_people_all}}】人</span>'},
{field: 'count_people_help', title: '帮忙砍价人数',unresize:true,width:'6%',templet: '<span>【{{d.count_people_help}}】人</span>'},
{field: 'count_people_success', title: '砍价成功人数',unresize:true,width:'6%',templet: '<span>【{{d.count_people_success}}】人</span>'},
{field: 'look', title: '浏览量',width:'6%',unresize:true},
{field: 'stock', title: '库存',width:'4%',unresize:true},
{fixed: 'right', title: '结束时间', width: '10%',toolbar: '#stopTime',unresize:true},
{fixed: 'right', title: '操作', width: '5%', align: 'center', toolbar: '#barDemo'}
{field: 'id', title: '编号', sort: true,width:'5%',event:'id'},
{field: 'image', title: '砍价图片',event:'open_image', width: '8%',templet: '<p><img src="{{d.image}}" alt="{{d.title}}"></p>'},
{field: 'title', title: '砍价名称',width:'10%'},
{field: 'price', title: '砍价价格',width:'6%'},
{field: 'bargain_min_price', title: '砍价区间',width:'8%',templet: '<span>{{d.bargain_min_price}}~{{d.bargain_max_price}}</span>'},
{field: 'min_price', title: '最低价',width:'8%'},
{field: 'status', title: '砍价状态',width:'8%',templet:"#status"},
{field: 'count_people_all', title: '参与人数',width:'6%',templet: '<span>【{{d.count_people_all}}】人</span>'},
{field: 'count_people_help', title: '帮忙砍价人数',width:'6%',templet: '<span>【{{d.count_people_help}}】人</span>'},
{field: 'count_people_success', title: '砍价成功人数',width:'6%',templet: '<span>【{{d.count_people_success}}】人</span>'},
{field: 'look', title: '浏览量',width:'5%'},
{field: 'stock', title: '库存',width:'4%'},
{field: '_stop_time', title: '结束时间', width: '10%',toolbar: '#stopTime'},
{field: 'right', title: '操作', width: '10%', align: 'center', toolbar: '#barDemo'}
]
});
// layList.date('time');

View File

@ -57,7 +57,7 @@
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.uid|getUserNickname}/{$vo.uid}
{$vo.nickName}/{$vo.uid}
</td>
<td class="text-center">
{$vo.add_time|date='Y-m-d H:i:s',###}

View File

@ -166,10 +166,12 @@
function setTime() {
setTimeout(function () {
$.each($combinationId,function (index,item) {
$('.count-time-'+item).downCount({
date: $('.count-time-'+item).attr('data-time'),
offset: +8
});
if($('.count-time-'+item).attr('data-time')!=undefined){
$('.count-time-'+item).downCount({
date: $('.count-time-'+item).attr('data-time'),
offset: +8
});
}
})
},3000);
}
@ -196,7 +198,6 @@
switch (event) {
case 'delstor':
var url=layList.U({c:'ump.store_combination',a:'delete',q:{id:data.id}});
console.log(url);
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
@ -214,56 +215,33 @@
$(document).click(function (e) {
$('.layui-nav-child').hide();
})
function dropdown(that){
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()){
if($(document).height() < offset.top+$(that).next('ul').height()){
$(that).next('ul').css({
'padding': 10,
'top': - ($(that).parent('td').height() / 2 + $(that).height() + $(that).next('ul').height()/2),
'top': offset.top-$(that).next('ul').height()-30,
'min-width': 'inherit',
'position': 'absolute'
'left': offset.left - $(that).width() / 2,
'position': 'fixed'
}).toggle();
}else{
$(that).next('ul').css({
'padding': 10,
'top':$(that).parent('td').height() / 2 + $(that).height(),
'top': offset.top + 30,
'min-width': 'inherit',
'position': 'absolute'
'left': offset.left - $(that).width() / 2,
'position': 'fixed'
}).toggle();
}
}
$('.js-group-btn').on('click',function(){
$('.js-group-btn').css({zIndex:1});
$(this).css({zIndex:2});
});
$('.delstor').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
console.log(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);
});
})
});
$(document).on('click',".open_image",function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
</script>
{/block}

View File

@ -36,7 +36,7 @@
<img class="open_image" style="max-width: 80px;" data-image="{$vo.avatar}" src="{$vo.avatar}" alt="{$vo.nickname}">
</td>
<td class="text-center">
<a href="{:Url('order.storeOrder/index')}?real_name={$vo.order_id_key|getOrderId}">{$vo.order_id}</a>
<a href="{:Url('order.storeOrder/index')}?real_name={$vo.order_id}">{$vo.order_id}</a>
</td>
<td class="text-center">
{$vo.price}

View File

@ -46,7 +46,7 @@
{$vo.coupon_time}
</td>
<td class="text-center">
<button class="btn btn-primary btn-xs grant" data-url="{:Url('store.storeCouponUser/grant_all',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
<button class="btn btn-primary btn-xs grant" data-url="{:Url('ump.storeCouponUser/grant_all',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
</button>
</td>
</tr>

View File

@ -46,7 +46,7 @@
{$vo.coupon_time}
</td>
<td class="text-center">
<button class="btn btn-primary btn-xs grant" data-id="{$vo['id']}" data-url="{:Url('store.storeCouponUser/grant_group',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
<button class="btn btn-primary btn-xs grant" data-id="{$vo['id']}" data-url="{:Url('ump.storeCouponUser/grant_group',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
</button>
</td>
</tr>

View File

@ -46,7 +46,7 @@
{$vo.coupon_time}
</td>
<td class="text-center">
<button class="btn btn-primary btn-xs grant" data-url="{:Url('store.storeCouponUser/grant_subscribe',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
<button class="btn btn-primary btn-xs grant" data-url="{:Url('ump.storeCouponUser/grant_subscribe',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
</button>
</td>
</tr>

View File

@ -46,7 +46,7 @@
{$vo.coupon_time}
</td>
<td class="text-center">
<button class="btn btn-primary btn-xs grant" data-url="{:Url('store.storeCouponUser/grant_tag',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
<button class="btn btn-primary btn-xs grant" data-url="{:Url('ump.storeCouponUser/grant_tag',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
</button>
</td>
</tr>

View File

@ -103,7 +103,7 @@
{field: 'start_name', title: '秒杀状态',width:'13%',toolbar:"#statusCn",unresize:true},
{field: 'stop_time', title: '结束时间', width: '13%',toolbar: '#stopTime',unresize:true},
{field: 'status', title: '状态',width:'6%',toolbar:"#status",unresize:true},
{fixed: 'right', title: '操作', width: '5%', align: 'center', toolbar: '#barDemo',unresize:true}
{field: 'right', title: '操作', width: '5%', align: 'center', toolbar: '#barDemo',unresize:true}
]
});
setTime();

View File

@ -28,7 +28,7 @@
{$vo.add_time|date="Y-m-d H:i:s",###}
</td>
<td class="text-center">
{$vo.uid|getOrderCount}
{$vo.orderCount}
</td>
<td class="text-center">
{$vo.now_money}

View File

@ -668,8 +668,6 @@ class AuthApi extends AuthController{
}else
return JsonService::fail('添加收货地址失败!');
}
}
/**
@ -1341,7 +1339,7 @@ class AuthApi extends AuthController{
$arr = User::where('spread_uid',$this->userInfo['uid'])->column('uid');
$list = StoreOrder::getUserOrderCount(implode(',',$arr),$type);
$price = [];
foreach ($list as $k=>$v) $price[]=$v['pay_price'];
if(!empty($list)) foreach ($list as $k=>$v) $price[]=$v['pay_price'];
$cont = count($list);
$sum = array_sum($price);
return JsonService::successful(['cont'=>$cont,'sum'=>$sum]);
@ -1433,11 +1431,15 @@ class AuthApi extends AuthController{
header('content-type:image/jpg');
if(!$this->userInfo['uid']) return JsonService::fail('授权失败,请重新授权');
$path = 'public/uploads/routine/'.$this->userInfo['uid'].'.jpg';
$domain=SystemConfigService::get('site_url').'/';
$domain = SystemConfigService::get('site_url').'/';
$domainTop = substr($domain,0,5);
if($domainTop != 'https') $domain = 'https:'.substr($domain,5,strlen($domain));
if(file_exists($path)) return JsonService::successful($domain.$path);
else{
$dir = iconv("UTF-8", "GBK", "public/uploads/routine");
mkdir ($dir,0775,true);
if(!file_exists('public/uploads/routine')){
$dir = iconv("UTF-8", "GBK", "public/uploads/routine");
mkdir ($dir,0775,true);
}
file_put_contents($path,RoutineCode::getCode($this->userInfo['uid']));
}
return JsonService::successful($domain.$path);

View File

@ -105,7 +105,7 @@ class StoreCouponUser extends ModelBasic
$data['coupon_price'] = $couponInfo['coupon_price'];
$data['use_min_price'] = $couponInfo['use_min_price'];
$data['add_time'] = time();
$data['end_time'] = $couponInfo['add_time']+$couponInfo['coupon_time']*86400;
$data['end_time'] = $data['add_time']+$couponInfo['coupon_time']*86400;
$data['type'] = $type;
return self::set($data);
}

View File

@ -206,7 +206,7 @@ class StorePink extends ModelBasic
$model = $model->join('StoreCombination c','c.id=p.cid');
return self::page($model,function($item)use($where){
$item['count_people'] = bcadd(self::where('k_id',$item['id'])->count(),1,0);
},$where);
$item['nickName'] = User::getUserInfo($item['uid'])['nickname'];},$where);
}
public static function isPinkBe($data,$id){

View File

@ -15,22 +15,23 @@
<div class="page-index" id="app-index">
<section ref="bsDom">
<div>
<div class="search-wrapper">
<!--<div class="search-wrapper">
<form method="post" @submit.prevent="goSearch">
<div class="search-box flex"><input type="text" v-model="keyword" placeholder="商品搜索: 请输入商品关键词"> <a
class="index-icon home-btn" href="{:url('my/notice')}">
{gt name="notice" value="0"} <b class="count-num">{$notice}</b> {/gt} </a></div>
</form>
</div>
</div>-->
<!-- 滑动导航 -->
<div class="common-slider-nav" ref="xScroll">
<!-- <div class="common-slider-nav" ref="xScroll">
<ul class="swiper-wrapper">
<li class="swiper-slide on"><a href="javascript:void(0);">商城优选</a></li>
<li class="swiper-slide"><a href="{:url('store/combination')}"><img src="{__WAP_PATH}sx/images/pt-bg.png" alt=""></a></li>
{volist name="category" id="vo"}
<li class="swiper-slide"><a href="{:Url('store/index',['cid'=>$vo['id']])}">{$vo.cate_name}</a></li>
{/volist}
</ul>
</div>
</div>-->
{notempty name="banner"}
<div class="banner" ref="banners">
<ul class="swiper-wrapper">
@ -112,6 +113,32 @@
</ul>
</div>
{/notempty}
<div class="buyspell-list" v-cloak="" v-show="combinationList.length > 0">
<div class="index-common-title border-1px">
<span class="color-red">拼团 . </span>花少钱买好货 <i class="icon" @click="window.location.href='{:url('store/combination')}'"></i>
</div>
<div class="product-banner"><img src="{$pinkImage}"></div>
<div class="bslist-box">
<div class="bs-item flex" v-for="item in combinationList">
<div class="picture">
<img :src="item.image">
</div>
<div class="bs-item-info flex">
<div class="info-title">{{item.title}}</div>
<div class="count-wrapper">
<span class="price">¥{{item.price}}</span>
<span class="old-price">¥{{item.product_price}}</span>
<span class="count">已拼{{item.sales}}单</span>
</div>
<a class="people-num flex">
<span class="numbers">{{item.people}}人团</span>
<span class="peo-txt" @click="window.location.href='{:url('store/combination_detail',[],false)}/id/'+item.id">去开团</span>
<i class="index-icon people-icon"></i>
</a>
</div>
</div>
</div>
</div>
<!-- 商品分类模板 -->
<div class="template-prolist" v-cloak="" v-for="item in cateGroupList" v-show="cateGroupList.length > 0">
<div class="index-common-title border-1px">
@ -155,31 +182,41 @@
</div>
<span class="nickname"></span>
</div>
<div class="lottie-bg"><div id="lottie"></div></div>
<script>
var anim;
var elem = document.getElementById('lottie');
//elem.style.display = 'none';
var animData = {
container: elem,
renderer: 'svg',
loop: true,
autoplay: true,
rendererSettings: {
progressiveLoad:false,
imagePreserveAspectRatio: 'xMidYMid meet'
},
path: '{__WAP_PATH}crmeb/js/animation.json'
};
anim = lottie.loadAnimation(animData);
anim.setSubframe(false);
setTimeout(
function () {
$('.lottie-bg').hide();
},2000)
</script>
<div class="lottie-bg">
<div id="lottie"></div>
</div>
<script type="text/javascript">
function loadCRMEB() {
var anim;
var elem = document.getElementById('lottie');
var animData = {
container: elem,
renderer: 'svg',
loop: true,
autoplay: true,
rendererSettings: {
progressiveLoad: false,
imagePreserveAspectRatio: 'xMidYMid meet'
},
path: '{__WAP_PATH}crmeb/js/animation.json'
};
anim = lottie.loadAnimation(animData);
anim.setSubframe(false);
setTimeout(
function () {
$('.lottie-bg').hide();
}, 2000)
}
if(!window.name) {
loadCRMEB();
window.name = "CRMEB";
}else{
$('.lottie-bg').hide();
}
var base = new Base64();
(function () {
var $pinkListUser = <?php echo json_encode($storePink);?>;
if($pinkListUser.length > 0){
@ -290,30 +327,21 @@
},
elInit: function () {
that = this;
setTimeout(function(){
var child = that.$refs.xScroll.children[0],liDom = child.getElementsByTagName('li');
if(this.$refs.banners){
var liDom = $(this.$refs.banners).find('li');
if(liDom.length > 0 ){
child.style.width = (liDom[0].offsetWidth * liDom.length)+'px';
new BScroll(that.$refs.xScroll,{eventPassthrough : 'vertical',scrollX: true, scrollY: false,observeDOM:false,click:true,probeType:1,cancelable:false});
// that.$nextTick(function(){
// that.scroll.refresh();
// });
}
});
setTimeout(function () {
if(!that.$refs.banners) return ;
var child = that.$refs.banners.children[0],liDom = child.getElementsByTagName('li');
if(liDom.length > 0 ){
child.style.width = (document.body.offsetWidth * liDom.length)+'px';
Array.prototype.slice.call(liDom).forEach(function (item) {
item.style.width = document.body.offsetWidth+'px';
liDom.width(document.body.offsetWidth);
$(this.$refs.banners).find('ul').width((document.body.offsetWidth * liDom.length)+'px');
var myBanner = new Swiper('.banner', {
pagination: '.swiper-pagination',
paginationClickable: false,
autoplay: 4500,
loop: true,
speed: 2500,
autoplayDisableOnInteraction: false
});
new BScroll(that.$refs.banners,{eventPassthrough : 'vertical',scrollX: true, scrollY: false,observeDOM:false,click:true,probeType:1,cancelable:false,momentum: false,snap: {loop: false, threshold: 0.1, stepX: document.body.offsetWidth}});
// that.$nextTick(function(){
// that.scroll.refresh();
// });
}
});
}
$('.schedule-weight').each(function() {
var _this = $(this);
var width = _this.attr('data-width');
@ -360,4 +388,5 @@
}
})
});
}());</script>{/block}
}());</script>
{/block}

View File

@ -116,7 +116,7 @@
that = this;
storeApi.goBuy({
cartNum: that.cartNum,
uniqueId: '',
uniqueId: 0,
productId: this.product.product_id,
combinationId: this.product.id
}, function (cartId) {

View File

@ -106,9 +106,9 @@
var $key = '<?=$orderKey?>';
var $seckill_id = '<?=$seckill_id?>';
var $bargain_id = '<?=$bargain_id?>';
var wap_path = '{__WAP_PATH}';
requirejs(['vue','store','helper','{__WAP_PATH}crmeb/module/store/use-coupon.js','{__WAP_PATH}crmeb/module/store/use-address.js','layer'],function(Vue,storeApi,$h,useCoupon,useAddress,layer){
requirejs(['vue','store','helper','{__WAP_PATH}crmeb/module/store/use-coupon.js'
,'{__WAP_PATH}crmeb/module/store/use-address.js','layer'],function(Vue,storeApi,$h,useCoupon,useAddress,layer){
Vue.use(useCoupon);
Vue.use(useAddress);

View File

@ -13,6 +13,7 @@
</div>
<div class="product-info">
<div class="title">{$storeInfo.store_name}</div>
<div class="price">¥{$storeInfo.price|floatval}</div>
<div class="oldprice">原价:¥{$storeInfo.ot_price|floatval}</div>
<div class="info-amount flex"><span class="current">商品编号:{$storeInfo.id}</span> <span class="">库存:{$storeInfo.stock}{$storeInfo.unit_name}</span>
<span class="fr">销量:{$storeInfo.sales}{$storeInfo.unit_name}</span></div>
@ -20,13 +21,12 @@
<div class="integral">积分:{$storeInfo.give_integral|floatval} <span>赠送</span></div>
{/gt}
</div>
<div class="like-it" v-cloak=""><i class="zan-btn iconfont icon-thumbsup"
:class="{'icon-thumbsup110':product.userLike == true}" @click="like"></i> 点赞
<span v-text="product.like_num"></span>
</div>
<div class="pro-attributes" @click="cardUp" v-show="productAttr && productAttr.length > 0" v-cloak="">选择
{{productAttrCate}}
</div>
<div class="like-it" v-cloak=""><i class="zan-btn iconfont icon-thumbsup" :class="{'icon-thumbsup110':product.userLike == true}" @click="like"></i> 点赞
<span v-text="product.like_num"></span>
</div>
{notempty name="reply"}
<div class="item-box">
<div class="item-tit"><i class="line"></i><i class="iconfont icon-pinglun1"></i><span>评价</span><i