From a1a4bd4c03185bd4f630fb0dc2563fb71822ef3c Mon Sep 17 00:00:00 2001
From: lccsw <805383944@qq.com>
Date: Wed, 12 Oct 2022 11:11:23 +0800
Subject: [PATCH] edit-item-pay
---
home/controllers/h5/market/sylive/Act.php | 82 ++++++++++++++++-----
home/views/h5/market/sylive/act/index.php | 2 +-
home/views/h5/market/sylive/act/item.php | 49 +++++++-----
home/views/h5/market/sylive/act/ucenter.php | 61 +++++++++------
home/views/h5/market/sylive/header.php | 2 +-
home/views/h5/market/sylive/login.php | 2 +-
www/home/css/h5/market/sylive/h5.css | 2 +-
7 files changed, 135 insertions(+), 65 deletions(-)
diff --git a/home/controllers/h5/market/sylive/Act.php b/home/controllers/h5/market/sylive/Act.php
index ddee650f..d7690b7e 100644
--- a/home/controllers/h5/market/sylive/Act.php
+++ b/home/controllers/h5/market/sylive/Act.php
@@ -6,6 +6,7 @@ class Act extends Wx {
private $group_id;
private $secretkey = '7a23vx9257';
+ private $item_banner = ['https://qs.haodian.cn/web/images/project/H5-ShiYu/goods.jpg'];
public function __construct(){
parent::__construct();
@@ -105,6 +106,9 @@ class Act extends Wx {
}else{
$info['live_url'] = "https://live.liche.cn/watch/{$row['channelId']}?userid={$userid}&ts={$ts}&sign={$sign}";
}
+ //判断是否支付商品
+ $is_pay = $this->market_sylive_order_model->count(['item_id'=>$a_id,'status'=>1,'uid'=>$this->uid]);
+ $info['is_pay'] = $is_pay ? 1 : 0;
$this->data['info'] = $info;
$this->data['sign_package'] = $sign_package;
$this->data['share'] = $share;
@@ -241,12 +245,17 @@ class Act extends Wx {
$jsondata = json_decode($row['jsondata'],true);
$item = $jsondata['item'] ? $jsondata['item'] : [];
$is_pay = $this->market_sylive_order_model->count(['item_id'=>$a_id,'status'=>1,'uid'=>$this->uid]);
+ if($is_pay){
+ $url = http_host_com('home').'/h5/market/sylive/act/ucenter?skey='.$skey;
+ redirect($url);exit;
+ }
$e_time = time() < strtotime($row['timeEnd']) ? strtotime($row['timeEnd']) - time() : 0;
- $banner = [];
- if($item['itemImg']){
- foreach ($item['itemImg'] as $value) {
- $banner[] = build_qiniu_image_url($value);
- }
+ $banner = $this->item_banner;
+ $validity = '';
+ if($item['useTimeStart'] || $item['useTimeEnd']){
+ $useTimeStart = date('Y-m-d',strtotime($item['useTimeStart']));
+ $useTimeEnd = date('Y-m-d',strtotime($item['useTimeEnd']));
+ $validity = "有效期 {$useTimeStart} - {$useTimeEnd}";
}
$info = [
'title' => $item['title'] ? $item['title'] : '',
@@ -255,7 +264,7 @@ class Act extends Wx {
'content' => $item['introduction'] ? $item['introduction'] : '',
'banner' => $banner,
'skey' => $skey,
- 'is_pay' => $is_pay
+ 'validity' => $validity
];
$this->data['info'] = $info;
$this->data['_title'] = $row['title'];
@@ -322,21 +331,60 @@ class Act extends Wx {
if(!$row){
throw new Hd_exception('参数错误',400);
}
+ $order = $this->market_sylive_order_model->get(['uid'=>$this->uid,'status'=>1,'item_id'=>$a_id]);
+ if(!$order){
+ $url = http_host_com('home').'/h5/market/sylive/act/item?skey='.$skey;
+ redirect($url);exit;
+ }
$jsondata = json_decode($row['jsondata'],true);
$item = $jsondata['item'] ? $jsondata['item'] : [];
- $banner = [];
- if($item['itemImg']){
- foreach ($item['itemImg'] as $value) {
- $banner[] = build_qiniu_image_url($value);
- }
+ $validity = '';
+ if($item['useTimeStart'] || $item['useTimeEnd']){
+ $useTimeStart = date('Y-m-d',strtotime($item['useTimeStart']));
+ $useTimeEnd = date('Y-m-d',strtotime($item['useTimeEnd']));
+ $validity = "有效期 {$useTimeStart} - {$useTimeEnd}";
+ }
+ $order = [
+ 'uname' => $order['uname'] ? $order['uname'] : '',
+ 'utel' => $order['mobile'] ? $order['mobile'] : '',
+ 'slogan' => '尊享您的直播好礼',
+ 'valid_time' => $validity,
+ 'oid' => $order['sid'],
+ 'c_time' => date('Y-m-d H:i:s'),
+ ];
+ $if_pid = 0;
+ $ac_user = $this->act_user_model->get(['userId'=>$this->uid,'activityId'=>$a_id],'channelId');
+ $ac_user['channelId'] && $pid_user = $this->user_model->get(['userId'=>$ac_user['channelId']],'uname,organizationId,mobile');
+ $gw_tel = $gw_slogan = $gw_title = '';
+ if($ac_user['channelId'] && $pid_user['organizationId']>0){
+ $group_id = $this->sylive_entity->get_level($pid_user['organizationId']);
+ if($group_id==3){ //顾问
+ $if_pid = 1;
+ $where = [
+ "organizationId in (select parentId from lc_market_sylive_organization where organizationId={$pid_user['organizationId']})" => null
+ ];
+ $org = $this->market_sylive_organization_model->get($where);
+ }elseif($group_id==2){ //店长
+ $if_pid = 1;
+ $where = [
+ "organizationId" => $pid_user['organizationId']
+ ];
+ $org = $this->market_sylive_organization_model->get($where);
+ }
+ $gw_title = $org['organizationName'];
+ $gw_slogan = $pid_user['uname'].'·您的专属的福利官';
+ $gw_tel = $pid_user['mobile'];
}
- $order = $this->market_sylive_order_model->get(['uid'=>$this->uid,'status'=>1,'item_id'=>$a_id]);
$info = [
- 'title' => $item['title'],
- 'content' => $item['introduction'],
- 'banner' => $banner,
- 'state' => $order ? 0 : 1,
- 'text' => $order ? '已抢购' : '未抢购',
+ 'bg' => "https://qs.haodian.cn/web/images/project/H5-ShiYu/mine-bg.jpg",
+ 'logo' => "https://qs.haodian.cn/web/images/project/H5-ShiYu/goodslogo.jpg",
+ 'if_pid' => $if_pid,
+ 'title' => $gw_title,
+ 'slogan' => $gw_slogan,
+ 'cust_tel' => $gw_tel,
+ 'introTitle' => '权益说明',
+ 'content' => $item['introduction'] ? $item['introduction'] : '',
+ 'order' => $order,
'skey' => $skey
];
$this->data['info'] = $info;
diff --git a/home/views/h5/market/sylive/act/index.php b/home/views/h5/market/sylive/act/index.php
index ce23832b..d51405b2 100644
--- a/home/views/h5/market/sylive/act/index.php
+++ b/home/views/h5/market/sylive/act/index.php
@@ -31,7 +31,7 @@
-
+