更新小程序订阅消息

This commit is contained in:
liaofei 2020-01-03 12:05:45 +08:00
parent 83e6b77e58
commit caf64b5266
152 changed files with 4033 additions and 3208 deletions

View File

@ -1,3 +1,3 @@
<?php
define('INSTALL_DATE',1567993973);
define('SERIALNUMBER','BaoWxF');
define('INSTALL_DATE',1576029123);
define('SERIALNUMBER','Xwdc05');

View File

@ -1,2 +1,2 @@
version=CRMEB-KYDT v3.1.2
version=CRMEB-KYDT v3.1.3
version_code=134

View File

@ -13,6 +13,7 @@ use app\admin\model\user\User as UserModel;//用户
use app\admin\model\store\StoreProductReply as StoreProductReplyModel;//评论
use app\admin\model\store\StoreProduct as ProductModel;//产品
use FormBuilder\Json;
use think\facade\Config;
/**
* 首页控制器
@ -26,45 +27,46 @@ class Index extends AuthController
{
//获取当前登录后台的管理员信息
$adminInfo = $this->adminInfo->toArray();
$roles = explode(',',$adminInfo['roles']);
$site_logo = SystemConfig::getOneConfig('menu_name','site_logo')->toArray();
$roles = explode(',', $adminInfo['roles']);
$site_logo = SystemConfig::getOneConfig('menu_name', 'site_logo')->toArray();
$this->assign([
'menuList'=>SystemMenus::menuList(),
'site_logo'=>json_decode($site_logo['value'],true),
'new_order_audio_link'=>sysConfig('new_order_audio_link'),
'role_name'=>SystemRole::where('id',$roles[0])->field('role_name')->find()
'menuList' => SystemMenus::menuList(),
'site_logo' => json_decode($site_logo['value'], true),
'new_order_audio_link' => sys_config('new_order_audio_link'),
'role_name' => SystemRole::where('id', $roles[0])->field('role_name')->find(),
'workermanPort' => Config::get('workerman.admin.port')
]);
return $this->fetch();
}
//后台首页内容
//后台首页内容
public function main()
{
/*首页第一行统计*/
$now_month = strtotime(date('Y-m'));//本月
$pre_month = strtotime(date('Y-m',strtotime('-1 month')));//上月
$pre_month = strtotime(date('Y-m', strtotime('-1 month')));//上月
$now_day = strtotime(date('Y-m-d'));//今日
$pre_day = strtotime(date('Y-m-d',strtotime('-1 day')));//昨天时间戳
$beforyester_day = strtotime(date('Y-m-d',strtotime('-2 day')));//前天时间戳
$pre_day = strtotime(date('Y-m-d', strtotime('-1 day')));//昨天时间戳
$beforyester_day = strtotime(date('Y-m-d', strtotime('-2 day')));//前天时间戳
//待发货数量
$topData['orderDeliveryNum'] = StoreOrderModel::where('status',0)
->where('paid',1)
->where('refund_status',0)
$topData['orderDeliveryNum'] = StoreOrderModel::where('status', 0)
->where('paid', 1)
->where('refund_status', 0)
->count();
//退换货订单数
$topData['orderRefundNum'] = StoreOrderModel::where('paid',1)
->where('refund_status','IN','1')
$topData['orderRefundNum'] = StoreOrderModel::where('paid', 1)
->where('refund_status', 'IN', '1')
->count();
//库存预警
$replenishment_num = SystemConfig::getConfigValue('store_stock') > 0 ? SystemConfig::getConfigValue('store_stock') : 20;//库存预警界限
$topData['stockProduct'] = StoreProduct::where('stock','<=',$replenishment_num)->where('is_show',1)->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();
$topData['treatedExtract'] = UserExtractModel::where('status', 0)->count();
//订单数->昨日
$now_day_order_p = StoreOrderModel::where('paid',1)->whereTime('pay_time','yesterday')->count();
$pre_day_order_p = StoreOrderModel::where('paid',1)->where('pay_time','>',$pre_day)->where('pay_time','<',$now_day)->count();
$now_day_order_p = StoreOrderModel::where('paid', 1)->whereTime('pay_time', 'yesterday')->count();
$pre_day_order_p = StoreOrderModel::where('paid', 1)->where('pay_time', '>', $pre_day)->where('pay_time', '<', $now_day)->count();
$first_line['d_num'] = [
'data' => $now_day_order_p ? $now_day_order_p : 0,
'percent' => abs($now_day_order_p - $pre_day_order_p),
@ -72,8 +74,8 @@ class Index extends AuthController
];
//交易额->昨天
$now_month_order_p = StoreOrderModel::where('paid',1)->whereTime('pay_time','yesterday')->sum('pay_price');
$pre_month_order_p = StoreOrderModel::where('paid',1)->where('pay_time','>',$beforyester_day)->where('pay_time','<',$pre_day)->sum('pay_price');
$now_month_order_p = StoreOrderModel::where('paid', 1)->whereTime('pay_time', 'yesterday')->sum('pay_price');
$pre_month_order_p = StoreOrderModel::where('paid', 1)->where('pay_time', '>', $beforyester_day)->where('pay_time', '<', $pre_day)->sum('pay_price');
$first_line['d_price'] = [
'data' => $now_month_order_p > 0 ? $now_month_order_p : 0,
'percent' => abs($now_month_order_p - $pre_month_order_p),
@ -81,8 +83,8 @@ class Index extends AuthController
];
//交易额->月
$now_month_order_p = StoreOrderModel::where('paid',1)->whereTime('pay_time','month')->sum('pay_price');
$pre_month_order_p = StoreOrderModel::where('paid',1)->where('pay_time','>',$pre_month)->where('pay_time','<',$now_month)->value('sum(pay_price)');
$now_month_order_p = StoreOrderModel::where('paid', 1)->whereTime('pay_time', 'month')->sum('pay_price');
$pre_month_order_p = StoreOrderModel::where('paid', 1)->where('pay_time', '>', $pre_month)->where('pay_time', '<', $now_month)->value('sum(pay_price)');
$first_line['m_price'] = [
'data' => $now_month_order_p > 0 ? $now_month_order_p : 0,
'percent' => abs($now_month_order_p - $pre_month_order_p),
@ -90,8 +92,8 @@ class Index extends AuthController
];
//新粉丝->日
$now_day_user = User::where('add_time','>',$now_day)->count();
$pre_day_user = User::where('add_time','>',$pre_day)->where('add_time','<',$now_day)->count();
$now_day_user = User::where('add_time', '>', $now_day)->count();
$pre_day_user = User::where('add_time', '>', $pre_day)->where('add_time', '<', $now_day)->count();
$pre_day_user = $pre_day_user ? $pre_day_user : 0;
$first_line['day'] = [
'data' => $now_day_user ? $now_day_user : 0,
@ -100,8 +102,8 @@ class Index extends AuthController
];
//新粉丝->月
$now_month_user = User::where('add_time','>',$now_month)->count();
$pre_month_user = User::where('add_time','>',$pre_month)->where('add_time','<',$now_month)->count();
$now_month_user = User::where('add_time', '>', $now_month)->count();
$pre_month_user = User::where('add_time', '>', $pre_month)->where('add_time', '<', $now_month)->count();
$first_line['month'] = [
'data' => $now_month_user ? $now_month_user : 0,
'percent' => abs($now_month_user - $pre_month_user),
@ -109,8 +111,8 @@ class Index extends AuthController
];
//本月订单总数
$now_order_info_c = StoreOrderModel::where('add_time','>',$now_month)->count();
$pre_order_info_c = StoreOrderModel::where('add_time','>',$pre_month)->where('add_time','<',$now_month)->count();
$now_order_info_c = StoreOrderModel::where('add_time', '>', $now_month)->count();
$pre_order_info_c = StoreOrderModel::where('add_time', '>', $pre_month)->where('add_time', '<', $now_month)->count();
$order_info['first'] = [
'data' => $now_order_info_c ? $now_order_info_c : 0,
'percent' => abs($now_order_info_c - $pre_order_info_c),
@ -118,10 +120,10 @@ class Index extends AuthController
];
//上月订单总数
$second_now_month = strtotime(date('Y-m',strtotime('-1 month')));
$second_pre_month = strtotime(date('Y-m',strtotime('-2 month')));
$now_order_info_c = StoreOrderModel::where('add_time','>',$pre_month)->where('add_time','<',$now_month)->count();
$pre_order_info_c = StoreOrderModel::where('add_time','>',$second_pre_month)->where('add_time','<',$second_now_month)->count();
$second_now_month = strtotime(date('Y-m', strtotime('-1 month')));
$second_pre_month = strtotime(date('Y-m', strtotime('-2 month')));
$now_order_info_c = StoreOrderModel::where('add_time', '>', $pre_month)->where('add_time', '<', $now_month)->count();
$pre_order_info_c = StoreOrderModel::where('add_time', '>', $second_pre_month)->where('add_time', '<', $second_now_month)->count();
$order_info["second"] = [
'data' => $now_order_info_c ? $now_order_info_c : 0,
'percent' => abs($now_order_info_c - $pre_order_info_c),
@ -141,385 +143,386 @@ class Index extends AuthController
/**
* 订单图表
*/
public function orderchart(){
public function orderchart()
{
header('Content-type:text/json');
$cycle = $this->request->param('cycle')?:'thirtyday';//默认30天
$cycle = $this->request->param('cycle') ?: 'thirtyday';//默认30天
$datalist = [];
switch ($cycle){
switch ($cycle) {
case 'thirtyday':
$datebefor = date('Y-m-d',strtotime('-30 day'));
$datebefor = date('Y-m-d', strtotime('-30 day'));
$dateafter = date('Y-m-d');
//上期
$pre_datebefor = date('Y-m-d',strtotime('-60 day'));
$pre_dateafter = date('Y-m-d',strtotime('-30 day'));
for($i=-30;$i < 0;$i++){
$datalist[date('m-d',strtotime($i.' day'))] = date('m-d',strtotime($i.' day'));
$pre_datebefor = date('Y-m-d', strtotime('-60 day'));
$pre_dateafter = date('Y-m-d', strtotime('-30 day'));
for ($i = -30; $i < 0; $i++) {
$datalist[date('m-d', strtotime($i . ' day'))] = date('m-d', strtotime($i . ' day'));
}
$order_list = StoreOrderModel::where('add_time','between time',[$datebefor,$dateafter])
$order_list = StoreOrderModel::where('add_time', 'between time', [$datebefor, $dateafter])
->field("FROM_UNIXTIME(add_time,'%m-%d') as day,count(*) as count,sum(pay_price) as price")
->group("FROM_UNIXTIME(add_time, '%Y%m%d')")
->order('add_time asc')
->select()->toArray();
if(empty($order_list)) return Json::fail('无数据');
foreach ($order_list as $k=>&$v){
if (empty($order_list)) return Json::fail('无数据');
foreach ($order_list as $k => &$v) {
$order_list[$v['day']] = $v;
}
$cycle_list = [];
foreach ($datalist as $dk=>$dd){
if(!empty($order_list[$dd])){
foreach ($datalist as $dk => $dd) {
if (!empty($order_list[$dd])) {
$cycle_list[$dd] = $order_list[$dd];
}else{
$cycle_list[$dd] = ['count'=>0,'day'=>$dd,'price'=>''];
} else {
$cycle_list[$dd] = ['count' => 0, 'day' => $dd, 'price' => ''];
}
}
$chartdata = [];
$data = [];//临时
$chartdata['yAxis']['maxnum'] = 0;//最大值数量
$chartdata['yAxis']['maxprice'] = 0;//最大值金额
foreach ($cycle_list as $k=>$v){
foreach ($cycle_list as $k => $v) {
$data['day'][] = $v['day'];
$data['count'][] = $v['count'];
$data['price'][] = round($v['price'],2);
if($chartdata['yAxis']['maxnum'] < $v['count'])
$data['price'][] = round($v['price'], 2);
if ($chartdata['yAxis']['maxnum'] < $v['count'])
$chartdata['yAxis']['maxnum'] = $v['count'];//日最大订单数
if($chartdata['yAxis']['maxprice'] < $v['price'])
if ($chartdata['yAxis']['maxprice'] < $v['price'])
$chartdata['yAxis']['maxprice'] = $v['price'];//日最大金额
}
$chartdata['legend'] = ['订单金额','订单数'];//分类
$chartdata['legend'] = ['订单金额', '订单数'];//分类
$chartdata['xAxis'] = $data['day'];//X轴值
//,'itemStyle'=>$series
$series= ['normal'=>['label'=>['show'=>true,'position'=>'top']]];
$chartdata['series'][] = ['name'=>$chartdata['legend'][0],'type'=>'bar','itemStyle'=>$series,'data'=>$data['price']];//分类1值
$chartdata['series'][] = ['name'=>$chartdata['legend'][1],'type'=>'bar','itemStyle'=>$series,'data'=>$data['count']];//分类2值
$series = ['normal' => ['label' => ['show' => true, 'position' => 'top']]];
$chartdata['series'][] = ['name' => $chartdata['legend'][0], 'type' => 'bar', 'itemStyle' => $series, 'data' => $data['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][1], 'type' => 'bar', 'itemStyle' => $series, 'data' => $data['count']];//分类2值
//统计总数上期
$pre_total = StoreOrderModel::where('add_time','between time',[$pre_datebefor,$pre_dateafter])
$pre_total = StoreOrderModel::where('add_time', 'between time', [$pre_datebefor, $pre_dateafter])
->field("count(*) as count,sum(pay_price) as price")
->find();
if($pre_total){
if ($pre_total) {
$chartdata['pre_cycle']['count'] = [
'data' => $pre_total['count']? : 0
'data' => $pre_total['count'] ?: 0
];
$chartdata['pre_cycle']['price'] = [
'data' => $pre_total['price']? : 0
'data' => $pre_total['price'] ?: 0
];
}
//统计总数
$total = StoreOrderModel::where('add_time','between time',[$datebefor,$dateafter])
$total = StoreOrderModel::where('add_time', 'between time', [$datebefor, $dateafter])
->field("count(*) as count,sum(pay_price) as price")
->find();
if($total){
if ($total) {
$cha_count = intval($pre_total['count']) - intval($total['count']);
$pre_total['count'] = $pre_total['count']==0 ? 1 : $pre_total['count'];
$pre_total['count'] = $pre_total['count'] == 0 ? 1 : $pre_total['count'];
$chartdata['cycle']['count'] = [
'data' => $total['count']? : 0,
'percent' => round((abs($cha_count)/intval($pre_total['count'])*100),2),
'data' => $total['count'] ?: 0,
'percent' => round((abs($cha_count) / intval($pre_total['count']) * 100), 2),
'is_plus' => $cha_count > 0 ? -1 : ($cha_count == 0 ? 0 : 1)
];
$cha_price = round($pre_total['price'],2) - round($total['price'],2);
$pre_total['price'] = $pre_total['price']==0 ? 1 : $pre_total['price'];
$cha_price = round($pre_total['price'], 2) - round($total['price'], 2);
$pre_total['price'] = $pre_total['price'] == 0 ? 1 : $pre_total['price'];
$chartdata['cycle']['price'] = [
'data' => $total['price']? : 0,
'percent' => round(abs($cha_price)/$pre_total['price']*100,2),
'data' => $total['price'] ?: 0,
'percent' => round(abs($cha_price) / $pre_total['price'] * 100, 2),
'is_plus' => $cha_price > 0 ? -1 : ($cha_price == 0 ? 0 : 1)
];
}
return app('json')->success('ok',$chartdata);
return app('json')->success('ok', $chartdata);
break;
case 'week':
$weekarray=array(['周日'],['周一'],['周二'],['周三'],['周四'],['周五'],['周六']);
$datebefor = date('Y-m-d',strtotime('-1 week Monday'));
$dateafter = date('Y-m-d',strtotime('-1 week Sunday'));
$order_list = StoreOrderModel::where('add_time','between time',[$datebefor,$dateafter])
$weekarray = array(['周日'], ['周一'], ['周二'], ['周三'], ['周四'], ['周五'], ['周六']);
$datebefor = date('Y-m-d', strtotime('-1 week Monday'));
$dateafter = date('Y-m-d', strtotime('-1 week Sunday'));
$order_list = StoreOrderModel::where('add_time', 'between time', [$datebefor, $dateafter])
->field("FROM_UNIXTIME(add_time,'%w') as day,count(*) as count,sum(pay_price) as price")
->group("FROM_UNIXTIME(add_time, '%Y%m%e')")
->order('add_time asc')
->select()->toArray();
//数据查询重新处理
$new_order_list = [];
foreach ($order_list as $k=>$v){
foreach ($order_list as $k => $v) {
$new_order_list[$v['day']] = $v;
}
$now_datebefor = date('Y-m-d', (time() - ((date('w') == 0 ? 7 : date('w')) - 1) * 24 * 3600));
$now_dateafter = date('Y-m-d',strtotime("+1 day"));
$now_order_list = StoreOrderModel::where('add_time','between time',[$now_datebefor,$now_dateafter])
$now_dateafter = date('Y-m-d', strtotime("+1 day"));
$now_order_list = StoreOrderModel::where('add_time', 'between time', [$now_datebefor, $now_dateafter])
->field("FROM_UNIXTIME(add_time,'%w') as day,count(*) as count,sum(pay_price) as price")
->group("FROM_UNIXTIME(add_time, '%Y%m%e')")
->order('add_time asc')
->select()->toArray();
//数据查询重新处理 key 变为当前值
$new_now_order_list = [];
foreach ($now_order_list as $k=>$v){
foreach ($now_order_list as $k => $v) {
$new_now_order_list[$v['day']] = $v;
}
foreach ($weekarray as $dk=>$dd){
if(!empty($new_order_list[$dk])){
foreach ($weekarray as $dk => $dd) {
if (!empty($new_order_list[$dk])) {
$weekarray[$dk]['pre'] = $new_order_list[$dk];
}else{
$weekarray[$dk]['pre'] = ['count'=>0,'day'=>$weekarray[$dk][0],'price'=>'0'];
} else {
$weekarray[$dk]['pre'] = ['count' => 0, 'day' => $weekarray[$dk][0], 'price' => '0'];
}
if(!empty($new_now_order_list[$dk])){
if (!empty($new_now_order_list[$dk])) {
$weekarray[$dk]['now'] = $new_now_order_list[$dk];
}else{
$weekarray[$dk]['now'] = ['count'=>0,'day'=>$weekarray[$dk][0],'price'=>'0'];
} else {
$weekarray[$dk]['now'] = ['count' => 0, 'day' => $weekarray[$dk][0], 'price' => '0'];
}
}
$chartdata = [];
$data = [];//临时
$chartdata['yAxis']['maxnum'] = 0;//最大值数量
$chartdata['yAxis']['maxprice'] = 0;//最大值金额
foreach ($weekarray as $k=>$v){
foreach ($weekarray as $k => $v) {
$data['day'][] = $v[0];
$data['pre']['count'][] = $v['pre']['count'];
$data['pre']['price'][] = round($v['pre']['price'],2);
$data['pre']['price'][] = round($v['pre']['price'], 2);
$data['now']['count'][] = $v['now']['count'];
$data['now']['price'][] = round($v['now']['price'],2);
if($chartdata['yAxis']['maxnum'] < $v['pre']['count'] || $chartdata['yAxis']['maxnum'] < $v['now']['count']){
$chartdata['yAxis']['maxnum'] = $v['pre']['count']>$v['now']['count']?$v['pre']['count']:$v['now']['count'];//日最大订单数
$data['now']['price'][] = round($v['now']['price'], 2);
if ($chartdata['yAxis']['maxnum'] < $v['pre']['count'] || $chartdata['yAxis']['maxnum'] < $v['now']['count']) {
$chartdata['yAxis']['maxnum'] = $v['pre']['count'] > $v['now']['count'] ? $v['pre']['count'] : $v['now']['count'];//日最大订单数
}
if($chartdata['yAxis']['maxprice'] < $v['pre']['price'] || $chartdata['yAxis']['maxprice'] < $v['now']['price']){
$chartdata['yAxis']['maxprice'] = $v['pre']['price']>$v['now']['price']?$v['pre']['price']:$v['now']['price'];//日最大金额
if ($chartdata['yAxis']['maxprice'] < $v['pre']['price'] || $chartdata['yAxis']['maxprice'] < $v['now']['price']) {
$chartdata['yAxis']['maxprice'] = $v['pre']['price'] > $v['now']['price'] ? $v['pre']['price'] : $v['now']['price'];//日最大金额
}
}
$chartdata['legend'] = ['上周金额','本周金额','上周订单数','本周订单数'];//分类
$chartdata['legend'] = ['上周金额', '本周金额', '上周订单数', '本周订单数'];//分类
$chartdata['xAxis'] = $data['day'];//X轴值
//,'itemStyle'=>$series
$series= ['normal'=>['label'=>['show'=>true,'position'=>'top']]];
$chartdata['series'][] = ['name'=>$chartdata['legend'][0],'type'=>'bar','itemStyle'=>$series,'data'=>$data['pre']['price']];//分类1值
$chartdata['series'][] = ['name'=>$chartdata['legend'][1],'type'=>'bar','itemStyle'=>$series,'data'=>$data['now']['price']];//分类1值
$chartdata['series'][] = ['name'=>$chartdata['legend'][2],'type'=>'line','itemStyle'=>$series,'data'=>$data['pre']['count']];//分类2值
$chartdata['series'][] = ['name'=>$chartdata['legend'][3],'type'=>'line','itemStyle'=>$series,'data'=>$data['now']['count']];//分类2值
$series = ['normal' => ['label' => ['show' => true, 'position' => 'top']]];
$chartdata['series'][] = ['name' => $chartdata['legend'][0], 'type' => 'bar', 'itemStyle' => $series, 'data' => $data['pre']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][1], 'type' => 'bar', 'itemStyle' => $series, 'data' => $data['now']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][2], 'type' => 'line', 'itemStyle' => $series, 'data' => $data['pre']['count']];//分类2值
$chartdata['series'][] = ['name' => $chartdata['legend'][3], 'type' => 'line', 'itemStyle' => $series, 'data' => $data['now']['count']];//分类2值
//统计总数上期
$pre_total = StoreOrderModel::where('add_time','between time',[$datebefor,$dateafter])
$pre_total = StoreOrderModel::where('add_time', 'between time', [$datebefor, $dateafter])
->field("count(*) as count,sum(pay_price) as price")
->find();
if($pre_total){
if ($pre_total) {
$chartdata['pre_cycle']['count'] = [
'data' => $pre_total['count']? : 0
'data' => $pre_total['count'] ?: 0
];
$chartdata['pre_cycle']['price'] = [
'data' => $pre_total['price']? : 0
'data' => $pre_total['price'] ?: 0
];
}
//统计总数
$total = StoreOrderModel::where('add_time','between time',[$now_datebefor,$now_dateafter])
$total = StoreOrderModel::where('add_time', 'between time', [$now_datebefor, $now_dateafter])
->field("count(*) as count,sum(pay_price) as price")
->find();
if($total){
if ($total) {
$cha_count = intval($pre_total['count']) - intval($total['count']);
$pre_total['count'] = $pre_total['count']==0 ? 1 : $pre_total['count'];
$pre_total['count'] = $pre_total['count'] == 0 ? 1 : $pre_total['count'];
$chartdata['cycle']['count'] = [
'data' => $total['count']? : 0,
'percent' => round((abs($cha_count)/intval($pre_total['count'])*100),2),
'data' => $total['count'] ?: 0,
'percent' => round((abs($cha_count) / intval($pre_total['count']) * 100), 2),
'is_plus' => $cha_count > 0 ? -1 : ($cha_count == 0 ? 0 : 1)
];
$cha_price = round($pre_total['price'],2) - round($total['price'],2);
$pre_total['price'] = $pre_total['price']==0 ? 1 : $pre_total['price'];
$cha_price = round($pre_total['price'], 2) - round($total['price'], 2);
$pre_total['price'] = $pre_total['price'] == 0 ? 1 : $pre_total['price'];
$chartdata['cycle']['price'] = [
'data' => $total['price']? : 0,
'percent' => round(abs($cha_price)/$pre_total['price']*100,2),
'data' => $total['price'] ?: 0,
'percent' => round(abs($cha_price) / $pre_total['price'] * 100, 2),
'is_plus' => $cha_price > 0 ? -1 : ($cha_price == 0 ? 0 : 1)
];
}
return app('json')->success('ok',$chartdata);
return app('json')->success('ok', $chartdata);
break;
case 'month':
$weekarray=array('01'=>['1'],'02'=>['2'],'03'=>['3'],'04'=>['4'],'05'=>['5'],'06'=>['6'],'07'=>['7'],'08'=>['8'],'09'=>['9'],'10'=>['10'],'11'=>['11'],'12'=>['12'],'13'=>['13'],'14'=>['14'],'15'=>['15'],'16'=>['16'],'17'=>['17'],'18'=>['18'],'19'=>['19'],'20'=>['20'],'21'=>['21'],'22'=>['22'],'23'=>['23'],'24'=>['24'],'25'=>['25'],'26'=>['26'],'27'=>['27'],'28'=>['28'],'29'=>['29'],'30'=>['30'],'31'=>['31']);
$weekarray = array('01' => ['1'], '02' => ['2'], '03' => ['3'], '04' => ['4'], '05' => ['5'], '06' => ['6'], '07' => ['7'], '08' => ['8'], '09' => ['9'], '10' => ['10'], '11' => ['11'], '12' => ['12'], '13' => ['13'], '14' => ['14'], '15' => ['15'], '16' => ['16'], '17' => ['17'], '18' => ['18'], '19' => ['19'], '20' => ['20'], '21' => ['21'], '22' => ['22'], '23' => ['23'], '24' => ['24'], '25' => ['25'], '26' => ['26'], '27' => ['27'], '28' => ['28'], '29' => ['29'], '30' => ['30'], '31' => ['31']);
$datebefor = date('Y-m-01',strtotime('-1 month'));
$dateafter = date('Y-m-d',strtotime(date('Y-m-01')));
$order_list = StoreOrderModel::where('add_time','between time',[$datebefor,$dateafter])
$datebefor = date('Y-m-01', strtotime('-1 month'));
$dateafter = date('Y-m-d', strtotime(date('Y-m-01')));
$order_list = StoreOrderModel::where('add_time', 'between time', [$datebefor, $dateafter])
->field("FROM_UNIXTIME(add_time,'%d') as day,count(*) as count,sum(pay_price) as price")
->group("FROM_UNIXTIME(add_time, '%Y%m%e')")
->order('add_time asc')
->select()->toArray();
//数据查询重新处理
$new_order_list = [];
foreach ($order_list as $k=>$v){
foreach ($order_list as $k => $v) {
$new_order_list[$v['day']] = $v;
}
$now_datebefor = date('Y-m-01');
$now_dateafter = date('Y-m-d',strtotime("+1 day"));
$now_order_list = StoreOrderModel::where('add_time','between time',[$now_datebefor,$now_dateafter])
$now_dateafter = date('Y-m-d', strtotime("+1 day"));
$now_order_list = StoreOrderModel::where('add_time', 'between time', [$now_datebefor, $now_dateafter])
->field("FROM_UNIXTIME(add_time,'%d') as day,count(*) as count,sum(pay_price) as price")
->group("FROM_UNIXTIME(add_time, '%Y%m%e')")
->order('add_time asc')
->select()->toArray();
//数据查询重新处理 key 变为当前值
$new_now_order_list = [];
foreach ($now_order_list as $k=>$v){
foreach ($now_order_list as $k => $v) {
$new_now_order_list[$v['day']] = $v;
}
foreach ($weekarray as $dk=>$dd){
if(!empty($new_order_list[$dk])){
foreach ($weekarray as $dk => $dd) {
if (!empty($new_order_list[$dk])) {
$weekarray[$dk]['pre'] = $new_order_list[$dk];
}else{
$weekarray[$dk]['pre'] = ['count'=>0,'day'=>$weekarray[$dk][0],'price'=>'0'];
} else {
$weekarray[$dk]['pre'] = ['count' => 0, 'day' => $weekarray[$dk][0], 'price' => '0'];
}
if(!empty($new_now_order_list[$dk])){
if (!empty($new_now_order_list[$dk])) {
$weekarray[$dk]['now'] = $new_now_order_list[$dk];
}else{
$weekarray[$dk]['now'] = ['count'=>0,'day'=>$weekarray[$dk][0],'price'=>'0'];
} else {
$weekarray[$dk]['now'] = ['count' => 0, 'day' => $weekarray[$dk][0], 'price' => '0'];
}
}
$chartdata = [];
$data = [];//临时
$chartdata['yAxis']['maxnum'] = 0;//最大值数量
$chartdata['yAxis']['maxprice'] = 0;//最大值金额
foreach ($weekarray as $k=>$v){
foreach ($weekarray as $k => $v) {
$data['day'][] = $v[0];
$data['pre']['count'][] = $v['pre']['count'];
$data['pre']['price'][] = round($v['pre']['price'],2);
$data['pre']['price'][] = round($v['pre']['price'], 2);
$data['now']['count'][] = $v['now']['count'];
$data['now']['price'][] = round($v['now']['price'],2);
if($chartdata['yAxis']['maxnum'] < $v['pre']['count'] || $chartdata['yAxis']['maxnum'] < $v['now']['count']){
$chartdata['yAxis']['maxnum'] = $v['pre']['count']>$v['now']['count']?$v['pre']['count']:$v['now']['count'];//日最大订单数
$data['now']['price'][] = round($v['now']['price'], 2);
if ($chartdata['yAxis']['maxnum'] < $v['pre']['count'] || $chartdata['yAxis']['maxnum'] < $v['now']['count']) {
$chartdata['yAxis']['maxnum'] = $v['pre']['count'] > $v['now']['count'] ? $v['pre']['count'] : $v['now']['count'];//日最大订单数
}
if($chartdata['yAxis']['maxprice'] < $v['pre']['price'] || $chartdata['yAxis']['maxprice'] < $v['now']['price']){
$chartdata['yAxis']['maxprice'] = $v['pre']['price']>$v['now']['price']?$v['pre']['price']:$v['now']['price'];//日最大金额
if ($chartdata['yAxis']['maxprice'] < $v['pre']['price'] || $chartdata['yAxis']['maxprice'] < $v['now']['price']) {
$chartdata['yAxis']['maxprice'] = $v['pre']['price'] > $v['now']['price'] ? $v['pre']['price'] : $v['now']['price'];//日最大金额
}
}
$chartdata['legend'] = ['上月金额','本月金额','上月订单数','本月订单数'];//分类
$chartdata['legend'] = ['上月金额', '本月金额', '上月订单数', '本月订单数'];//分类
$chartdata['xAxis'] = $data['day'];//X轴值
//,'itemStyle'=>$series
$series= ['normal'=>['label'=>['show'=>true,'position'=>'top']]];
$chartdata['series'][] = ['name'=>$chartdata['legend'][0],'type'=>'bar','itemStyle'=>$series,'data'=>$data['pre']['price']];//分类1值
$chartdata['series'][] = ['name'=>$chartdata['legend'][1],'type'=>'bar','itemStyle'=>$series,'data'=>$data['now']['price']];//分类1值
$chartdata['series'][] = ['name'=>$chartdata['legend'][2],'type'=>'line','itemStyle'=>$series,'data'=>$data['pre']['count']];//分类2值
$chartdata['series'][] = ['name'=>$chartdata['legend'][3],'type'=>'line','itemStyle'=>$series,'data'=>$data['now']['count']];//分类2值
$series = ['normal' => ['label' => ['show' => true, 'position' => 'top']]];
$chartdata['series'][] = ['name' => $chartdata['legend'][0], 'type' => 'bar', 'itemStyle' => $series, 'data' => $data['pre']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][1], 'type' => 'bar', 'itemStyle' => $series, 'data' => $data['now']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][2], 'type' => 'line', 'itemStyle' => $series, 'data' => $data['pre']['count']];//分类2值
$chartdata['series'][] = ['name' => $chartdata['legend'][3], 'type' => 'line', 'itemStyle' => $series, 'data' => $data['now']['count']];//分类2值
//统计总数上期
$pre_total = StoreOrderModel::where('add_time','between time',[$datebefor,$dateafter])
$pre_total = StoreOrderModel::where('add_time', 'between time', [$datebefor, $dateafter])
->field("count(*) as count,sum(pay_price) as price")
->find();
if($pre_total){
if ($pre_total) {
$chartdata['pre_cycle']['count'] = [
'data' => $pre_total['count']? : 0
'data' => $pre_total['count'] ?: 0
];
$chartdata['pre_cycle']['price'] = [
'data' => $pre_total['price']? : 0
'data' => $pre_total['price'] ?: 0
];
}
//统计总数
$total = StoreOrderModel::where('add_time','between time',[$now_datebefor,$now_dateafter])
$total = StoreOrderModel::where('add_time', 'between time', [$now_datebefor, $now_dateafter])
->field("count(*) as count,sum(pay_price) as price")
->find();
if($total){
if ($total) {
$cha_count = intval($pre_total['count']) - intval($total['count']);
$pre_total['count'] = $pre_total['count']==0 ? 1 : $pre_total['count'];
$pre_total['count'] = $pre_total['count'] == 0 ? 1 : $pre_total['count'];
$chartdata['cycle']['count'] = [
'data' => $total['count']? : 0,
'percent' => round((abs($cha_count)/intval($pre_total['count'])*100),2),
'data' => $total['count'] ?: 0,
'percent' => round((abs($cha_count) / intval($pre_total['count']) * 100), 2),
'is_plus' => $cha_count > 0 ? -1 : ($cha_count == 0 ? 0 : 1)
];
$cha_price = round($pre_total['price'],2) - round($total['price'],2);
$pre_total['price'] = $pre_total['price']==0 ? 1 : $pre_total['price'];
$cha_price = round($pre_total['price'], 2) - round($total['price'], 2);
$pre_total['price'] = $pre_total['price'] == 0 ? 1 : $pre_total['price'];
$chartdata['cycle']['price'] = [
'data' => $total['price']? : 0,
'percent' => round(abs($cha_price)/$pre_total['price']*100,2),
'data' => $total['price'] ?: 0,
'percent' => round(abs($cha_price) / $pre_total['price'] * 100, 2),
'is_plus' => $cha_price > 0 ? -1 : ($cha_price == 0 ? 0 : 1)
];
}
return app('json')->success('ok',$chartdata);
return app('json')->success('ok', $chartdata);
break;
case 'year':
$weekarray=array('01'=>['一月'],'02'=>['二月'],'03'=>['三月'],'04'=>['四月'],'05'=>['五月'],'06'=>['六月'],'07'=>['七月'],'08'=>['八月'],'09'=>['九月'],'10'=>['十月'],'11'=>['十一月'],'12'=>['十二月']);
$datebefor = date('Y-01-01',strtotime('-1 year'));
$dateafter = date('Y-12-31',strtotime('-1 year'));
$order_list = StoreOrderModel::where('add_time','between time',[$datebefor,$dateafter])
$weekarray = array('01' => ['一月'], '02' => ['二月'], '03' => ['三月'], '04' => ['四月'], '05' => ['五月'], '06' => ['六月'], '07' => ['七月'], '08' => ['八月'], '09' => ['九月'], '10' => ['十月'], '11' => ['十一月'], '12' => ['十二月']);
$datebefor = date('Y-01-01', strtotime('-1 year'));
$dateafter = date('Y-12-31', strtotime('-1 year'));
$order_list = StoreOrderModel::where('add_time', 'between time', [$datebefor, $dateafter])
->field("FROM_UNIXTIME(add_time,'%m') as day,count(*) as count,sum(pay_price) as price")
->group("FROM_UNIXTIME(add_time, '%Y%m')")
->order('add_time asc')
->select()->toArray();
//数据查询重新处理
$new_order_list = [];
foreach ($order_list as $k=>$v){
foreach ($order_list as $k => $v) {
$new_order_list[$v['day']] = $v;
}
$now_datebefor = date('Y-01-01');
$now_dateafter = date('Y-m-d');
$now_order_list = StoreOrderModel::where('add_time','between time',[$now_datebefor,$now_dateafter])
$now_order_list = StoreOrderModel::where('add_time', 'between time', [$now_datebefor, $now_dateafter])
->field("FROM_UNIXTIME(add_time,'%m') as day,count(*) as count,sum(pay_price) as price")
->group("FROM_UNIXTIME(add_time, '%Y%m')")
->order('add_time asc')
->select()->toArray();
//数据查询重新处理 key 变为当前值
$new_now_order_list = [];
foreach ($now_order_list as $k=>$v){
foreach ($now_order_list as $k => $v) {
$new_now_order_list[$v['day']] = $v;
}
foreach ($weekarray as $dk=>$dd){
if(!empty($new_order_list[$dk])){
foreach ($weekarray as $dk => $dd) {
if (!empty($new_order_list[$dk])) {
$weekarray[$dk]['pre'] = $new_order_list[$dk];
}else{
$weekarray[$dk]['pre'] = ['count'=>0,'day'=>$weekarray[$dk][0],'price'=>'0'];
} else {
$weekarray[$dk]['pre'] = ['count' => 0, 'day' => $weekarray[$dk][0], 'price' => '0'];
}
if(!empty($new_now_order_list[$dk])){
if (!empty($new_now_order_list[$dk])) {
$weekarray[$dk]['now'] = $new_now_order_list[$dk];
}else{
$weekarray[$dk]['now'] = ['count'=>0,'day'=>$weekarray[$dk][0],'price'=>'0'];
} else {
$weekarray[$dk]['now'] = ['count' => 0, 'day' => $weekarray[$dk][0], 'price' => '0'];
}
}
$chartdata = [];
$data = [];//临时
$chartdata['yAxis']['maxnum'] = 0;//最大值数量
$chartdata['yAxis']['maxprice'] = 0;//最大值金额
foreach ($weekarray as $k=>$v){
foreach ($weekarray as $k => $v) {
$data['day'][] = $v[0];
$data['pre']['count'][] = $v['pre']['count'];
$data['pre']['price'][] = round($v['pre']['price'],2);
$data['pre']['price'][] = round($v['pre']['price'], 2);
$data['now']['count'][] = $v['now']['count'];
$data['now']['price'][] = round($v['now']['price'],2);
if($chartdata['yAxis']['maxnum'] < $v['pre']['count'] || $chartdata['yAxis']['maxnum'] < $v['now']['count']){
$chartdata['yAxis']['maxnum'] = $v['pre']['count']>$v['now']['count']?$v['pre']['count']:$v['now']['count'];//日最大订单数
$data['now']['price'][] = round($v['now']['price'], 2);
if ($chartdata['yAxis']['maxnum'] < $v['pre']['count'] || $chartdata['yAxis']['maxnum'] < $v['now']['count']) {
$chartdata['yAxis']['maxnum'] = $v['pre']['count'] > $v['now']['count'] ? $v['pre']['count'] : $v['now']['count'];//日最大订单数
}
if($chartdata['yAxis']['maxprice'] < $v['pre']['price'] || $chartdata['yAxis']['maxprice'] < $v['now']['price']){
$chartdata['yAxis']['maxprice'] = $v['pre']['price']>$v['now']['price']?$v['pre']['price']:$v['now']['price'];//日最大金额
if ($chartdata['yAxis']['maxprice'] < $v['pre']['price'] || $chartdata['yAxis']['maxprice'] < $v['now']['price']) {
$chartdata['yAxis']['maxprice'] = $v['pre']['price'] > $v['now']['price'] ? $v['pre']['price'] : $v['now']['price'];//日最大金额
}
}
$chartdata['legend'] = ['去年金额','今年金额','去年订单数','今年订单数'];//分类
$chartdata['legend'] = ['去年金额', '今年金额', '去年订单数', '今年订单数'];//分类
$chartdata['xAxis'] = $data['day'];//X轴值
//,'itemStyle'=>$series
$series= ['normal'=>['label'=>['show'=>true,'position'=>'top']]];
$chartdata['series'][] = ['name'=>$chartdata['legend'][0],'type'=>'bar','itemStyle'=>$series,'data'=>$data['pre']['price']];//分类1值
$chartdata['series'][] = ['name'=>$chartdata['legend'][1],'type'=>'bar','itemStyle'=>$series,'data'=>$data['now']['price']];//分类1值
$chartdata['series'][] = ['name'=>$chartdata['legend'][2],'type'=>'line','itemStyle'=>$series,'data'=>$data['pre']['count']];//分类2值
$chartdata['series'][] = ['name'=>$chartdata['legend'][3],'type'=>'line','itemStyle'=>$series,'data'=>$data['now']['count']];//分类2值
$series = ['normal' => ['label' => ['show' => true, 'position' => 'top']]];
$chartdata['series'][] = ['name' => $chartdata['legend'][0], 'type' => 'bar', 'itemStyle' => $series, 'data' => $data['pre']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][1], 'type' => 'bar', 'itemStyle' => $series, 'data' => $data['now']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][2], 'type' => 'line', 'itemStyle' => $series, 'data' => $data['pre']['count']];//分类2值
$chartdata['series'][] = ['name' => $chartdata['legend'][3], 'type' => 'line', 'itemStyle' => $series, 'data' => $data['now']['count']];//分类2值
//统计总数上期
$pre_total = StoreOrderModel::where('add_time','between time',[$datebefor,$dateafter])
$pre_total = StoreOrderModel::where('add_time', 'between time', [$datebefor, $dateafter])
->field("count(*) as count,sum(pay_price) as price")
->find();
if($pre_total){
if ($pre_total) {
$chartdata['pre_cycle']['count'] = [
'data' => $pre_total['count']? : 0
'data' => $pre_total['count'] ?: 0
];
$chartdata['pre_cycle']['price'] = [
'data' => $pre_total['price']? : 0
'data' => $pre_total['price'] ?: 0
];
}
//统计总数
$total = StoreOrderModel::where('add_time','between time',[$now_datebefor,$now_dateafter])
$total = StoreOrderModel::where('add_time', 'between time', [$now_datebefor, $now_dateafter])
->field("count(*) as count,sum(pay_price) as price")
->find();
if($total){
if ($total) {
$cha_count = intval($pre_total['count']) - intval($total['count']);
$pre_total['count'] = $pre_total['count']==0 ? 1 : $pre_total['count'];
$pre_total['count'] = $pre_total['count'] == 0 ? 1 : $pre_total['count'];
$chartdata['cycle']['count'] = [
'data' => $total['count']? : 0,
'percent' => round((abs($cha_count)/intval($pre_total['count'])*100),2),
'data' => $total['count'] ?: 0,
'percent' => round((abs($cha_count) / intval($pre_total['count']) * 100), 2),
'is_plus' => $cha_count > 0 ? -1 : ($cha_count == 0 ? 0 : 1)
];
$cha_price = round($pre_total['price'],2) - round($total['price'],2);
$pre_total['price'] = $pre_total['price']==0 ? 1 : $pre_total['price'];
$cha_price = round($pre_total['price'], 2) - round($total['price'], 2);
$pre_total['price'] = $pre_total['price'] == 0 ? 1 : $pre_total['price'];
$chartdata['cycle']['price'] = [
'data' => $total['price']? : 0,
'percent' => round(abs($cha_price)/$pre_total['price']*100,2),
'data' => $total['price'] ?: 0,
'percent' => round(abs($cha_price) / $pre_total['price'] * 100, 2),
'is_plus' => $cha_price > 0 ? -1 : ($cha_price == 0 ? 0 : 1)
];
}
return app('json')->success('ok',$chartdata);
return app('json')->success('ok', $chartdata);
break;
default:
break;
@ -527,16 +530,18 @@ class Index extends AuthController
}
/**
* 用户图表
*/
public function userchart(){
public function userchart()
{
header('Content-type:text/json');
$starday = date('Y-m-d',strtotime('-30 day'));
$starday = date('Y-m-d', strtotime('-30 day'));
$yesterday = date('Y-m-d');
$user_list = UserModel::where('add_time','between time',[$starday,$yesterday])
$user_list = UserModel::where('add_time', 'between time', [$starday, $yesterday])
->field("FROM_UNIXTIME(add_time,'%m-%e') as day,count(*) as count")
->group("FROM_UNIXTIME(add_time, '%Y%m%e')")
->order('add_time asc')
@ -547,17 +552,17 @@ class Index extends AuthController
$chartdata['yAxis']['maxnum'] = 0;//最大值数量
$chartdata['xAxis'] = [date('m-d')];//X轴值
$chartdata['series'] = [0];//分类1值
if(!empty($user_list)) {
foreach ($user_list as $k=>$v){
if (!empty($user_list)) {
foreach ($user_list as $k => $v) {
$data['day'][] = $v['day'];
$data['count'][] = $v['count'];
if($chartdata['yAxis']['maxnum'] < $v['count'])
if ($chartdata['yAxis']['maxnum'] < $v['count'])
$chartdata['yAxis']['maxnum'] = $v['count'];
}
$chartdata['xAxis'] = $data['day'];//X轴值
$chartdata['series'] = $data['count'];//分类1值
}
return app('json')->success('ok',$chartdata);
return app('json')->success('ok', $chartdata);
}
/**
@ -565,20 +570,20 @@ class Index extends AuthController
* @param int $newTime
* @return false|string
*/
public function Jnotice($newTime=30)
public function Jnotice($newTime = 30)
{
header('Content-type:text/json');
$data = [];
$data['ordernum'] = StoreOrderModel::statusByWhere(1)->count();//待发货
$replenishment_num = SystemConfig::getConfigValue('store_stock') > 0 ? SystemConfig::getConfigValue('store_stock') : 2;//库存预警界限
$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']);
$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']);
//新订单提醒
$data['newOrderId']=StoreOrderModel::statusByWhere(1)->where('is_remind',0)->column('order_id','id');
if(count($data['newOrderId'])) StoreOrderModel::where('order_id','in',$data['newOrderId'])->update(['is_remind'=>1]);
return app('json')->success('ok',$data);
$data['newOrderId'] = StoreOrderModel::statusByWhere(1)->where('is_remind', 0)->column('order_id', 'id');
if (count($data['newOrderId'])) StoreOrderModel::where('order_id', 'in', $data['newOrderId'])->update(['is_remind' => 1]);
return app('json')->success('ok', $data);
}
}

View File

@ -127,13 +127,7 @@ SCRIPT;
],Url::buildUrl('/user/bill/2')->suffix(false)->build());
break;
case 'routine':
RoutineTemplate::sendOut('ORDER_REFUND_SUCCESS',$UserRecharge['uid'],[
'keyword1'=>$UserRecharge['order_id'],
'keyword2'=>date('Y-m-d H:i:s',time()),
'keyword3'=>$UserRecharge['price'],
'keyword4'=>'余额充值退款',
'keyword5'=>'亲,您充值的金额已退款,本次退款'. $data['refund_price'].'金额',
]);
RoutineTemplate::sendRechargeSuccess($UserRecharge,$data['refund_price']);
break;
}
UserBill::expend('系统退款',$UserRecharge['uid'],'now_money','user_recharge_refund',$refund_price,$id,$UserRecharge['price'],'退款给用户'.$refund_price.'元');

View File

@ -3,6 +3,7 @@
namespace app\admin\controller\routine;
use app\admin\controller\AuthController;
use crmeb\services\CacheService;
use crmeb\services\FormBuilder as Form;
use crmeb\services\UtilService as Util;
use crmeb\services\JsonService as Json;
@ -19,10 +20,10 @@ class RoutineTemplate extends AuthController
public function index()
{
$where = Util::getMore([
['name',''],
['status','']
],$this->request);
$this->assign('where',$where);
['name', ''],
['status', '']
], $this->request);
$this->assign('where', $where);
$this->assign(RoutineTemplateModel::SystemPage($where));
return $this->fetch();
}
@ -34,15 +35,16 @@ class RoutineTemplate extends AuthController
public function create()
{
$f = array();
$f[] = Form::input('tempkey','模板编号');
$f[] = Form::input('tempid','模板ID');
$f[] = Form::input('name','模板名');
$f[] = Form::input('content','回复内容')->type('textarea');
$f[] = Form::radio('status','状态',1)->options([['label'=>'开启','value'=>1],['label'=>'关闭','value'=>0]]);
$form = Form::make_post_form('添加模板消息',$f,Url::buildUrl('save'));
$f[] = Form::input('tempkey', '模板编号');
$f[] = Form::input('tempid', '模板ID');
$f[] = Form::input('name', '模板名');
$f[] = Form::input('content', '回复内容')->type('textarea');
$f[] = Form::radio('status', '状态', 1)->options([['label' => '开启', 'value' => 1], ['label' => '关闭', 'value' => 0]]);
$form = Form::make_post_form('添加模板消息', $f, Url::buildUrl('save'));
$this->assign(compact('form'));
return $this->fetch('public/form-builder');
}
public function save()
{
$data = Util::postMore([
@ -50,16 +52,17 @@ class RoutineTemplate extends AuthController
'tempid',
'name',
'content',
['status',0]
['status', 0]
]);
if($data['tempkey'] == '') return Json::fail('请输入模板编号');
if($data['tempkey'] != '' && RoutineTemplateModel::be($data['tempkey'],'tempkey'))
if ($data['tempkey'] == '') return Json::fail('请输入模板编号');
if ($data['tempkey'] != '' && RoutineTemplateModel::be($data['tempkey'], 'tempkey'))
return Json::fail('请输入模板编号已存在,请重新输入');
if($data['tempid'] == '') return Json::fail('请输入模板ID');
if($data['name'] == '') return Json::fail('请输入模板名');
if($data['content'] == '') return Json::fail('请输入回复内容');
if ($data['tempid'] == '') return Json::fail('请输入模板ID');
if ($data['name'] == '') return Json::fail('请输入模板名');
if ($data['content'] == '') return Json::fail('请输入回复内容');
$data['add_time'] = time();
RoutineTemplateModel::create($data);
CacheService::clear();
return Json::successful('添加模板消息成功!');
}
@ -70,15 +73,15 @@ class RoutineTemplate extends AuthController
*/
public function edit($id)
{
if(!$id) return $this->failed('数据不存在');
if (!$id) return $this->failed('数据不存在');
$product = RoutineTemplateModel::get($id);
if(!$product) return Json::fail('数据不存在!');
if (!$product) return Json::fail('数据不存在!');
$f = array();
$f[] = Form::input('tempkey','模板编号',$product->getData('tempkey'))->disabled(1);
$f[] = Form::input('name','模板名',$product->getData('name'))->disabled(1);
$f[] = Form::input('tempid','模板ID',$product->getData('tempid'));
$f[] = Form::radio('status','状态',$product->getData('status'))->options([['label'=>'开启','value'=>1],['label'=>'关闭','value'=>0]]);
$form = Form::make_post_form('编辑模板消息',$f,Url::buildUrl('update',compact('id')));
$f[] = Form::input('tempkey', '模板编号', $product->getData('tempkey'))->disabled(1);
$f[] = Form::input('name', '模板名', $product->getData('name'))->disabled(1);
$f[] = Form::input('tempid', '模板ID', $product->getData('tempid'));
$f[] = Form::radio('status', '状态', $product->getData('status'))->options([['label' => '开启', 'value' => 1], ['label' => '关闭', 'value' => 0]]);
$form = Form::make_post_form('编辑模板消息', $f, Url::buildUrl('update', compact('id')));
$this->assign(compact('form'));
return $this->fetch('public/form-builder');
}
@ -87,13 +90,14 @@ class RoutineTemplate extends AuthController
{
$data = Util::postMore([
'tempid',
['status',0]
['status', 0]
]);
if($data['tempid'] == '') return Json::fail('请输入模板ID');
if(!$id) return $this->failed('数据不存在');
if ($data['tempid'] == '') return Json::fail('请输入模板ID');
if (!$id) return $this->failed('数据不存在');
$product = RoutineTemplateModel::get($id);
if(!$product) return Json::fail('数据不存在!');
RoutineTemplateModel::edit($data,$id);
if (!$product) return Json::fail('数据不存在!');
RoutineTemplateModel::edit($data, $id);
CacheService::clear();
return Json::successful('修改成功!');
}
@ -104,11 +108,13 @@ class RoutineTemplate extends AuthController
*/
public function delete($id)
{
if(!$id) return Json::fail('数据不存在!');
if(!RoutineTemplateModel::del($id))
if (!$id) return Json::fail('数据不存在!');
if (!RoutineTemplateModel::del($id))
return Json::fail(RoutineTemplateModel::getErrorInfo('删除失败,请稍候再试!'));
else
else {
CacheService::clear();
return Json::successful('删除成功!');
}
}

View File

@ -3,6 +3,7 @@
namespace app\admin\controller\system;
use app\admin\controller\AuthController;
use crmeb\services\CacheService;
use crmeb\services\JsonService as Json;
/**
@ -48,7 +49,7 @@ class Clear extends AuthController
}
}
}
CacheService::clear();
return app('json')->successful('数据缓存刷新成功!');
}

View File

@ -12,6 +12,8 @@ namespace app\admin\controller\system;
use app\admin\controller\AuthController;
use app\admin\model\store\StoreProduct;
use crmeb\services\JsonService as Json;
use crmeb\services\SystemConfigService;
use think\facade\Config;
use think\facade\Db;
/**
@ -19,117 +21,137 @@ use think\facade\Db;
* Class SystemclearData
* @package app\admin\controller\system
*/
class SystemclearData extends AuthController
class SystemclearData extends AuthController
{
public function index(){
return $this->fetch();
public function index()
{
return $this->fetch();
}
//清除用户数据
public function userRelevantData(){
self::clearData('user_recharge',1);
self::clearData('user_address',1);
self::clearData('user_bill',1);
self::clearData('user_enter',1);
self::clearData('user_extract',1);
self::clearData('user_notice',1);
self::clearData('user_notice_see',1);
self::clearData('wechat_qrcode',1);
self::clearData('wechat_message',1);
self::clearData('store_visit',1);
self::clearData('store_coupon_user',1);
self::clearData('store_coupon_issue_user',1);
self::clearData('store_bargain_user',1);
self::clearData('store_bargain_user_help',1);
self::clearData('store_product_reply',1);
self::clearData('store_product_cate',1);
self::clearData('routine_qrcode',1);
self::clearData('routine_form_id',1);
self::clearData('user_sign',1);
self::clearData('user_task_finish',1);
self::clearData('user_level',1);
self::clearData('user_token',1);
self::clearData('user_group',1);
public function userRelevantData()
{
self::clearData('user_recharge', 1);
self::clearData('user_address', 1);
self::clearData('user_bill', 1);
self::clearData('user_enter', 1);
self::clearData('user_extract', 1);
self::clearData('user_notice', 1);
self::clearData('user_notice_see', 1);
self::clearData('wechat_qrcode', 1);
self::clearData('wechat_message', 1);
self::clearData('store_visit', 1);
self::clearData('store_coupon_user', 1);
self::clearData('store_coupon_issue_user', 1);
self::clearData('store_bargain_user', 1);
self::clearData('store_bargain_user_help', 1);
self::clearData('store_product_reply', 1);
self::clearData('store_product_cate', 1);
self::clearData('routine_qrcode', 1);
self::clearData('routine_form_id', 1);
self::clearData('user_sign', 1);
self::clearData('user_task_finish', 1);
self::clearData('user_level', 1);
self::clearData('user_token', 1);
self::clearData('user_group', 1);
$this->delDirAndFile('./public/uploads/store/comment');
self::clearData('store_product_relation',1);
self::clearData('store_product_relation', 1);
return Json::successful('清除数据成功!');
}
//清除商城数据
public function storeData(){
self::clearData('store_coupon',1);
self::clearData('store_coupon_issue',1);
self::clearData('store_bargain',1);
self::clearData('store_combination',1);
self::clearData('store_combination_attr',1);
self::clearData('store_combination_attr_result',1);
self::clearData('store_combination_attr_value',1);
self::clearData('store_product_attr',1);
self::clearData('store_product_cate',1);
self::clearData('store_product_attr_result',1);
self::clearData('store_product_attr_value',1);
self::clearData('store_seckill',1);
self::clearData('store_seckill_attr',1);
self::clearData('store_seckill_attr_result',1);
self::clearData('store_seckill_attr_value',1);
self::clearData('store_product',1);
self::clearData('store_visit',1);
public function storeData()
{
self::clearData('store_coupon', 1);
self::clearData('store_coupon_issue', 1);
self::clearData('store_bargain', 1);
self::clearData('store_combination', 1);
self::clearData('store_combination_attr', 1);
self::clearData('store_combination_attr_result', 1);
self::clearData('store_combination_attr_value', 1);
self::clearData('store_product_attr', 1);
self::clearData('store_product_cate', 1);
self::clearData('store_product_attr_result', 1);
self::clearData('store_product_attr_value', 1);
self::clearData('store_seckill', 1);
self::clearData('store_seckill_attr', 1);
self::clearData('store_seckill_attr_result', 1);
self::clearData('store_seckill_attr_value', 1);
self::clearData('store_product', 1);
self::clearData('store_visit', 1);
return Json::successful('清除数据成功!');
}
//清除产品分类
public function categoryData(){
self::clearData('store_category',1);
public function categoryData()
{
self::clearData('store_category', 1);
return Json::successful('清除数据成功!');
}
//清除订单数据
public function orderData(){
self::clearData('store_order',1);
self::clearData('store_order_cart_info',1);
self::clearData('store_order_status',1);
self::clearData('store_pink',1);
self::clearData('store_cart',1);
self::clearData('store_order_status',1);
public function orderData()
{
self::clearData('store_order', 1);
self::clearData('store_order_cart_info', 1);
self::clearData('store_order_status', 1);
self::clearData('store_pink', 1);
self::clearData('store_cart', 1);
self::clearData('store_order_status', 1);
return Json::successful('清除数据成功!');
}
//清除客服数据
public function kefuData(){
self::clearData('store_service',1);
public function kefuData()
{
self::clearData('store_service', 1);
$this->delDirAndFile('./public/uploads/store/service');
self::clearData('store_service_log',1);
self::clearData('store_service_log', 1);
return Json::successful('清除数据成功!');
}
//清除微信管理数据
public function wechatData(){
self::clearData('wechat_media',1);
self::clearData('wechat_reply',1);
self::clearData('cache',1);
public function wechatData()
{
self::clearData('wechat_media', 1);
self::clearData('wechat_reply', 1);
self::clearData('cache', 1);
$this->delDirAndFile('./public/uploads/wechat');
return Json::successful('清除数据成功!');
}
//清除所有附件
public function uploadData(){
self::clearData('system_attachment',1);
self::clearData('system_attachment_category',1);
public function uploadData()
{
self::clearData('system_attachment', 1);
self::clearData('system_attachment_category', 1);
$this->delDirAndFile('./public/uploads/');
return Json::successful('清除上传文件成功!');
}
//清除微信用户
public function wechatuserData(){
self::clearData('wechat_user',1);
self::clearData('user',1);
public function wechatuserData()
{
self::clearData('wechat_user', 1);
self::clearData('user', 1);
return Json::successful('清除数据成功!');
}
//清除内容分类
public function articledata(){
self::clearData('article_category',1);
self::clearData('article',1);
self::clearData('article_content',1);
public function articledata()
{
self::clearData('article_category', 1);
self::clearData('article', 1);
self::clearData('article_content', 1);
return Json::successful('清除数据成功!');
}
//清除系统记录
public function systemdata(){
self::clearData('system_notice_admin',1);
self::clearData('system_log',1);
public function systemdata()
{
self::clearData('system_notice_admin', 1);
self::clearData('system_log', 1);
return Json::successful('清除数据成功!');
}
@ -140,39 +162,91 @@ class SystemclearData extends AuthController
*/
public function undata($type = 1)
{
switch ((int)$type){
switch ((int)$type) {
case 1:
\app\admin\model\system\SystemAttachment::where('module_type',2)->delete();
$fileImage = \app\admin\model\system\SystemAttachment::where('module_type', 2)->field(['att_dir', 'satt_dir'])->select();
foreach ($fileImage as $image) {
if ($image['att_dir'] && ($imagePath = strstr($image['att_dir'], 'uploads')) !== false) {
if (is_file($imagePath))
unlink($imagePath);
unset($imagePath);
}
if ($image['satt_dir'] && ($imagePath = strstr($image['satt_dir'], 'uploads')) !== false) {
if (is_file($imagePath))
unlink($imagePath);
unset($imagePath);
}
}
\app\admin\model\system\SystemAttachment::where('module_type', 2)->delete();
@unlink('uploads/follow/follow.jpg');//删除海报二维码
break;
case 2:
StoreProduct::where('is_del',1)->delete();
StoreProduct::where('is_del', 1)->delete();
break;
case 3:
$value = $this->request->param('value');
if (!$value)
return Json::fail('请输入需要更换的域名');
if (!verify_domain($value))
return Json::fail('域名不合法');
$siteUrl = SystemConfigService::get('site_url', true);
$siteUrlJosn = str_replace('http://', 'http:\\/\\/', $siteUrl);
$valueJosn = str_replace('http://', 'http:\\/\\/', $value);
$prefix = Config::get('database.connections.' . Config::get('database.default') . '.prefix');
$sql = [
"UPDATE `{$prefix}system_attachment` SET `att_dir` = replace(att_dir ,'{$siteUrl}','{$value}'),`satt_dir` = replace(satt_dir ,'{$siteUrl}','{$value}')",
"UPDATE `{$prefix}store_product` SET `image` = replace(image ,'{$siteUrl}','{$value}'),`slider_image` = replace(slider_image ,'{$siteUrl}','{$value}'),`description`= replace(description,'{$siteUrl}','{$value}')",
"UPDATE `{$prefix}store_product_attr_value` SET `image` = replace(image ,'{$siteUrl}','{$value}')",
"UPDATE `{$prefix}store_seckill` SET `image` = replace(image ,'{$siteUrl}','{$value}'),`images` = replace(images,'{$siteUrl}','{$value}'),`description` = replace(description,'{$siteUrl}','{$value}')",
"UPDATE `{$prefix}store_combination` SET `image` = replace(image ,'{$siteUrl}','{$value}'),`images` = replace(images,'{$siteUrl}','{$value}'),`description` = replace(description,'{$siteUrl}','{$value}')",
"UPDATE `{$prefix}store_bargain` SET `image` = replace(image ,'{$siteUrl}','{$value}'),`images` = replace(images,'{$siteUrl}','{$value}'),`description` = replace(description,'{$siteUrl}','{$value}')",
"UPDATE `{$prefix}system_config` SET `value` = replace(value ,'{$siteUrlJosn}','{$valueJosn}')",
"UPDATE `{$prefix}article_category` SET `image` = replace(`image` ,'{$siteUrl}','{$value}')",
"UPDATE `{$prefix}article` SET `image_input` = replace(`image_input` ,'{$siteUrl}','{$value}')",
"UPDATE `{$prefix}article_content` SET `content` = replace(`content` ,'{$siteUrl}','{$value}')",
"UPDATE `{$prefix}store_category` SET `pic` = replace(`pic` ,'{$siteUrl}','{$value}')",
"UPDATE `{$prefix}system_group_data` SET `value` = replace(value ,'{$siteUrlJosn}','{$valueJosn}')"
];
try {
foreach ($sql as $item) {
db::execute($item);
}
} catch (\Throwable $e) {
return Json::fail('替换失败,失败原因:' . $e->getMessage());
}
return Json::success('替换成功!');
break;
}
return Json::successful('清除数据成功!');
}
//清除制定表数据
public function clearData($table_name,$status){
$table_name = config('database.connections.' . config('database.default'))['prefix'].$table_name;
if($status){
@db::execute('TRUNCATE TABLE '.$table_name);
}else{
@db::execute('DELETE FROM'.$table_name);
public function clearData($table_name, $status)
{
$table_name = config('database.connections.' . config('database.default'))['prefix'] . $table_name;
if ($status) {
@db::execute('TRUNCATE TABLE ' . $table_name);
} else {
@db::execute('DELETE FROM' . $table_name);
}
}
//递归删除文件
function delDirAndFile($dirName,$subdir=true){
if ($handle = @opendir("$dirName")){
while(false !== ($item = readdir($handle))){
if($item != "." && $item != ".."){
if(is_dir("$dirName/$item"))
$this->delDirAndFile("$dirName/$item",false);
function delDirAndFile($dirName, $subdir = true)
{
if ($handle = @opendir("$dirName")) {
while (false !== ($item = readdir($handle))) {
if ($item != "." && $item != "..") {
if (is_dir("$dirName/$item"))
$this->delDirAndFile("$dirName/$item", false);
else
@unlink("$dirName/$item");
}
}
closedir($handle);
if(!$subdir) @rmdir($dirName);
if (!$subdir) @rmdir($dirName);
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,7 @@
* Date: 2018-03-03
* Time: 16:47
*/
namespace app\admin\model\user;
use app\admin\model\wechat\WechatUser;
@ -40,9 +41,9 @@ class UserExtract extends BaseModel
* @param $uid
* @return mixed
*/
public static function userExtractTotalPrice($uid,$status=1,$where=[])
public static function userExtractTotalPrice($uid, $status = 1, $where = [])
{
return self::getModelTime($where,self::where('uid','in',$uid)->where('status',$status))->sum('extract_price')?:0;
return self::getModelTime($where, self::where('uid', 'in', $uid)->where('status', $status))->sum('extract_price') ?: 0;
}
public static function extractStatistics()
@ -54,7 +55,7 @@ class UserExtract extends BaseModel
//已提现金额
$data['priced'] = floatval(self::where('status', 1)->sum('extract_price'));
//未提现金额
$data['brokerage_not'] = bcsub(bcsub($data['brokerage_count'], $data['priced'], 2), $data['price'], 2);
$data['brokerage_not'] = bcsub(bcsub($data['brokerage_count'], $data['priced'], 2), $data['price'], 2);
return compact('data');
}
@ -65,61 +66,56 @@ class UserExtract extends BaseModel
public static function systemPage($where)
{
$model = new self;
if($where['date'] != '') {
if ($where['date'] != '') {
list($startTime, $endTime) = explode(' - ', $where['date']);
$model = $model->where('a.add_time', '>', strtotime($startTime));
$model = $model->where('a.add_time', '<', (int)bcadd(strtotime($endTime), 86400, 0));
}
if($where['status'] != '') $model = $model->where('a.status',$where['status']);
if($where['extract_type'] != '') $model = $model->where('a.extract_type',$where['extract_type']);
if($where['nireid'] != '') $model = $model->where('a.real_name|a.id|b.nickname|a.bank_code|a.alipay_code','like',"%$where[nireid]%");
if ($where['status'] != '') $model = $model->where('a.status', $where['status']);
if ($where['extract_type'] != '') $model = $model->where('a.extract_type', $where['extract_type']);
if ($where['nireid'] != '') $model = $model->where('a.real_name|a.id|b.nickname|a.bank_code|a.alipay_code', 'like', "%$where[nireid]%");
$model = $model->alias('a');
$model = $model->field('a.*,b.nickname');
$model = $model->join('user b','b.uid=a.uid','LEFT');
$model = $model->join('user b', 'b.uid=a.uid', 'LEFT');
$model = $model->order('a.id desc');
return self::page($model, $where);
}
public static function changeFail($id,$fail_msg)
public static function changeFail($id, $fail_msg)
{
$fail_time = time();
$data =self::get($id);
$extract_number=$data['extract_price'];
$mark='提现失败,退回佣金'.$extract_number.'元';
$uid=$data['uid'];
$data = self::get($id);
$extract_number = $data['extract_price'];
$mark = '提现失败,退回佣金' . $extract_number . '元';
$uid = $data['uid'];
$status = -1;
$User= User::where('uid', $uid)->find()->toArray();
UserBill::income('提现失败',$uid,'now_money','extract',$extract_number,$id,bcadd($User['now_money'],$extract_number,2),$mark);
User::bcInc($uid,'brokerage_price',$extract_number,'uid');
$extract_type='未知方式';
switch ($data['extract_type']){
$User = User::where('uid', $uid)->find()->toArray();
UserBill::income('提现失败', $uid, 'now_money', 'extract', $extract_number, $id, bcadd($User['now_money'], $extract_number, 2), $mark);
User::bcInc($uid, 'brokerage_price', $extract_number, 'uid');
$extract_type = '未知方式';
switch ($data['extract_type']) {
case 'alipay':
$extract_type='支付宝';
$extract_type = '支付宝';
break;
case 'bank':
$extract_type='银行卡';
$extract_type = '银行卡';
break;
case 'weixin':
$extract_type='微信';
$extract_type = '微信';
break;
}
if(strtolower($User['user_type']) == 'wechat'){
WechatTemplateService::sendTemplate(WechatUser::where('uid',$uid)->value('openid'),WechatTemplateService::USER_BALANCE_CHANGE,[
'first'=> $mark,
'keyword1'=>'佣金提现',
'keyword2'=>date('Y-m-d H:i:s',time()),
'keyword3'=>$extract_number,
'remark'=>'错误原因:'.$fail_msg
],Url::buildUrl('/user/cashrecord')->suffix('')->domain(true)->build());
}else if(strtolower($User['user_type'])=='routine'){
RoutineTemplate::sendOut('USER_EXTRACT_FALSE',$uid,[
'keyword1'=>$fail_msg,
'keyword2'=>$extract_number,
'keyword3'=>$extract_type,
'keyword4'=>date('Y-m-d H:i:s',time()),
]);
if (strtolower($User['user_type']) == 'wechat') {
WechatTemplateService::sendTemplate(WechatUser::where('uid', $uid)->value('openid'), WechatTemplateService::USER_BALANCE_CHANGE, [
'first' => $mark,
'keyword1' => '佣金提现',
'keyword2' => date('Y-m-d H:i:s', time()),
'keyword3' => $extract_number,
'remark' => '错误原因:' . $fail_msg
], Url::buildUrl('/user/cashrecord')->suffix('')->domain(true)->build());
} else if (strtolower($User['user_type']) == 'routine') {
RoutineTemplate::sendExtractFail($uid, $fail_msg, $extract_number, $User['nickname']);
}
return self::edit(compact('fail_time','fail_msg','status'),$id);
return self::edit(compact('fail_time', 'fail_msg', 'status'), $id);
}
public static function changeSuccess($id)
@ -127,29 +123,24 @@ class UserExtract extends BaseModel
$data = self::get($id);
$extractNumber = $data['extract_price'];
$mark = '成功提现佣金'.$extractNumber.'元';
$wechatUserInfo = WechatUser::where('uid',$data['uid'])->field('openid,user_type,routine_openid')->find();
$extract_type='未知方式';
switch ($data['extract_type']){
$mark = '成功提现佣金' . $extractNumber . '元';
$wechatUserInfo = WechatUser::where('uid', $data['uid'])->field('openid,user_type,routine_openid,nickname')->find();
$extract_type = '未知方式';
switch ($data['extract_type']) {
case 'alipay':
$extract_type='支付宝';
$extract_type = '支付宝';
break;
case 'bank':
$extract_type='银行卡';
$extract_type = '银行卡';
break;
case 'weixin':
$extract_type='微信';
$extract_type = '微信';
break;
}
if($wechatUserInfo){
if(strtolower($wechatUserInfo->user_type)=='routine'){
RoutineTemplate::sendOut('USER_EXTRACT_TRUE',$data['uid'],[
'keyword1'=>$extractNumber.'元',
'keyword2'=>'审核成功',
'keyword3'=>date('Y-m-d H:i:s', time()),
'keyword4'=>$extract_type,
]);
}else if(strtolower($wechatUserInfo->user_type)=='wechat'){
if ($wechatUserInfo) {
if (strtolower($wechatUserInfo->user_type) == 'routine') {
RoutineTemplate::sendExtractSuccess($data['uid'], $extractNumber, $wechatUserInfo->nickname);
} else if (strtolower($wechatUserInfo->user_type) == 'wechat') {
WechatTemplateService::sendTemplate($wechatUserInfo->openid, WechatTemplateService::USER_BALANCE_CHANGE, [
'first' => $mark,
'keyword1' => '佣金提现',
@ -159,163 +150,169 @@ class UserExtract extends BaseModel
], Url::buildUrl('/user/cashrecord')->suffix('')->domain(true)->build());
}
}
return self::edit(['status'=>1],$id);
return self::edit(['status' => 1], $id);
}
//测试数据
public static function test(){
$uids=User::order('uid desc')->limit(2,20)->field(['uid','nickname'])->select()->toArray();
$type=['bank','alipay','weixin'];
foreach ($uids as $item){
$data=[
'uid'=>$item['uid'],
'real_name'=>$item['nickname'],
'extract_type'=>isset($type[rand(0,2)]) ? $type[rand(0,2)] :'alipay',
'bank_code'=>rand(1000000,999999999),
'bank_address'=>'中国',
'alipay_code'=>rand(1000,9999999),
'extract_price'=>rand(100,9999),
'mark'=>'测试数据',
'add_time'=>time(),
'status'=>1,
'wechat'=>rand(999,878788).$item['uid'],
public static function test()
{
$uids = User::order('uid desc')->limit(2, 20)->field(['uid', 'nickname'])->select()->toArray();
$type = ['bank', 'alipay', 'weixin'];
foreach ($uids as $item) {
$data = [
'uid' => $item['uid'],
'real_name' => $item['nickname'],
'extract_type' => isset($type[rand(0, 2)]) ? $type[rand(0, 2)] : 'alipay',
'bank_code' => rand(1000000, 999999999),
'bank_address' => '中国',
'alipay_code' => rand(1000, 9999999),
'extract_price' => rand(100, 9999),
'mark' => '测试数据',
'add_time' => time(),
'status' => 1,
'wechat' => rand(999, 878788) . $item['uid'],
];
self::create($data);
}
}
//获取头部提现信息
public static function getExtractHead(){
public static function getExtractHead()
{
//本月提现人数
$month=self::getModelTime(['data'=>'month'],self::where('status', 1))->group('uid')->count();
$month = self::getModelTime(['data' => 'month'], self::where('status', 1))->group('uid')->count();
//本月提现笔数
$new_month=self::getModelTime(['data'=>'month'],self::where('status', 1))->distinct(true)->count();
$new_month = self::getModelTime(['data' => 'month'], self::where('status', 1))->distinct(true)->count();
//上月提现人数
$last_month=self::whereTime('add_time','last month')->where('status',1)->group('uid')->distinct(true)->count();
$last_month = self::whereTime('add_time', 'last month')->where('status', 1)->group('uid')->distinct(true)->count();
//上月提现笔数
$last_count=self::whereTime('add_time','last month')->where('status',1)->count();
$last_count = self::whereTime('add_time', 'last month')->where('status', 1)->count();
//本月提现金额
$extract_price=self::getModelTime(['data'=>'month'],self::where('status', 1))->sum('extract_price');
$extract_price = self::getModelTime(['data' => 'month'], self::where('status', 1))->sum('extract_price');
//上月提现金额
$last_extract_price=self::whereTime('add_time','last month')->where('status',1)->sum('extract_price');
$last_extract_price = self::whereTime('add_time', 'last month')->where('status', 1)->sum('extract_price');
return [
[
'name'=>'总提现人数',
'field'=>'个',
'count'=>self::where('status', 1)->group('uid')->count(),
'content'=>'',
'background_color'=>'layui-bg-blue',
'sum'=>'',
'class'=>'fa fa-bar-chart',
'name' => '总提现人数',
'field' => '个',
'count' => self::where('status', 1)->group('uid')->count(),
'content' => '',
'background_color' => 'layui-bg-blue',
'sum' => '',
'class' => 'fa fa-bar-chart',
],
[
'name'=>'总提现笔数',
'field'=>'笔',
'count'=>self::where('status', 1)->distinct(true)->count(),
'content'=>'',
'background_color'=>'layui-bg-cyan',
'sum'=>'',
'class'=>'fa fa-line-chart',
'name' => '总提现笔数',
'field' => '笔',
'count' => self::where('status', 1)->distinct(true)->count(),
'content' => '',
'background_color' => 'layui-bg-cyan',
'sum' => '',
'class' => 'fa fa-line-chart',
],
[
'name'=>'本月提现人数',
'field'=>'人',
'count'=>$month,
'content'=>'',
'background_color'=>'layui-bg-orange',
'sum'=>'',
'class'=>'fa fa-line-chart',
'name' => '本月提现人数',
'field' => '人',
'count' => $month,
'content' => '',
'background_color' => 'layui-bg-orange',
'sum' => '',
'class' => 'fa fa-line-chart',
],
[
'name'=>'本月提现笔数',
'field'=>'笔',
'count'=>$new_month,
'content'=>'',
'background_color'=>'layui-bg-green',
'sum'=>'',
'class'=>'fa fa-line-chart',
'name' => '本月提现笔数',
'field' => '笔',
'count' => $new_month,
'content' => '',
'background_color' => 'layui-bg-green',
'sum' => '',
'class' => 'fa fa-line-chart',
],
[
'name'=>'本月提现金额',
'field'=>'元',
'count'=>$extract_price,
'content'=>'提现总金额',
'background_color'=>'layui-bg-cyan',
'sum'=>self::where('status', 1)->sum('extract_price'),
'class'=>'fa fa-line-chart',
'name' => '本月提现金额',
'field' => '元',
'count' => $extract_price,
'content' => '提现总金额',
'background_color' => 'layui-bg-cyan',
'sum' => self::where('status', 1)->sum('extract_price'),
'class' => 'fa fa-line-chart',
],
[
'name'=>'上月提现人数',
'field'=>'个',
'count'=>$last_month,
'content'=>'环比增幅',
'background_color'=>'layui-bg-blue',
'sum'=>$last_month==0 ? '100%' :bcdiv($month,$last_month,2)*100,
'class'=>$last_month==0 ? 'fa fa-level-up':'fa fa-level-down',
'name' => '上月提现人数',
'field' => '个',
'count' => $last_month,
'content' => '环比增幅',
'background_color' => 'layui-bg-blue',
'sum' => $last_month == 0 ? '100%' : bcdiv($month, $last_month, 2) * 100,
'class' => $last_month == 0 ? 'fa fa-level-up' : 'fa fa-level-down',
],
[
'name'=>'上月提现笔数',
'field'=>'笔',
'count'=>$last_count,
'content'=>'环比增幅',
'background_color'=>'layui-bg-black',
'sum'=>$last_count==0 ? '100%':bcdiv($new_month,$last_count,2)*100,
'class'=>$last_count==0 ? 'fa fa-level-up':'fa fa-level-down',
'name' => '上月提现笔数',
'field' => '笔',
'count' => $last_count,
'content' => '环比增幅',
'background_color' => 'layui-bg-black',
'sum' => $last_count == 0 ? '100%' : bcdiv($new_month, $last_count, 2) * 100,
'class' => $last_count == 0 ? 'fa fa-level-up' : 'fa fa-level-down',
],
[
'name'=>'上月提现金额',
'field'=>'元',
'count'=>$last_extract_price,
'content'=>'环比增幅',
'background_color'=>'layui-bg-gray',
'sum'=>$last_extract_price==0 ? '100%':bcdiv($extract_price,$last_extract_price,2)*100,
'class'=>$last_extract_price==0 ? 'fa fa-level-up':'fa fa-level-down',
'name' => '上月提现金额',
'field' => '元',
'count' => $last_extract_price,
'content' => '环比增幅',
'background_color' => 'layui-bg-gray',
'sum' => $last_extract_price == 0 ? '100%' : bcdiv($extract_price, $last_extract_price, 2) * 100,
'class' => $last_extract_price == 0 ? 'fa fa-level-up' : 'fa fa-level-down',
],
];
}
//获取提现分布图和提现人数金额曲线图
public static function getExtractList($where,$limit=15){
$legdata=['提现人数','提现金额'];
$list=self::getModelTime($where,self::where('status',1))
public static function getExtractList($where, $limit = 15)
{
$legdata = ['提现人数', '提现金额'];
$list = self::getModelTime($where, self::where('status', 1))
->field('FROM_UNIXTIME(add_time,"%Y-%c-%d") as un_time,count(uid) as count,sum(extract_price) as sum_price')->group('un_time')->order('un_time asc')->select();
if(count($list)) $list=$list->toArray();
if (count($list)) $list = $list->toArray();
$xdata = [];
$itemList = [0=>[],1=>[]];
$itemList = [0 => [], 1 => []];
$chatrList = [];
$zoom = '';
foreach ($list as $value){
$xdata[]=$value['un_time'];
$itemList[0][]=$value['count'];
$itemList[1][]=$value['sum_price'];
foreach ($list as $value) {
$xdata[] = $value['un_time'];
$itemList[0][] = $value['count'];
$itemList[1][] = $value['sum_price'];
}
foreach ($legdata as $key=>$name){
$item['name']=$name;
$item['type']='line';
$item['data']=$itemList[$key];
$chatrList[]=$item;
foreach ($legdata as $key => $name) {
$item['name'] = $name;
$item['type'] = 'line';
$item['data'] = $itemList[$key];
$chatrList[] = $item;
}
unset($item,$name,$key);
if(count($xdata)>$limit) $zoom=$xdata[$limit-5];
unset($item, $name, $key);
if (count($xdata) > $limit) $zoom = $xdata[$limit - 5];
//饼状图
$cake=['支付宝','银行卡','微信'];
$fenbulist=self::getModelTime($where,self::where('status',1))
$cake = ['支付宝', '银行卡', '微信'];
$fenbulist = self::getModelTime($where, self::where('status', 1))
->field('count(uid) as count,extract_type')->group('extract_type')->order('count asc')->select();
if(count($fenbulist)) $fenbulist = $fenbulist->toArray();
$sum_count = self::getModelTime($where,self::where('status',1))->count();
$color = ['#FB7773','#81BCFE','#91F3FE'];
if (count($fenbulist)) $fenbulist = $fenbulist->toArray();
$sum_count = self::getModelTime($where, self::where('status', 1))->count();
$color = ['#FB7773', '#81BCFE', '#91F3FE'];
$fenbudata = [];
foreach ($fenbulist as $key=>$item){
if($item['extract_type']=='bank'){
$item_date['name']='银行卡';
}else if($item['extract_type']=='alipay'){
$item_date['name']='支付宝';
}else if($item['extract_type']=='weixin'){
$item_date['name']='微信';
foreach ($fenbulist as $key => $item) {
if ($item['extract_type'] == 'bank') {
$item_date['name'] = '银行卡';
} else if ($item['extract_type'] == 'alipay') {
$item_date['name'] = '支付宝';
} else if ($item['extract_type'] == 'weixin') {
$item_date['name'] = '微信';
}
$item_date['value']=bcdiv($item['count'],$sum_count,2)*100;
$item_date['itemStyle']['color']=$color[$key];
$fenbudata[]=$item_date;
$item_date['value'] = bcdiv($item['count'], $sum_count, 2) * 100;
$item_date['itemStyle']['color'] = $color[$key];
$fenbudata[] = $item_date;
}
return compact('xdata','chatrList','legdata','zoom','cake','fenbudata');
return compact('xdata', 'chatrList', 'legdata', 'zoom', 'cake', 'fenbudata');
}
/**
@ -323,9 +320,10 @@ class UserExtract extends BaseModel
* @param int $uid
* @return int|mixed
*/
public static function getUserCountPrice($uid = 0){
if(!$uid) return 0;
$price = self::where('uid',$uid)->where('status',1)->sum('extract_price');
public static function getUserCountPrice($uid = 0)
{
if (!$uid) return 0;
$price = self::where('uid', $uid)->where('status', 1)->sum('extract_price');
return $price ? $price : 0;
}
@ -334,8 +332,9 @@ class UserExtract extends BaseModel
* @param int $uid
* @return int|string
*/
public static function getUserCountNum($uid = 0){
if(!$uid) return 0;
return self::where('uid',$uid)->count();
public static function getUserCountNum($uid = 0)
{
if (!$uid) return 0;
return self::where('uid', $uid)->count();
}
}

View File

@ -266,6 +266,7 @@
{include file="public/style"}
<script>
window.newOrderAudioLink='{$new_order_audio_link}';
window.workermanPort = '{$workermanPort}';
</script>
<script src="{__FRAME_PATH}js/index.js"></script>
</body>

View File

@ -0,0 +1,35 @@
{extend name="public/container"}
{block name="content"}
<div class="ibox-content order-info">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<img src="{$spread.avatar}" width="50" height="50" style="border-radius: 60px;" />
<span style="font-size: 16px">{$spread.nickname}</span>
</div>
<div class="panel-body">
<div class="row show-grid">
<div class="col-xs-6" style="color: #ff0005">余额:¥ {$spread.now_money}</div>
<div class="col-xs-6">UID{$spread.uid}</div>
<div class="col-xs-6" style="color: green">佣金:¥ {$spread.brokerage_price}</div>
<div class="col-xs-6">真实姓名:{$spread.real_name}</div>
<div class="col-xs-6">身份证:{$spread.card_id}</div>
<div class="col-xs-6">手机号码:{$spread.phone}</div>
<div class="col-xs-6">生日:{$spread.birthday}</div>
<div class="col-xs-6">积分:{$spread.integral}</div>
<div class="col-xs-6">用户备注:{$spread.mark}</div>
<div class="col-xs-6">最后登录时间:{$spread.last_time|date="Y/m/d H:i"}</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="{__FRAME_PATH}js/content.min.js?v=1.0.0"></script>
{/block}
{block name="script"}
{/block}

View File

@ -4,7 +4,7 @@
.clear_tit span{font-size: 12px; color: #ED4014;margin: 15px 0;}
.clear_box{border: 1px solid #DADFE6;border-radius: 3px;display: flex;flex-direction: column;align-items: center;padding: 30px 10px;box-sizing:border-box}
.clear_box_sp1{font-size: 16px;color: #000000;display: block;}
.clear_box_sp2{font-size: 14px;color: #ED4014;display: block;margin: 12px 0;}
.clear_box_sp2{font-size: 14px;color: #808695;display: block;margin: 12px 0;}
.layui-btn-danger {background-color: #FF5722;}
</style>
<div class="layui-fluid">

View File

@ -126,9 +126,11 @@
</div>
<div class="layui-card-body clearfix image-box" style="padding: 10px;height: 360px;z-index:10;">
<div class="layui-col-md2 layui-col-xs2 layui-col-sm2 image" v-for="(item,index) in imageList">
<span class="layui-badge layui-bg-cyan" style="position: absolute;" v-if="item.sort">{{ item.sort }}</span>
<div class="layui-img-box" :class="item.isSelect ? 'on': '' ">
<img :src="item.att_dir" v-if="small == 1" @click="changImage(item,index)">
<img :src="item.att_dir" v-else @click="changImage(item,index)">
<img :src="item.att_dir" v-if="small == 1" @click="changImage(item)">
<img :src="item.att_dir" v-else @click="changImage(item)">
</div>
</div>
<div class="empty-image" style="width: 100%;height: 100%;text-align: center;" v-if="!imageList.length && loading == false">
@ -251,17 +253,25 @@
},
//图片选中和取消
changImage:function(item,index){
var len = this.imageList.length,selectImages=[],selectImagesIDS=[];
this.$set(this.imageList[index],'isSelect',item.isSelect == undefined ? true : !item.isSelect);
for (var i=0;i<len;i++){
if(this.imageList[i].isSelect === true) {
selectImages.push(small == 1 ? this.imageList[i]['satt_dir'] : this.imageList[i]['att_dir']);
selectImagesIDS.push(this.imageList[i]['att_id']);
this.$set(item,'isSelect',item.isSelect == undefined ? true : !item.isSelect);
var val = small == 1 ? item['satt_dir'] : item['att_dir'];
if(item.isSelect === true) {
this.selectImages[this.selectImages.length] = val;
this.selectImagesIDS[this.selectImages.length] = item['att_id'];
item.sort = this.selectImages.length;
}else{
this.selectImages.splice(this.selectImages.indexOf(val),1);
this.selectImagesIDS.splice(this.selectImages.indexOf(item['att_id']),1);
for (var i=0;i<this.imageList.length;i++){
if(this.imageList[i].sort > item.sort) {
this.imageList[i].sort = (this.imageList[i].sort-1)>=0? this.imageList[i].sort-1 : 0;
}
}
item.sort = 0;
}
this.$set(this,'selectImages',selectImages);
this.$set(this,'selectImagesIDS',selectImagesIDS);
// console.log(this.selectImagesIDS)
this.$set(this,'selectImages',this.selectImages);
this.$set(this,'selectImagesIDS',this.selectImagesIDS);
},
//获取图片列表
getImageList:function(){

View File

@ -70,11 +70,6 @@ class AuthController
return app('json')->success('成功');
}
public function test()
{
echo 'test';
}
/**
* 验证码发送
* @param Request $request

View File

@ -12,7 +12,6 @@ use app\models\user\UserBill;
use app\models\user\WechatUser;
use app\Request;
use crmeb\services\GroupDataService;
use crmeb\services\SystemConfigService;
use crmeb\services\UploadService;
use crmeb\services\UtilService;
use crmeb\services\workerman\ChannelService;
@ -38,28 +37,29 @@ class PublicController
$menus = GroupDataService::getData('routine_home_menus') ?: [];//TODO 首页按钮
$roll = GroupDataService::getData('routine_home_roll_news') ?: [];//TODO 首页滚动新闻
$activity = GroupDataService::getData('routine_home_activity', 3) ?: [];//TODO 首页活动区域图片
$site_name = sysConfig('site_name');
$site_name = sys_config('site_name');
$routine_index_page = GroupDataService::getData('routine_index_page');
$info['fastInfo'] = $routine_index_page[0]['fast_info'] ?? '';//sysConfig('fast_info');//TODO 快速选择简介
$info['bastInfo'] = $routine_index_page[0]['bast_info'] ?? '';//sysConfig('bast_info');//TODO 精品推荐简介
$info['firstInfo'] = $routine_index_page[0]['first_info'] ?? '';//sysConfig('first_info');//TODO 首发新品简介
$info['salesInfo'] = $routine_index_page[0]['sales_info'] ?? '';//sysConfig('sales_info');//TODO 促销单品简介
$logoUrl = sysConfig('routine_index_logo');//TODO 促销单品简介
if (strstr($logoUrl, 'http') === false) $logoUrl = sysConfig('site_url') . $logoUrl;
$info['fastInfo'] = $routine_index_page[0]['fast_info'] ?? '';//sys_config('fast_info');//TODO 快速选择简介
$info['bastInfo'] = $routine_index_page[0]['bast_info'] ?? '';//sys_config('bast_info');//TODO 精品推荐简介
$info['firstInfo'] = $routine_index_page[0]['first_info'] ?? '';//sys_config('first_info');//TODO 首发新品简介
$info['salesInfo'] = $routine_index_page[0]['sales_info'] ?? '';//sys_config('sales_info');//TODO 促销单品简介
$logoUrl = sys_config('routine_index_logo');//TODO 促销单品简介
if (strstr($logoUrl, 'http') === false && $logoUrl) $logoUrl = sys_config('site_url') . $logoUrl;
$logoUrl = str_replace('\\', '/', $logoUrl);
$fastNumber = $routine_index_page[0]['fast_number'] ?? 6;//sysConfig('fast_number');//TODO 快速选择分类个数
$bastNumber = $routine_index_page[0]['bast_number'] ?? 6;//sysConfig('bast_number');//TODO 精品推荐个数
$firstNumber = $routine_index_page[0]['first_number'] ?? 6;//sysConfig('first_number');//TODO 首发新品个数
$info['fastList'] = StoreCategory::byIndexList((int)$fastNumber);//TODO 快速选择分类个数
$info['bastList'] = StoreProduct::getBestProduct('id,image,store_name,cate_id,price,ot_price,IFNULL(sales,0) + IFNULL(ficti,0) as sales,unit_name', (int)$bastNumber, $request->uid());//TODO 精品推荐个数
$info['firstList'] = StoreProduct::getNewProduct('id,image,store_name,cate_id,price,unit_name,IFNULL(sales,0) + IFNULL(ficti,0) as sales', (int)$firstNumber, $request->uid());//TODO 首发新品个数
$fastNumber = $routine_index_page[0]['fast_number'] ?? 0;//sys_config('fast_number');//TODO 快速选择分类个数
$bastNumber = $routine_index_page[0]['bast_number'] ?? 0;//sys_config('bast_number');//TODO 精品推荐个数
$firstNumber = $routine_index_page[0]['first_number'] ?? 0;//sys_config('first_number');//TODO 首发新品个数
$info['fastList'] = StoreCategory::byIndexList((int)$fastNumber, false);//TODO 快速选择分类个数
$info['bastList'] = StoreProduct::getBestProduct('id,image,store_name,cate_id,price,ot_price,IFNULL(sales,0) + IFNULL(ficti,0) as sales,unit_name', (int)$bastNumber, $request->uid(), false);//TODO 精品推荐个数
$info['firstList'] = StoreProduct::getNewProduct('id,image,store_name,cate_id,price,unit_name,IFNULL(sales,0) + IFNULL(ficti,0) as sales', (int)$firstNumber, $request->uid(), false);//TODO 首发新品个数
$info['bastBanner'] = GroupDataService::getData('routine_home_bast_banner') ?? [];//TODO 首页精品推荐图片
$benefit = StoreProduct::getBenefitProduct('id,image,store_name,cate_id,price,ot_price,stock,unit_name', 3);//TODO 首页促销单品
$lovely = GroupDataService::getData('routine_home_new_banner') ?: [];//TODO 首发新品顶部图
$likeInfo = StoreProduct::getHotProduct('id,image,store_name,cate_id,price,unit_name', 3);//TODO 热门榜单 猜你喜欢
$couponList = StoreCouponIssue::getIssueCouponList($request->uid(), 3);
$subscribe = WechatUser::where('uid', $request->uid() ?? 0)->value('subscribe') ? true : false;
return app('json')->successful(compact('banner', 'menus', 'roll', 'info', 'activity', 'lovely', 'benefit', 'likeInfo', 'logoUrl', 'couponList', 'site_name','subscribe'));
$newGoodsBananr = sys_config('new_goods_bananr');
return app('json')->successful(compact('banner', 'menus', 'roll', 'info', 'activity', 'lovely', 'benefit', 'likeInfo', 'logoUrl', 'couponList', 'site_name', 'subscribe','newGoodsBananr'));
}
/**
@ -68,11 +68,11 @@ class PublicController
*/
public function share()
{
$data['img'] = sysConfig('wechat_share_img');
if (strstr($data['img'], 'http') === false) $data['img'] = sysConfig('site_url') . $data['img'];
$data['img'] = sys_config('wechat_share_img');
if (strstr($data['img'], 'http') === false) $data['img'] = sys_config('site_url') . $data['img'];
$data['img'] = str_replace('\\', '/', $data['img']);
$data['title'] = sysConfig('wechat_share_title');
$data['synopsis'] = sysConfig('wechat_share_synopsis');
$data['title'] = sys_config('wechat_share_title');
$data['synopsis'] = sys_config('wechat_share_synopsis');
return app('json')->successful(compact('data'));
}
@ -89,11 +89,11 @@ class PublicController
{
$menusInfo = GroupDataService::getData('routine_my_menus') ?? [];
$user = $request->user();
$vipOpen = sysConfig('vip_open');
$vipOpen = sys_config('vip_open');
$vipOpen = is_string($vipOpen) ? (int)$vipOpen : $vipOpen;
foreach ($menusInfo as $key => &$value) {
$value['pic'] = UtilService::setSiteUrl($value['pic']);
if ($value['id'] == 137 && !(intval(sysConfig('store_brokerage_statu')) == 2 || $user->is_promoter == 1))
$value['pic'] = set_file_url($value['pic']);
if ($value['id'] == 137 && !(intval(sys_config('store_brokerage_statu')) == 2 || $user->is_promoter == 1))
unset($menusInfo[$key]);
if ($value['id'] == 174 && !StoreService::orderServiceStatus($user->uid))
unset($menusInfo[$key]);
@ -149,7 +149,7 @@ class PublicController
$start_uploads = 0;
$start_uploads++;
Cache::set('start_uploads_' . $request->uid(), $start_uploads, 86400);
$res['dir'] = UploadService::pathToUrl($res['dir']);
$res['dir'] = UtilService::pathToUrl($res['dir']);
if (strpos($res['dir'], 'http') === false) $res['dir'] = $request->domain() . $res['dir'];
return app('json')->successful('图片上传成功!', ['name' => $res['name'], 'url' => $res['dir']]);
}

View File

@ -4,8 +4,10 @@
namespace app\api\controller\wechat;
use app\models\routine\RoutineTemplate;
use app\models\user\WechatUser;
use app\Request;
use crmeb\services\CacheService;
use crmeb\services\MiniProgramService;
use crmeb\services\UtilService;
use app\models\user\UserToken;
@ -13,6 +15,7 @@ use crmeb\services\SystemConfigService;
use app\models\user\User;
use app\models\routine\RoutineFormId;
use think\facade\Cache;
use crmeb\services\SubscribeTemplateService;
/**
* 小程序相关
@ -34,20 +37,20 @@ class AuthController
public function mp_auth(Request $request)
{
$cache_key = '';
list($code,$post_cache_key,$login_type) = UtilService::postMore([
['code',''],
['cache_key',''],
['login_type','']
],$request,true);
$session_key = Cache::get('eb_api_code_'.$post_cache_key);
list($code, $post_cache_key, $login_type) = UtilService::postMore([
['code', ''],
['cache_key', ''],
['login_type', '']
], $request, true);
$session_key = Cache::get('eb_api_code_' . $post_cache_key);
if (!$code && !$session_key)
return app('json')->fail('授权失败,参数有误');
if($code && !$session_key){
if ($code && !$session_key) {
try {
$userInfoCong = MiniProgramService::getUserInfo($code);
$session_key = $userInfoCong['session_key'];
$cache_key = md5(time().$code);
Cache::set('eb_api_code_'.$cache_key,$session_key,86400);
$cache_key = md5(time() . $code);
Cache::set('eb_api_code_' . $cache_key, $session_key, 86400);
} catch (\Exception $e) {
return app('json')->fail('获取session_key失败请检查您的配置', ['line' => $e->getLine(), 'message' => $e->getMessage()]);
}
@ -72,12 +75,12 @@ class AuthController
$userInfo['session_key'] = $session_key;
$userInfo['login_type'] = $login_type;
$uid = WechatUser::routineOauth($userInfo);
$userInfo = User::where('uid',$uid)->find();
if($userInfo->login_type == 'h5' && ($h5UserInfo = User::where(['account'=>$userInfo->phone,'phone'=>$userInfo->phone,'user_type'=>'h5'])->find()))
$userInfo = User::where('uid', $uid)->find();
if ($userInfo->login_type == 'h5' && ($h5UserInfo = User::where(['account' => $userInfo->phone, 'phone' => $userInfo->phone, 'user_type' => 'h5'])->find()))
$token = UserToken::createToken($userInfo, 'routine');
else
$token = UserToken::createToken($userInfo, 'routine');
if($token) {
if ($token) {
event('UserLogin', [$userInfo, $token]);
return app('json')->successful('登陆成功!', [
'token' => $token->token,
@ -85,7 +88,7 @@ class AuthController
'expires_time' => strtotime($token->expires_time),
'cache_key' => $cache_key
]);
}else
} else
return app('json')->fail('获取用户访问token失败!');
}
@ -96,20 +99,20 @@ class AuthController
*/
public function get_logo(Request $request)
{
$logoType = $request->get('type',1);
$logoType = $request->get('type', 1);
switch ((int)$logoType) {
case 1:
$logo = sysConfig('routine_logo');
$logo = sys_config('routine_logo');
break;
case 2:
$logo = sysConfig('wechat_avatar');
$logo = sys_config('wechat_avatar');
break;
default:
$logo = '';
break;
}
if (strstr($logo,'http') === false && $logo) $logo = sysConfig('site_url').$logo;
return app('json')->successful(['logo_url'=>str_replace('\\','/',$logo)]);
if (strstr($logo, 'http') === false && $logo) $logo = sys_config('site_url') . $logo;
return app('json')->successful(['logo_url' => str_replace('\\', '/', $logo)]);
}
/**
@ -119,10 +122,10 @@ class AuthController
*/
public function set_form_id(Request $request)
{
$formId = $request->post('formId','');
if(!$formId) return app('json')->fail('缺少form id');
RoutineFormId::SetFormId($formId,$request->uid());
return app('json')->successful('保存form id 成功!',['uid'=>$request->uid()]);
$formId = $request->post('formId', '');
if (!$formId) return app('json')->fail('缺少form id');
RoutineFormId::SetFormId($formId, $request->uid());
return app('json')->successful('保存form id 成功!', ['uid' => $request->uid()]);
}
/**
@ -132,4 +135,21 @@ class AuthController
{
MiniProgramService::handleNotify();
}
/**
* 获取小程序订阅消息id
* @return mixed
*/
public function teml_ids()
{
$temlIdsName = SubscribeTemplateService::getConstants();
$temlIdsList = CacheService::get('TEML_IDS_LIST', function () use ($temlIdsName) {
$temlId = [];
foreach ($temlIdsName as $key => $item) {
$temlId[strtolower($key)] = SubscribeTemplateService::setTemplateId($item);
}
return $temlId;
});
return app('json')->success($temlIdsList);
}
}

View File

@ -8,8 +8,8 @@ use app\models\user\User;
use app\models\user\UserToken;
use app\models\user\WechatUser;
use app\Request;
use crmeb\utils\Canvas;
use crmeb\services\WechatService;
use crmeb\utils\Canvas;
use think\facade\Cookie;
/**
@ -25,6 +25,7 @@ class WechatController
*/
public function serve()
{
ob_clean();
return WechatService::serve();
}
@ -33,6 +34,7 @@ class WechatController
*/
public function notify()
{
ob_clean();
WechatService::handleNotify();
}
@ -61,7 +63,7 @@ class WechatController
try {
$wechatInfo = WechatService::oauthService()->user()->getOriginal();
} catch (\Exception $e) {
return app('json')->fail('授权失败');
return app('json')->fail('授权失败', ['message' => $e->getMessage(), 'line' => $e->getLine()]);
}
if (!isset($wechatInfo['nickname'])) {
$wechatInfo = WechatService::getUserInfo($wechatInfo['openid']);
@ -99,12 +101,13 @@ class WechatController
$path = 'uploads/follow/';
$imageType = 'jpg';
$name = 'follow';
$siteUrl = sysConfig('site_url');
if (file_exists($path . $name . '.' . $imageType)) {
return app('json')->success('ok', ['path' => $siteUrl . '/' . $path . $name . '.' . $imageType]);
$siteUrl = sys_config('site_url');
$imageUrl = $path . $name . '.' . $imageType;
if (file_exists($imageUrl)) {
return app('json')->success('ok', ['path' => $siteUrl . '/' . $imageUrl]);
}
$canvas->setImageUrl('static/qrcode/follow.png')->setImageHeight(720)->setImageWidth(500)->pushImageValue();
$wechatQrcode = sysConfig('wechat_qrcode');
$wechatQrcode = sys_config('wechat_qrcode');
if (($strlen = stripos($wechatQrcode, 'uploads')) !== false) {
$wechatQrcode = substr($wechatQrcode, $strlen);
}
@ -114,5 +117,4 @@ class WechatController
$image = $canvas->setFileName($name)->setImageType($imageType)->setPath($path)->setBackgroundWidth(500)->setBackgroundHeight(720)->starDrawChart();
return app('json')->success('ok', ['path' => $image ? $siteUrl . '/' . $image : '']);
}
}

View File

@ -152,30 +152,45 @@ if (!function_exists('sysData')) {
}
}
if (!function_exists('sort_list_tier')) {
if (!function_exists('sys_config')) {
/**
* 分级排序
* @param $data
* @param int $pid
* @param string $field
* @param string $pk
* @param string $html
* @param int $level
* @param bool $clear
* @return array
* 获取系统单个配置
* @param string $name
* @return string | null
*/
function sort_list_tier($data, $pid = 0, $field = 'pid', $pk = 'id', $html = '|-----', $level = 1, $clear = true)
function sys_config(string $name)
{
static $list = [];
if ($clear) $list = [];
foreach ($data as $k => $res) {
if ($res[$field] == $pid) {
$res['html'] = str_repeat($html, $level);
$list[] = $res;
unset($data[$k]);
sort_list_tier($data, $res[$pk], $field, $pk, $html, $level + 1, false);
}
}
return $list;
if (empty($name))
return null;
return app('sysConfig')->get($name);
}
}
if (!function_exists('sys_data')) {
/**
* 获取系统单个配置
* @param string $name
* @return string
*/
function sys_data($name)
{
return app('sysGroupData')->getData($name);
}
}
if (!function_exists('set_file_url')) {
/**
* 设置附加路径
* @param $url
* @return bool
*/
function set_file_url($image, $siteUrl = '')
{
if (!strlen(trim($siteUrl))) $siteUrl = sys_config('site_url');
$domainTop = substr($image, 0, 4);
if ($domainTop == 'http') return $image;
$image = str_replace('\\', '/', $image);
return $siteUrl . $image;
}
}

View File

@ -2,6 +2,8 @@
namespace app\models\routine;
use app\admin\model\wechat\StoreService as ServiceModel;
use crmeb\basic\BaseModel;
use crmeb\utils\Template;
use app\models\store\StoreOrder;
use app\models\user\WechatUser;
@ -12,7 +14,7 @@ use app\models\user\WechatUser;
* Class RoutineTemplate
* @package app\models\routine
*/
class RoutineTemplate
class RoutineTemplate extends BaseModel
{
/**
* 数据表主键
@ -26,51 +28,99 @@ class RoutineTemplate
*/
protected $name = 'routine_template';
public static function sendOrderTakeOver()
/**
* 确认收货
* @param $order
* @param $title
* @return bool
*/
public static function sendOrderTakeOver($order, $title)
{
return self::sendOut('OREDER_TAKEVER', $order['uid'], [
'thing1' => $order['order_id'],
'thing2' => $title,
'date5' => date('Y-m-d H:i:s', time()),
], '/pages/order_details/index?order_id=' . $order['order_id']);
}
/**
* 送货和发货
* @param $order
* @param int $isGive
* @param int $isGive 0 = 同城配送, 1 = 快递发货
* @return bool
*/
public static function sendOrderPostage($order, $isGive = 0)
{
if ($isGive) {
$data['keyword1'] = $order['order_id'];
$data['keyword2'] = $order['delivery_name'];
$data['keyword3'] = $order['delivery_id'];
$data['keyword4'] = date('Y-m-d H:i:s', time());
$data['keyword5'] = '您的商品已经发货请注意查收';
return self::sendOut('ORDER_POSTAGE_SUCCESS', $order['uid'], $data);
} else {
$data['keyword1'] = $order['order_id'];
$data['keyword2'] = $order['delivery_name'];
$data['keyword3'] = $order['delivery_id'];
$data['keyword4'] = date('Y-m-d H:i:s', time());
return self::sendOut('ORDER_DELIVER_SUCCESS', $order['uid'], $data);
if (is_string($order['cart_id']))
$order['cart_id'] = json_decode($order['cart_id'], true);
$storeTitle = StoreOrder::getProductTitle($order['cart_id']);
$storeTitle = StoreOrder::getSubstrUTf8($storeTitle, 20,'UTF-8','');
if ($isGive) {//快递发货
return self::sendOut('ORDER_DELIVER_SUCCESS', $order['uid'], [
'character_string2' => $order['delivery_id'],
'thing1' => $order['delivery_name'],
'time3' => date('Y-m-d H:i:s', time()),
'thing5' => $storeTitle,
], '/pages/order_details/index?order_id=' . $order['order_id']);
} else {//同城配送
return self::sendOut('ORDER_POSTAGE_SUCCESS', $order['uid'], [
'thing8' => $storeTitle,
'character_string1' => $order['order_id'],
'name4' => $order['delivery_name'],
'phone_number10' => $order['delivery_id']
], '/pages/order_details/index?order_id=' . $order['order_id']);
}
}
/**
* 退款成功发送消息
* 充值金额退款
* @param $UserRecharge
* @param $refund_price
* @return bool
*/
public static function sendRechargeSuccess($UserRecharge, $refund_price)
{
return self::sendOut('ORDER_REFUND', $UserRecharge['uid'], [
'thing1' => '亲,您充值的金额已退款,本次退款' . $refund_price . '金额',
'thing2' => '余额充值退款',
'amount3' => $UserRecharge['price'],
'character_string6' => $UserRecharge['order_id'],
], '/pages/user_bill/index?type=2');
}
/**
* 订单退款成功发送消息
* @param array $order
* @return bool
*/
public static function sendOrderRefundSuccess($order = array())
{
if (!$order) return false;
$data['keyword1'] = $order['order_id'];
$data['keyword2'] = date('Y-m-d H:i:s', time());
$data['keyword3'] = $order['pay_price'];
if ($order['pay_type'] == 'yue') $data['keyword4'] = '余额支付';
else if ($order['pay_type'] == 'weixin') $data['keyword4'] = '微信支付';
else if ($order['pay_type'] == 'offline') $data['keyword4'] = '线下支付';
$data['keyword5']['value'] = '已成功退款';
return self::sendOut('ORDER_REFUND_SUCCESS', $order['uid'], $data);
if (is_string($order['cart_id']))
$order['cart_id'] = json_decode($order['cart_id'], true);
$storeTitle = StoreOrder::getProductTitle($order['cart_id']);
$storeTitle = StoreOrder::getSubstrUTf8($storeTitle, 20,'UTF-8','');
return self::sendOut('ORDER_REFUND', $order['uid'], [
'thing1' => '已成功退款',
'thing2' => $storeTitle,
'amount3' => $order['pay_price'],
'character_string6' => $order['order_id']
], '/pages/order_details/index?order_id=' . $order['order_id'] . '&isReturen=1');
}
/**
* 订单退款失败
* @param $order
* @return bool
*/
public static function sendOrderRefundFail($order, $storeTitle)
{
return self::sendOut('ORDER_REFUND', $order['uid'], [
'thing1' => '退款失败',
'thing2' => $storeTitle,
'amount3' => $order['pay_price'],
'character_string6' => $order['order_id']
], '/pages/order_details/index?order_id=' . $order['order_id'] . '&isReturen=1');
}
/**
@ -79,14 +129,15 @@ class RoutineTemplate
* @param string $refundReasonWap
* @param array $adminList
*/
public static function sendOrderRefundStatus($order = array(), $refundReasonWap = '', $adminList = array())
public static function sendOrderRefundStatus($order)
{
$data['keyword1'] = $order['order_id'];
$data['keyword2'] = $refundReasonWap;
$data['keyword3'] = date('Y-m-d H:i:s', time());
$data['keyword4'] = $order['pay_price'];
$data['keyword5'] = '原路返回';
foreach ($adminList as $uid) {
$data['character_string4'] = $order['order_id'];
$data['date5'] = date('Y-m-d H:i:s', time());
$data['amount2'] = $order['pay_price'];
$data['phrase7'] = '申请退款中';
$data['thing8'] = '请及时处理';
$kefuIds = ServiceModel::where('notify', 1)->column('uid', 'uid');
foreach ($kefuIds as $uid) {
self::sendOut('ORDER_REFUND_STATUS', $uid, $data);
}
}
@ -100,35 +151,122 @@ class RoutineTemplate
*/
public static function sendBargainSuccess($bargain = array(), $bargainUser = array(), $bargainUserId = 0)
{
$data['keyword1'] = $bargain['title'];
$data['keyword2'] = $bargainUser['bargain_price'];
$data['keyword3'] = $bargainUser['bargain_price_min'];
$data['keyword4'] = $bargainUser['price'];
$data['keyword5'] = $bargainUser['bargain_price_min'];
$data['keyword6'] = '恭喜您,已经砍到最低价了';
return self::sendOut('BARGAIN_SUCCESS', $bargainUser['uid'], $data);
$data['thing1'] = $bargain['title'];
$data['amount2'] = $bargainUser['min_price'];
$data['thing3'] = '恭喜您,已经砍到最低价了';
return self::sendOut('BARGAIN_SUCCESS', $bargainUser['uid'], $data, '/pages/activity/user_goods_bargain_list/index');
}
/**
* 订单支付成功发送模板消息
* @param string $formId
* @param string $orderId
* @param $uid
* @param $pay_price
* @param $orderId
* @param $payTime
* @return bool|void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function sendOrderSuccess($formId = '', $orderId = '')
public static function sendOrderSuccess($uid, $pay_price, $orderId)
{
if ($orderId == '') return;
$order = StoreOrder::where('order_id', $orderId)->find();
$data['keyword1'] = $orderId;
$data['keyword2'] = date('Y-m-d H:i:s', time());
$data['keyword3'] = '已支付';
$data['keyword4'] = $order['pay_price'];
if ($order['pay_type'] == 'yue') $data['keyword5'] = '余额支付';
else if ($order['pay_type'] == 'weixin') $data['keyword5'] = '微信支付';
return self::sendOut('ORDER_PAY_SUCCESS', $order['uid'], $data, $formId, '/pages/order_details/index?order_id=' . $orderId);
$data['character_string1'] = $orderId;
$data['amount2'] = $pay_price . '元';
$data['date3'] = date('Y-m-d H:i:s', time());
return self::sendOut('ORDER_PAY_SUCCESS', $uid, $data, '/pages/order_details/index?order_id=' . $orderId);
}
/**
*提现失败
* @param $uid
* @param $msg
* @param $extract_number
* @param $extract_type
* @return bool
*/
public static function sendExtractFail($uid, $msg, $extract_number, $nickname)
{
return self::sendOut('USER_EXTRACT', $uid, [
'thing1' => '提现失败:' . $msg,
'amount2' => $extract_number . '元',
'thing3' => $nickname,
'date4' => date('Y-m-d H:i:s', time())
], '/pages/user_spread_money/index');
}
/**
* 提现成功
* @param $uid
* @param $extract_number
* @param $nickname
* @return bool
*/
public static function sendExtractSuccess($uid, $extract_number, $nickname)
{
return self::sendOut('USER_EXTRACT', $uid, [
'thing1' => '提现成功',
'amount2' => $extract_number . '元',
'thing3' => $nickname,
'date4' => date('Y-m-d H:i:s', time())
], '/pages/user_spread_money/index');
}
/**
* 拼团成功通知
* @param $uid
* @param $pinkTitle
* @param $nickname
* @param $pinkTime
* @param $count
* @return bool
*/
public static function sendPinkSuccess($uid, $pinkTitle, $nickname, $pinkTime, $count, string $link = '')
{
return self::sendOut('PINK_TRUE', $uid, [
'thing1' => StoreOrder::getSubstrUTf8($pinkTitle, 20,'UTF-8',''),
'name3' => $nickname,
'date5' => date('Y-m-d H:i:s', $pinkTime),
'number2' => $count
], $link);
}
/**
* 拼团状态通知
* @param $uid
* @param $pinkTitle
* @param $count
* @param $remarks
* @return bool
*/
public static function sendPinkFail($uid, $pinkTitle, $count, $remarks, $link)
{
return self::sendOut('PINK_STATUS', $uid, [
'thing2' => StoreOrder::getSubstrUTf8($pinkTitle,20,'UTF-8',''),
'thing1' => $count,
'thing3' => $remarks
], $link);
}
/**
* 赠送积分消息提醒
* @param $uid
* @param $order
* @param $gainIntegral
* @param $integral
* @return bool
*/
public static function sendUserIntegral($uid, $order, $gainIntegral, $integral)
{
if (!$order) return false;
if (is_string($order['cart_id']))
$order['cart_id'] = json_decode($order['cart_id'], true);
$storeTitle = StoreOrder::getProductTitle($order['cart_id']);
$storeTitle = StoreOrder::getSubstrUTf8($storeTitle, 20);
return self::sendOut('INTEGRAL_ACCOUT', $uid, [
'character_string2' => $order['order_id'],
'thing3' => $storeTitle,
'amount4' => $order['pay_price'],
'number5' => $gainIntegral,
'number6' => $integral
], '/pages/user_bill/index?type=2');
}
/**
@ -136,26 +274,13 @@ class RoutineTemplate
* @param string $TempCode 模板消息常量名称
* @param int $uid 用户uid
* @param array $data 模板内容
* @param string $formId formId
* @param string $link 跳转链接
* @return bool
*/
public static function sendOut($TempCode, $uid = null, $data = null, $formId = '', $link = '')
public static function sendOut(string $tempCode, $uid, array $data, string $link = '')
{
try {
$openid = WechatUser::uidToOpenid($uid);
if (!$openid) return false;
if (!$formId) {
$form = RoutineFormId::getFormIdOne($uid, true);
if (!$form) return false;
if (isset($form['id'])) RoutineFormId::where('id', $form['id'])->delete();
} else {
$form['form_id'] = $formId;
}
return Template::instance()->routine()->setTemplateUrl($link)->setTemplateOpenId($openid)
->setTemplateData($data)->setTemplateFormId($form['form_id'])->setTemplateCode($TempCode)->send();
} catch (\Exception $e) {
return false;
}
$openid = WechatUser::uidToOpenid($uid);
if (!$openid) return false;
return Template::instance()->subscribe()->setTemplateUrl($link)->setTemplateOpenId($openid)->setTemplateData($data)->setTemplateCode($tempCode)->send();
}
}

View File

@ -74,8 +74,9 @@ class StoreCategory extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function byIndexList($limit = 4, $field = 'id,cate_name,pid,pic')
public static function byIndexList($limit = 4,bool $bool = true, $field = 'id,cate_name,pid,pic')
{
if(!$limit && !$bool) return [];
return self::where('pid', '>', 0)->where('is_show', 1)->field($field)->order('sort DESC')->limit($limit)->select();
}

View File

@ -76,8 +76,8 @@ class StoreOrder extends BaseModel
*/
public static function getOrderPriceGroup($cartInfo)
{
$storePostage = floatval(sysConfig('store_postage')) ?: 0;//邮费基础价
$storeFreePostage = floatval(sysConfig('store_free_postage')) ?: 0;//满额包邮
$storePostage = floatval(sys_config('store_postage')) ?: 0;//邮费基础价
$storeFreePostage = floatval(sys_config('store_free_postage')) ?: 0;//满额包邮
$totalPrice = self::getOrderSumPrice($cartInfo, 'truePrice');//获取订单总金额
$costPrice = self::getOrderSumPrice($cartInfo, 'costPrice');//获取订单成本价
$vipPrice = self::getOrderSumPrice($cartInfo, 'vip_truePrice');//获取订单会员优惠金额
@ -118,8 +118,8 @@ class StoreOrder extends BaseModel
*/
public static function getCombinationOrderPriceGroup($cartInfo)
{
$storePostage = floatval(sysConfig('store_postage')) ?: 0;
$storeFreePostage = floatval(sysConfig('store_free_postage')) ?: 0;
$storePostage = floatval(sys_config('store_postage')) ?: 0;
$storeFreePostage = floatval(sys_config('store_free_postage')) ?: 0;
$totalPrice = self::getCombinationOrderTotalPrice($cartInfo);
$costPrice = self::getCombinationOrderTotalPrice($cartInfo);
if (!$storeFreePostage) {
@ -216,30 +216,30 @@ class StoreOrder extends BaseModel
* @throws \think\exception\DbException
*/
public static function cacheKeyCreateOrder($uid, $key, $addressId, $payType, $useIntegral = false, $couponId = 0, $mark = '', $combinationId = 0, $pinkId = 0, $seckill_id = 0, $bargain_id = 0, $test = false, $isChannel = 0,$shipping_type = 1,$real_name='',$phone='')
public static function cacheKeyCreateOrder($uid, $key, $addressId, $payType, $useIntegral = false, $couponId = 0, $mark = '', $combinationId = 0, $pinkId = 0, $seckill_id = 0, $bargain_id = 0, $test = false, $isChannel = 0, $shipping_type = 1, $real_name = '', $phone = '')
{
self::beginTrans();
try{
try {
$shipping_type = (int)$shipping_type;
$offlinePayStatus = (int)sysConfig('offline_pay_status') ?? (int)2;
if($offlinePayStatus == 2) unset(self::$payType['offline']);
if (!array_key_exists($payType, self::$payType)) return self::setErrorInfo('选择支付方式有误!',true);
if (self::be(['unique' => $key, 'uid' => $uid])) return self::setErrorInfo('请勿重复提交订单',true);
$offlinePayStatus = (int)sys_config('offline_pay_status') ?? (int)2;
if ($offlinePayStatus == 2) unset(self::$payType['offline']);
if (!array_key_exists($payType, self::$payType)) return self::setErrorInfo('选择支付方式有误!', true);
if (self::be(['unique' => $key, 'uid' => $uid])) return self::setErrorInfo('请勿重复提交订单', true);
$userInfo = User::getUserInfo($uid);
if (!$userInfo) return self::setErrorInfo('用户不存在!',true);
if (!$userInfo) return self::setErrorInfo('用户不存在!', true);
$cartGroup = self::getCacheOrderInfo($uid, $key);
if (!$cartGroup) return self::setErrorInfo('订单已过期,请刷新当前页面!',true);
if (!$cartGroup) return self::setErrorInfo('订单已过期,请刷新当前页面!', true);
$cartInfo = $cartGroup['cartInfo'];
$priceGroup = $cartGroup['priceGroup'];
$other = $cartGroup['other'];
$payPrice = (float)$priceGroup['totalPrice'];
$payPostage = $priceGroup['storePostage'];
if($shipping_type === 1) {
if ($shipping_type === 1) {
if (!$test && !$addressId) return self::setErrorInfo('请选择收货地址!', true);
if (!$test && (!UserAddress::be(['uid' => $uid, 'id' => $addressId, 'is_del' => 0]) || !($addressInfo = UserAddress::find($addressId))))
return self::setErrorInfo('地址选择有误!', true);
}else{
if((!$real_name || !$phone) && !$test) return self::setErrorInfo('请填写姓名和电话',true);
} else {
if ((!$real_name || !$phone) && !$test) return self::setErrorInfo('请填写姓名和电话', true);
$addressInfo['real_name'] = $real_name;
$addressInfo['phone'] = $phone;
$addressInfo['province'] = '';
@ -254,28 +254,28 @@ class StoreOrder extends BaseModel
foreach ($cartInfo as $cart) {
$cartIds[] = $cart['id'];
$totalNum += $cart['cart_num'];
if(!$seckill_id) $seckill_id = $cart['seckill_id'];
if(!$bargain_id) $bargain_id = $cart['bargain_id'];
if(!$combinationId) $combinationId = $cart['combination_id'];
$cartInfoGainIntegral = isset($cart['productInfo']['give_integral']) ? bcmul($cart['cart_num'],$cart['productInfo']['give_integral'],2) : 0;
if (!$seckill_id) $seckill_id = $cart['seckill_id'];
if (!$bargain_id) $bargain_id = $cart['bargain_id'];
if (!$combinationId) $combinationId = $cart['combination_id'];
$cartInfoGainIntegral = isset($cart['productInfo']['give_integral']) ? bcmul($cart['cart_num'], $cart['productInfo']['give_integral'], 2) : 0;
$gainIntegral = bcadd($gainIntegral, $cartInfoGainIntegral, 2);
}
$deduction = $seckill_id || $bargain_id || $combinationId;
if($deduction){
if ($deduction) {
$couponId = 0;
$useIntegral = false;
if(!$test){
if (!$test) {
unset(self::$payType['offline']);
if (!array_key_exists($payType, self::$payType)) return self::setErrorInfo('营销产品不能使用线下支付!',true);
if (!array_key_exists($payType, self::$payType)) return self::setErrorInfo('营销产品不能使用线下支付!', true);
}
}
//使用优惠劵
$res1 = true;
if ($couponId) {
$couponInfo = StoreCouponUser::validAddressWhere()->where('id', $couponId)->where('uid', $uid)->find();
if (!$couponInfo) return self::setErrorInfo('选择的优惠劵无效!',true);
if (!$couponInfo) return self::setErrorInfo('选择的优惠劵无效!', true);
if ($couponInfo['use_min_price'] > $payPrice)
return self::setErrorInfo('不满足优惠劵的使用条件!',true);
return self::setErrorInfo('不满足优惠劵的使用条件!', true);
$payPrice = (float)bcsub($payPrice, $couponInfo['coupon_price'], 2);
$res1 = StoreCouponUser::useCoupon($couponId);
$couponPrice = $couponInfo['coupon_price'];
@ -283,16 +283,16 @@ class StoreOrder extends BaseModel
$couponId = 0;
$couponPrice = 0;
}
if (!$res1) return self::setErrorInfo('使用优惠劵失败!',true);
if (!$res1) return self::setErrorInfo('使用优惠劵失败!', true);
//$shipping_type = 1 快递发货 $shipping_type = 2 门店自提
$store_self_mention = sysConfig('store_self_mention') ?? 0;
if(!$store_self_mention) $shipping_type = 1;
if($shipping_type === 1) {
$store_self_mention = sys_config('store_self_mention') ?? 0;
if (!$store_self_mention) $shipping_type = 1;
if ($shipping_type === 1) {
//是否包邮
if ((isset($other['offlinePostage']) && $other['offlinePostage'] && $payType == 'offline')) $payPostage = 0;
$payPrice = (float)bcadd($payPrice, $payPostage, 2);
}else if($shipping_type === 2){
} else if ($shipping_type === 2) {
//门店自提没有邮费支付
$priceGroup['storePostage'] = 0;
$payPostage = 0;
@ -311,7 +311,7 @@ class StoreOrder extends BaseModel
} else {
$deductionPrice = $payPrice;
$usedIntegral = (float)bcdiv($payPrice, $other['integralRatio'], 2);
$SurplusIntegral = bcsub($userInfo['integral'],$usedIntegral,2);
$SurplusIntegral = bcsub($userInfo['integral'], $usedIntegral, 2);
$res2 = false !== User::bcDec($userInfo['uid'], 'integral', $usedIntegral, 'uid');
$payPrice = 0;
}
@ -320,8 +320,8 @@ class StoreOrder extends BaseModel
$deductionPrice = 0;
$usedIntegral = 0;
}
if (!$res2) return self::setErrorInfo('使用积分抵扣失败!',true);
if($payPrice <= 0) $payPrice = 0;
if (!$res2) return self::setErrorInfo('使用积分抵扣失败!', true);
if ($payPrice <= 0) $payPrice = 0;
if ($test) {
self::rollbackTrans();
return [
@ -330,7 +330,7 @@ class StoreOrder extends BaseModel
'pay_postage' => $payPostage,
'coupon_price' => $couponPrice,
'deduction_price' => $deductionPrice,
'SurplusIntegral'=> $SurplusIntegral,
'SurplusIntegral' => $SurplusIntegral,
];
}
$orderInfo = [
@ -361,15 +361,15 @@ class StoreOrder extends BaseModel
'is_channel' => $isChannel,
'add_time' => time(),
'unique' => $key,
'shipping_type'=>$shipping_type,
'shipping_type' => $shipping_type,
];
if($shipping_type === 2){
if ($shipping_type === 2) {
$orderInfo['verify_code'] = self::getStoreCode();
$orderInfo['store_id'] = SystemStore::getStoreDispose(0,'id');
if(!$orderInfo['store_id']) return self::setErrorInfo('暂无门店无法选择门店自提!',true);
$orderInfo['store_id'] = SystemStore::getStoreDispose(0, 'id');
if (!$orderInfo['store_id']) return self::setErrorInfo('暂无门店无法选择门店自提!', true);
}
$order = self::create($orderInfo);
if (!$order) return self::setErrorInfo('订单生成失败!',true);
if (!$order) return self::setErrorInfo('订单生成失败!', true);
$res5 = true;
foreach ($cartInfo as $cart) {
//减库存加销量
@ -382,19 +382,19 @@ class StoreOrder extends BaseModel
$res4 = false !== StoreOrderCartInfo::setCartInfo($order['id'], $cartInfo);
//购物车状态修改
$res6 = false !== StoreCart::where('id', 'IN', $cartIds)->update(['is_pay' => 1]);
if (!$res4 || !$res5 || !$res6) return self::setErrorInfo('订单生成失败!',true);
if (!$res4 || !$res5 || !$res6) return self::setErrorInfo('订单生成失败!', true);
//自动设置默认地址
UserRepository::storeProductOrderCreateEbApi($order, compact('cartInfo', 'addressId'));
self::clearCacheOrderInfo($uid, $key);
self::commitTrans();
StoreOrderStatus::status($order['id'], 'cache_key_create_order', '订单生成');
return $order;
}catch (\PDOException $e) {
} catch (\PDOException $e) {
self::rollbackTrans();
return self::setErrorInfo('生成订单时SQL执行错误错误原因'.$e->getMessage());
}catch (\Exception $e){
return self::setErrorInfo('生成订单时SQL执行错误错误原因' . $e->getMessage());
} catch (\Exception $e) {
self::rollbackTrans();
return self::setErrorInfo('生成订单时系统错误错误原因:'.$e->getMessage());
return self::setErrorInfo('生成订单时系统错误错误原因:' . $e->getMessage());
}
}
@ -468,7 +468,7 @@ class StoreOrder extends BaseModel
*/
public static function cancelOrder($order_id, $uid)
{
$order = self::where('order_id', $order_id)->where('uid',$uid)->find();
$order = self::where('order_id', $order_id)->where('uid', $uid)->find();
if (!$order) return self::setErrorInfo('没有查到此订单');
self::beginTrans();
try {
@ -476,9 +476,9 @@ class StoreOrder extends BaseModel
$order->is_del = 1;
if ($res && $order->save()) {
self::commitTrans();
return true;
}else
return false;
return true;
} else
return false;
} catch (\Exception $e) {
self::rollbackTrans();
return self::setErrorInfo(['line' => $e->getLine(), 'message' => $e->getMessage()]);
@ -493,9 +493,9 @@ class StoreOrder extends BaseModel
public static function getNewOrderId()
{
list($msec, $sec) = explode(' ', microtime());
$msectime = number_format((floatval($msec) + floatval($sec)) * 1000,0,'','');
$orderId = 'wx' . $msectime . mt_rand(10000,99999);
if(self::be(['order_id'=>$orderId])) $orderId = 'wx' . $msectime . mt_rand(10000,99999);
$msectime = number_format((floatval($msec) + floatval($sec)) * 1000, 0, '', '');
$orderId = 'wx' . $msectime . mt_rand(10000, 99999);
if (self::be(['order_id' => $orderId])) $orderId = 'wx' . $msectime . mt_rand(10000, 99999);
return $orderId;
}
@ -519,24 +519,25 @@ class StoreOrder extends BaseModel
public static function getProductTitle($cartId)
{
$title = '';
try{
$orderCart=StoreOrderCartInfo::where('cart_id','in',$cartId)->field('cart_info')->select();
foreach ($orderCart as $item){
if(isset($item['cart_info']['productInfo']['store_name'])){
$title.=$item['cart_info']['productInfo']['store_name'].'|';
try {
$orderCart = StoreOrderCartInfo::where('cart_id', 'in', $cartId)->field('cart_info')->select();
foreach ($orderCart as $item) {
if (isset($item['cart_info']['productInfo']['store_name'])) {
$title .= $item['cart_info']['productInfo']['store_name'] . '|';
}
}
unset($item);
if(!$title){
if (!$title) {
$productIds = StoreCart::where('id', 'in', $cartId)->column('product_id');
$productlist = ($productlist= StoreProduct::getProductField($productIds, 'store_name')) ? $productlist->toArray() : [];
$productlist = ($productlist = StoreProduct::getProductField($productIds, 'store_name')) ? $productlist->toArray() : [];
foreach ($productlist as $item) {
if (isset($item['store_name'])) $title .= $item['store_name'] . '|';
}
}
if($title) $title = substr($title,0,strlen($title)-1);
if ($title) $title = substr($title, 0, strlen($title) - 1);
unset($item);
}catch (\Exception $e){}
} catch (\Exception $e) {
}
return $title;
}
@ -544,14 +545,15 @@ class StoreOrder extends BaseModel
* 获取门店自提唯一核销码
* @return bool|string
*/
public static function getStoreCode(){
public static function getStoreCode()
{
list($msec, $sec) = explode(' ', microtime());
$num = bcadd(time(),mt_rand(10,999999),0).''.substr($msec,2,3);//生成随机数
if(strlen($num) < 12)
$num = str_pad((string)$num,12,0,STR_PAD_RIGHT);
$num = bcadd(time(), mt_rand(10, 999999), 0) . '' . substr($msec, 2, 3);//生成随机数
if (strlen($num) < 12)
$num = str_pad((string)$num, 12, 0, STR_PAD_RIGHT);
else
$num = substr($num,0,12);
if(self::be(['verify_code'=>$num])) return self::getStoreCode();
$num = substr($num, 0, 12);
if (self::be(['verify_code' => $num])) return self::getStoreCode();
return $num;
}
@ -576,9 +578,9 @@ class StoreOrder extends BaseModel
if ($orderInfo['pay_price'] <= 0) exception('该支付无需支付!');
$openid = WechatUser::getOpenId($orderInfo['uid']);
$bodyContent = self::getProductTitle($orderInfo['cart_id']);
$site_name = sysConfig('site_name');
if(!$bodyContent && !$site_name) exception('支付参数缺少:请前往后台设置->系统设置-> 填写 网站名称');
return MiniProgramService::jsPay($openid, $orderInfo['order_id'], $orderInfo['pay_price'], 'productr',self::getSubstrUTf8($site_name.' - '.$bodyContent,30));
$site_name = sys_config('site_name');
if (!$bodyContent && !$site_name) exception('支付参数缺少:请前往后台设置->系统设置-> 填写 网站名称');
return MiniProgramService::jsPay($openid, $orderInfo['order_id'], $orderInfo['pay_price'], 'productr', self::getSubstrUTf8($site_name . ' - ' . $bodyContent, 30));
}
/**
@ -590,20 +592,20 @@ class StoreOrder extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function wxPay($orderId,$field = 'order_id')
public static function wxPay($orderId, $field = 'order_id')
{
if(is_string($orderId))
$orderInfo = self::where($field,$orderId)->find();
if (is_string($orderId))
$orderInfo = self::where($field, $orderId)->find();
else
$orderInfo = $orderId;
if(!$orderInfo || !isset($orderInfo['paid'])) exception('支付订单不存在!');
if($orderInfo['paid']) exception('支付已支付!');
if($orderInfo['pay_price'] <= 0) exception('该支付无需支付!');
$openid = WechatUser::uidToOpenid($orderInfo['uid'],'openid');
if (!$orderInfo || !isset($orderInfo['paid'])) exception('支付订单不存在!');
if ($orderInfo['paid']) exception('支付已支付!');
if ($orderInfo['pay_price'] <= 0) exception('该支付无需支付!');
$openid = WechatUser::uidToOpenid($orderInfo['uid'], 'openid');
$bodyContent = self::getProductTitle($orderInfo['cart_id']);
$site_name = sysConfig('site_name');
if(!$bodyContent && !$site_name) exception('支付参数缺少:请前往后台设置->系统设置-> 填写 网站名称');
return WechatService::jsPay($openid,$orderInfo['order_id'],$orderInfo['pay_price'],'product',self::getSubstrUTf8($site_name.' - '.$bodyContent,30));
$site_name = sys_config('site_name');
if (!$bodyContent && !$site_name) exception('支付参数缺少:请前往后台设置->系统设置-> 填写 网站名称');
return WechatService::jsPay($openid, $orderInfo['order_id'], $orderInfo['pay_price'], 'product', self::getSubstrUTf8($site_name . ' - ' . $bodyContent, 30));
}
/**
@ -615,19 +617,19 @@ class StoreOrder extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function h5Pay($orderId,$field = 'order_id')
public static function h5Pay($orderId, $field = 'order_id')
{
if(is_string($orderId))
$orderInfo = self::where($field,$orderId)->find();
if (is_string($orderId))
$orderInfo = self::where($field, $orderId)->find();
else
$orderInfo = $orderId;
if(!$orderInfo || !isset($orderInfo['paid'])) exception('支付订单不存在!');
if($orderInfo['paid']) exception('支付已支付!');
if($orderInfo['pay_price'] <= 0) exception('该支付无需支付!');
if (!$orderInfo || !isset($orderInfo['paid'])) exception('支付订单不存在!');
if ($orderInfo['paid']) exception('支付已支付!');
if ($orderInfo['pay_price'] <= 0) exception('该支付无需支付!');
$bodyContent = self::getProductTitle($orderInfo['cart_id']);
$site_name = sysConfig('site_name');
if(!$bodyContent && !$site_name) exception('支付参数缺少:请前往后台设置->系统设置-> 填写 网站名称');
return WechatService::paymentPrepare(null,$orderInfo['order_id'],$orderInfo['pay_price'],'product',self::getSubstrUTf8($site_name.' - '.$bodyContent,30),'','MWEB');
$site_name = sys_config('site_name');
if (!$bodyContent && !$site_name) exception('支付参数缺少:请前往后台设置->系统设置-> 填写 网站名称');
return WechatService::paymentPrepare(null, $orderInfo['order_id'], $orderInfo['pay_price'], 'product', self::getSubstrUTf8($site_name . ' - ' . $bodyContent, 30), '', 'MWEB');
}
@ -715,26 +717,25 @@ class StoreOrder extends BaseModel
if (!$res)
return self::setErrorInfo('申请退款失败!');
else {
try{
$adminIds = sysConfig('site_store_admin_uids');
if (!empty($adminIds)) {
if (!($adminList = array_unique(array_filter(explode(',', trim($adminIds)))))) {
return self::setErrorInfo('申请退款成功,');
}
//小程序 发送模板消息
RoutineTemplate::sendOrderRefundStatus($order, $refundReasonWap, $adminList);
try {
if (in_array($order['is_channel'], [0, 2])) {
//公众号发送模板消息
WechatTemplateService::sendAdminNoticeTemplate([
'first'=>"亲,您有一个新订单 \n订单号:{$order['order_id']}",
'keyword1'=>'新订单',
'keyword2'=>'已支付',
'keyword3'=>date('Y/m/d H:i',time()),
'remark'=>'请及时处理'
'first' => "亲,您有一个新订单 \n订单号:{$order['order_id']}",
'keyword1' => '新订单',
'keyword2' => '已支付',
'keyword3' => date('Y/m/d H:i', time()),
'remark' => '请及时处理'
]);
}
ChannelService::instance()->send('NEW_REFUND_ORDER', ['order_id'=>$order['order_id']]);
}catch (\Exception $e){}
event('ShortMssageSend',[$order['order_id'],'AdminRefund']);
if (in_array($order['is_channel'], [1, 2])) {
//小程序 发送模板消息
RoutineTemplate::sendOrderRefundStatus($order, $refundReasonWap);
}
ChannelService::instance()->send('NEW_REFUND_ORDER', ['order_id' => $order['order_id']]);
} catch (\Exception $e) {
}
event('ShortMssageSend', [$order['order_id'], 'AdminRefund']);
return true;
}
}
@ -755,7 +756,7 @@ class StoreOrder extends BaseModel
$oid = self::where('order_id', $orderId)->value('id');
StoreOrderStatus::status($oid, 'pay_success', '用户付款成功');
//支付成功后
event('OrderPaySuccess', [$order,$formId]);
event('OrderPaySuccess', [$order, $formId]);
$res = $res1 && $resPink;
return false !== $res;
}
@ -808,28 +809,10 @@ class StoreOrder extends BaseModel
public static function orderPostageAfter($postageData, $oid)
{
$order = self::where('id', $oid)->find();
$url = '/pages/order_details/index?order_id=' . $order['order_id'];
$group = [
'first' => '亲,您的订单已发货,请注意查收',
'remark' => '点击查看订单详情'
];
if ($postageData['delivery_type'] == 'send') {//送货
$goodsName = StoreOrderCartInfo::getProductNameList($order['id']);
$group = array_merge($group, [
'keyword1' => $goodsName,
'keyword2' => $order['pay_type'] == 'offline' ? '线下支付' : date('Y/m/d H:i', $order['pay_time']),
'keyword3' => $order['user_address'],
'keyword4' => $postageData['delivery_name'],
'keyword5' => $postageData['delivery_id']
]);
RoutineTemplate::sendOut('ORDER_DELIVER_SUCCESS', $order['uid'], $group, $url);
RoutineTemplate::sendOrderPostage($order);
} else if ($postageData['delivery_type'] == 'express') {//发货
$group = array_merge($group, [
'keyword1' => $order['order_id'],
'keyword2' => $postageData['delivery_name'],
'keyword3' => $postageData['delivery_id']
]);
RoutineTemplate::sendOut('ORDER_POSTAGE_SUCCESS', $order['uid'], $group, $url);
RoutineTemplate::sendOrderPostage($order, 1);
}
}
@ -838,14 +821,9 @@ class StoreOrder extends BaseModel
*/
public static function orderTakeAfter($order)
{
$title=self::getProductTitle($order['cart_id']);
$title = self::getProductTitle($order['cart_id']);
if ($order['is_channel'] == 1) {//小程序
RoutineTemplate::sendOut('OREDER_TAKEVER', $order['uid'], [
'keyword1' => $order['order_id'],
'keyword2' => $title,
'keyword3' => $order['pay_price'],
'keyword4' => date('Y-m-d H:i:s', time()),
]);
RoutineTemplate::sendOrderTakeOver($order, $title);
} else {
$openid = WechatUser::where('uid', $order['uid'])->value('openid');
\crmeb\services\WechatTemplateService::sendTemplate($openid, \crmeb\services\WechatTemplateService::ORDER_TAKE_SUCCESS, [
@ -905,10 +883,10 @@ class StoreOrder extends BaseModel
return self::setErrorInfo($e->getMessage());
}
self::commitTrans();
event('UserLevelAfter',[User::get($uni)]);
event('UserLevelAfter', [User::get($uni)]);
event('UserOrderTake', $uni);
//短信通知
event('ShortMssageSend',[$order['order_id'],['Receiving','AdminConfirmTakeOver']]);
event('ShortMssageSend', [$order['order_id'], ['Receiving', 'AdminConfirmTakeOver']]);
return true;
} else {
self::rollbackTrans();
@ -997,12 +975,12 @@ class StoreOrder extends BaseModel
$status['_class'] = 'state-nfh';
}
} else {
if($order['shipping_type'] === 1){
if ($order['shipping_type'] === 1) {
$status['_type'] = 1;
$status['_title'] = '未发货';
$status['_msg'] = '商家未发货,请耐心等待';
$status['_class'] = 'state-nfh';
}else{
} else {
$status['_type'] = 1;
$status['_title'] = '待核销';
$status['_msg'] = '待核销,请到核销点进行核销';
@ -1018,7 +996,11 @@ class StoreOrder extends BaseModel
} else {//TODO 发货
$status['_type'] = 2;
$status['_title'] = '待收货';
$status['_msg'] = date('m月d日H时i分', StoreOrderStatus::getTime($order['id'], 'delivery_goods')) . '服务商已发货';
if($order['delivery_type'] == 'fictitious')
$_time = StoreOrderStatus::getTime($order['id'], 'delivery_fictitious');
else
$_time = StoreOrderStatus::getTime($order['id'], 'delivery_goods');
$status['_msg'] = date('m月d日H时i分', $_time) . '服务商已发货';
$status['_class'] = 'state-ysh';
}
} else if ($order['status'] == 2) {
@ -1050,7 +1032,7 @@ class StoreOrder extends BaseModel
}
}
}
$order['offlinePayStatus'] = (int)sysConfig('offline_pay_status') ?? (int)2;
$order['offlinePayStatus'] = (int)sys_config('offline_pay_status') ?? (int)2;
return $order;
}
@ -1103,7 +1085,7 @@ class StoreOrder extends BaseModel
*/
public static function getUserOrderList($uid, $status = '', $page = 0, $limit = 8)
{
if($page) $list = self::statusByWhere($status, $uid)->where('is_del', 0)->where('uid', $uid)
if ($page) $list = self::statusByWhere($status, $uid)->where('is_del', 0)->where('uid', $uid)
->field('add_time,seckill_id,bargain_id,combination_id,id,order_id,pay_price,total_num,total_price,pay_postage,total_postage,paid,status,refund_status,pay_type,coupon_price,deduction_price,pink_id,delivery_type,is_del,shipping_type')
->order('add_time DESC')->page((int)$page, (int)$limit)->select()->toArray();
else $list = self::statusByWhere($status, $uid)->where('is_del', 0)->where('uid', $uid)
@ -1183,7 +1165,7 @@ class StoreOrder extends BaseModel
$noBuy = (int)self::where('uid', $uid)->where('paid', 0)->where('is_del', 0)->where('pay_type', '<>', 'offline')->count();
$noPostageNoPink = (int)self::where('o.uid', $uid)->alias('o')->where('o.paid', 1)->where('o.pink_id', 0)->where('o.is_del', 0)->where('o.status', 0)->where('o.pay_type', '<>', 'offline')->count();
$noPostageYesPink = (int)self::where('o.uid', $uid)->alias('o')->join('StorePink p', 'o.pink_id = p.id')->where('p.status', 2)->where('o.paid', 1)->where('o.is_del', 0)->where('o.status', 0)->where('o.pay_type', '<>', 'offline')->count();
$noPostage = (int)bcadd($noPostageNoPink, $noPostageYesPink,0);
$noPostage = (int)bcadd($noPostageNoPink, $noPostageYesPink, 0);
$noTake = (int)self::where('uid', $uid)->where('paid', 1)->where('is_del', 0)->where('status', 1)->where('pay_type', '<>', 'offline')->count();
$noReply = (int)self::where('uid', $uid)->where('paid', 1)->where('is_del', 0)->where('status', 2)->count();
$noPink = (int)self::where('o.uid', $uid)->alias('o')->join('StorePink p', 'o.pink_id = p.id')->where('p.status', 1)->where('o.paid', 1)->where('o.is_del', 0)->where('o.status', 0)->where('o.pay_type', '<>', 'offline')->count();
@ -1319,20 +1301,20 @@ class StoreOrder extends BaseModel
public static function getOrderTimeData()
{
$to_day = strtotime(date('Y-m-d'));//今日
$pre_day = strtotime(date('Y-m-d',strtotime('-1 day')));//昨日
$pre_day = strtotime(date('Y-m-d', strtotime('-1 day')));//昨日
$now_month = strtotime(date('Y-m'));//本月
//今日成交额
$data['todayPrice'] = (float)number_format(self::where('is_del', 0)->where('pay_time','>=',$to_day)->where('paid', 1)->where('refund_status', 0)->value('sum(pay_price)'), 2) ?? 0;
$data['todayPrice'] = (float)number_format(self::where('is_del', 0)->where('pay_time', '>=', $to_day)->where('paid', 1)->where('refund_status', 0)->value('sum(pay_price)'), 2) ?? 0;
//今日订单数
$data['todayCount'] = self::where('is_del', 0)->where('pay_time','>=',$to_day)->where('paid', 1)->where('refund_status', 0)->count();
$data['todayCount'] = self::where('is_del', 0)->where('pay_time', '>=', $to_day)->where('paid', 1)->where('refund_status', 0)->count();
//昨日成交额
$data['proPrice'] = (float)number_format(self::where('is_del', 0)->where('pay_time','<',$to_day)->where('pay_time','>=',$pre_day)->where('paid', 1)->where('refund_status', 0)->value('sum(pay_price)'), 2) ?? 0;
$data['proPrice'] = (float)number_format(self::where('is_del', 0)->where('pay_time', '<', $to_day)->where('pay_time', '>=', $pre_day)->where('paid', 1)->where('refund_status', 0)->value('sum(pay_price)'), 2) ?? 0;
//昨日订单数
$data['proCount'] = self::where('is_del', 0)->where('pay_time','<',$to_day)->where('pay_time','>=',$pre_day)->where('paid', 1)->where('refund_status', 0)->count();
$data['proCount'] = self::where('is_del', 0)->where('pay_time', '<', $to_day)->where('pay_time', '>=', $pre_day)->where('paid', 1)->where('refund_status', 0)->count();
//本月成交额
$data['monthPrice'] = (float)number_format(self::where('is_del', 0)->where('pay_time','>=',$now_month)->where('paid', 1)->where('refund_status', 0)->value('sum(pay_price)'), 2) ?? 0;
$data['monthPrice'] = (float)number_format(self::where('is_del', 0)->where('pay_time', '>=', $now_month)->where('paid', 1)->where('refund_status', 0)->value('sum(pay_price)'), 2) ?? 0;
//本月订单数
$data['monthCount'] = self::where('is_del', 0)->where('pay_time','>=',$now_month)->where('paid', 1)->where('refund_status', 0)->count();
$data['monthCount'] = self::where('is_del', 0)->where('pay_time', '>=', $now_month)->where('paid', 1)->where('refund_status', 0)->count();
return $data;
}
@ -1448,13 +1430,13 @@ class StoreOrder extends BaseModel
}
}
if (!$res) throw new \Exception('更新错误');
unset($orderList,$res,$pages);
unset($orderList, $res, $pages);
return null;
} catch (PDOException $e) {
Log::error('未支付自动取消时发生数据库查询错误,错误原因为:'.$e->getMessage());
Log::error('未支付自动取消时发生数据库查询错误,错误原因为:' . $e->getMessage());
throw new \Exception($e->getMessage());
} catch (\think\Exception $e) {
Log::error('未支付自动取消时发生系统错误,错误原因为:'.$e->getMessage());
Log::error('未支付自动取消时发生系统错误,错误原因为:' . $e->getMessage());
throw new \Exception($e->getMessage());
}
@ -1479,7 +1461,7 @@ class StoreOrder extends BaseModel
$res3 = self::RegressionCoupon($order);
$res = $res1 && $res2 && $res3;
if ($res) $res = false !== self::where('order_id', $order['order_id'])->update(['is_del' => 1, 'mark' => '订单未支付已超过系统预设时间']);
unset($res1,$res2,$res3);
unset($res1, $res2, $res3);
return $res;
} else
return true;
@ -1565,38 +1547,38 @@ class StoreOrder extends BaseModel
public static function startTakeOrder()
{
//7天前时间戳
$systemDeliveryTime = sysConfig('system_delivery_time') ?? 0;
$systemDeliveryTime = sys_config('system_delivery_time') ?? 0;
//0为取消自动收货功能
if($systemDeliveryTime == 0) return true;
$sevenDay = strtotime(date('Y-m-d H:i:s',strtotime('-'. $systemDeliveryTime .' day')));
if ($systemDeliveryTime == 0) return true;
$sevenDay = strtotime(date('Y-m-d H:i:s', strtotime('-' . $systemDeliveryTime . ' day')));
$model = new self;
$model = $model->alias('o');
$model = $model->join('StoreOrderStatus s','s.oid=o.id');
$model = $model->join('StoreOrderStatus s', 's.oid=o.id');
$model = $model->where('o.paid', 1);
$model = $model->where('s.change_type', 'delivery_goods');
$model = $model->where('s.change_time', '<',$sevenDay);
$model = $model->where('s.change_time', '<', $sevenDay);
$model = $model->where('o.status', 1);
$model = $model->where('o.refund_status', 0);
$model = $model->where('o.is_del', 0);
$orderInfo = $model->column('id','id');
if(!count($orderInfo)) return true;
$orderInfo = $model->column('id', 'id');
if (!count($orderInfo)) return true;
$res = true;
foreach ($orderInfo as $key=>&$item){
foreach ($orderInfo as $key => &$item) {
$order = self::get($item);
if($order['status'] == 2) continue;
if($order['paid'] == 1 && $order['status'] == 1) $data['status'] = 2;
else if($order['pay_type'] == 'offline') $data['status'] = 2;
if ($order['status'] == 2) continue;
if ($order['paid'] == 1 && $order['status'] == 1) $data['status'] = 2;
else if ($order['pay_type'] == 'offline') $data['status'] = 2;
else continue;
if(!self::edit($data,$item,'id')) continue;
try{
OrderRepository::storeProductOrderTakeDeliveryAdmin($order, $item);
if (!self::edit($data, $item, 'id')) continue;
try {
OrderRepository::storeProductOrderTakeDeliveryTimer($order);
$res = $res && true;
}catch (\Exception $e){
} catch (\Exception $e) {
$res = $res && false;
}
$res = $res && StoreOrderStatus::status($item,'take_delivery','已收货[自动收货]');
$res = $res && StoreOrderStatus::status($item, 'take_delivery', '已收货[自动收货]');
}
if(!$res){
if (!$res) {
throw new \Exception('收货失败');
}
}
@ -1612,7 +1594,7 @@ class StoreOrder extends BaseModel
*/
public static function getOrderInfo($id, $field = 'order_id')
{
return self::where('id',$id)->field($field)->find();
return self::where('id', $id)->field($field)->find();
}
/**
@ -1623,7 +1605,7 @@ class StoreOrder extends BaseModel
*/
public static function getOrderDataPriceCount($page, $limit)
{
if(!$limit) return [];
if (!$limit) return [];
$model = new self;
$model = $model->field('sum(pay_price) as price,count(id) as count,FROM_UNIXTIME(add_time, \'%m-%d\') as time');
$model = $model->where('is_del', 0);
@ -1631,7 +1613,7 @@ class StoreOrder extends BaseModel
$model = $model->where('refund_status', 0);
$model = $model->group("FROM_UNIXTIME(add_time, '%Y-%m-%d')");
$model = $model->order('add_time DESC');
if($page) $model = $model->page($page, $limit);
if ($page) $model = $model->page($page, $limit);
return $model->select();
}
@ -1640,14 +1622,15 @@ class StoreOrder extends BaseModel
* @param $where
* @return mixed
*/
public static function orderList($where){
$model = self::getOrderWhere($where,self::alias('a')->join('user r','r.uid=a.uid','LEFT'),'a.','r')->field('a.id,a.order_id,a.add_time,a.status,a.total_num,a.total_price,a.total_postage,a.pay_price,a.pay_postage,a.paid,a.refund_status,a.remark,a.pay_type');
if($where['order']!=''){
public static function orderList($where)
{
$model = self::getOrderWhere($where, self::alias('a')->join('user r', 'r.uid=a.uid', 'LEFT'), 'a.', 'r')->field('a.id,a.order_id,a.add_time,a.status,a.total_num,a.total_price,a.total_postage,a.pay_price,a.pay_postage,a.paid,a.refund_status,a.remark,a.pay_type');
if ($where['order'] != '') {
$model = $model->order(self::setOrder($where['order']));
}else{
} else {
$model = $model->order('a.id desc');
}
$data = ($data=$model->page((int)$where['page'],(int)$where['limit'])->select()) && count($data) ? $data->toArray() : [];
$data = ($data = $model->page((int)$where['page'], (int)$where['limit'])->select()) && count($data) ? $data->toArray() : [];
return self::tidyAdminOrder($data);
}
@ -1662,27 +1645,27 @@ class StoreOrder extends BaseModel
*/
public static function tidyAdminOrder($data, $status = false)
{
foreach ($data as &$item){
$_info = StoreOrderCartInfo::where('oid',$item['id'])->field('cart_info')->select()->toArray();
foreach ($_info as $k=>$v){
if(!is_array($v['cart_info']))
$_info[$k]['cart_info'] = json_decode($v['cart_info'],true);
foreach ($data as &$item) {
$_info = StoreOrderCartInfo::where('oid', $item['id'])->field('cart_info')->select()->toArray();
foreach ($_info as $k => $v) {
if (!is_array($v['cart_info']))
$_info[$k]['cart_info'] = json_decode($v['cart_info'], true);
}
foreach ($_info as $k=>$v){
unset($_info[$k]['cart_info']['type'], $_info[$k]['cart_info']['product_id'], $_info[$k]['cart_info']['combination_id'], $_info[$k]['cart_info']['seckill_id'], $_info[$k]['cart_info']['bargain_id'], $_info[$k]['cart_info']['bargain_id'],$_info[$k]['cart_info']['truePrice'],$_info[$k]['cart_info']['vip_truePrice'],$_info[$k]['cart_info']['trueStock'],$_info[$k]['cart_info']['costPrice'],$_info[$k]['cart_info']['productInfo']['id'],$_info[$k]['cart_info']['productInfo']['vip_price'],$_info[$k]['cart_info']['productInfo']['postage'],$_info[$k]['cart_info']['productInfo']['give_integral'],$_info[$k]['cart_info']['productInfo']['sales'],$_info[$k]['cart_info']['productInfo']['stock'],$_info[$k]['cart_info']['productInfo']['unit_name'],$_info[$k]['cart_info']['productInfo']['is_postage'], $_info[$k]['cart_info']['productInfo']['slider_image'], $_info[$k]['cart_info']['productInfo']['cost'], $_info[$k]['cart_info']['productInfo']['mer_id'], $_info[$k]['cart_info']['productInfo']['cate_id'], $_info[$k]['cart_info']['productInfo']['is_show'], $_info[$k]['cart_info']['productInfo']['store_info'], $_info[$k]['cart_info']['productInfo']['is_del'], $_info[$k]['cart_info']['is_pay'], $_info[$k]['cart_info']['is_del'], $_info[$k]['cart_info']['is_new'], $_info[$k]['cart_info']['add_time'], $_info[$k]['cart_info']['id'], $_info[$k]['cart_info']['uid'], $_info[$k]['cart_info']['product_attr_unique']);
foreach ($_info as $k => $v) {
unset($_info[$k]['cart_info']['type'], $_info[$k]['cart_info']['product_id'], $_info[$k]['cart_info']['combination_id'], $_info[$k]['cart_info']['seckill_id'], $_info[$k]['cart_info']['bargain_id'], $_info[$k]['cart_info']['bargain_id'], $_info[$k]['cart_info']['truePrice'], $_info[$k]['cart_info']['vip_truePrice'], $_info[$k]['cart_info']['trueStock'], $_info[$k]['cart_info']['costPrice'], $_info[$k]['cart_info']['productInfo']['id'], $_info[$k]['cart_info']['productInfo']['vip_price'], $_info[$k]['cart_info']['productInfo']['postage'], $_info[$k]['cart_info']['productInfo']['give_integral'], $_info[$k]['cart_info']['productInfo']['sales'], $_info[$k]['cart_info']['productInfo']['stock'], $_info[$k]['cart_info']['productInfo']['unit_name'], $_info[$k]['cart_info']['productInfo']['is_postage'], $_info[$k]['cart_info']['productInfo']['slider_image'], $_info[$k]['cart_info']['productInfo']['cost'], $_info[$k]['cart_info']['productInfo']['mer_id'], $_info[$k]['cart_info']['productInfo']['cate_id'], $_info[$k]['cart_info']['productInfo']['is_show'], $_info[$k]['cart_info']['productInfo']['store_info'], $_info[$k]['cart_info']['productInfo']['is_del'], $_info[$k]['cart_info']['is_pay'], $_info[$k]['cart_info']['is_del'], $_info[$k]['cart_info']['is_new'], $_info[$k]['cart_info']['add_time'], $_info[$k]['cart_info']['id'], $_info[$k]['cart_info']['uid'], $_info[$k]['cart_info']['product_attr_unique']);
$_info[$k]['cart_info']['productInfo']['suk'] = '';
if(isset($v['cart_info']['productInfo']['attrInfo'])){
if (isset($v['cart_info']['productInfo']['attrInfo'])) {
$_info[$k]['cart_info']['productInfo']['image'] = $_info[$k]['cart_info']['productInfo']['attrInfo']['image'];
$_info[$k]['cart_info']['productInfo']['price'] = $_info[$k]['cart_info']['productInfo']['attrInfo']['price'];
$_info[$k]['cart_info']['productInfo']['suk'] = $_info[$k]['cart_info']['productInfo']['attrInfo']['suk'];
unset($_info[$k]['cart_info']['productInfo']['attrInfo']);
}
if(!isset($v['cart_info']['productInfo']['ot_price'])){
if (!isset($v['cart_info']['productInfo']['ot_price'])) {
$_info[$k]['cart_info']['productInfo']['ot_price'] = $v['cart_info']['productInfo']['price'];
}
}
$item['_info'] = $_info;
$item['add_time'] = date('Y-m-d H:i:s',$item['add_time']);
$item['add_time'] = date('Y-m-d H:i:s', $item['add_time']);
// if($item['pink_id'] || $item['combination_id']){
// $pinkStatus = StorePink::where('order_id_key',$item['id'])->value('status');
// switch ($pinkStatus){
@ -1740,7 +1723,7 @@ class StoreOrder extends BaseModel
// }
// }
if($status){
if ($status) {
$status = [];
if (!$item['paid'] && $item['pay_type'] == 'offline' && !$item['status'] >= 2) {
$status['_type'] = 9;
@ -1830,17 +1813,17 @@ class StoreOrder extends BaseModel
if (isset($item['delivery_type']))
$status['_deliveryType'] = isset(self::$deliveryType[$item['delivery_type']]) ? self::$deliveryType[$item['delivery_type']] : '其他方式';
$item['_status'] = $status;
}else{
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'] == 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'] = '已完成';
}
}
// unset($item['refund_status']);
@ -1879,44 +1862,45 @@ class StoreOrder extends BaseModel
* @param string $join
* @return StoreOrder|null
*/
public static function getOrderWhere($where, $model, $aler = '', $join = ''){
if(isset($where['status']) && $where['status'] != '') $model = self::statusWhere($where['status'],$model,$aler);
if(isset($where['is_del']) && $where['is_del'] != '' && $where['is_del'] != -1) $model = $model->where($aler.'is_del',$where['is_del']);
if(isset($where['combination_id'])){
if($where['combination_id'] =='普通订单'){
$model = $model->where($aler.'combination_id',0)->where($aler.'seckill_id',0)->where($aler.'bargain_id',0);
public static function getOrderWhere($where, $model, $aler = '', $join = '')
{
if (isset($where['status']) && $where['status'] != '') $model = self::statusWhere($where['status'], $model, $aler);
if (isset($where['is_del']) && $where['is_del'] != '' && $where['is_del'] != -1) $model = $model->where($aler . 'is_del', $where['is_del']);
if (isset($where['combination_id'])) {
if ($where['combination_id'] == '普通订单') {
$model = $model->where($aler . 'combination_id', 0)->where($aler . 'seckill_id', 0)->where($aler . 'bargain_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 . '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 . 'seckill_id', ">", 0);
}
if($where['combination_id'] =='砍价订单'){
$model = $model->where($aler.'bargain_id',">",0);
if ($where['combination_id'] == '砍价订单') {
$model = $model->where($aler . 'bargain_id', ">", 0);
}
}
if(isset($where['type'])){
switch ($where['type']){
if (isset($where['type'])) {
switch ($where['type']) {
case 1:
$model = $model->where($aler.'combination_id',0)->where($aler.'seckill_id',0)->where($aler.'bargain_id',0);
$model = $model->where($aler . 'combination_id', 0)->where($aler . 'seckill_id', 0)->where($aler . 'bargain_id', 0);
break;
case 2:
$model = $model->where($aler.'combination_id',">",0);
$model = $model->where($aler . 'combination_id', ">", 0);
break;
case 3:
$model = $model->where($aler.'seckill_id',">",0);
$model = $model->where($aler . 'seckill_id', ">", 0);
break;
case 4:
$model = $model->where($aler.'bargain_id',">",0);
$model = $model->where($aler . 'bargain_id', ">", 0);
break;
}
}
if(isset($where['real_name']) && $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(isset($where['data']) && $where['data'] !== '')
$model = self::getModelTime($where,$model,$aler.'add_time');
if (isset($where['real_name']) && $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 (isset($where['data']) && $where['data'] !== '')
$model = self::getModelTime($where, $model, $aler . 'add_time');
return $model;
}
@ -1927,27 +1911,27 @@ class StoreOrder extends BaseModel
* @param string $alert
* @return StoreOrder|null
*/
public static function statusWhere($status,$model = null,$alert='')
public static function statusWhere($status, $model = null, $alert = '')
{
if($model == null) $model = new self;
if('' === $status)
if ($model == null) $model = new self;
if ('' === $status)
return $model;
else if($status == 0)//未支付
return $model->where($alert.'paid',0)->where($alert.'status',0)->where($alert.'refund_status',0);
else if($status == 1)//已支付 未发货
return $model->where($alert.'paid',1)->where($alert.'status',0)->where($alert.'refund_status',0);
else if($status == 2)//已支付 待收货
return $model->where($alert.'paid',1)->where($alert.'status',1)->where($alert.'refund_status',0);
else if($status == 3)// 已支付 已收货 待评价
return $model->where($alert.'paid',1)->where($alert.'status',2)->where($alert.'refund_status',0);
else if($status == 4)// 交易完成
return $model->where($alert.'paid',1)->where($alert.'status',3)->where($alert.'refund_status',0);
else if($status == -1)//退款中
return $model->where($alert.'paid',1)->where($alert.'refund_status',1);
else if($status == -2)//已退款
return $model->where($alert.'paid',1)->where($alert.'refund_status',2);
else if($status == -3)//退款
return $model->where($alert.'paid',1)->where($alert.'refund_status','in','1,2');
else if ($status == 0)//未支付
return $model->where($alert . 'paid', 0)->where($alert . 'status', 0)->where($alert . 'refund_status', 0);
else if ($status == 1)//已支付 未发货
return $model->where($alert . 'paid', 1)->where($alert . 'status', 0)->where($alert . 'refund_status', 0);
else if ($status == 2)//已支付 待收货
return $model->where($alert . 'paid', 1)->where($alert . 'status', 1)->where($alert . 'refund_status', 0);
else if ($status == 3)// 已支付 已收货 待评价
return $model->where($alert . 'paid', 1)->where($alert . 'status', 2)->where($alert . 'refund_status', 0);
else if ($status == 4)// 交易完成
return $model->where($alert . 'paid', 1)->where($alert . 'status', 3)->where($alert . 'refund_status', 0);
else if ($status == -1)//退款中
return $model->where($alert . 'paid', 1)->where($alert . 'refund_status', 1);
else if ($status == -2)//已退款
return $model->where($alert . 'paid', 1)->where($alert . 'refund_status', 2);
else if ($status == -3)//退款
return $model->where($alert . 'paid', 1)->where($alert . 'refund_status', 'in', '1,2');
else
return $model;
}
@ -2035,7 +2019,7 @@ class StoreOrder extends BaseModel
*/
public static function setOrderTypePayOffline($orderId)
{
return self::edit(['pay_type'=>'offline'], $orderId, 'order_id');
return self::edit(['pay_type' => 'offline'], $orderId, 'order_id');
}
/**
@ -2043,12 +2027,13 @@ class StoreOrder extends BaseModel
* @param $id
* @return $this
*/
public static function updateOffline($id){
$count = self::where('id',$id)->count();
if(!$count) return self::setErrorInfo('订单不存在');
$count = self::where('id',$id)->where('paid', 0)->count();
if(!$count) return self::setErrorInfo('订单已支付');
$res = self::where('id', $id)->update(['paid'=>1,'pay_time'=>time()]);
public static function updateOffline($id)
{
$count = self::where('id', $id)->count();
if (!$count) return self::setErrorInfo('订单不存在');
$count = self::where('id', $id)->where('paid', 0)->count();
if (!$count) return self::setErrorInfo('订单已支付');
$res = self::where('id', $id)->update(['paid' => 1, 'pay_time' => time()]);
return $res;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -58,9 +58,9 @@ class StoreProduct extends BaseModel
else return false;
}
public static function getGoodList($limit=18,$field='*')
public static function getGoodList($limit = 18, $field = '*')
{
return self::validWhere()->where('is_good',1)->order('sort desc,id desc')->limit($limit)->field($field)->select();
return self::validWhere()->where('is_good', 1)->order('sort desc,id desc')->limit($limit)->field($field)->select();
}
public static function validWhere()
@ -104,8 +104,8 @@ class StoreProduct extends BaseModel
if ($salesOrder) $baseOrder = $salesOrder == 'desc' ? 'sales DESC' : 'sales ASC';//虚拟销量
if ($baseOrder) $baseOrder .= ', ';
$model->order($baseOrder . 'sort DESC, add_time DESC');
$list = $model->page((int)$page, (int)$limit)->field('id,store_name,cate_id,image,IFNULL(sales,0) + IFNULL(ficti,0) as sales,price,stock')->select()->each(function ($item) use($uid,$type){
if($type) {
$list = $model->page((int)$page, (int)$limit)->field('id,store_name,cate_id,image,IFNULL(sales,0) + IFNULL(ficti,0) as sales,price,stock')->select()->each(function ($item) use ($uid, $type) {
if ($type) {
$item['is_att'] = StoreProductAttrValueModel::where('product_id', $item['id'])->count() ? true : false;
if ($uid) $item['cart_num'] = StoreCart::where('is_pay', 0)->where('is_del', 0)->where('is_new', 0)->where('type', 'product')->where('product_id', $item['id'])->where('uid', $uid)->value('cart_num');
else $item['cart_num'] = 0;
@ -154,8 +154,9 @@ class StoreProduct extends BaseModel
* @param int $limit
* @return false|\PDOStatement|string|\think\Collection
*/
public static function getNewProduct($field = '*', $limit = 0, $uid = 0)
public static function getNewProduct($field = '*', $limit = 0, $uid = 0, bool $bool = true)
{
if (!$limit && !$bool) return [];
$model = self::where('is_new', 1)->where('is_del', 0)->where('mer_id', 0)
->where('stock', '>', 0)->where('is_show', 1)->field($field)
->order('sort DESC, id DESC');
@ -192,11 +193,11 @@ class StoreProduct extends BaseModel
*/
public static function getHotProductLoading($field = '*', $page = 0, $limit = 0)
{
if(!$limit) return [];
if (!$limit) return [];
$model = self::where('is_hot', 1)->where('is_del', 0)->where('mer_id', 0)
->where('stock', '>', 0)->where('is_show', 1)->field($field)
->order('sort DESC, id DESC');
if($page) $model->page($page, $limit);
if ($page) $model->page($page, $limit);
$list = $model->select();
if (is_object($list)) return $list->toArray();
return $list;
@ -208,8 +209,9 @@ class StoreProduct extends BaseModel
* @param int $limit
* @return false|\PDOStatement|string|\think\Collection
*/
public static function getBestProduct($field = '*', $limit = 0, $uid = 0)
public static function getBestProduct($field = '*', $limit = 0, $uid = 0, bool $bool = true)
{
if (!$limit && !$bool) return [];
$model = self::where('is_best', 1)->where('is_del', 0)->where('mer_id', 0)
->where('stock', '>', 0)->where('is_show', 1)->field($field)
->order('sort DESC, id DESC');
@ -217,7 +219,7 @@ class StoreProduct extends BaseModel
return self::setLevelPrice($model->select(), $uid);
}
/*
/**
* 设置会员价格
* @param object | array $list 产品列表
* @param int $uid 用户uid
@ -226,7 +228,7 @@ class StoreProduct extends BaseModel
public static function setLevelPrice($list, $uid, $isSingle = false)
{
if (is_object($list)) $list = count($list) ? $list->toArray() : [];
if (!sysConfig('vip_open')) {
if (!sys_config('vip_open')) {
if (is_array($list)) return $list;
return $isSingle ? $list : 0;
}
@ -314,13 +316,14 @@ class StoreProduct extends BaseModel
} else {
$res = false !== self::where('id', $productId)->dec('stock', $num)->inc('sales', $num)->update();
}
if($res){
if ($res) {
$stock = self::where('id', $productId)->value('stock');
$replenishment_num = sysConfig('store_stock') ?? 0;//库存预警界限
if($replenishment_num >= $stock){
try{
ChannelService::instance()->send('STORE_STOCK', ['id'=>$productId]);
}catch (\Exception $e){}
$replenishment_num = sys_config('store_stock') ?? 0;//库存预警界限
if ($replenishment_num >= $stock) {
try {
ChannelService::instance()->send('STORE_STOCK', ['id' => $productId]);
} catch (\Exception $e) {
}
}
}
return $res;
@ -359,7 +362,7 @@ class StoreProduct extends BaseModel
*/
public static function getPacketPrice($storeInfo, $productValue)
{
$store_brokerage_ratio = sysConfig('store_brokerage_ratio');
$store_brokerage_ratio = sys_config('store_brokerage_ratio');
$store_brokerage_ratio = bcdiv($store_brokerage_ratio, 100, 2);
if (count($productValue)) {
$Maxkey = self::getArrayMax($productValue, 'price');
@ -452,11 +455,12 @@ class StoreProduct extends BaseModel
* @param string $field
* @return mixed
*/
public static function getProductField($id,$field = 'store_name'){
if(is_array($id))
return self::where('id','in',$id)->field($field)->select();
public static function getProductField($id, $field = 'store_name')
{
if (is_array($id))
return self::where('id', 'in', $id)->field($field)->select();
else
return self::where('id',$id)->value($field);
return self::where('id', $id)->value($field);
}
}

View File

@ -28,33 +28,34 @@ class SystemStore extends BaseModel
protected $name = 'system_store';
public static function getLatlngAttr($value,$data)
public static function getLatlngAttr($value, $data)
{
return $data['latitude'].','.$data['longitude'];
return $data['latitude'] . ',' . $data['longitude'];
}
public static function verificWhere()
{
return self::where('is_show',1)->where('is_del',0);
return self::where('is_show', 1)->where('is_del', 0);
}
/*
* 获取门店信息
* @param int $id
* */
public static function getStoreDispose($id = 0,$felid='')
public static function getStoreDispose($id = 0, $felid = '')
{
if($id)
$storeInfo = self::verificWhere()->where('id',$id)->find();
if ($id)
$storeInfo = self::verificWhere()->where('id', $id)->find();
else
$storeInfo = self::verificWhere()->find();
if($storeInfo) {
if ($storeInfo) {
$storeInfo['latlng'] = self::getLatlngAttr(null, $storeInfo);
$storeInfo['valid_time'] = $storeInfo['valid_time'] ? explode(' - ', $storeInfo['valid_time']) : [];
$storeInfo['_valid_time'] = str_replace('-','/',($storeInfo['valid_time'][0] ?? '').' ~ '.($storeInfo['valid_time'][1]) ?? '');
$storeInfo['day_time'] = $storeInfo['day_time'] ? str_replace(' - ',' ~ ',$storeInfo['day_time']) : [];
$storeInfo['_detailed_address'] = $storeInfo['address'].' '.$storeInfo['detailed_address'];
$storeInfo['_valid_time'] = str_replace('-', '/', ($storeInfo['valid_time'][0] ?? '') . ' ~ ' . ($storeInfo['valid_time'][1] ?? ""));
$storeInfo['day_time'] = $storeInfo['day_time'] ? str_replace(' - ', ' ~ ', $storeInfo['day_time']) : [];
$storeInfo['_detailed_address'] = $storeInfo['address'] . ' ' . $storeInfo['detailed_address'];
$storeInfo['address'] = $storeInfo['address'] ? explode(',', $storeInfo['address']) : [];
if($felid) return $storeInfo[$felid] ?? '';
if ($felid) return $storeInfo[$felid] ?? '';
}
return $storeInfo;
}

View File

@ -114,7 +114,7 @@ class User extends BaseModel
'last_ip' => request()->ip(),
];
//TODO 获取后台分销类型
$storeBrokerageStatus = sysConfig('store_brokerage_statu');
$storeBrokerageStatus = sys_config('store_brokerage_statu');
$storeBrokerageStatus = $storeBrokerageStatus ? $storeBrokerageStatus : 1;
if (isset($wechatUser['code']) && $wechatUser['code'] && $wechatUser['code'] != $uid && $uid != self::where('uid', $wechatUser['code'])->value('spread_uid')) {
if ($storeBrokerageStatus == 1) {
@ -155,7 +155,7 @@ class User extends BaseModel
if ($spread == $uid) return true;
if ($uid == self::where('uid', $spread)->value('spread_uid')) return true;
//TODO 获取后台分销类型
$storeBrokerageStatus = sysConfig('store_brokerage_statu');
$storeBrokerageStatus = sys_config('store_brokerage_statu');
$storeBrokerageStatus = $storeBrokerageStatus ? $storeBrokerageStatus : 1;
if ($storeBrokerageStatus == 1) {
$spreadCount = self::where('uid', $spread)->count();
@ -183,7 +183,7 @@ class User extends BaseModel
self::beginTrans();
$res1 = true;
if ($spread_uid) $res1 = self::where('uid', $spread_uid)->inc('spread_count', 1)->update();
// $storeBrokerageStatu = sysConfig('store_brokerage_statu') ? : 1;//获取后台分销类型
// $storeBrokerageStatu = sys_config('store_brokerage_statu') ? : 1;//获取后台分销类型
$res2 = self::create([
'account' => 'rt' . $routineUser['uid'] . time(),
'pwd' => md5(123456),
@ -242,7 +242,7 @@ class User extends BaseModel
public static function isUserSpread($uid = 0)
{
if (!$uid) return false;
$status = (int)sysConfig('store_brokerage_statu');
$status = (int)sys_config('store_brokerage_statu');
$isPromoter = true;
if ($status == 1) $isPromoter = self::where('uid', $uid)->value('is_promoter');
if ($isPromoter) return true;
@ -259,7 +259,7 @@ class User extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function backOrderBrokerage($orderInfo)
public static function backOrderBrokerage($orderInfo,bool $open = true)
{
//TODO 如果时营销产品不返佣金
if (isset($orderInfo['combination_id']) && $orderInfo['combination_id']) return true;
@ -272,14 +272,14 @@ class User extends BaseModel
//TODO 当前用户不存在 没有上级 或者 当用用户上级时自己 直接返回
if (!$userInfo || !$userInfo['spread_uid'] || $userInfo['spread_uid'] == $orderInfo['uid']) return true;
//TODO 获取后台分销类型 1 指定分销 2 人人分销
$storeBrokerageStatus = sysConfig('store_brokerage_statu');
$storeBrokerageStatus = sys_config('store_brokerage_statu');
$storeBrokerageStatus = $storeBrokerageStatus ? $storeBrokerageStatus : 1;
//TODO 指定分销 判断 上级是否时推广员 如果不是推广员直接跳转二级返佣
if ($storeBrokerageStatus == 1) {
if (!User::be(['uid' => $userInfo['spread_uid'], 'is_promoter' => 1])) return self::backOrderBrokerageTwo($orderInfo);
if (!User::be(['uid' => $userInfo['spread_uid'], 'is_promoter' => 1])) return self::backOrderBrokerageTwo($orderInfo,$open);
}
//TODO 获取后台一级返佣比例
$storeBrokerageRatio = sysConfig('store_brokerage_ratio');
$storeBrokerageRatio = sys_config('store_brokerage_ratio');
//TODO 一级返佣比例 小于等于零时直接返回 不返佣
if ($storeBrokerageRatio <= 0) return true;
//TODO 计算获取一级返佣比例
@ -299,14 +299,14 @@ class User extends BaseModel
//TODO 上级推广员返佣之后的金额
$balance = bcadd($spreadUserInfo['brokerage_price'], $brokeragePrice, 2);
$mark = $userInfo['nickname'] . '成功消费' . floatval($orderInfo['pay_price']) . '元,奖励推广佣金' . floatval($brokeragePrice);
self::beginTrans();
$open && self::beginTrans();
//TODO 添加推广记录
$res1 = UserBill::income('获得推广佣金', $userInfo['spread_uid'], 'now_money', 'brokerage', $brokeragePrice, $orderInfo['id'], $balance, $mark);
//TODO 添加用户余额
$res2 = self::bcInc($userInfo['spread_uid'], 'brokerage_price', $brokeragePrice, 'uid');
//TODO 一级返佣成功 跳转二级返佣
$res = $res1 && $res2 && self::backOrderBrokerageTwo($orderInfo);
self::checkTrans($res);
$res = $res1 && $res2 && self::backOrderBrokerageTwo($orderInfo,$open);
$open && self::checkTrans($res);
// if($res) return self::backOrderBrokerageTwo($orderInfo);
return $res;
}
@ -320,7 +320,7 @@ class User extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function backOrderBrokerageTwo($orderInfo)
public static function backOrderBrokerageTwo($orderInfo,bool $open = true)
{
//TODO 获取购买商品的用户
$userInfo = User::getUserInfo($orderInfo['uid']);
@ -329,14 +329,14 @@ class User extends BaseModel
//TODO 上推广人不存在 或者 上推广人没有上级 或者 当用用户上上级时自己 直接返回
if (!$userInfoTwo || !$userInfoTwo['spread_uid'] || $userInfoTwo['spread_uid'] == $orderInfo['uid']) return true;
//TODO 获取后台分销类型 1 指定分销 2 人人分销
$storeBrokerageStatus = sysConfig('store_brokerage_statu');
$storeBrokerageStatus = sys_config('store_brokerage_statu');
$storeBrokerageStatus = $storeBrokerageStatus ? $storeBrokerageStatus : 1;
//TODO 指定分销 判断 上上级是否时推广员 如果不是推广员直接返回
if ($storeBrokerageStatus == 1) {
if (!User::be(['uid' => $userInfoTwo['spread_uid'], 'is_promoter' => 1])) return true;
}
//TODO 获取二级返佣比例
$storeBrokerageTwo = sysConfig('store_brokerage_two');
$storeBrokerageTwo = sys_config('store_brokerage_two');
//TODO 二级返佣比例小于等于0 直接返回
if ($storeBrokerageTwo <= 0) return true;
//TODO 计算获取二级返佣比例
@ -356,13 +356,13 @@ class User extends BaseModel
//TODO 获取上上级推广员返佣之后余额
$balance = bcadd($spreadUserInfoTwo['brokerage_price'], $brokeragePrice, 2);
$mark = '二级推广人' . $userInfo['nickname'] . '成功消费' . floatval($orderInfo['pay_price']) . '元,奖励推广佣金' . floatval($brokeragePrice);
self::beginTrans();
$open && self::beginTrans();
//TODO 添加返佣记录
$res1 = UserBill::income('获得推广佣金', $userInfoTwo['spread_uid'], 'now_money', 'brokerage', $brokeragePrice, $orderInfo['id'], $balance, $mark);
//TODO 添加用户余额
$res2 = self::bcInc($userInfoTwo['spread_uid'], 'brokerage_price', $brokeragePrice, 'uid');
$res = $res1 && $res2;
self::checkTrans($res);
$open && self::checkTrans($res);
return $res;
}
@ -505,7 +505,7 @@ class User extends BaseModel
// 自己不能绑定自己为上级
if ($uid == $spreadUid) return false;
//TODO 获取后台分销类型
$storeBrokerageStatus = sysConfig('store_brokerage_statu');
$storeBrokerageStatus = sys_config('store_brokerage_statu');
$storeBrokerageStatus = $storeBrokerageStatus ? $storeBrokerageStatus : 1;
if ($storeBrokerageStatus == 1) {
$spreadCount = self::where('uid', $spreadUid)->count();
@ -561,7 +561,7 @@ class User extends BaseModel
$data['last_time'] = time();
$data['last_ip'] = app('request')->ip();
$data['nickname'] = substr(md5($account . time()), 0, 12);
$data['avatar'] = $data['headimgurl'] = sysConfig('h5_avatar');
$data['avatar'] = $data['headimgurl'] = sys_config('h5_avatar');
$data['city'] = '';
$data['language'] = '';
$data['province'] = '';

View File

@ -160,7 +160,7 @@ class WechatUser extends BaseModel
if (isset($userInfo['unionid'])) {
$wechatInfo = self::where('unionid', $userInfo['unionid'])->find();
if ($wechatInfo) {
return self::edit($userInfo, $userInfo['unionid'], 'unionid');
return self::edit(is_object($userInfo) ? $userInfo->toArray() : $userInfo, $userInfo['unionid'], 'unionid');
}
}
self::beginTrans();

View File

@ -15,6 +15,7 @@ use app\models\routine\RoutineTemplate;
use app\models\store\StoreOrderCartInfo;
use app\models\user\User;
use crmeb\services\YLYService;
use think\facade\Log;
use think\facade\Route;
/** 消息通知静态类
@ -52,7 +53,7 @@ class NoticeRepositories
//订单支付成功后给客服发送客服消息
CustomerRepository::sendOrderPaySuccessCustomerService($order, 1);
} else if ($routineOpenid && in_array($order['is_channel'],[1,2])) {//小程序发送模板消息
RoutineTemplate::sendOrderSuccess($formId, $order['order_id']);
RoutineTemplate::sendOrderSuccess($order['uid'],$order['pay_price'], $order['order_id']);
//订单支付成功后给客服发送客服消息
CustomerRepository::sendOrderPaySuccessCustomerService($order, 0);
}
@ -61,7 +62,7 @@ class NoticeRepositories
}
}
//打印小票
$switch = sysConfig('pay_success_printing_switch') ? true : false;
$switch = sys_config('pay_success_printing_switch') ? true : false;
if ($switch) {
try {
$order['cart_id'] = is_string($order['cart_id']) ? json_decode($order['cart_id'], true) : $order['cart_id'];
@ -74,7 +75,7 @@ class NoticeRepositories
$value['productInfo']['store_name'] = StoreOrderCartInfo::getSubstrUTf8($value['productInfo']['store_name'], 10, 'UTF-8', '');
$product[] = $value;
}
YLYService::instance()->setContent(sysConfig('site_name'), is_object($order) ? $order->toArray() : $order, $product)->orderPrinting();
YLYService::instance()->setContent(sys_config('site_name'), is_object($order) ? $order->toArray() : $order, $product)->orderPrinting();
} catch (\Exception $e) {
Log::error('小票打印出现错误,错误原因:' . $e->getMessage());
}

View File

@ -1,4 +1,5 @@
<?php
namespace crmeb\repositories;
use app\models\store\StoreOrder;
@ -30,8 +31,8 @@ class OrderRepository
$res2 = User::backOrderBrokerage($order);
StoreOrder::orderTakeAfter($order);
$giveCouponMinPrice = sysConfig('store_give_con_min_price');
if($order['total_price'] >= $giveCouponMinPrice) WechatUser::userTakeOrderGiveCoupon($uid);
if(!($res1 && $res2)) exception('收货失败!');
if ($order['total_price'] >= $giveCouponMinPrice) WechatUser::userTakeOrderGiveCoupon($uid);
if (!($res1 && $res2)) exception('收货失败!');
}
/**
@ -45,7 +46,21 @@ class OrderRepository
$res1 = AdminStoreOrder::gainUserIntegral($order);
$res2 = User::backOrderBrokerage($order);
AdminStoreOrder::orderTakeAfter($order);
if(!($res1 && $res2)) exception('收货失败!');
if (!($res1 && $res2)) exception('收货失败!');
}
/**
* 修改状态 为已收货 定时任务使用
* @param $order
* @throws \Exception
*/
public static function storeProductOrderTakeDeliveryTimer($order)
{
$res1 = AdminStoreOrder::gainUserIntegral($order, false);
$res2 = User::backOrderBrokerage($order, false);
AdminStoreOrder::orderTakeAfter($order);
if (!($res1 && $res2)) exception('收货失败!');
}
@ -58,12 +73,13 @@ class OrderRepository
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function storeProductOrderRefundY($data,$oid){
public static function storeProductOrderRefundY($data, $oid)
{
$order = AdminStoreOrder::where('id', $oid)->find();
if($order['is_channel'] == 1)
if ($order['is_channel'] == 1)
return AdminStoreOrder::refundRoutineTemplate($oid); //TODO 小程序余额退款模板消息
else
return AdminStoreOrder::refundTemplate($data,$oid);//TODO 公众号余额退款模板消息
return AdminStoreOrder::refundTemplate($data, $oid);//TODO 公众号余额退款模板消息
}
@ -73,10 +89,10 @@ class OrderRepository
* @param $refund_data
* @throws \Exception
*/
public static function storeOrderYueRefund($product,$refund_data)
public static function storeOrderYueRefund($product, $refund_data)
{
$res = AdminStoreOrder::integralBack($product['id']);
if(!$res) exception('退积分失败!');
if (!$res) exception('退积分失败!');
}
/**
@ -84,12 +100,7 @@ class OrderRepository
* @param $product $product 商品信息
* @param $back_integral $back_integral 退多少积分
*/
public static function storeOrderIntegralBack($product,$back_integral){
}
public static function computedOrder()
public static function storeOrderIntegralBack($product, $back_integral)
{
}

View File

@ -44,9 +44,13 @@ class CacheService
* @param bool $default
* @return mixed
*/
public static function get(string $name, $default = false)
public static function get(string $name, $default = false, int $expire = null)
{
return self::handler()->remember($name, $default);
//这里不要去读取缓存配置,会导致死循环
$expire = $expire ?: SystemConfigService::get('cache_config', null, true);
if (!is_int($expire))
$expire = (int)$expire;
return self::handler()->remember($name, $default, $expire);
}
/**

View File

@ -24,10 +24,14 @@ class GroupDataService
public static function getGroupData(string $config_name, $limit = 0, bool $isCaChe = false): array
{
$callable = function () use ($config_name, $limit) {
$data = SystemGroupData::getGroupData($config_name, $limit);
if (is_object($data))
$data = $data->toArray();
return $data;
try {
$data = SystemGroupData::getGroupData($config_name, $limit);
if (is_object($data))
$data = $data->toArray();
return $data;
} catch (\Exception $e) {
return [];
}
};
try {
$cacheName = $limit ? "group_data_{$config_name}_{$limit}" : "data_{$config_name}";
@ -38,11 +42,7 @@ class GroupDataService
return CacheService::get($cacheName, $callable);
} catch (\Throwable $e) {
try {
return $callable();
} catch (\Exception $e) {
return [];
}
return $callable();
}
}
@ -56,10 +56,14 @@ class GroupDataService
public static function getData(string $config_name, int $limit = 0, bool $isCaChe = false): array
{
$callable = function () use ($config_name, $limit) {
$data = SystemGroupData::getAllValue($config_name, $limit);
if (is_object($data))
$data = $data->toArray();
return $data;
try {
$data = SystemGroupData::getAllValue($config_name, $limit);
if (is_object($data))
$data = $data->toArray();
return $data;
} catch (\Exception $e) {
return [];
}
};
try {
$cacheName = $limit ? "data_{$config_name}_{$limit}" : "data_{$config_name}";
@ -70,11 +74,7 @@ class GroupDataService
return CacheService::get($cacheName, $callable);
} catch (\Throwable $e) {
try {
return $callable();
} catch (\Exception $e) {
return [];
}
return $callable();
}
}
@ -87,10 +87,14 @@ class GroupDataService
public static function getDataNumber(int $id, bool $isCaChe = false): array
{
$callable = function () use ($id) {
$data = SystemGroupData::getDateValue($id);
if (is_object($data))
$data = $data->toArray();
return $data;
try {
$data = SystemGroupData::getDateValue($id);
if (is_object($data))
$data = $data->toArray();
return $data;
} catch (\Exception $e) {
return [];
}
};
try {
$cacheName = "data_number_{$id}";
@ -101,11 +105,7 @@ class GroupDataService
return CacheService::get($cacheName, $callable);
} catch (\Throwable $e) {
try {
return $callable();
} catch (\Exception $e) {
return [];
}
return $callable();
}
}
}

View File

@ -39,7 +39,7 @@ class MiniProgramService
'key' => trim($payment['pay_routine_key']),
'cert_path' => realpath('.' . $payment['pay_routine_client_cert']),
'key_path' => realpath('.' . $payment['pay_routine_client_key']),
'notify_url' => $wechat['site_url'] . Url::buildUrl('/api/routine/notify')
'notify_url' => $wechat['site_url'] . Url::buildUrl('/api/routine/notify')->suffix(false)->build()
];
return $config;
}
@ -49,7 +49,7 @@ class MiniProgramService
(self::$instance === null || $cache === true) && (self::$instance = new Application(self::options()));
return self::$instance;
}
/**
* 小程序接口
* @return \EasyWeChat\MiniProgram\MiniProgram
@ -133,6 +133,15 @@ class MiniProgramService
return self::miniprogram()->notice;
}
/**
* 订阅模板消息接口
* @return \crmeb\utils\ProgramSubscribe
*/
public static function SubscribenoticeService()
{
return self::miniprogram()->now_notice;
}
/**发送小程序模版消息
* @param $openid
* @param $templateId
@ -150,6 +159,21 @@ class MiniProgramService
return $notice->send($message);
}
/**
* 发送订阅消息
* @param string $touser 接收者(用户)的 openid
* @param string $templateId 所需下发的订阅模板id
* @param array $data 模板内容,格式形如 { "key1": { "value": any }, "key2": { "value": any } }
* @param string $link 击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,示例index?foo=bar。该字段不填则模板无跳转。
* @return \EasyWeChat\Support\Collection|null
* @throws \EasyWeChat\Core\Exceptions\HttpException
* @throws \EasyWeChat\Core\Exceptions\InvalidArgumentException
*/
public static function sendSubscribeTemlate(string $touser, string $templateId, array $data, string $link = '')
{
return self::SubscribenoticeService()->to($touser)->template($templateId)->andData($data)->withUrl($link)->send();
}
/**
* 支付

View File

@ -0,0 +1,89 @@
<?php
namespace crmeb\services;
use app\admin\model\wechat\WechatUser;
use app\admin\model\wechat\StoreService as ServiceModel;
use app\models\routine\RoutineTemplate;
use crmeb\interfaces\ProviderInterface;
use think\facade\Db;
/**
* 小程序模板消息
* Class RoutineTemplate
* @package app\routine\model\routine
*/
class SubscribeTemplateService implements ProviderInterface
{
//订单发货提醒(送货)
const ORDER_POSTAGE_SUCCESS = 1128;
//提现成功通知
const USER_EXTRACT = 1470;
//确认收货通知
const OREDER_TAKEVER = 1481;
//订单取消
const ORDER_CLONE = 1134;
//订单发货提醒(快递)
const ORDER_DELIVER_SUCCESS = 1458;
//拼团成功
const PINK_TRUE = 3098;
//砍价成功
const BARGAIN_SUCCESS = 2727;
//核销成功通知
const ORDER_WRITE_OFF = 3116;
//新订单提醒
const ORDER_NEW = 1476;
//退款通知
const ORDER_REFUND = 1451;
//充值成功
const RECHARGE_SUCCESS = 755;
//订单支付成功
const ORDER_PAY_SUCCESS = 1927;
//申请退款通知 管理员提醒
const ORDER_REFUND_STATUS = 1468;
//积分到账提醒
const INTEGRAL_ACCOUT = 335;
//拼团状态通知
const PINK_STATUS = 3353;
public static function getConstants($code = '')
{
$oClass = new \ReflectionClass(__CLASS__);
$stants = $oClass->getConstants();
if ($code) return isset($stants[$code]) ? $stants[$code] : '';
else return $stants;
}
public function register($config)
{
}
/**
* 根据模板编号获取模板ID
* @param string $tempKey
* @return mixed|string
*/
public static function setTemplateId($tempKey = '')
{
if ($tempKey == '') return '';
return RoutineTemplate::where('tempkey', $tempKey)->where('status', 1)->value('tempid');
}
/**
* 发送订阅模板消息
* @param string $tempCode 所需下发的模板编号
* @param string $openId 接收者(用户)的 openid
* @param array $dataKey 模板内容,不填则下发空模板
* @param string $link 点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,示例index?foo=bar。该字段不填则模板无跳转
* @return bool|\EasyWeChat\Support\Collection|null
*/
public static function sendTemplate(string $tempCode, string $openId, array $dataKey, string $link = '')
{
if (!$openId || !$tempCode) return false;
return MiniProgramService::sendSubscribeTemlate($openId, trim(self::setTemplateId(self::getConstants($tempCode))), $dataKey, $link);
}
}

View File

@ -13,6 +13,7 @@ use crmeb\services\storage\Qiniu;
use crmeb\traits\LogicTrait;
use think\exception\ValidateException;
use think\facade\Filesystem;
use Guzzle\Http\EntityBody;
use think\File;
/**
@ -191,7 +192,7 @@ class UploadService
{
$info = [];
try {
$uploadType = $this->uploadType ?: sysConfig('upload_type');
$uploadType = $this->uploadType ?: sys_config('upload_type');
//TODO 没有选择默认使用本地上传
if (!$uploadType)
$uploadType = 1;
@ -257,8 +258,6 @@ class UploadService
if (!isset($header['Content-Length'])) $header['Content-Length'] = 0;
if (!isset($header['Content-Type'])) $header['Content-Type'] = 'image/jpeg';
} catch (\Exception $e) {
$header['Content-Length'] = 0;
$header['Content-Type'] = 'image/jpeg';
}
return $header;
}
@ -301,7 +300,7 @@ class UploadService
*/
public function uploadLocalStream($key, $content, $root = '')
{
$siteUrl = sysConfig('site_url') . '/';
$siteUrl = sys_config('site_url') . '/';
$path = self::uploadDir($this->uploadPath, $root);
$path = str_replace('\\', DS, $path);
$path = str_replace('/', DS, $path);
@ -325,7 +324,7 @@ class UploadService
*/
public function imageStream($key, $content, $root = '')
{
$uploadType = sysConfig('upload_type');
$uploadType = sys_config('upload_type');
//TODO 没有选择默认使用本地上传
if (!$uploadType) $uploadType = 1;
$info = [];
@ -405,11 +404,10 @@ class UploadService
*/
public function file($fileName)
{
if (!isset($_FILES[$fileName])) return self::setError('上传文件不存在!');
$extension = strtolower(pathinfo($_FILES[$fileName]['name'], PATHINFO_EXTENSION));
if (strtolower($extension) == 'php' || !$extension)
return self::setError('上传文件非法!');
$file = request()->file($fileName);
if (!$file) return self::setError('上传文件不存在!');
if (strtolower($file->getOriginalExtension()) === 'php' || !$file->getOriginalExtension())
return self::setError('上传文件非法!');
if ($this->autoValidate) {
try {
validate([$fileName => $this->imageValidate])->check([$fileName => $file]);
@ -422,11 +420,11 @@ class UploadService
return self::successful(str_replace('\\', '/', $fileName));
}
public static function pathToUrl($path)
{
return trim(str_replace(DS, '/', $path), '.');
}
/**
* 打开图片
* @param $filePath
* @return \think\Image
*/
public function openImage($filePath)
{
return \think\Image::open($filePath);
@ -443,7 +441,13 @@ class UploadService
*/
public function thumb($filePath, $ratio = 5, $pre = 's_')
{
$img = $this->openImage($filePath);
try {
$img = $this->openImage($filePath);
} catch (\Throwable $e) {
$dir = dirname($filePath);
$fileName = basename($filePath);
return $dir . DS . $fileName;
}
$width = $img->width() * $ratio / 10;
$height = $img->height() * $ratio / 10;
$dir = dirname($filePath);
@ -453,4 +457,14 @@ class UploadService
if (substr($savePath, 0, 2) == './') return substr($savePath, 1, strlen($savePath));
return DS . $savePath;
}
/**
* TODO 转为文件流
* @param $resource
* @return EntityBody
*/
public static function resourceStream($resource)
{
return EntityBody::factory($resource)->__toString();
}
}

View File

@ -3,6 +3,7 @@
namespace crmeb\services;
use app\models\system\Cache as CacheModel;
use crmeb\exceptions\AuthException;
use crmeb\interfaces\ProviderInterface;
use crmeb\traits\LogicTrait;

View File

@ -23,17 +23,6 @@ trait LogicTrait
*/
protected static $instance;
/**
* 静态方法调用
* @param $method 调用方法
* @param $params 参数
* @return mixed
*/
public static function __callStatic($method, $params)
{
return call_user_func_array([self::$instance, $method], $params);
}
/**
* 配置参数
* @param array $config
@ -171,8 +160,12 @@ trait LogicTrait
return $this;
}
} else if (in_array($method, $keys)) {
$this->sendType = $method;
return $this;
if (property_exists($this, 'handleType') && array_shift($ages) !== true) {
$this->handleType = $method;
return $this;
} else {
return $this->{$method};
}
} else {
throw new AuthException('Method does not exist' . $method);
}

View File

@ -4,6 +4,7 @@
* @author: xaboy<365615158@qq.com>
* @day: 2017/11/11
*/
namespace crmeb\traits;
use think\db\Query;
@ -13,14 +14,15 @@ trait ModelTrait
{
public static function get($where)
{
if(!is_array($where)){
if (!is_array($where)) {
return self::find($where);
}else{
} else {
return self::where($where)->find();
}
}
public static function all($function){
public static function all($function)
{
$query = self::newQuery();
$function($query);
return $query->select();
@ -34,7 +36,7 @@ trait ModelTrait
*/
public static function setAll($group, $replace = false)
{
return self::insertAll($group,$replace);
return self::insertAll($group, $replace);
}
/**
@ -44,17 +46,17 @@ trait ModelTrait
* @param $field
* @return bool $type 返回成功失败
*/
public static function edit($data,$id,$field = null)
public static function edit($data, $id, $field = null)
{
$model = new self;
if(!$field) $field = $model->getPk();
if (!$field) $field = $model->getPk();
// return false !== $model->update($data,[$field=>$id]);
// return 0 < $model->update($data,[$field=>$id])->result;
$res = $model->update($data,[$field=>$id]);
if(isset($res->result))
$res = $model->update($data, [$field => $id]);
if (isset($res->result))
return 0 < $res->result;
else if(isset($res['data']['result']))
return 0 < $res['data']['result'];
else if (isset($res['data']['result']))
return 0 < $res['data']['result'];
else
return false !== $res;
}
@ -69,8 +71,8 @@ trait ModelTrait
public static function be($map, $field = '')
{
$model = (new self);
if(!is_array($map) && empty($field)) $field = $model->getPk();
$map = !is_array($map) ? [$field=>$map] : $map;
if (!is_array($map) && empty($field)) $field = $model->getPk();
$map = !is_array($map) ? [$field => $map] : $map;
return 0 < $model->where($map)->count();
}
@ -95,40 +97,41 @@ trait ModelTrait
*/
public static function page($model = null, $eachFn = null, $params = [], $limit = 20)
{
if(is_numeric($eachFn) && is_numeric($model)){
return parent::page($model,$eachFn);
if (is_numeric($eachFn) && is_numeric($model)) {
return parent::page($model, $eachFn);
}
if(is_numeric($eachFn)){
if (is_numeric($eachFn)) {
$limit = $eachFn;
$eachFn = null;
}else if(is_array($eachFn)){
} else if (is_array($eachFn)) {
$params = $eachFn;
$eachFn = null;
}
if(is_callable($model)){
if (is_callable($model)) {
$eachFn = $model;
$model = null;
}elseif(is_numeric($model)){
} elseif (is_numeric($model)) {
$limit = $model;
$model = null;
}elseif(is_array($model)){
} elseif (is_array($model)) {
$params = $model;
$model = null;
}
if(is_numeric($params)){
if (is_numeric($params)) {
$limit = $params;
$params = [];
}
$paginate = $model === null ? self::paginate($limit,false,['query'=>$params]) : $model->paginate($limit,false,['query'=>$params]);
$paginate = $model === null ? self::paginate($limit, false, ['query' => $params]) : $model->paginate($limit, false, ['query' => $params]);
$list = is_callable($eachFn) ? $paginate->each($eachFn) : $paginate;
$page = $list->render();
$total = $list->total();
return compact('list','page','total');
return compact('list', 'page', 'total');
}
/**
* 获取分页 生成where 条件和 whereOr 支持多表查询生成条件
* @param object $model 模型对象
@ -139,115 +142,129 @@ trait ModelTrait
* @param string $like 模糊查找 关键字
* @return array
*/
public static function setWherePage($model=null,$where=[],$field=[],$fieldOr=[],$fun=null,$like='LIKE'){
if(!is_array($where) || !is_array($field)) return false;
if($model===null) $model=new self();
public static function setWherePage($model = null, $where = [], $field = [], $fieldOr = [], $fun = null, $like = 'LIKE')
{
if (!is_array($where) || !is_array($field)) return false;
if ($model === null) $model = new self();
//处理等于行查询
foreach ($field as $key=>$item){
if(($count=strpos($item,'.'))===false){
if(isset($where[$item]) && $where[$item]!='') {
$model=$model->where($item,$where[$item]);
foreach ($field as $key => $item) {
if (($count = strpos($item, '.')) === false) {
if (isset($where[$item]) && $where[$item] != '') {
$model = $model->where($item, $where[$item]);
}
}else{
$item_l=substr($item,$count+1);
if(isset($where[$item_l]) && $where[$item_l]!=''){
$model=$model->where($item,$where[$item_l]);
} else {
$item_l = substr($item, $count + 1);
if (isset($where[$item_l]) && $where[$item_l] != '') {
$model = $model->where($item, $where[$item_l]);
}
}
}
//回收变量
unset($count,$key,$item,$item_l);
unset($count, $key, $item, $item_l);
//处理模糊查询
if(!empty($fieldOr) && is_array($fieldOr) && isset($fieldOr[0])){
if(($count=strpos($fieldOr[0],'.'))===false){
if(isset($where[$fieldOr[0]]) && $where[$fieldOr[0]]!='') {
$model=$model->where(self::get_field($fieldOr),$like,"%".$where[$fieldOr[0]]."%");
if (!empty($fieldOr) && is_array($fieldOr) && isset($fieldOr[0])) {
if (($count = strpos($fieldOr[0], '.')) === false) {
if (isset($where[$fieldOr[0]]) && $where[$fieldOr[0]] != '') {
$model = $model->where(self::get_field($fieldOr), $like, "%" . $where[$fieldOr[0]] . "%");
}
}else{
$item_l = substr($fieldOr[0],$count+1);
if(isset($where[$item_l]) && $where[$item_l]!='') {
$model=$model->where(self::get_field($fieldOr),$like,"%".$where[$item_l]."%");
} else {
$item_l = substr($fieldOr[0], $count + 1);
if (isset($where[$item_l]) && $where[$item_l] != '') {
$model = $model->where(self::get_field($fieldOr), $like, "%" . $where[$item_l] . "%");
}
}
}
unset($count,$key,$item,$item_l);
unset($count, $key, $item, $item_l);
return $model;
}
/**
* 字符串拼接
* @param int|array $id
* @param string $str
* @return string
*/
private static function get_field($id,$str='|'){
if(is_array($id)){
$sql="";
$i=0;
foreach($id as $val){
private static function get_field($id, $str = '|')
{
if (is_array($id)) {
$sql = "";
$i = 0;
foreach ($id as $val) {
$i++;
if($i<count($id)){
$sql.=$val.$str;
}else{
$sql.=$val;
if ($i < count($id)) {
$sql .= $val . $str;
} else {
$sql .= $val;
}
}
return $sql;
}else{
return $sql;
} else {
return $id;
}
}
/**
* 条件切割
* @param string $order
* @param string $file
* @return string
*/
public static function setOrder($order,$file='-'){
if(empty($order)) return '';
return str_replace($file,' ',$order);
public static function setOrder($order, $file = '-')
{
if (empty($order)) return '';
return str_replace($file, ' ', $order);
}
/**
* 获取时间段之间的model
* @param int|string $time
* @param string $ceil
* @return array
*/
public static function getModelTime($where,$model=null,$prefix='add_time',$data='data',$field=' - '){
public static function getModelTime($where, $model = null, $prefix = 'add_time', $data = 'data', $field = ' - ')
{
if ($model == null) $model = new self;
if(!isset($where[$data])) return $model;
switch ($where[$data]){
case 'today':case 'week':case 'month':case 'year':case 'yesterday':
$model=$model->whereTime($prefix,$where[$data]);
break;
if (!isset($where[$data])) return $model;
switch ($where[$data]) {
case 'today':
case 'week':
case 'month':
case 'year':
case 'yesterday':
$model = $model->whereTime($prefix, $where[$data]);
break;
case 'quarter':
list($startTime,$endTime)=self::getMonth();
list($startTime, $endTime) = self::getMonth();
$model = $model->where($prefix, '>', strtotime($startTime));
$model = $model->where($prefix, '<', strtotime($endTime));
break;
case 'lately7':
$model = $model->where($prefix,'between',[strtotime("-7 day"),time()]);
$model = $model->where($prefix, 'between', [strtotime("-7 day"), time()]);
break;
case 'lately30':
$model = $model->where($prefix,'between',[strtotime("-30 day"),time()]);
$model = $model->where($prefix, 'between', [strtotime("-30 day"), time()]);
break;
default:
if(strstr($where[$data],$field)!==false){
if (strstr($where[$data], $field) !== false) {
list($startTime, $endTime) = explode($field, $where[$data]);
$model = $model->where($prefix, '>', strtotime($startTime));
$model = $model->where($prefix, '<', bcadd(strtotime($endTime),86400,0));
$model = $model->where($prefix, '<', bcadd(strtotime($endTime), 86400, 0));
}
break;
}
return $model;
}
/**
* 获取去除html去除空格去除软回车,软换行,转换过后的字符串
* @param string $str
* @return string
*/
public static function HtmlToMbStr($str){
return trim(strip_tags(str_replace(["\n","\t","\r"," ","&nbsp;"],'',htmlspecialchars_decode($str))));
public static function HtmlToMbStr($str)
{
return trim(strip_tags(str_replace(["\n", "\t", "\r", " ", "&nbsp;"], '', htmlspecialchars_decode($str))));
}
/**
* 截取中文指定字节
* @param string $str
@ -256,27 +273,31 @@ trait ModelTrait
* @param string $file
* @return string
*/
public static function getSubstrUTf8($str,$utf8len=100,$chaet='UTF-8',$file='....'){
if(mb_strlen($str,$chaet) > $utf8len){
$str = mb_substr($str,0,$utf8len,$chaet).$file;
public static function getSubstrUTf8($str, $utf8len = 100, $chaet = 'UTF-8', $file = '....')
{
if (mb_strlen($str, $chaet) > $utf8len) {
$str = mb_substr($str, 0, $utf8len, $chaet) . $file;
}
return $str;
}
/**
* 获取本季度 time
* @param int|string $time
* @param string $ceil
* @return array
*/
public static function getMonth($time='',$ceil=0){
if($ceil!=0)
$season = ceil(date('n') /3)-$ceil;
public static function getMonth($time = '', $ceil = 0)
{
if ($ceil != 0)
$season = ceil(date('n') / 3) - $ceil;
else
$season = ceil(date('n') /3);
$firstday = date('Y-m-01',mktime(0,0,0,($season - 1) *3 +1,1,date('Y')));
$lastday = date('Y-m-t',mktime(0,0,0,$season * 3,1,date('Y')));
return array($firstday,$lastday);
$season = ceil(date('n') / 3);
$firstday = date('Y-m-01', mktime(0, 0, 0, ($season - 1) * 3 + 1, 1, date('Y')));
$lastday = date('Y-m-t', mktime(0, 0, 0, $season * 3, 1, date('Y')));
return array($firstday, $lastday);
}
/**
* 高精度 加法
* @param int|string $uid id
@ -286,14 +307,14 @@ trait ModelTrait
* @param int $acc 精度
* @return bool
*/
public static function bcInc($key, $incField, $inc, $keyField = null, $acc=2)
public static function bcInc($key, $incField, $inc, $keyField = null, $acc = 2)
{
if(!is_numeric($inc)) return false;
if (!is_numeric($inc)) return false;
$model = new self();
if($keyField === null) $keyField = $model->getPk();
$result = self::where($keyField,$key)->find();
if(!$result) return false;
$new = bcadd($result[$incField],$inc,$acc);
if ($keyField === null) $keyField = $model->getPk();
$result = self::where($keyField, $key)->find();
if (!$result) return false;
$new = bcadd($result[$incField], $inc, $acc);
$result->$incField = $new;
return false !== $result->save();
// return false !== $model->where($keyField,$key)->update([$incField=>$new]);
@ -310,15 +331,15 @@ trait ModelTrait
* @param int $acc 精度
* @return bool
*/
public static function bcDec($key, $decField, $dec, $keyField = null, $minus = false, $acc=2)
public static function bcDec($key, $decField, $dec, $keyField = null, $minus = false, $acc = 2)
{
if(!is_numeric($dec)) return false;
if (!is_numeric($dec)) return false;
$model = new self();
if($keyField === null) $keyField = $model->getPk();
$result = self::where($keyField,$key)->find();
if(!$result) return false;
if(!$minus && $result[$decField] < $dec) return false;
$new = bcsub($result[$decField],$dec,$acc);
if ($keyField === null) $keyField = $model->getPk();
$result = self::where($keyField, $key)->find();
if (!$result) return false;
if (!$minus && $result[$decField] < $dec) return false;
$new = bcsub($result[$decField], $dec, $acc);
$result->$decField = $new;
return false !== $result->save();
// return false !== $model->where($keyField,$key)->update([$decField=>$new]);

View File

@ -11,18 +11,19 @@ use EasyWeChat\Core\Exceptions\InvalidArgumentException;
* Class ProgramSubscribe
* @package crmeb\utils
* @method $this
* @method $this withTemplate(string $template_id) 设置模板id
* @method $this template(string $template_id) 设置模板id
* @method $this withTemplateId(string $template_id) 设置模板id
* @method $this andTemplateId(string $template_id) 设置模板id
* @method $this andTemplate(string $template_id) 设置模板id
* @method $this andUses(string $template_id) 设置模板id
* @method $this andTo(string $touser) 设置opendid
* @method $this to(string $touser) 设置opendid
* @method $this andReceiver(string $touser) 设置opendid
* @method $this withReceiver(string $touser) 设置opendid
* @method $this with(array $data) 设置发送内容
* @method $this andData(array $data) 设置发送内容
* @method $this withData(array $data) 设置发送内容
* @method $this data(array $data) 设置发送内容
* @method $this withUrl(string $page) 设置跳转路径
*/
class ProgramSubscribe extends AbstractAPI
{
@ -205,13 +206,33 @@ class ProgramSubscribe extends AbstractAPI
}
/**
* TODO: 未实现
* @param $data
* @return mixed
* 设置订阅消息发送data
* @param array $data
* @return array
*/
protected function formatData($data)
protected function formatData(array $data)
{
return $data;
$return = [];
foreach ($data as $key => $item) {
if (is_scalar($item)) {
$value = $item;
} elseif (is_array($item) && !empty($item)) {
if (isset($item['value'])) {
$value = strval($item['value']);
} elseif (count($item) < 2) {
$value = array_shift($item);
} else {
[$value] = $item;
}
} else {
$value = 'error data item.';
}
$return[$key] = ['value' => $value];
}
return $return;
}
@ -230,8 +251,8 @@ class ProgramSubscribe extends AbstractAPI
'uses' => 'template_id',
'to' => 'touser',
'receiver' => 'touser',
'url' => 'url',
'link' => 'url',
'url' => 'page',
'link' => 'page',
'data' => 'data',
'with' => 'data',
];

View File

@ -20,22 +20,24 @@ use think\app\Url;
* @method $this setTemplateFormId(string $templateFormId) 设置发送模板消息formid
* @method $this setTemplateDefaultColor(string $templateDefaultColor) 设置发送模板消息默认背景颜色
* @method $this setTemplateCode(string $templateCode) 设置模板id
* @method $this setSendType($sendType) 设置发送类型句柄 1 = 小程序 2 = 公众号
* @method $this setHandleType($handleType) 设置发送类型句柄 1 = 小程序 2 = 公众号
* @method $this setDefaultData($defaultData) 设置默认数据
* @method $this setTemplateUrl(Url $url, string $sux = '') 设置跳转Url
* @method $this routine() 设置当前发送类型句柄为 小程序
* @method $this wechat() 设置当前发送类型句柄为 公众号
* @method $this subscribe() 设置当前发送类型句柄为 小程序订阅消息
*/
class Template
{
use LogicTrait;
/**
* 注册服务 会自动添加$providers对应的key名称方法方便设置$sendType
* 注册服务 会自动添加$providers对应的key名称方法方便设置$handleType
* @var array
*/
protected $providers = [
'routine' => \crmeb\services\ProgramTemplateService::class,
'subscribe' => \crmeb\services\SubscribeTemplateService::class,
'wechat' => \crmeb\services\WechatTemplateService::class,
];
@ -49,7 +51,7 @@ class Template
'templateData' => [[], 'array'],
'templateUrl' => [null, 'callable', 'postpositionUrl'],
'templateFormId' => [null, 'string'],
'sendType' => [null, 'string'],
'handleType' => [null, 'string'],
'templateOpenId' => [null, 'string'],
'templateOpenId' => [null, 'string'],
];
@ -88,7 +90,7 @@ class Template
* 发送类型 对应 $providers key
* @var string | int
*/
protected $sendType;
protected $handleType;
/**
* 接收人openid 小程序 公众号使用
@ -118,7 +120,7 @@ class Template
*/
public function postpositionUrl($url, string $suffix = '')
{
if($url instanceof Url)
if ($url instanceof Url)
$url = $url->suffix($suffix)->domain(true)->build();
return $url;
}
@ -129,16 +131,16 @@ class Template
protected function validate()
{
$keys = array_keys($this->providers);
if (is_string($this->sendType)) {
if (!in_array($this->sendType, $keys))
throw new AuthException('设置的发送类型句柄不存在:' . $this->sendType);
} elseif (is_int($this->sendType)) {
if ($this->sendType > count($keys))
throw new AuthException('设置的发送类型句柄不存在:' . $this->sendType);
$this->sendType = $keys[$this->sendType - 1];
if (is_string($this->handleType)) {
if (!in_array($this->handleType, $keys))
throw new AuthException('设置的发送类型句柄不存在:' . $this->handleType);
} elseif (is_int($this->handleType)) {
if ($this->handleType > count($keys))
throw new AuthException('设置的发送类型句柄不存在:' . $this->handleType);
$this->handleType = $keys[$this->handleType - 1];
}
if (!$this->sendType)
if (!$this->handleType)
throw new AuthException('请设置发送类型句柄');
if (!$this->templateData)
@ -160,7 +162,7 @@ class Template
$this->validate();
$resource = null;
switch ($this->sendType) {
switch ($this->handleType) {
case 'routine':
$resource = self::$instance->routine->sendTemplate(
$this->templateCode,
@ -180,6 +182,14 @@ class Template
$this->templateDefaultColor
);
break;
case 'subscribe':
$resource = self::$instance->subscribe->sendTemplate(
$this->templateCode,
$this->templateOpenId,
$this->templateData,
$this->templateUrl
);
break;
default:
$resource = false;
break;
@ -206,7 +216,7 @@ class Template
$this->templateDefaultColor = null;
$this->templateData = [];
$this->templateUrl = null;
$this->sendType = null;
$this->handleType = null;
$this->templateFormId = null;
$this->templateCode = null;
return $this;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.payment[data-v-54b2b916]{position:fixed;bottom:0;left:0;width:100%;border-radius:.16rem .16rem 0 0;background-color:#fff;padding-bottom:.6rem;z-index:99;transition:all .3s cubic-bezier(.25,.5,.5,.9);-webkit-transition:all .3s cubic-bezier(.25,.5,.5,.9);-moz-transition:all .3s cubic-bezier(.25,.5,.5,.9);-o-transition:all .3s cubic-bezier(.25,.5,.5,.9);transform:translate3d(0,100%,0);-webkit-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);-moz-transform:translate3d(0,100%,0);-o-transform:translate3d(0,100%,0)}.payment.on[data-v-54b2b916]{transform:translateZ(0);-webkit-transform:translateZ(0);-ms-transform:translateZ(0);-moz-transform:translateZ(0);-o-transform:translateZ(0)}.payment .title[data-v-54b2b916]{text-align:center;height:1.23rem;font-size:.32rem;color:#282828;font-weight:700;padding-right:.3rem;margin-left:.3rem;position:relative;border-bottom:.01rem solid #eee}.payment .title .iconfont[data-v-54b2b916]{position:absolute;right:.3rem;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:.43rem;color:#8a8a8a;font-weight:400}.payment .item[data-v-54b2b916]{border-bottom:.01rem solid #eee;height:1.3rem;margin-left:.3rem;padding-right:.3rem}.payment .item .left[data-v-54b2b916]{width:6.1rem}.payment .item .left .text[data-v-54b2b916]{width:5.4rem}.payment .item .left .text .name[data-v-54b2b916]{font-size:.32rem;color:#282828}.payment .item .left .text .info[data-v-54b2b916]{font-size:.24rem;color:#999}.payment .item .left .text .info .money[data-v-54b2b916]{color:#f90}.payment .item .left .iconfont[data-v-54b2b916]{font-size:.45rem;color:#09bb07}.payment .item .left .iconfont.icon-zhifubao[data-v-54b2b916]{color:#00aaea}.payment .item .left .iconfont.icon-yuezhifu[data-v-54b2b916]{color:#f90}.payment .item .left .iconfont.icon-yuezhifu1[data-v-54b2b916]{color:#eb6623}.payment .item .iconfont[data-v-54b2b916]{font-size:.3rem;color:#999}.noCart[data-v-0f909e66]{margin-top:.17rem;padding-top:.1rem}.noCart .pictrue[data-v-0f909e66]{width:4rem;height:3rem;margin:.7rem auto .5rem auto}.noCart .pictrue img[data-v-0f909e66]{width:100%;height:100%}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.payment[data-v-54b2b916]{position:fixed;bottom:0;left:0;width:100%;border-radius:.16rem .16rem 0 0;background-color:#fff;padding-bottom:.6rem;z-index:99;transition:all .3s cubic-bezier(.25,.5,.5,.9);-webkit-transition:all .3s cubic-bezier(.25,.5,.5,.9);-moz-transition:all .3s cubic-bezier(.25,.5,.5,.9);-o-transition:all .3s cubic-bezier(.25,.5,.5,.9);transform:translate3d(0,100%,0);-webkit-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);-moz-transform:translate3d(0,100%,0);-o-transform:translate3d(0,100%,0)}.payment.on[data-v-54b2b916]{transform:translateZ(0);-webkit-transform:translateZ(0);-ms-transform:translateZ(0);-moz-transform:translateZ(0);-o-transform:translateZ(0)}.payment .title[data-v-54b2b916]{text-align:center;height:1.23rem;font-size:.32rem;color:#282828;font-weight:700;padding-right:.3rem;margin-left:.3rem;position:relative;border-bottom:.01rem solid #eee}.payment .title .iconfont[data-v-54b2b916]{position:absolute;right:.3rem;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:.43rem;color:#8a8a8a;font-weight:400}.payment .item[data-v-54b2b916]{border-bottom:.01rem solid #eee;height:1.3rem;margin-left:.3rem;padding-right:.3rem}.payment .item .left[data-v-54b2b916]{width:6.1rem}.payment .item .left .text[data-v-54b2b916]{width:5.4rem}.payment .item .left .text .name[data-v-54b2b916]{font-size:.32rem;color:#282828}.payment .item .left .text .info[data-v-54b2b916]{font-size:.24rem;color:#999}.payment .item .left .text .info .money[data-v-54b2b916]{color:#f90}.payment .item .left .iconfont[data-v-54b2b916]{font-size:.45rem;color:#09bb07}.payment .item .left .iconfont.icon-zhifubao[data-v-54b2b916]{color:#00aaea}.payment .item .left .iconfont.icon-yuezhifu[data-v-54b2b916]{color:#f90}.payment .item .left .iconfont.icon-yuezhifu1[data-v-54b2b916]{color:#eb6623}.payment .item .iconfont[data-v-54b2b916]{font-size:.3rem;color:#999}.geoPage[data-v-15d1bbac]{position:fixed;width:100%;height:100%;top:0;z-index:10000}.order-details .writeOff[data-v-15d1bbac]{background-color:#fff;margin-top:.13rem;padding-bottom:.3rem}.order-details .writeOff .title[data-v-15d1bbac]{font-size:.3rem;color:#282828;height:.87rem;border-bottom:1px solid #f0f0f0;padding:0 .3rem;line-height:.87rem}.order-details .writeOff .grayBg[data-v-15d1bbac]{background-color:#f2f5f7;width:5.9rem;height:3.84rem;border-radius:.2rem .2rem 0 0;margin:.5rem auto 0 auto;padding-top:.55rem}.order-details .writeOff .grayBg .pictrue[data-v-15d1bbac]{width:2.9rem;height:2.9rem;margin:0 auto}.order-details .writeOff .grayBg .pictrue img[data-v-15d1bbac]{width:100%;height:100%;display:block}.order-details .writeOff .gear[data-v-15d1bbac]{width:5.9rem;height:.3rem;margin:0 auto}.order-details .writeOff .gear img[data-v-15d1bbac]{width:100%;height:100%;display:block}.order-details .writeOff .num[data-v-15d1bbac]{background-color:#f0c34c;width:5.9rem;height:.84rem;color:#282828;font-size:.48rem;margin:0 auto;border-radius:0 0 .2rem .2rem;text-align:center;padding-top:.04rem}.order-details .writeOff .rules[data-v-15d1bbac]{margin:.46rem .3rem 0 .3rem;border-top:.01rem solid #f0f0f0;padding-top:.1rem}.order-details .writeOff .rules .item[data-v-15d1bbac]{margin-top:.15rem}.order-details .writeOff .rules .item .rulesTitle[data-v-15d1bbac]{font-size:.28rem;color:#282828}.order-details .writeOff .rules .item .rulesTitle .iconfont[data-v-15d1bbac]{font-size:.3rem;color:#333;margin-right:.08rem;margin-top:.05rem}.order-details .writeOff .rules .item .info[data-v-15d1bbac]{font-size:.28rem;color:#999;margin-top:.05rem}.order-details .writeOff .rules .item .info .time[data-v-15d1bbac]{margin-left:.2rem}.order-details .map[data-v-15d1bbac]{height:.86rem;font-size:.3rem;color:#282828;line-height:.86rem;border-bottom:.01rem solid #f0f0f0;margin-top:.13rem;background-color:#fff;padding:0 .3rem}.order-details .map .place[data-v-15d1bbac]{font-size:.26rem;width:1.76rem;height:.5rem;border-radius:.25rem;line-height:.5rem;text-align:center}.order-details .map .place .iconfont[data-v-15d1bbac]{font-size:.27rem;height:.27rem;line-height:.27rem;margin:.02rem .03rem 0 0}.order-details .address .name .iconfont[data-v-15d1bbac]{font-size:.34rem;margin-left:.1rem}

View File

@ -0,0 +1 @@
.noCart[data-v-69b4fdee]{margin-top:.17rem;padding-top:.1rem}.noCart .pictrue[data-v-69b4fdee]{width:4rem;height:3rem;margin:.7rem auto .5rem auto}.noCart .pictrue img[data-v-69b4fdee]{width:100%;height:100%}

View File

@ -0,0 +1 @@
.poster-first[data-v-f3067a28]{-ms-scroll-chaining:none;overscroll-behavior:contain}.mask-share[data-v-f3067a28]{position:fixed;top:0;left:0;right:0;bottom:0;z-index:999}.mask-share img[data-v-f3067a28]{width:100%}.newsDetail .picTxt[data-v-390cca14]{width:6.9rem;height:2rem!important;border-radius:.2rem;border:1px solid #e1e1e1;position:relative;margin:.3rem auto 0 auto}.newsDetail .picTxt .pictrue[data-v-390cca14]{width:2rem;height:2rem}.newsDetail .picTxt .pictrue img[data-v-390cca14]{width:100%;height:100%;border-radius:.2rem 0 0 .2rem;display:block}.newsDetail .picTxt .text[data-v-390cca14]{width:4.6rem}.newsDetail .picTxt .text .name[data-v-390cca14]{font-size:.3rem;color:#282828}.newsDetail .picTxt .text .money[data-v-390cca14]{font-size:.24rem;margin-top:.4rem;font-weight:700}.newsDetail .picTxt .text .money .num[data-v-390cca14]{font-size:.36rem}.newsDetail .picTxt .text .y_money[data-v-390cca14]{font-size:.26rem;color:#999;text-decoration:line-through}.newsDetail .picTxt .label[data-v-390cca14]{position:absolute;background-color:#303131;width:1.6rem;height:.5rem;right:-.07rem;border-radius:.25rem 0 .06rem .25rem;text-align:center;line-height:.5rem;bottom:.24rem}.newsDetail .picTxt .label .span[data-v-390cca14]{background-image:-webkit-gradient(linear,left top,right top,from(#fff71e),to(#f9b513));background-image:linear-gradient(90deg,#fff71e 0,#f9b513);background-image:-moz-linear-gradient(to right,#fff71e 0,#f9b513 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.newsDetail .picTxt .label[data-v-390cca14]:after{content:" ";position:absolute;width:0;height:0;border-bottom:.08rem solid #303131;border-right:.08rem solid transparent;top:-.08rem;right:0}.newsDetail .bnt[data-v-390cca14]{color:#fff;font-size:.3rem;width:6.9rem;height:.9rem;border-radius:.45rem;margin:.48rem auto 0 auto;text-align:center;line-height:.9rem}

View File

@ -0,0 +1 @@
.commission-rank .header[data-v-a0b8569a]{background:url(../../h5/img/commission.a895a872.jpg) no-repeat;width:100%;height:3.44rem;background-size:100% 100%;position:relative;z-index:-1}.commission-rank .header .rank[data-v-a0b8569a]{font-size:.33rem;color:#fff;position:absolute;top:1.6rem;left:.48rem}.commission-rank .header .rank .num[data-v-a0b8569a]{font-size:.51rem;font-weight:700;margin:0 .1rem}.commission-rank .wrapper[data-v-a0b8569a]{width:7.1rem;background-color:#fff;border-radius:.2rem;margin:-.76rem auto 0 auto}.commission-rank .wrapper .nav[data-v-a0b8569a]{height:.99rem;border-bottom:.025rem solid #f3f3f3;font-size:.3rem;font-weight:700;color:#999;line-height:.99rem}.commission-rank .wrapper .nav .item.font-color-red[data-v-a0b8569a]{border-bottom:.04rem solid #e93323}.commission-rank .wrapper .list[data-v-a0b8569a]{padding:0 .3rem}.commission-rank .wrapper .list .item[data-v-a0b8569a]{border-bottom:1px solid #f3f3f3;height:1.01rem;font-size:.28rem}.commission-rank .wrapper .list .item .num[data-v-a0b8569a]{color:#666;width:.7rem}.commission-rank .wrapper .list .item .num img[data-v-a0b8569a]{width:.34rem;height:.4rem;display:block}.commission-rank .wrapper .list .item .picTxt[data-v-a0b8569a]{width:3.5rem}.commission-rank .wrapper .list .item .picTxt .pictrue[data-v-a0b8569a]{width:.68rem;height:.68rem}.commission-rank .wrapper .list .item .picTxt .pictrue img[data-v-a0b8569a]{width:100%;height:100%;display:block;border-radius:50%}.commission-rank .wrapper .list .item .picTxt .text[data-v-a0b8569a]{width:2.62rem;color:#333}.commission-rank .wrapper .list .item .people[data-v-a0b8569a]{width:1.75rem;text-align:right}

View File

@ -0,0 +1 @@
.noscroll[data-v-f4f096a6]{height:100%;overflow:hidden}.product-con .nav[data-v-f4f096a6]{padding:0 .2rem}

View File

@ -0,0 +1 @@
.poster-first[data-v-f3067a28]{-ms-scroll-chaining:none;overscroll-behavior:contain}.mask-share[data-v-f3067a28]{position:fixed;top:0;left:0;right:0;bottom:0;z-index:999}.mask-share img[data-v-f3067a28]{width:100%}.geoPage[data-v-005f45d0]{position:fixed;width:100%;height:100%;top:0;z-index:10000}.product-con .store-info[data-v-005f45d0]{margin-top:.2rem;background-color:#fff}.product-con .store-info .title[data-v-005f45d0]{padding:0 .3rem;font-size:.28rem;color:#282828;height:.8rem;line-height:.8rem;border-bottom:.01rem solid #f5f5f5}.product-con .store-info .info[data-v-005f45d0]{padding:0 .3rem;height:1.26rem}.product-con .store-info .info .picTxt[data-v-005f45d0]{width:6.15rem}.product-con .store-info .info .picTxt .pictrue[data-v-005f45d0]{width:.76rem;height:.76rem}.product-con .store-info .info .picTxt .pictrue img[data-v-005f45d0]{width:100%;height:100%;border-radius:.06rem}.product-con .store-info .info .picTxt .text[data-v-005f45d0]{width:5.22rem}.product-con .store-info .info .picTxt .text .name[data-v-005f45d0]{font-size:.3rem;color:#282828}.product-con .store-info .info .picTxt .text .address[data-v-005f45d0]{font-size:.24rem;color:#666;margin-top:.03rem}.product-con .store-info .info .picTxt .text .address .iconfont[data-v-005f45d0]{color:#707070;font-size:.18rem;margin-left:.1rem}.product-con .store-info .info .picTxt .text .address .addressTxt[data-v-005f45d0]{max-width:4.8rem;width:auto}.product-con .store-info .info .iconfont[data-v-005f45d0]{font-size:.4rem}.product-con .superior[data-v-005f45d0]{background-color:#fff;margin-top:.2rem}.product-con .superior .title[data-v-005f45d0]{height:.98rem}.product-con .superior .title img[data-v-005f45d0]{width:.3rem;height:.3rem}.product-con .superior .title .titleTxt[data-v-005f45d0]{margin:0 .2rem;font-size:.3rem;background-image:-webkit-gradient(linear,left top,right top,from(#f57a37),to(#f21b07));background-image:linear-gradient(90deg,#f57a37 0,#f21b07);background-image:-moz-linear-gradient(to right,#f57a37 0,#f21b07 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.product-con .superior .slider-banner[data-v-005f45d0]{width:6.9rem;margin:0 auto;padding-bottom:.2rem}.product-con .superior .slider-banner .list[data-v-005f45d0]{width:100%;padding-bottom:.2rem}.product-con .superior .slider-banner .list .item[data-v-005f45d0]{width:2.15rem;margin:0 .22rem .3rem 0;font-size:.26rem}.product-con .superior .slider-banner .list .item[data-v-005f45d0]:nth-of-type(3n){margin-right:0}.product-con .superior .slider-banner .list .item .pictrue[data-v-005f45d0]{width:100%;height:2.15rem}.product-con .superior .slider-banner .list .item .pictrue img[data-v-005f45d0]{width:100%;height:100%;border-radius:.06rem}.product-con .superior .slider-banner .list .item .name[data-v-005f45d0]{color:#282828;margin-top:.12rem}.product-con .superior .slider-banner .swiper-pagination-bullet[data-v-005f45d0]{background-color:#999}.product-con .superior .slider-banner .swiper-pagination-bullet-active[data-v-005f45d0]{background-color:#e93323}.mask[data-v-005f45d0]{-webkit-filter:blur(2px);-moz-filter:blur(2px);-ms-filter:blur(2px);filter:blur(2px)}.footer .icon-shoucang1[data-v-005f45d0]{color:#e93323}.product-con .product-intro .conter div[data-v-005f45d0]{width:100%!important}.generate-posters[data-v-005f45d0]{width:100%;height:1.7rem;background-color:#fff;position:fixed;left:0;bottom:0;z-index:99;transform:translate3d(0,100%,0);-webkit-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);-moz-transform:translate3d(0,100%,0);-o-transform:translate3d(0,100%,0);transition:all .3s cubic-bezier(.25,.5,.5,.9);-webkit-transition:all .3s cubic-bezier(.25,.5,.5,.9);-moz-transition:all .3s cubic-bezier(.25,.5,.5,.9);-o-transition:all .3s cubic-bezier(.25,.5,.5,.9)}.generate-posters.on[data-v-005f45d0]{transform:translateZ(0);-webkit-transform:translateZ(0);-ms-transform:translateZ(0);-moz-transform:translateZ(0);-o-transform:translateZ(0)}.generate-posters .item[data-v-005f45d0]{-webkit-box-flex:50%;flex:50%;-webkit-flex:50%;-ms-flex:50%;text-align:center}.generate-posters .item .iconfont[data-v-005f45d0]{font-size:.8rem;color:#5eae72}.generate-posters .item .iconfont.icon-haibao[data-v-005f45d0]{color:#5391f1}.noscroll[data-v-005f45d0]{height:100%;overflow:hidden}

View File

@ -0,0 +1 @@
.coupon-list-window .iconfont[data-v-71d8c8b6]{font-size:.4rem}.couponNo[data-v-71d8c8b6]{font-size:.3rem;font-weight:700;color:#fff;width:6.9rem;height:.86rem;border-radius:.43rem;text-align:center;line-height:.86rem;margin:.6rem auto}.order-submission .wrapper .shipping select[data-v-5b9cff8e]{color:#999;padding-right:.15rem}.order-submission .wrapper .shipping .iconfont[data-v-5b9cff8e]{font-size:.3rem;color:#515151}.order-submission .allAddress[data-v-5b9cff8e]{width:100%;background-image:-webkit-gradient(linear,left top,left bottom,from(#e93323),to(#f5f5f5));background-image:linear-gradient(180deg,#e93323 0,#f5f5f5);background-image:-moz-linear-gradient(to bottom,#e93323 0,#f5f5f5 100%);padding-top:1rem}.order-submission .allAddress .nav[data-v-5b9cff8e]{width:7.1rem;margin:0 auto}.order-submission .allAddress .nav .item[data-v-5b9cff8e]{width:3.55rem}.order-submission .allAddress .nav .item.on[data-v-5b9cff8e]{position:relative;width:2.5rem}.order-submission .allAddress .nav .item.on[data-v-5b9cff8e]:before{position:absolute;bottom:0;content:"\5FEB\9012\914D\9001";font-size:.28rem;display:block;height:0;width:3.55rem;border-width:0 .2rem .8rem 0;border-style:none solid solid;border-color:transparent transparent #fff;z-index:9;border-radius:.07rem .3rem 0 0;text-align:center;line-height:.8rem}.order-submission .allAddress .nav .item:nth-of-type(2).on[data-v-5b9cff8e]:before{content:"\5230\5E97\81EA\63D0";border-width:0 0 .8rem .2rem;border-radius:.3rem .07rem 0 0}.order-submission .allAddress .nav .item.on2[data-v-5b9cff8e]{position:relative}.order-submission .allAddress .nav .item.on2[data-v-5b9cff8e]:before{position:absolute;bottom:0;content:"\5230\5E97\81EA\63D0";font-size:.28rem;display:block;height:0;width:4.6rem;border-width:0 0 .6rem .6rem;border-style:none solid solid;border-color:transparent transparent #f7c1bd;border-radius:.4rem .06rem 0 0;text-align:center;line-height:.6rem}.order-submission .allAddress .nav .item:first-of-type.on2[data-v-5b9cff8e]:before{content:"\5FEB\9012\914D\9001";border-width:0 .6rem .6rem 0;border-radius:.06rem .4rem 0 0}.order-submission .allAddress .address[data-v-5b9cff8e]{width:7.1rem;height:1.5rem;margin:0 auto}.order-submission .allAddress .line[data-v-5b9cff8e]{width:7.1rem;margin:0 auto}.order-submission .wrapper .item .discount input[data-v-5b9cff8e]::-webkit-input-placeholder{color:#ccc}.order-submission .wrapper .item .discount input[data-v-5b9cff8e]::-moz-placeholder{color:#ccc}.order-submission .wrapper .item .discount input[data-v-5b9cff8e]:-ms-input-placeholder{color:#ccc}.order-submission .wrapper .item .discount input[data-v-5b9cff8e]::-ms-input-placeholder{color:#ccc}.order-submission .wrapper .item .discount input[data-v-5b9cff8e]::placeholder{color:#ccc}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-074d26c0"],{2564:function(t,n,e){t.exports=e.p+"h5/img/examine.70b662a8.png"},3717:function(t,n,e){"use strict";e.r(n);var s=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div",{staticClass:"cash-audit"},[t._m(0),e("div",{staticClass:"tip"},[t._v("提现申请已提交,等待人工审核")]),e("div",{staticClass:"time"},[t._v(t._s(t.time))]),e("div",{staticClass:"bnt bg-color-red",on:{click:function(n){return t.$router.push({path:"/user/user_promotion"})}}},[t._v("\n 好的\n ")])])},i=[function(){var t=this,n=t.$createElement,s=t._self._c||n;return s("div",{staticClass:"pictrue"},[s("img",{attrs:{src:e("2564")}})])}],a={name:"CashAudit",components:{},props:{},data:function(){return{time:""}},mounted:function(){var t=new Date;this.time=t.toLocaleString()},methods:{}},c=a,r=e("2877"),o=Object(r["a"])(c,s,i,!1,null,null,null);n["default"]=o.exports}}]);
//# sourceMappingURL=chunk-074d26c0.4c8f6e53.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["webpack:///./src/assets/images/examine.png","webpack:///./src/views/user/promotion/CashAudit.vue?87c9","webpack:///src/views/user/promotion/CashAudit.vue","webpack:///./src/views/user/promotion/CashAudit.vue?557e","webpack:///./src/views/user/promotion/CashAudit.vue"],"names":["module","exports","__webpack_require__","p","render","_vm","this","_h","$createElement","_c","_self","staticClass","_m","_v","_s","time","on","click","$event","$router","push","path","staticRenderFns","attrs","src","CashAuditvue_type_script_lang_js_","name","components","props","data","mounted","myData","Date","toLocaleString","methods","promotion_CashAuditvue_type_script_lang_js_","component","Object","componentNormalizer","__webpack_exports__"],"mappings":"mGAAAA,EAAAC,QAAiBC,EAAAC,EAAuB,wECAxC,IAAAC,EAAA,WAA0B,IAAAC,EAAAC,KAAaC,EAAAF,EAAAG,eAA0BC,EAAAJ,EAAAK,MAAAD,IAAAF,EAAwB,OAAAE,EAAA,OAAiBE,YAAA,cAAyB,CAAAN,EAAAO,GAAA,GAAAH,EAAA,OAAsBE,YAAA,OAAkB,CAAAN,EAAAQ,GAAA,oBAAAJ,EAAA,OAAuCE,YAAA,QAAmB,CAAAN,EAAAQ,GAAAR,EAAAS,GAAAT,EAAAU,SAAAN,EAAA,OAAuCE,YAAA,mBAAAK,GAAA,CAAmCC,MAAA,SAAAC,GAAyB,OAAAb,EAAAc,QAAAC,KAAA,CAAyBC,KAAA,4BAAmC,CAAAhB,EAAAQ,GAAA,qBACpYS,EAAA,YAAoC,IAAAjB,EAAAC,KAAaC,EAAAF,EAAAG,eAA0BC,EAAAJ,EAAAK,MAAAD,IAAAF,EAAwB,OAAAE,EAAA,OAAiBE,YAAA,WAAsB,CAAAF,EAAA,OAAYc,MAAA,CAAOC,IAAMtB,EAAQ,eCa3KuB,EAAA,CACAC,KAAA,YACAC,WAAA,GACAC,MAAA,GACAC,KAAA,WACA,OACAd,KAAA,KAGAe,QAAA,WACA,IAAAC,EAAA,IAAAC,KACA1B,KAAAS,KAAAgB,EAAAE,kBAEAC,QAAA,IC3BiXC,EAAA,cCOjXC,EAAgBC,OAAAC,EAAA,KAAAD,CACdF,EACA/B,EACAkB,GACF,EACA,KACA,KACA,MAIeiB,EAAA,WAAAH","file":"h5/js/chunk-074d26c0.4c8f6e53.js","sourcesContent":["module.exports = __webpack_public_path__ + \"h5/img/examine.70b662a8.png\";","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"cash-audit\"},[_vm._m(0),_c('div',{staticClass:\"tip\"},[_vm._v(\"提现申请已提交,等待人工审核\")]),_c('div',{staticClass:\"time\"},[_vm._v(_vm._s(_vm.time))]),_c('div',{staticClass:\"bnt bg-color-red\",on:{\"click\":function($event){return _vm.$router.push({ path: '/user/user_promotion' })}}},[_vm._v(\"\\n 好的\\n \")])])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"pictrue\"},[_c('img',{attrs:{\"src\":require(\"@assets/images/examine.png\")}})])}]\n\nexport { render, staticRenderFns }","<template>\r\n <div class=\"cash-audit\">\r\n <div class=\"pictrue\"><img src=\"@assets/images/examine.png\" /></div>\r\n <div class=\"tip\">提现申请已提交,等待人工审核</div>\r\n <div class=\"time\">{{ time }}</div>\r\n <div\r\n class=\"bnt bg-color-red\"\r\n @click=\"$router.push({ path: '/user/user_promotion' })\"\r\n >\r\n 好的\r\n </div>\r\n </div>\r\n</template>\r\n<script>\r\nexport default {\r\n name: \"CashAudit\",\r\n components: {},\r\n props: {},\r\n data: function() {\r\n return {\r\n time: \"\"\r\n };\r\n },\r\n mounted: function() {\r\n let myData = new Date();\r\n this.time = myData.toLocaleString();\r\n },\r\n methods: {}\r\n};\r\n</script>\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CashAudit.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CashAudit.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./CashAudit.vue?vue&type=template&id=1baf5b4f&\"\nimport script from \"./CashAudit.vue?vue&type=script&lang=js&\"\nexport * from \"./CashAudit.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-146ed97a"],{"5f10":function(t,n,s){t.exports=s.p+"h5/img/noCoupon.e524084b.png"},b701:function(t,n,s){"use strict";s.r(n);var i=function(){var t=this,n=t.$createElement,s=t._self._c||n;return s("div",{ref:"container"},[t.couponsList.length>0?s("div",{staticClass:"coupon-list"},t._l(t.couponsList,function(n,i){return s("div",{key:i,staticClass:"item acea-row row-center-wrapper"},[s("div",{staticClass:"money",class:n.is_use?"moneyGray":""},[t._v("\n ¥"),s("span",{staticClass:"num"},[t._v(t._s(n.coupon_price))])]),s("div",{staticClass:"text"},[s("div",{staticClass:"condition line1"},[t._v("\n 购物满"+t._s(n.use_min_price)+"元可用\n ")]),s("div",{staticClass:"data acea-row row-between-wrapper"},[0!==n.end_time?s("div",[t._v("\n "+t._s(n.start_time?n.start_time+"-":"")+t._s(n.end_time)+"\n ")]):s("div",[t._v("不限时")]),!0===n.is_use?s("div",{staticClass:"bnt gray"},[t._v("已领取")]):2===n.is_use?s("div",{staticClass:"bnt gray"},[t._v("已领完")]):s("div",{staticClass:"bnt bg-color-red",on:{click:function(s){return t.getCoupon(n.id,i)}}},[t._v("\n 立即领取\n ")])])])])}),0):t._e(),s("Loading",{attrs:{loaded:t.loadend,loading:t.loading}}),0===t.couponsList.length&&t.page>1?s("div",{staticClass:"noCommodity"},[t._m(0)]):t._e()],1)},a=[function(){var t=this,n=t.$createElement,i=t._self._c||n;return i("div",{staticClass:"noPictrue"},[i("img",{staticClass:"image",attrs:{src:s("5f10")}})])}],e=s("c24f"),o=s("3a5e"),c={name:"getCoupon",components:{Loading:o["a"]},props:{},data:function(){return{page:1,limit:10,couponsList:[],loading:!1,loadend:!1}},mounted:function(){var t=this;this.getUseCoupons(),this.$scroll(this.$refs.container,function(){!t.loading&&t.getUseCoupons()})},methods:{getCoupon:function(t,n){var s=this,i=s.couponsList;Object(e["q"])(t).then(function(){i[n].is_use=!0,s.$dialog.toast({mes:"领取成功"})}).catch(function(t){s.$dialog.toast({mes:t.msg})})},getUseCoupons:function(){var t=this;if(!t.loading&&!t.loadend){t.loading=!0;var n={page:t.page,limit:t.limit};Object(e["p"])(n).then(function(n){t.loading=!1,t.couponsList.push.apply(t.couponsList,n.data),t.loadend=n.data.length<t.limit,t.page=t.page+1})}}}},l=c,d=s("2877"),r=Object(d["a"])(l,i,a,!1,null,null,null);n["default"]=r.exports}}]);
//# sourceMappingURL=chunk-146ed97a.7a6fabd0.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-22637d46"],{6726:function(t,i,s){},e436:function(t,i,s){"use strict";s.r(i);var a=function(){var t=this,i=t.$createElement,s=t._self._c||i;return s("div",{staticClass:"PromoterRank"},[s("div",{staticClass:"redBg bg-color-red"},[s("div",{staticClass:"header"},[s("div",{staticClass:"nav acea-row row-center-wrapper"},t._l(t.navList,function(i,a){return s("div",{key:a,staticClass:"item",class:t.active===a?"font-color-red":"",on:{click:function(i){t.active=a}}},[t._v("\n "+t._s(i)+"\n ")])}),0),s("div",{staticClass:"rank acea-row row-bottom row-around"},[s("div",{directives:[{name:"show",rawName:"v-show",value:t.Two.uid,expression:"Two.uid"}],staticClass:"item"},[s("div",{staticClass:"pictrue"},[s("img",{attrs:{src:t.Two.avatar}})]),s("div",{staticClass:"name line1"},[t._v(t._s(t.Two.nickname))]),s("div",{staticClass:"num"},[t._v(t._s(t.Two.count)+"人")])]),t.One.uid?s("div",{staticClass:"item"},[s("div",{staticClass:"pictrue"},[s("img",{attrs:{src:t.One.avatar}})]),s("div",{staticClass:"name line1"},[t._v(t._s(t.One.nickname))]),s("div",{staticClass:"num"},[t._v(t._s(t.One.count)+"人")])]):t._e(),t.Three.uid?s("div",{staticClass:"item"},[s("div",{staticClass:"pictrue"},[s("img",{attrs:{src:t.Three.avatar}})]),s("div",{staticClass:"name line1"},[t._v(t._s(t.Three.nickname))]),s("div",{staticClass:"num"},[t._v(t._s(t.Three.count)+"人")])]):t._e()])])]),t.rankList.length?s("div",{staticClass:"list"},t._l(t.rankList,function(i,a){return s("div",{key:i.nickname,staticClass:"item acea-row row-between-wrapper"},[s("div",{staticClass:"num"},[t._v(t._s(a+4))]),s("div",{staticClass:"picTxt acea-row row-between-wrapper"},[s("div",{staticClass:"pictrue"},[s("img",{attrs:{src:i.avatar}})]),s("div",{staticClass:"text line1"},[t._v(t._s(i.nickname))])]),s("div",{staticClass:"people font-color-red"},[t._v(t._s(i.count)+"人")])])}),0):t._e()])},e=[],n=(s("7f7f"),s("c24f")),r="PromoterRank",c={name:r,props:{},data:function(){return{navList:["周榜","月榜"],active:0,page:1,limit:10,loading:!1,loadend:!1,rankList:[],One:{},Two:{},Three:{},type:"week"}},watch:{$route:function(t){t.name===r&&(this.loaded=!1,this.page=1,this.$set(this,"rankList",[]),this.getRankList())},active:function(t){this.type=t?"month":"week",this.page=1,this.loaded=!1,this.$set(this,"rankList",[]),this.getRankList()}},mounted:function(){var t=this;this.getRankList(),this.$scroll(this.$refs.container,function(){!t.loading&&t.getRankList()})},methods:{getRankList:function(){var t=this;Object(n["v"])({page:this.page,limit:this.limit,type:this.type}).then(function(i){var s=i.data;t.rankList.push.apply(t.rankList,s),1==t.page&&(t.One=t.rankList.shift()||{},t.Two=t.rankList.shift()||{},t.Three=t.rankList.shift()||{}),t.page++,t.loading=!1,t.loaded=s.length<t.limit,t.$set(t,"rankList",t.rankList)}).catch(function(){t.loading=!1})}}},o=c,l=(s("e57f"),s("2877")),d=Object(l["a"])(o,a,e,!1,null,"ba858c14",null);i["default"]=d.exports},e57f:function(t,i,s){"use strict";var a=s("6726"),e=s.n(a);e.a}}]);
//# sourceMappingURL=chunk-22637d46.bf9fd936.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-249cbda8"],{"563c":function(s,t,a){s.exports=a.p+"h5/img/noAddress.d76a1cef.png"},ab22:function(s,t,a){"use strict";var i=a("e733"),e=a.n(i);e.a},afa3:function(s,t,a){s.exports=a.p+"h5/img/line.05bf1c84.jpg"},bb9a:function(s,t,a){"use strict";a.r(t);var i=function(){var s=this,t=s.$createElement,i=s._self._c||t;return i("div",{ref:"container",staticClass:"address-management",class:s.addressList.length<1&&s.page>1?"on":""},[s.addressList.length>0?i("div",{staticClass:"line"},[i("img",{attrs:{src:a("afa3")}})]):s._e(),s._l(s.addressList,function(t,a){return i("div",{key:a,staticClass:"item"},[i("div",{staticClass:"address"},[i("div",{staticClass:"consignee"},[s._v("\n 收货人:"+s._s(t.real_name)),i("span",{staticClass:"phone"},[s._v(s._s(t.phone))])]),i("div",[s._v("\n 收货地址:"+s._s(t.province)+s._s(t.city)+s._s(t.district)+s._s(t.detail)+"\n ")])]),i("div",{staticClass:"operation acea-row row-between-wrapper"},[i("div",{staticClass:"select-btn"},[i("div",{staticClass:"checkbox-wrapper"},[i("label",{staticClass:"well-check"},[i("input",{attrs:{type:"radio",name:"default",value:""},domProps:{checked:!!t.is_default},on:{click:function(t){return s.radioChange(a)}}}),i("i",{staticClass:"icon"}),i("span",{staticClass:"default"},[s._v("设为默认")])])])]),i("div",{staticClass:"acea-row row-middle"},[i("div",{on:{click:function(t){return s.editAddress(a)}}},[i("span",{staticClass:"iconfont icon-bianji"}),s._v("编辑\n ")]),i("div",{on:{click:function(t){return s.delAddress(a)}}},[i("span",{staticClass:"iconfont icon-shanchu"}),s._v("删除\n ")])])])])}),i("Loading",{attrs:{loaded:s.loadend,loading:s.loading}}),s.addressList.length<1&&s.page>1?i("div",{staticClass:"noCommodity"},[s._m(0)]):s._e(),i("div",{staticStyle:{height:"1.2rem"}}),i("div",{staticClass:"footer acea-row row-between-wrapper"},[s.isWechat?i("div",{staticClass:"addressBnt bg-color-red",on:{click:s.addAddress}},[i("span",{staticClass:"iconfont icon-tianjiadizhi"}),s._v("添加新地址\n ")]):i("div",{staticClass:"addressBnt on bg-color-red",on:{click:s.addAddress}},[i("span",{staticClass:"iconfont icon-tianjiadizhi"}),s._v("添加新地址\n ")]),s.isWechat?i("div",{staticClass:"addressBnt wxbnt",on:{click:s.getAddress}},[i("span",{staticClass:"iconfont icon-weixin2"}),s._v("导入微信地址\n ")]):s._e()])],2)},e=[function(){var s=this,t=s.$createElement,i=s._self._c||t;return i("div",{staticClass:"noPictrue"},[i("img",{staticClass:"image",attrs:{src:a("563c")}})])}],d=a("c24f"),n=a("3a5e"),c=a("ed08"),o=a("74f9"),r={components:{Loading:n["a"]},data:function(){return{page:1,limit:20,addressList:[],loadTitle:"",loading:!1,loadend:!1,isWechat:Object(c["d"])()}},mounted:function(){var s=this;this.AddressList(),this.$scroll(this.$refs.container,function(){!s.loading&&s.AddressList()})},methods:{AddressList:function(){var s=this;s.loading||s.loadend||(s.loading=!0,Object(d["f"])({page:s.page,limit:s.limit}).then(function(t){s.loading=!1,s.addressList.push.apply(s.addressList,t.data),s.loadend=t.data.length<s.limit,s.page=s.page+1}))},editAddress:function(s){this.$router.push({path:"/user/add_address/"+this.addressList[s].id})},delAddress:function(s){var t=this,a=this.addressList[s],i=a.id;Object(d["g"])(i).then(function(){t.$dialog.toast({mes:"删除成功!",callback:function(){t.addressList.splice(s,1),t.$set(t,"addressList",t.addressList)}})})},radioChange:function(s){var t=this,a=this.addressList[s],i=a.id;Object(d["e"])(i).then(function(){for(var a=0,i=t.addressList.length;a<i;a++)t.addressList[a].is_default=a===s?1:0;t.$set(t,"addressList",t.addressList)})},addAddress:function(){this.$router.push({path:"/user/add_address"})},getAddress:function(){var s=this;Object(o["openAddress"])().then(function(t){s.$dialog.loading.open(),Object(d["J"])({real_name:t.userName,phone:t.telNumber,address:{province:t.provinceName,city:t.cityName,district:t.countryName},detail:t.detailInfo,post_code:t.postalCode,wx_export:1}).then(function(){s.page=1,s.loading=!1,s.loadend=!1,s.addressList=[],s.AddressList(),s.$dialog.loading.close(),s.$dialog.toast({mes:"添加成功"})}).catch(function(t){s.$dialog.loading.close(),s.$dialog.error(t.msg||"添加失败")})})}}},l=r,u=(a("ab22"),a("2877")),p=Object(u["a"])(l,i,e,!1,null,"c7960950",null);t["default"]=p.exports},e733:function(s,t,a){}}]);
//# sourceMappingURL=chunk-249cbda8.3a11a19d.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-293c3d87"],{1104:function(t,s,e){},e483:function(t,s,e){"use strict";e.r(s);var a=function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"logistics"},[t._l(t.cartInfo,function(s){return a("div",{key:s.id,staticClass:"header acea-row row-between row-top"},[a("div",{staticClass:"pictrue"},[a("img",{attrs:{src:s.productInfo.image}})]),a("div",{staticClass:"text acea-row row-between"},[a("div",{staticClass:"name line2"},[t._v("\n "+t._s(s.productInfo.store_name)+"\n ")]),a("div",{staticClass:"money"},[a("div",[t._v("¥"+t._s(s.truePrice))]),a("div",[t._v("x"+t._s(s.cart_num))])])])])}),a("div",{staticClass:"logisticsCon"},[a("div",{staticClass:"company acea-row row-between-wrapper"},[a("div",{staticClass:"picTxt acea-row row-between-wrapper"},[a("div",{staticClass:"iconfont icon-wuliu"}),a("div",{staticClass:"text"},[a("div",[a("span",{staticClass:"name line1"},[t._v("物流公司:")]),t._v("\n "+t._s(t.orderInfo.delivery_name)+"\n ")]),a("div",{staticClass:"express line1"},[a("span",{staticClass:"name"},[t._v("快递单号:")]),t._v(" "+t._s(t.orderInfo.delivery_id)+"\n ")])])]),a("div",{staticClass:"copy acea-row row-center-wrapper copy-data",attrs:{"data-clipboard-text":t.orderInfo.delivery_id}},[t._v("\n 复制单号\n ")])]),t._l(t.expressList,function(s,e){return a("div",{key:e,staticClass:"item"},[a("div",{staticClass:"circular",class:0===e?"on":""}),a("div",{staticClass:"text"},[a("div",{class:0===e?"font-color-red":""},[t._v("\n "+t._s(s.status)+"\n ")]),a("div",{staticClass:"data"},[t._v(t._s(s.time))])])])})],2),t.loaded&&!t.expressList.length?a("div",{staticClass:"no-express"},[a("img",{attrs:{src:e("eb49")}})]):t._e(),a("Recommend")],2)},i=[],n=(e("7f7f"),e("f410")),r=e("b311"),o=e.n(r),c=e("f8b7"),d="Logistics",l={name:d,components:{Recommend:n["a"]},data:function(){return{id:this.$route.params.id,cartInfo:[],orderInfo:{},expressList:[],loaded:!1}},watch:{$route:function(t){t.name===d&&this.$route.params.id!==this.id&&(this.id=this.$route.params.id,this.getExpress())}},mounted:function(){this.getExpress()},methods:{getExpress:function(){var t=this;if(!this.id)return this.$dialog.error("订单不存在");this.loaded=!1,Object(c["d"])(this.id).then(function(s){var e=s.data.express.result||{};t.cartInfo=s.data.order.cartInfo,t.orderInfo=s.data.order,t.expressList=e.list||[],t.loaded=!0,t.$nextTick(function(){var t=this,s=document.getElementsByClassName("copy-data"),e=new o.a(s);e.on("success",function(){t.$dialog.success("复制成功")})})}).catch(function(s){t.$dialog.error(s.msg||"加载失败")})}}},u=l,p=(e("f26a"),e("2877")),v=Object(p["a"])(u,a,i,!1,null,"33384c09",null);s["default"]=v.exports},eb49:function(t,s,e){t.exports=e.p+"h5/img/noExpress.375a0428.png"},f26a:function(t,s,e){"use strict";var a=e("1104"),i=e.n(a);i.a}}]);
//# sourceMappingURL=chunk-293c3d87.7aa109ae.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0b995a"],{3425:function(t,s,a){"use strict";a.r(s);var o=function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"my-promotion"},[a("div",{staticClass:"header"},[a("div",{staticClass:"name acea-row row-center-wrapper"},[a("div",[t._v("当前佣金")]),a("router-link",{staticClass:"record",attrs:{to:"/user/cashrecord"}},[t._v("\n 提现记录"),a("span",{staticClass:"iconfont icon-xiangyou"})])],1),a("div",{staticClass:"num"},[t._v(t._s(t.userInfo.brokerage_price||0))]),a("div",{staticClass:"profit acea-row row-between-wrapper"},[a("div",{staticClass:"item"},[a("div",[t._v("昨日收益")]),a("div",{staticClass:"money"},[t._v(t._s(t.userInfo.yesterDay||0))])]),a("div",{staticClass:"item"},[a("div",[t._v("累积已提")]),a("div",{staticClass:"money"},[t._v(t._s(t.userInfo.extractTotalPrice||0))])])])]),a("div",{staticClass:"bnt bg-color-red",on:{click:t.toCash}},[t._v("立即提现")]),a("div",{staticClass:"list acea-row row-between-wrapper"},[a("router-link",{staticClass:"item acea-row row-center-wrapper row-column",attrs:{to:"/user/poster"}},[a("span",{staticClass:"iconfont icon-erweima"}),a("div",[t._v("推广名片")])]),a("router-link",{staticClass:"item acea-row row-center-wrapper row-column",attrs:{to:"/user/promoter_list"}},[a("span",{staticClass:"iconfont icon-tongji"}),a("div",[t._v("推广人统计")])]),a("router-link",{staticClass:"item acea-row row-center-wrapper row-column",attrs:{to:"/user/commission"}},[a("span",{staticClass:"iconfont icon-qiandai"}),a("div",[t._v("佣金明细")])]),a("router-link",{staticClass:"item acea-row row-center-wrapper row-column",attrs:{to:"/user/promoter_order"}},[a("span",{staticClass:"iconfont icon-dingdan"}),a("div",[t._v("推广人订单")])]),a("router-link",{staticClass:"item acea-row row-center-wrapper row-column",attrs:{to:"/user/promoter_rank"}},[a("span",{staticClass:"iconfont icon-paihang1"}),a("div",[t._v("推广人排行")])]),a("router-link",{staticClass:"item acea-row row-center-wrapper row-column",attrs:{to:"/user/commission/rank"}},[a("span",{staticClass:"iconfont icon-paihang"}),a("div",[t._v("佣金排行")])])],1)])},r=[],e=a("c24f"),n={name:"UserPromotion",components:{},props:{},data:function(){return{userInfo:{}}},mounted:function(){this.getInfo()},methods:{getInfo:function(){var t=this;Object(e["D"])().then(function(s){t.userInfo=s.data,console.log(t.userInfo)},function(s){t.$dialog.message(s.msg)})},toCash:function(){this.$router.push({path:"/user/user_cash"})}}},i=n,c=a("2877"),l=Object(c["a"])(i,o,r,!1,null,null,null);s["default"]=l.exports}}]);
//# sourceMappingURL=chunk-2d0b995a.41d89d52.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c1002"],{"43d1":function(i,t,s){"use strict";s.r(t);var n=function(){var i=this,t=i.$createElement,s=i._self._c||t;return s("div",{ref:"container",staticClass:"commission-details"},[s("div",{staticClass:"promoterHeader bg-color-red"},[s("div",{staticClass:"headerCon acea-row row-between-wrapper"},[s("div",[s("div",{staticClass:"name"},[i._v("佣金明细")]),s("div",{staticClass:"money"},[i._v("\n ¥"),s("span",{staticClass:"num"},[i._v(i._s(i.commission))])])]),s("div",{staticClass:"iconfont icon-jinbi1"})])]),s("div",{ref:"content",staticClass:"sign-record"},[s("div",{staticClass:"list"},i._l(i.info,function(t,n){return s("div",{key:n,staticClass:"item"},[s("div",{staticClass:"data"},[i._v(i._s(t.time))]),i._l(t.list,function(t,n){return s("div",{key:n,staticClass:"listn"},[s("div",{staticClass:"itemn acea-row row-between-wrapper"},[s("div",[s("div",{staticClass:"name line1"},[i._v(i._s(t.title))]),s("div",[i._v(i._s(t.add_time))])]),1==t.pm?s("div",{staticClass:"num"},[i._v("+"+i._s(t.number))]):i._e(),0==t.pm?s("div",{staticClass:"num font-color-red"},[i._v("\n -"+i._s(t.number)+"\n ")]):i._e()])])})],2)}),0)]),s("Loading",{attrs:{loaded:i.loaded,loading:i.loading}})],1)},e=[],a=s("c24f"),o=s("3a5e"),d={name:"CommissionDetails",components:{Loading:o["a"]},props:{},data:function(){return{info:[],commission:0,where:{page:1,limit:3},types:3,loaded:!1,loading:!1}},mounted:function(){var i=this;this.getCommission(),this.getIndex(),this.$scroll(this.$refs.container,function(){!1===i.loading&&i.getIndex()})},methods:{getIndex:function(){var i=this;1!=i.loading&&1!=i.loaded&&(i.loading=!0,Object(a["o"])(i.where,i.types).then(function(t){i.loading=!1,i.loaded=t.data.length<i.where.limit,i.loadTitle=i.loaded?"人家是有底线的":"上拉加载更多",i.where.page=i.where.page+1,i.info.push.apply(i.info,t.data)},function(t){i.$dialog.message(t.msg)}))},getCommission:function(){var i=this,t=this;Object(a["A"])().then(function(i){t.commission=i.data.commissionCount},function(t){i.$dialog.message(t.msg)})}}},l=d,c=s("2877"),r=Object(c["a"])(l,n,e,!1,null,null,null);t["default"]=r.exports}}]);
//# sourceMappingURL=chunk-2d0c1002.f548018e.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d0177"],{6700:function(t,a,s){"use strict";s.r(a);var e=function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{ref:"container",staticClass:"promoter-order"},[s("div",{staticClass:"promoterHeader bg-color-red"},[s("div",{staticClass:"headerCon acea-row row-between-wrapper"},[s("div",[s("div",{staticClass:"name"},[t._v("累计推广订单")]),s("div",[s("span",{staticClass:"num"},[t._v(t._s(t.count))]),t._v("单\n ")])]),s("div",{staticClass:"iconfont icon-2"})])]),s("div",{staticClass:"list"},t._l(t.list,function(a,e){return s("div",{key:e,staticClass:"item"},[s("div",{staticClass:"title acea-row row-column row-center"},[s("div",{staticClass:"data"},[t._v(t._s(a.time))]),s("div",[t._v("本月累计推广订单:"+t._s(a.count?a.count:0)+"单")])]),s("div",{staticClass:"listn"},t._l(a.child,function(a,e){return s("div",{key:e,staticClass:"itenm"},[s("div",{staticClass:"top acea-row row-between-wrapper"},[s("div",{staticClass:"pictxt acea-row row-between-wrapper"},[s("div",{staticClass:"pictrue"},[s("img",{attrs:{src:a.avatar}})]),s("div",{staticClass:"text line1"},[t._v(t._s(a.nickname))])]),s("div",{staticClass:"money"},[t._v("\n 返佣:"),s("span",{staticClass:"font-color-red"},[t._v("¥"+t._s(a.number?a.number:0))])])]),s("div",{staticClass:"bottom"},[s("div",[s("span",{staticClass:"name"},[t._v("订单号:")]),t._v(t._s(a.order_id))]),s("div",[s("span",{staticClass:"name"},[t._v("下单时间:")]),t._v(t._s(a.time))])])])}),0)])}),0),s("Loading",{attrs:{loaded:t.loaded,loading:t.loading}})],1)},i=[],n=s("c24f"),o=s("3a5e"),d={name:"PromoterOrder",components:{Loading:o["a"]},props:{},data:function(){return{list:[],where:{page:1,limit:15},loaded:!1,loading:!1,loadTitle:"",count:""}},mounted:function(){var t=this;this.getIndex(),this.$scroll(this.$refs.container,function(){!t.loading&&t.getIndex()})},methods:{getIndex:function(){var t=this;1!=t.loaded&&1!=t.loading&&(t.loading=!0,Object(n["B"])(t.where).then(function(a){t.loading=!1,t.loaded=a.data.list.length<t.where.limit,t.loadTitle=t.loaded?"人家是有底线的":"上拉加载更多",t.where.page=t.where.page+1,t.list.push.apply(t.list,a.data.list),t.count=a.data.count},function(a){t.$dialog.message(a.msg)},300))}}},l=d,r=s("2877"),c=Object(r["a"])(l,e,i,!1,null,null,null);a["default"]=c.exports}}]);
//# sourceMappingURL=chunk-2d0d0177.88479f7f.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d3247"],{"5c03":function(i,t,s){"use strict";s.r(t);var n=function(){var i=this,t=i.$createElement,s=i._self._c||t;return s("div",{ref:"container",staticClass:"commission-details"},[s("div",{staticClass:"promoterHeader bg-color-red"},[s("div",{staticClass:"headerCon acea-row row-between-wrapper"},[s("div",[s("div",{staticClass:"name"},[i._v("提现记录")]),s("div",{staticClass:"money"},[i._v("\n ¥"),s("span",{staticClass:"num"},[i._v(i._s(i.commission))])])]),s("div",{staticClass:"iconfont icon-jinbi1"})])]),s("div",{ref:"content",staticClass:"sign-record"},[s("div",{staticClass:"list"},i._l(i.info,function(t,n){return s("div",{key:n,staticClass:"item"},[s("div",{staticClass:"data"},[i._v(i._s(t.time))]),i._l(t.list,function(t,n){return s("div",{key:n,staticClass:"listn"},[s("div",{staticClass:"itemn acea-row row-between-wrapper"},[s("div",[s("div",{staticClass:"name line1"},[i._v(i._s(t.title))]),s("div",[i._v(i._s(t.add_time))])]),1==t.pm?s("div",{staticClass:"num"},[i._v("+"+i._s(t.number))]):i._e(),0==t.pm?s("div",{staticClass:"num font-color-red"},[i._v("\n -"+i._s(t.number)+"\n ")]):i._e()])])})],2)}),0)]),s("Loading",{attrs:{loaded:i.loaded,loading:i.loading}})],1)},e=[],a=s("c24f"),o=s("3a5e"),d={name:"CashRecord",components:{Loading:o["a"]},props:{},data:function(){return{info:[],commission:0,where:{page:1,limit:3},types:4,loaded:!1,loading:!1}},mounted:function(){var i=this;this.getCommission(),this.getIndex(),this.$scroll(this.$refs.container,function(){!1===i.loading&&i.getIndex()})},methods:{getIndex:function(){var i=this;1!=i.loading&&1!=i.loaded&&(i.loading=!0,Object(a["o"])(i.where,i.types).then(function(t){i.loading=!1,i.loaded=t.data.length<i.where.limit,i.where.page=i.where.page+1,i.info.push.apply(i.info,t.data)},function(t){i.$dialog.message(t.msg)}))},getCommission:function(){var i=this,t=this;Object(a["A"])().then(function(i){t.commission=i.data.commissionCount},function(t){i.$dialog.message(t.msg)})}}},c=d,l=s("2877"),r=Object(l["a"])(c,n,e,!1,null,null,null);t["default"]=r.exports}}]);
//# sourceMappingURL=chunk-2d0d3247.a21c1d5c.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d6b8d"],{7482:function(i,t,n){"use strict";n.r(t);var a=function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{ref:"container",staticClass:"sign-record"},[n("div",{staticClass:"list"},i._l(i.signList,function(t,a){return n("div",{key:a,staticClass:"item"},[n("div",{staticClass:"data"},[i._v(i._s(t.month))]),n("div",{staticClass:"listn"},i._l(t.list,function(t,a){return n("div",{key:a,staticClass:"itemn acea-row row-between-wrapper"},[n("div",[n("div",{staticClass:"name line1"},[i._v(i._s(t.title))]),n("div",[i._v(i._s(t.add_time))])]),n("div",{staticClass:"num font-color-red"},[i._v("+"+i._s(t.number))])])}),0)])}),0),n("Loading",{attrs:{loaded:i.loadend,loading:i.loading}})],1)},s=[],e=n("c24f"),d=n("3a5e"),l={name:"SignRecord",components:{Loading:d["a"]},props:{},data:function(){return{page:1,limit:3,signList:[],loading:!1,loadend:!1,active:!1}},mounted:function(){var i=this;this.signListTap(),this.$scroll(this.$refs.container,function(){!i.loading&&i.signListTap()})},methods:{signListTap:function(){var i=this;i.loading||i.loadend||(i.loading=!0,Object(e["y"])(i.page,i.limit).then(function(t){i.loading=!1,i.signList.push.apply(i.signList,t.data),i.loadend=t.data.length<i.limit,i.page=i.page+1}))}}},o=l,c=n("2877"),r=Object(c["a"])(o,a,s,!1,null,null,null);t["default"]=r.exports}}]);
//# sourceMappingURL=chunk-2d0d6b8d.824173a6.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0da964"],{"6bdf":function(t,e,s){"use strict";s.r(e);var n=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{ref:"container",staticClass:"bill-details"},[s("div",{staticClass:"nav acea-row"},[s("div",{staticClass:"item",class:0==t.types?"on":"",on:{click:function(e){return t.changeTypes(0)}}},[t._v("\n 全部\n ")]),s("div",{staticClass:"item",class:1==t.types?"on":"",on:{click:function(e){return t.changeTypes(1)}}},[t._v("\n 消费\n ")]),s("div",{staticClass:"item",class:2==t.types?"on":"",on:{click:function(e){return t.changeTypes(2)}}},[t._v("\n 充值\n ")])]),s("div",{staticClass:"sign-record"},[s("div",{staticClass:"list"},t._l(t.list,function(e,n){return s("div",{key:n,staticClass:"item"},[s("div",{staticClass:"data"},[t._v(t._s(e.time))]),t._l(e.list,function(e,n){return s("div",{key:n,staticClass:"listn"},[s("div",{staticClass:"itemn acea-row row-between-wrapper"},[s("div",[s("div",{staticClass:"name line1"},[t._v(t._s(e.title))]),s("div",[t._v(t._s(e.add_time))])]),s("div",{staticClass:"num",class:0==e.pm?"font-color-red":""},[t._v("\n "+t._s(0==e.pm?"-":"+")+t._s(e.number)+"\n ")])])])})],2)}),0)]),s("Loading",{attrs:{loaded:t.loaded,loading:t.loading}})],1)},i=[],a=s("c24f"),l=s("3a5e"),o={name:"UserBill",components:{Loading:l["a"]},props:{},data:function(){return{types:"",where:{page:1,limit:5},list:[],loaded:!1,loading:!1}},watch:{"$route.params.types":function(t){var e=this;void 0!=t&&(e.types=t,e.list=[],e.where.page=1,e.loaded=!1,e.loading=!1,e.getIndex())},types:function(){this.getIndex()}},mounted:function(){var t=this;t.types=t.$route.params.types,t.getIndex(),t.$scroll(t.$refs.container,function(){!t.loading&&t.getIndex()})},methods:{code:function(){this.sendCode()},changeTypes:function(t){t!=this.types&&(this.types=t,this.list=[],this.where.page=1,this.loaded=!1,this.loading=!1)},getIndex:function(){var t=this;1!=t.loaded&&1!=t.loading&&(t.loading=!0,Object(a["o"])(t.where,t.types).then(function(e){t.loading=!1,t.loaded=e.data.length<t.where.limit,t.where.page=t.where.page+1,t.list.push.apply(t.list,e.data)},function(e){t.$dialog.message(e.msg)}))}}},d=o,c=s("2877"),r=Object(c["a"])(d,n,i,!1,null,null,null);e["default"]=r.exports}}]);
//# sourceMappingURL=chunk-2d0da964.cb78b008.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0f0b4a"],{"9e08":function(t,i,s){"use strict";s.r(i);var e=function(){var t=this,i=t.$createElement,s=t._self._c||i;return s("div",{staticClass:"quality-recommend"},[s("div",{staticClass:"slider-banner swiper"},[s("swiper",{staticClass:"swiper-wrapper",attrs:{options:t.RecommendSwiper}},t._l(t.imgUrls,function(t,i){return s("swiperSlide",{key:i,staticClass:"swiper-slide"},[s("img",{staticClass:"slide-image",attrs:{src:t.img}})])}),1),s("div",{staticClass:"swiper-pagination"})],1),s("div",{staticClass:"title acea-row row-center-wrapper"},[s("div",{staticClass:"line"}),s("div",{staticClass:"name"},[s("span",{staticClass:"iconfont",class:t.icon}),t._v(t._s(t.name)+"\n ")]),s("div",{staticClass:"line"})]),s("GoodList",{attrs:{"good-list":t.goodsList,"is-sort":!1}})],1)},n=[],a=s("7212"),o=(s("e5d0"),s("d829")),r=s("73f5"),c={name:"HotNewGoods",components:{swiper:a["swiper"],swiperSlide:a["swiperSlide"],GoodList:o["a"]},props:{},data:function(){return{imgUrls:[],goodsList:[],name:"",icon:"",RecommendSwiper:{pagination:{el:".swiper-pagination",clickable:!0},autoplay:{disableOnInteraction:!1,delay:2e3},loop:!0,speed:1e3,observer:!0,observeParents:!0}}},mounted:function(){this.titleInfo(),this.getIndexGroomList()},methods:{titleInfo:function(){var t=this.$route.params.type;"1"===t?(this.name="精品推荐",this.icon="icon-jingpintuijian",document.title="精品推荐"):"2"===t?(this.name="热门榜单",this.icon="icon-remen",document.title="热门榜单"):"3"===t&&(this.name="首发新品",this.icon="icon-xinpin",document.title="首发新品")},getIndexGroomList:function(){var t=this,i=this.$route.params.type;console.log(i),Object(r["e"])(i).then(function(i){t.imgUrls=i.data.banner,t.goodsList=i.data.list,console.log(i.data.list)}).catch(function(t){this.$dialog.toast({mes:t.msg})})}}},l=c,d=s("2877"),p=Object(d["a"])(l,e,n,!1,null,null,null);i["default"]=p.exports}}]);
//# sourceMappingURL=chunk-2d0f0b4a.9e8ad235.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21f45b"],{d8b3:function(t,s,i){"use strict";i.r(s);var e=function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("div",{staticClass:"quality-recommend"},[i("div",{staticClass:"slider-banner swiper"},[i("swiper",{staticClass:"swiper-wrapper",attrs:{options:t.RecommendSwiper}},t._l(t.imgUrls,function(t,s){return i("swiperSlide",{key:s,staticClass:"swiper-slide"},[i("img",{staticClass:"slide-image",attrs:{src:t.img}})])}),1),i("div",{staticClass:"swiper-pagination"})],1),t._m(0),i("Promotion-good",{attrs:{benefit:t.goodsList}})],1)},a=[function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("div",{staticClass:"title acea-row row-center-wrapper"},[i("div",{staticClass:"line"}),i("div",{staticClass:"name"},[i("span",{staticClass:"iconfont icon-cuxiaoguanli"}),t._v("促销单品\n ")]),i("div",{staticClass:"line"})])}],n=i("7212"),o=(i("e5d0"),i("91c8")),r=i("73f5"),c={name:"GoodsPromotion",components:{swiper:n["swiper"],swiperSlide:n["swiperSlide"],PromotionGood:o["a"]},props:{},data:function(){return{imgUrls:[],goodsList:[],RecommendSwiper:{pagination:{el:".swiper-pagination",clickable:!0},autoplay:{disableOnInteraction:!1,delay:2e3},loop:!0,speed:1e3,observer:!0,observeParents:!0}}},mounted:function(){this.getIndexGroomList()},methods:{getIndexGroomList:function(){var t=this;Object(r["e"])(4).then(function(s){t.imgUrls=s.data.banner,t.goodsList=s.data.list}).catch(function(t){this.$dialog.toast({mes:t.msg})})}}},l=c,d=i("2877"),p=Object(d["a"])(l,e,a,!1,null,null,null);s["default"]=p.exports}}]);
//# sourceMappingURL=chunk-2d21f45b.cfd48a51.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d5271a2"],{"64ba":function(t,a,i){"use strict";i.r(a);var s=function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{ref:"container",staticClass:"integral-details"},[s("div",{staticClass:"header"},[s("div",{staticClass:"currentScore"},[t._v("当前积分")]),s("div",[t._v(t._s(t.info.integral))]),s("div",{staticClass:"line"}),s("div",{staticClass:"nav acea-row"},[s("div",{staticClass:"item"},[s("div",{staticClass:"num"},[t._v(t._s(t.info.sum_integral))]),s("div",[t._v("累计积分")])]),s("div",{staticClass:"item"},[s("div",{staticClass:"num"},[t._v(t._s(t.info.deduction_integral))]),s("div",[t._v("累计消费")])]),s("div",{staticClass:"item"},[s("div",{staticClass:"num"},[t._v(t._s(t.info.today_integral))]),s("div",[t._v("今日获得")])])])]),s("div",{staticClass:"wrapper"},[s("div",{staticClass:"nav acea-row"},t._l(t.navList,function(a,i){return s("div",{key:i,staticClass:"item acea-row row-center-wrapper",class:t.current===i?"on":"",on:{click:function(a){return t.nav(i)}}},[s("span",{staticClass:"iconfont",class:a.icon}),t._v(t._s(a.name)+"\n ")])}),0),s("div",{staticClass:"list",attrs:{hidden:0!==t.current}},[t._m(0),t._l(t.list,function(a,i){return s("div",{key:i,staticClass:"item acea-row row-between-wrapper"},[s("div",[s("div",{staticClass:"state"},[t._v(t._s(a.mark))]),s("div",[t._v(t._s(a.add_time))])]),1==a.pm?s("div",{staticClass:"num"},[t._v("+"+t._s(a.number))]):t._e(),0==a.pm?s("div",{staticClass:"num font-color-red"},[t._v("\n -"+t._s(a.number)+"\n ")]):t._e()])})],2),s("div",{staticClass:"list2",attrs:{hidden:1!==t.current}},[s("router-link",{staticClass:"item acea-row row-between-wrapper",attrs:{to:"/"}},[s("div",{staticClass:"pictrue"},[s("img",{attrs:{src:i("d31e")}})]),s("div",{staticClass:"name"},[t._v("购买商品可获得积分奖励")]),s("div",{staticClass:"earn"},[t._v("赚积分")])]),s("router-link",{staticClass:"item acea-row row-between-wrapper",attrs:{to:"/user/sign"}},[s("div",{staticClass:"pictrue"},[s("img",{attrs:{src:i("d31e")}})]),s("div",{staticClass:"name"},[t._v("每日签到可获得积分奖励")]),s("div",{staticClass:"earn"},[t._v("赚积分")])])],1)]),s("Loading",{attrs:{loaded:t.loaded,loading:t.loading}})],1)},n=[function(){var t=this,a=t.$createElement,i=t._self._c||a;return i("div",{staticClass:"tip acea-row row-middle"},[i("span",{staticClass:"iconfont icon-shuoming"}),t._v("提示:积分数值的高低会直接影响您的会员等级\n ")])}],e=i("c24f"),r=i("3a5e"),c={name:"Integral",components:{Loading:r["a"]},props:{},data:function(){return{navList:[{name:"分值明细",icon:"icon-mingxi"},{name:"分值提升",icon:"icon-tishengfenzhi"}],current:0,where:{page:1,limit:15},data:{sign:1,integral:1,all:1},list:[],info:[],loaded:!1,loading:!1}},mounted:function(){var t=this;this.getIntegral(),this.getInfo(),this.$scroll(this.$refs.container,function(){!t.loading&&t.getInfo()})},methods:{nav:function(t){this.current=t},getInfo:function(){var t=this;1!=t.loaded&&1!=t.loading&&(t.loading=!0,Object(e["s"])(t.where).then(function(a){t.loading=!1,t.loaded=a.data.length<t.where.limit,t.loadTitle=t.loaded?"人家是有底线的":"上拉加载更多",t.where.page=t.where.page+1,t.list.push.apply(t.list,a.data)},function(a){t.$dialog.message(a.msg)}))},getIntegral:function(){var t=this;Object(e["N"])(t.data).then(function(a){t.info=a.data},function(a){t.$dialog.message(a.msg)})}}},o=c,l=i("2877"),d=Object(l["a"])(o,s,n,!1,null,null,null);a["default"]=d.exports},d31e:function(t,a,i){t.exports=i.p+"h5/img/score.30715cf5.png"}}]);
//# sourceMappingURL=chunk-2d5271a2.9c35a64c.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2df2bc60"],{"707b":function(e,s,t){"use strict";t.r(s);var i=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"distribution-posters"},[t("div",{staticClass:"slider-banner banner"},[t("swiper",{ref:"mySwiper",staticClass:"swiper-wrapper",attrs:{options:e.swiperPosters}},e._l(e.info,function(e,s){return t("swiperSlide",{key:s,staticClass:"swiper-slide"},[t("img",{staticClass:"slide-image",attrs:{src:e.wap_poster}})])}),1)],1),e._m(0)])},r=[function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"preserve acea-row row-center-wrapper"},[t("div",{staticClass:"line"}),t("div",{staticClass:"tip"},[e._v("长按保存图片")]),t("div",{staticClass:"line"})])}],n=t("7212"),a=(t("e5d0"),t("c24f")),c={name:"Poster",components:{swiper:n["swiper"],swiperSlide:n["swiperSlide"]},props:{},data:function(){return{swiperPosters:{speed:1e3,effect:"coverflow",slidesPerView:"auto",centeredSlides:!0,coverflowEffect:{rotate:0,stretch:-20,depth:100,modifier:3,slideShadows:!1},observer:!0,observeParents:!0},info:[],activeIndex:0}},mounted:function(){this.getIndex();var e=this;this.swiper.on("slideChange",function(){e.activeIndex=e.swiper.activeIndex})},computed:{swiper:function(){return this.$refs.mySwiper.swiper}},methods:{getIndex:function(){var e=this;Object(a["z"])().then(function(s){e.info=s.data},function(s){e.$dialog.message(s.msg)})}}},o=c,d=(t("a8fd"),t("2877")),p=Object(d["a"])(o,i,r,!1,null,null,null);s["default"]=p.exports},a45b:function(e,s,t){},a8fd:function(e,s,t){"use strict";var i=t("a45b"),r=t.n(i);r.a}}]);
//# sourceMappingURL=chunk-2df2bc60.e89fcf32.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-352a53ed"],{"0636":function(s,t,i){"use strict";i.r(t);var n=function(){var s=this,t=s.$createElement,i=s._self._c||t;return i("div",{staticClass:"sign"},[i("div",{staticClass:"header bg-color-red"},[i("div",{staticClass:"headerCon acea-row row-between-wrapper"},[i("div",{staticClass:"left acea-row row-between-wrapper"},[i("div",{staticClass:"pictrue"},[i("img",{attrs:{src:s.userInfo.avatar}})]),i("div",{staticClass:"text"},[i("div",{staticClass:"line1"},[s._v(s._s(s.userInfo.nickname))]),i("div",{staticClass:"integral acea-row"},[i("span",[s._v("积分: "+s._s(s.userInfo.integral))])])])]),i("router-link",{staticClass:"right acea-row row-middle",attrs:{to:"/user/sign_record"}},[i("div",{staticClass:"iconfont icon-caidan"}),i("div",[s._v("明细")])])],1)]),i("div",{staticClass:"wrapper"},[i("div",{staticClass:"list acea-row row-between-wrapper"},s._l(s.signSystemList,function(t,n){return i("div",{key:n,staticClass:"item"},[i("div",{class:n+1===s.signSystemList.length?"rewardTxt":""},[s._v("\n "+s._s(t.day)+"\n ")]),i("div",{staticClass:"venus",class:(n+1===s.signSystemList.length?"reward":"")+" "+(s.sign_index>=n+1?"venusSelect":"")}),i("div",{staticClass:"num",class:s.sign_index>=n+1?"on":""},[s._v("\n +"+s._s(t.sign_num)+"\n ")])])}),0),i("div",{staticClass:"but bg-color-red",class:s.userInfo.is_day_sgin?"on":"",on:{click:s.goSign}},[s._v("\n "+s._s(s.userInfo.is_day_sgin?"已签到":"立即签到")+"\n ")]),i("div",{staticClass:"lock"})]),i("div",{staticClass:"wrapper wrapper2"},[i("div",{staticClass:"tip"},[s._v("已累计签到")]),i("div",{staticClass:"list2 acea-row row-center row-bottom"},[s._l(s.signCount,function(t,n){return i("div",{key:n,staticClass:"item"},[s._v("\n "+s._s(t||0)+"\n ")])}),i("div",{staticClass:"data"},[s._v("天")])],2),i("div",{staticClass:"tip2"},[s._v("\n 据说连续签到第"+s._s(s.day)+"天可获得超额积分,一定要坚持签到哦~~~\n ")]),i("div",{staticClass:"list3"},[s._l(s.signList,function(t,n){return i("div",{key:n,staticClass:"item acea-row row-between-wrapper"},[i("div",[i("div",{staticClass:"name line1"},[s._v(s._s(t.title))]),i("div",{staticClass:"data"},[s._v(s._s(t.add_time))])]),i("div",{staticClass:"num font-color-red"},[s._v("+"+s._s(t.number))])])}),s.signList.length>0?i("router-link",{staticClass:"Loads acea-row row-center-wrapper",attrs:{to:"/user/sign_record"}},[s._v("\n 点击加载更多\n "),i("div",{staticClass:"iconfont icon-xiangyou acea-row row-center-wrapper"})]):s._e()],2)]),i("div",{staticClass:"signTip acea-row row-center-wrapper",class:!0===s.active?"on":""},[i("div",{staticClass:"signTipLight loadingpic"}),i("div",{staticClass:"signTipCon"},[i("div",{staticClass:"state"},[s._v("签到成功")]),i("div",{staticClass:"integral"},[s._v("获得"+s._s(s.integral)+"积分")]),i("div",{staticClass:"signTipBnt",on:{click:s.close}},[s._v("好的")])])]),i("div",{staticClass:"mask",attrs:{hidden:!1===s.active},on:{touchmove:function(s){s.preventDefault()}}})])},a=[],e=(i("28a5"),i("c24f")),r=i("9fd0"),c={name:"Sign",components:{},props:{},data:function(){return{userInfo:{},integral:0,signCount:[],sign_index:0,signSystemList:[],signList:[],page:1,limit:3,active:!1,day:""}},mounted:function(){this.signUser(),this.signConfig(),this.getSignList()},methods:{PrefixInteger:function(s,t){return(Array(t).join("0")+s).slice(-t).split("")},Rp:function(s){var t=["零","一","二","三","四","五","六","七","八","九"],i="";s=""+s;for(var n=0;n<s.length;n++)i+=t[parseInt(s.charAt(n))];return i},signUser:function(){var s=this;Object(e["N"])({sign:1}).then(function(t){t.data.integral=parseInt(t.data.integral);var i=t.data.sum_sgin_day;s.userInfo=t.data,s.signCount=s.PrefixInteger(i,4),s.sign_index=parseInt(t.data.sign_num)})},signConfig:function(){var s=this;Object(e["w"])().then(function(t){s.signSystemList=t.data,s.day=s.Rp(s.signSystemList.length)})},goSign:function(){var s=this,t=s.userInfo.sum_sgin_day;if(s.userInfo.is_day_sgin)return s.$dialog.toast({mes:"您今日已签到!"});Object(e["M"])().then(function(i){s.active=!0,s.integral=i.data.integral;var n=parseInt(s.sign_index+1);s.sign_index=n>s.signSystemList.length?1:n,s.signCount=s.PrefixInteger(t+1,4),s.userInfo.is_day_sgin=!0,s.userInfo.integral=Object(r["a"])(s.userInfo.integral,i.data.integral),s.getSignList()})},getSignList:function(){var s=this;Object(e["x"])(s.page,s.limit).then(function(t){s.signList=t.data})},close:function(){this.active=!1}}},o=c,l=(i("210b"),i("2877")),d=Object(l["a"])(o,n,a,!1,null,"67d3757c",null);t["default"]=d.exports},"210b":function(s,t,i){"use strict";var n=i("2165"),a=i.n(n);a.a},2165:function(s,t,i){}}]);
//# sourceMappingURL=chunk-352a53ed.d0c010cf.js.map

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More