market_activity_1121_2
This commit is contained in:
@@ -99,7 +99,7 @@ class Draw extends CI_Controller
|
||||
}
|
||||
$winTypeAry = $this->mdSyliveOrder->winTypeAry($activityId);
|
||||
$price = $winTypeAry[$winType]['price'];
|
||||
$limit = $winNum >= 50 ? 100 : 30;
|
||||
$limit = $winNum >= 50 ? 100 : 50;
|
||||
//随机数据
|
||||
$sql = "SELECT id,userId,mobile,uname,totalPrice FROM lc_market_sylive_order WHERE activityId={$activityId}
|
||||
AND win=0 AND status=1 AND totalPrice>={$price} ORDER BY RAND() LIMIT {$limit}";
|
||||
|
||||
@@ -90,12 +90,18 @@
|
||||
<a class="text-middle inline-block bg-1282f4 ml10 mr10 pt10 pb10 pl20 pr20 text-center font-18 color-fff ulib-r5"
|
||||
v-if="draw.list.length>0" href="javascript:;" @click="start">开始抽奖</a>
|
||||
</span>
|
||||
<a v-else
|
||||
class="text-middle inline-block bg-1282f4 ml10 mr10 pt10 pb10 pl20 pr20 text-center font-18 color-fff ulib-r5"
|
||||
href="javascript:;" @click="result">立即开奖</a>
|
||||
<div class="absolute left-0 right-0 top-0 pt10 font-14 color-eb5359 text-bold">{{msgTip}}</div>
|
||||
<span v-else>
|
||||
<a class="text-middle inline-block bg-1282f4 ml10 mr10 pt10 pb10 pl20 pr20 text-center font-18 color-fff ulib-r5"
|
||||
href="javascript:;" @click="result">立即开奖</a>
|
||||
<a v-if="!isShowReset"
|
||||
class="text-middle inline-block bg-aaa ml10 mr10 pt10 pb10 pl20 pr20 text-center font-18 color-fff ulib-r5"
|
||||
href="javascript:;" @click="isShowReset = true">放弃开奖</a>
|
||||
<a v-else
|
||||
class="text-middle inline-block bg-aaa ml10 mr10 pt10 pb10 pl20 pr20 text-center font-18 color-fff ulib-r5"
|
||||
href="javascript:;" @click="reset">确认放弃开奖</a>
|
||||
</span>
|
||||
<div class=" absolute left-0 right-0 top-0 pt10 font-14 color-eb5359 ">{{msgTip}}</div>
|
||||
</div>
|
||||
|
||||
<!--隐藏加载数据-->
|
||||
<div class="absolute left-0 bottom-0 op0 overflowhidden" style="width:50px;height:50px;">
|
||||
<div v-for="item in draw.list">
|
||||
@@ -150,6 +156,7 @@
|
||||
isStartAc: false,
|
||||
isOpen: false,
|
||||
isShowLogin: true,
|
||||
isShowReset: false,
|
||||
drawCode: '',
|
||||
msgTip: ''
|
||||
},
|
||||
@@ -195,6 +202,7 @@
|
||||
if (that.isSubmiting) return;
|
||||
clearTimeout(that.timer);
|
||||
that.msgTip = "";
|
||||
this.isShowReset = false;
|
||||
if (!that.isOpen && that.winNum > 0) {
|
||||
that.draw = {list: [], result: [], type: 0, prizeUrl: ''};
|
||||
that.list = [];
|
||||
@@ -319,6 +327,15 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
//放弃开奖
|
||||
reset() {
|
||||
//提交中奖数据
|
||||
clearTimeout(this.timer);
|
||||
this.list = [];
|
||||
this.draw = {list: [], result: [], type: 0, prizeUrl: ''};
|
||||
this.isStartAc = false;
|
||||
this.isOpen = true;
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -135,11 +135,12 @@ class Activity extends BaseController
|
||||
}
|
||||
$skey = $this->myencryption->base64url_encode("a_id=" . $activityId);
|
||||
$url = http_host_com('home') . "/h5/market/sylive?skey=" . $skey;//活动连接
|
||||
$serviceLink = $jsondata['serviceLink'] ? $jsondata['serviceLink'] : '';
|
||||
$list[] = [
|
||||
'activityId' => $activityId, 'title' => $v['title'], 'channelId' => $v['channelId'], 'bizIds' => $bizIds, 'teamIds' => $teamIds, 'pay' => $pay,
|
||||
'introduction' => $v['introduction'], 'shareTitle' => $shareTitle, 'dateRange' => $dateRange, 'coupon' => $coupon, 'drawCode' => $v['drawCode'],
|
||||
'bgImg' => $bgImg, 'channelImg' => $channelImg, 'banner' => $banner, 'sharePhoto' => $sharePhoto, 'shareImg' => $shareImg, 'item' => $item, 'url' => $url,
|
||||
'mchId' => $v['mchId'], 'protocolTitle' => $v['protocolTitle'], 'protocol' => $v['protocol']
|
||||
'mchId' => $v['mchId'], 'protocolTitle' => $v['protocolTitle'], 'protocol' => $v['protocol'], 'serviceLink' => $serviceLink
|
||||
, 's_time' => $v['timeStart'], 'e_time' => $v['timeEnd'], 'status' => $status, 'createTime' => $v['createTime']];
|
||||
}
|
||||
}
|
||||
@@ -171,6 +172,7 @@ class Activity extends BaseController
|
||||
$mchId = $this->input_param('mchId');
|
||||
$protocolTitle = $this->input_param('protocolTitle');
|
||||
$protocol = $this->input_param('protocol');
|
||||
$serviceLink = $this->input_param('serviceLink');
|
||||
if (!$title) {
|
||||
$this->return_json('请输入活动标题');
|
||||
}
|
||||
@@ -211,6 +213,7 @@ class Activity extends BaseController
|
||||
}
|
||||
$jsondata['pay'] = $pay;
|
||||
$jsondata['banner'] = $banner;
|
||||
$jsondata['serviceLink'] = $serviceLink;
|
||||
$jsondata = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
|
||||
$addDate = ['title' => $title, 'bgImg' => $bgImg, 'channelImg' => $channelImg, 'channelId' => $channelId, 'jsondata' => $jsondata
|
||||
, 'introduction' => $introduction, 'shareTitle' => $shareTitle, 'sharePhoto' => $sharePhoto, 'shareImg' => $setShareImg
|
||||
@@ -310,6 +313,7 @@ class Activity extends BaseController
|
||||
$mchId = $this->input_param('mchId');
|
||||
$protocolTitle = $this->input_param('protocolTitle');
|
||||
$protocol = $this->input_param('protocol');
|
||||
$serviceLink = $this->input_param('serviceLink');
|
||||
if (!$activityId) {
|
||||
$this->return_json('参数错误');
|
||||
}
|
||||
@@ -411,6 +415,7 @@ class Activity extends BaseController
|
||||
}
|
||||
$jsondata['pay'] = $pay;
|
||||
$jsondata['banner'] = $banner;
|
||||
$jsondata['serviceLink'] = $serviceLink;
|
||||
$jsondata = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
|
||||
$organizationIds = $organizationIds ? ',' . implode(',', $organizationIds) . ',' : '';
|
||||
$upDate = ['title' => $title, 'bgImg' => $bgImg, 'channelImg' => $channelImg, 'channelId' => $channelId, 'introduction' => $introduction,
|
||||
|
||||
@@ -148,7 +148,8 @@ class Statistics extends BaseController
|
||||
$itemId = intval($this->input_param('itemId'));//商品
|
||||
!$page && $page = 1;
|
||||
!$limit && $limit = 100;
|
||||
$list = [];
|
||||
$list = $legendData = $yAxisSeries = [];
|
||||
$xAxisData = ['参与门店数', '参与顾问数', '全部顾问数', '浏览数', '预约数', '观看数', '订单数', '观看数', '人均观看'];
|
||||
$re = $this->mdSyliveActivity->get(['activityId' => $activityId]);
|
||||
if ($re) {
|
||||
$type = 0;
|
||||
@@ -198,7 +199,12 @@ class Statistics extends BaseController
|
||||
$allConsultant = $this->mdSyliveUser->count(["organizationId in({$str_organizationIds})" => null, 'status>=' => 0, 'organizationId>' => 0]);
|
||||
}
|
||||
$consultant > $allConsultant && $allConsultant = $consultant;
|
||||
$list[] = ['areaName' => $re_area['organizationName'], 'biz' => count($v['biz']), 'consultant' => $consultant . '/' . $allConsultant
|
||||
$biz = count($v['biz']);
|
||||
$organizationName = $re_area['organizationName'] ? $re_area['organizationName'] : '-';
|
||||
$legendData[] = $organizationName;
|
||||
$yAxisSeries[] = ['name' => $organizationName, 'type' => 'line'
|
||||
, 'data' => [$biz, $consultant, $allConsultant, $browse, $subscribe, $watch, $orderTotal, $livePV, $watchDuration]];
|
||||
$list[] = ['areaName' => $organizationName, 'biz' => $biz, 'consultant' => $consultant . '/' . $allConsultant
|
||||
, 'browse' => $browse, 'subscribe' => $subscribe, 'watch' => $watch, 'order' => $orderTotal
|
||||
, 'livePV' => $livePV, 'watchDuration' => $watchDuration];
|
||||
}
|
||||
@@ -218,7 +224,7 @@ class Statistics extends BaseController
|
||||
$orderTotal = $this->mdSyliveActivityKpidata->count(['kpi' => 'order', 'areaId' => $areaId, 'type' => $type, 'itemId' => $itemId, 'activityId' => $activityId]);
|
||||
} else {
|
||||
$sumOrder = $this->mdSyliveActivityBiz->sum('orderTotal', ['areaId' => $areaId, 'activityId' => $activityId]);
|
||||
$orderTotal = $sumOrder['orderTotal'];
|
||||
$orderTotal = intval($sumOrder['orderTotal']);
|
||||
}
|
||||
$livePV = $watchDuration = 0;
|
||||
if ($channelId) {
|
||||
@@ -236,8 +242,16 @@ class Statistics extends BaseController
|
||||
$allConsultant = $this->mdSyliveUser->count(["organizationId in({$str_organizationIds})" => null, 'status>=' => 0, 'organizationId>' => 0]);
|
||||
}
|
||||
$consultant > $allConsultant && $allConsultant = $consultant;
|
||||
$list[] = ['areaName' => $re_area['organizationName'], 'biz' => count($v['biz']), 'consultant' => $consultant . '/' . $allConsultant
|
||||
, 'browse' => $browse['browse'], 'subscribe' => $subscribe['subscribe'], 'watch' => $watch['watch'], 'order' => $orderTotal
|
||||
$biz = count($v['biz']);
|
||||
$browse = intval($browse['browse']);
|
||||
$subscribe = intval($subscribe['subscribe']);
|
||||
$watch = intval($watch['watch']);
|
||||
$organizationName = $re_area['organizationName'] ? $re_area['organizationName'] : '-';
|
||||
$legendData[] = $organizationName;
|
||||
$yAxisSeries[] = ['name' => $organizationName, 'type' => 'line'
|
||||
, 'data' => [$biz, $consultant, $allConsultant, $browse, $subscribe, $watch, $orderTotal, $livePV, $watchDuration]];
|
||||
$list[] = ['areaName' => $organizationName, 'biz' => $biz, 'consultant' => $consultant . '/' . $allConsultant
|
||||
, 'browse' => $browse, 'subscribe' => $subscribe, 'watch' => $watch, 'order' => $orderTotal
|
||||
, 'livePV' => $livePV, 'watchDuration' => $watchDuration];
|
||||
}
|
||||
}
|
||||
@@ -248,7 +262,9 @@ class Statistics extends BaseController
|
||||
array_multisort($sortKey, $order, $list);
|
||||
$count = count($list);
|
||||
//$list = array_splice($list, 0, $limit);
|
||||
$date = ['list' => $list, 'count' => $count];
|
||||
//折线图数据
|
||||
$chart = ['legendData' => $legendData, 'xAxisData' => $xAxisData, 'yAxisSeries' => $yAxisSeries];
|
||||
$date = ['list' => $list, 'count' => $count, 'chart' => $chart];
|
||||
$this->return_response_list($date);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user