@ -0,0 +1,949 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
|
|||
class Housekeep |
|||
{ |
|||
/** |
|||
* Comment: 默认服务类型列表 |
|||
* Author: wlf |
|||
* Date: 2021/03/31 15:33 |
|||
* @return array |
|||
*/ |
|||
public static function defaultType() |
|||
{ |
|||
global $_W; |
|||
return [ |
|||
[ |
|||
'title' => '殡葬服务', |
|||
'img' => $_W['siteroot'].'addons/'.MODULE_NAME.'/plugin/housekeep/web/resource/image/bzfw.png', |
|||
'list' => [ |
|||
'墓地', |
|||
'殡葬用品', |
|||
'白事承办' |
|||
], |
|||
], |
|||
[ |
|||
'title' => '管道疏通', |
|||
'img' => $_W['siteroot'].'addons/'.MODULE_NAME.'/plugin/housekeep/web/resource/image/gdst.png', |
|||
'list' => [ |
|||
'马桶疏通', |
|||
'下水道疏通', |
|||
'管道安装改造', |
|||
'打捞', |
|||
'化粪池清理', |
|||
], |
|||
], |
|||
[ |
|||
'title' => '门锁服务', |
|||
'img' => $_W['siteroot'].'addons/'.MODULE_NAME.'/plugin/housekeep/web/resource/image/msfw.png', |
|||
'list' => [ |
|||
'开锁', |
|||
'换锁', |
|||
'修锁', |
|||
'配钥匙', |
|||
], |
|||
], |
|||
[ |
|||
'title' => '房屋维护', |
|||
'img' => $_W['siteroot'].'addons/'.MODULE_NAME.'/plugin/housekeep/web/resource/image/fwwx.png', |
|||
'list' => [ |
|||
'卫浴安装维修', |
|||
'灶具安装维修', |
|||
'灯具安装维修', |
|||
'防水补漏', |
|||
'电路安装维修', |
|||
'打孔', |
|||
'粉刷防腐', |
|||
'门窗安装维修', |
|||
'暖气安装维修', |
|||
], |
|||
], |
|||
[ |
|||
'title' => '家电维修', |
|||
'img' => $_W['siteroot'].'addons/'.MODULE_NAME.'/plugin/housekeep/web/resource/image/jdwx.png', |
|||
'list' => [ |
|||
'电视维修', |
|||
'冰箱维修', |
|||
'空调维修', |
|||
'洗衣机维修', |
|||
'厨房家电维修', |
|||
'热水器维修', |
|||
], |
|||
], |
|||
[ |
|||
'title' => '衣服洗护', |
|||
'img' => $_W['siteroot'].'addons/'.MODULE_NAME.'/plugin/housekeep/web/resource/image/ywxf.png', |
|||
'list' => [ |
|||
'洗衣店', |
|||
'皮具养护', |
|||
'衣服鞋包改制', |
|||
], |
|||
], |
|||
[ |
|||
'title' => '生活配送', |
|||
'img' => $_W['siteroot'].'addons/'.MODULE_NAME.'/plugin/housekeep/web/resource/image/shpt.png', |
|||
'list' => [ |
|||
'跑腿服务', |
|||
'蔬菜水果', |
|||
'粮油副食', |
|||
'液化气煤气', |
|||
'桶装水', |
|||
'医院挂号', |
|||
'代排队', |
|||
'派发传单', |
|||
'机场接送', |
|||
'专人专送', |
|||
], |
|||
], |
|||
[ |
|||
'title' => '鲜花绿植', |
|||
'img' => $_W['siteroot'].'addons/'.MODULE_NAME.'/plugin/housekeep/web/resource/image/xhlz.png', |
|||
'list' => [ |
|||
'鲜花', |
|||
'绿植盆栽', |
|||
'园林园艺', |
|||
'仿真花饰', |
|||
], |
|||
], |
|||
[ |
|||
'title' => '二手回收', |
|||
'img' => $_W['siteroot'].'addons/'.MODULE_NAME.'/plugin/housekeep/web/resource/image/eshs.png', |
|||
'list' => [ |
|||
'手机回收', |
|||
'电器回收', |
|||
'家具回收', |
|||
'数码回收', |
|||
'金银回收', |
|||
'奢侈品回收', |
|||
'设备回收', |
|||
'建筑废料', |
|||
'库存积压', |
|||
'纺织皮革', |
|||
], |
|||
], |
|||
[ |
|||
'title' => '搬家搬运', |
|||
'img' => $_W['siteroot'].'addons/'.MODULE_NAME.'/plugin/housekeep/web/resource/image/bjby.png', |
|||
'list' => [ |
|||
'居民搬家', |
|||
'空调移机', |
|||
'公司搬家', |
|||
'搬家搬场', |
|||
'长途搬家', |
|||
'设备搬迁', |
|||
'起重吊装', |
|||
], |
|||
], |
|||
[ |
|||
'title' => '保姆月嫂', |
|||
'img' => $_W['siteroot'].'addons/'.MODULE_NAME.'/plugin/housekeep/web/resource/image/bmys.png', |
|||
'list' => [ |
|||
'保姆', |
|||
'钟点工', |
|||
'月嫂', |
|||
'陪护', |
|||
'育婴育儿师', |
|||
'催乳师', |
|||
], |
|||
], |
|||
[ |
|||
'title' => '保洁清洗', |
|||
'img' => $_W['siteroot'].'addons/'.MODULE_NAME.'/plugin/housekeep/web/resource/image/bjqx.png', |
|||
'list' => [ |
|||
'家庭保洁', |
|||
'物业保洁', |
|||
'开荒保洁', |
|||
'高空清洗', |
|||
'灯具清洗', |
|||
'油烟机清洗', |
|||
'地毯清洗', |
|||
'空调清洗', |
|||
'沙发清洗', |
|||
'地板打蜡', |
|||
'石材养护翻新', |
|||
'玻璃清洗', |
|||
'墙纸清洗', |
|||
'除虫除蚁', |
|||
'空气净化', |
|||
], |
|||
], |
|||
]; |
|||
} |
|||
/** |
|||
* Comment: 获取服务类目列表 |
|||
* Author: wlf |
|||
* Date: 2021/04/12 10:54 |
|||
* @return array |
|||
*/ |
|||
public static function getCategory() |
|||
{ |
|||
global $_W; |
|||
//一级分类获取 |
|||
$categoryes = pdo_getall(PDO_NAME.'housekeep_type',[ |
|||
'uniacid' => $_W['uniacid'], |
|||
'aid' => $_W['aid'], |
|||
'status' => 1, |
|||
'onelevelid' => 0 |
|||
],['id','title'],'','sort DESC,id DESC'); |
|||
//二级分类信息获取 |
|||
foreach ($categoryes as $key => &$val) { |
|||
$val['list'] = pdo_getall(PDO_NAME.'housekeep_type',[ |
|||
'uniacid' => $_W['uniacid'], |
|||
'aid' => $_W['aid'], |
|||
'status' => 1, |
|||
'onelevelid' => $val['id'], |
|||
],['id','title'],'','sort DESC,id DESC'); |
|||
//兼容 删除没有二级分类的一级分类信息 |
|||
if (!$val['list']) { |
|||
unset($categoryes[$key]); |
|||
} |
|||
} |
|||
$newcategoryes = []; |
|||
foreach ($categoryes as $ca){ |
|||
$newcategoryes[] = $ca; |
|||
} |
|||
return $newcategoryes; |
|||
} |
|||
/** |
|||
* Comment: 获取商户服务类目列表 |
|||
* Author: wlf |
|||
* Date: 2021/05/24 10:54 |
|||
* @return array |
|||
*/ |
|||
public static function getStoreCategory($sid,$type){ |
|||
global $_W; |
|||
if($type == 1){ |
|||
$type = 3; |
|||
} |
|||
//一级获取 |
|||
$categoryes = pdo_fetchall("SELECT distinct a.id,a.title FROM ".tablename(PDO_NAME."housekeep_type")." a LEFT JOIN".tablename('wlmerchant_housekeep_relation')." b ON a.id = b.onelevelid WHERE a.uniacid = {$_W['uniacid']} AND a.aid = {$_W['aid']} AND a.status = 1 AND a.onelevelid = 0 AND b.type = {$type} AND b.objid = {$sid} ORDER BY a.sort DESC,a.id DESC"); |
|||
//二级分类信息获取 |
|||
foreach ($categoryes as $key => &$val) { |
|||
$val['list'] = pdo_fetchall("SELECT distinct a.id,a.title FROM ".tablename(PDO_NAME."housekeep_type")." a LEFT JOIN".tablename('wlmerchant_housekeep_relation')." b ON a.id = b.twolevelid WHERE a.uniacid = {$_W['uniacid']} AND a.aid = {$_W['aid']} AND a.status = 1 AND a.onelevelid = {$val['id']} AND b.type = {$type} AND b.objid = {$sid} ORDER BY a.sort DESC,a.id DESC"); |
|||
//兼容 删除没有二级分类的一级分类信息 |
|||
if (!$val['list']) { |
|||
unset($categoryes[$key]); |
|||
} |
|||
} |
|||
return $categoryes; |
|||
} |
|||
|
|||
/** |
|||
* Comment: 处理图片集 |
|||
* Author: wlf |
|||
* Date: 2021/04/28 15:16 |
|||
* @return array |
|||
*/ |
|||
public static function beautifyImgInfo($imgs) |
|||
{ |
|||
global $_W; |
|||
$imgs = unserialize($imgs); |
|||
if (empty($imgs)) { |
|||
$imgs = []; |
|||
} else { |
|||
foreach ($imgs as &$th) { |
|||
$th = tomedia($th); |
|||
} |
|||
} |
|||
return $imgs; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 查询关联服务类目 |
|||
* Author: wlf |
|||
* Date: 2021/05/06 15:29 |
|||
* @return array |
|||
*/ |
|||
public static function getRelation($id,$type,$more = 0){ |
|||
if(empty($id)){ |
|||
$catearray = []; |
|||
}else{ |
|||
if($more > 0){ |
|||
$catearray = pdo_fetchall("SELECT b.id,b.title FROM ".tablename('wlmerchant_housekeep_relation')." a LEFT JOIN".tablename('wlmerchant_housekeep_type')." b ON a.twolevelid = b.id WHERE a.objid = {$id} AND a.type = {$type} ORDER BY b.sort DESC,b.id DESC"); |
|||
}else{ |
|||
$catearray = pdo_fetchall("SELECT b.title FROM ".tablename('wlmerchant_housekeep_relation')." a LEFT JOIN".tablename('wlmerchant_housekeep_type')." b ON a.twolevelid = b.id WHERE a.objid = {$id} AND a.type = {$type} ORDER BY b.sort DESC,b.id DESC"); |
|||
$catearray = array_column($catearray,'title'); |
|||
} |
|||
} |
|||
return $catearray; |
|||
} |
|||
|
|||
/** |
|||
* Comment: 查询评论详细信息 |
|||
* Author: wlf |
|||
* Date: 2021/05/08 18:55 |
|||
* @return array |
|||
*/ |
|||
public static function getCommentInfo($com){ |
|||
global $_W; |
|||
$member = pdo_get('wlmerchant_member',array('id' => $com['mid']),array('nickname','avatar')); |
|||
$com['nickname'] = $member['nickname']; |
|||
$com['avatar'] = tomedia($member['avatar']); |
|||
$com['createtime'] = date('m-d H:i',$com['createtime']); |
|||
$com['pic'] = Housekeep::beautifyImgInfo($com['pic']); |
|||
$com['replypicone'] = Housekeep::beautifyImgInfo($com['replypicone']); |
|||
$com['replytotal'] = pdo_fetchcolumn('SELECT count(id) FROM '.tablename('wlmerchant_housekeep_reply')." WHERE cid = {$com['id']}"); |
|||
$com['praisetotal'] = pdo_fetchcolumn('SELECT count(id) FROM '.tablename('wlmerchant_housekeep_praise')." WHERE cid = {$com['id']}"); |
|||
$com['replylist'] = pdo_fetchall("SELECT a.id,a.content,b.nickname FROM ".tablename(PDO_NAME."housekeep_reply")." a LEFT JOIN".tablename('wlmerchant_member')." b ON a.smid = b.id WHERE cid = {$com['id']} LIMIT 5"); |
|||
$com['praiseflag'] = pdo_getcolumn(PDO_NAME.'housekeep_praise',array('cid'=>$com['id'],'mid'=>$_W['mid']),'id'); |
|||
$com['praiseflag'] = $com['praiseflag'] ? 1 : 0; |
|||
return $com; |
|||
} |
|||
|
|||
/** |
|||
* Comment: 判断是否需要审核 |
|||
* Author: wlf |
|||
* Date: 2021/05/19 17:31 |
|||
* $type 1=商户 2个人 |
|||
* $$project 1=需求 2=服务 |
|||
* @return array |
|||
*/ |
|||
public static function getStatus($type,$objid,$set,$project){ |
|||
//判断权限以及是否需要审核 |
|||
$objname = ''; |
|||
if($type == 1){ |
|||
if($project == 1){ |
|||
if($set['demandpass'] == 2){ |
|||
$attinfo = Attestation::checkAttestation(2,$objid); |
|||
if(empty($attinfo['attestation'])){ |
|||
$check = 1; |
|||
} |
|||
}else if(empty($set['demandpass'])){ |
|||
$check = 1; |
|||
} |
|||
}else if($project == 2){ |
|||
$merchant = pdo_get('wlmerchant_merchantdata',array('id' => $objid),array('storename','groupid')); |
|||
$objname = $merchant['storename']; |
|||
if($set['servicepass'] == 2){ |
|||
$attinfo = Attestation::checkAttestation(2,$objid); |
|||
if(empty($attinfo['attestation'])){ |
|||
$check = 1; |
|||
} |
|||
}else if(empty($set['servicepass'])){ |
|||
$check = 1; |
|||
} |
|||
} |
|||
}else if($type == 2){ |
|||
if($project == 1){ |
|||
if($set['demandpass'] == 2){ |
|||
$attinfo = Attestation::checkAttestation(1,$objid); |
|||
if(empty($attinfo['attestation'])){ |
|||
$check = 1; |
|||
} |
|||
}else if(empty($set['demandpass'])){ |
|||
$check = 1; |
|||
} |
|||
}else if($project == 2){ |
|||
$artificer = pdo_get('wlmerchant_housekeep_artificer',array('id' => $objid),array('mid','name','mealid')); |
|||
$objname = $artificer['name']; |
|||
$objid = $artificer['mid']; |
|||
if($set['servicepass'] == 2){ |
|||
$attinfo = Attestation::checkAttestation(1,$objid); |
|||
if(empty($attinfo['attestation'])){ |
|||
$check = 1; |
|||
} |
|||
}else if(empty($set['servicepass'])){ |
|||
$check = 1; |
|||
} |
|||
} |
|||
} |
|||
if($check > 0){ |
|||
$status = 5; |
|||
}else{ |
|||
$status = 1; |
|||
} |
|||
return ['status' => $status,'objname'=> $objname]; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 判断权限 |
|||
* Author: wlf |
|||
* Date: 2021/05/28 17:50 |
|||
* $type 1=个人 2商户 |
|||
* $$project 1=需求 2=服务 |
|||
* @return array |
|||
*/ |
|||
public static function getJurisdiction($type,$objid,$project){ |
|||
global $_W; |
|||
$set = Setting::agentsetting_read('housekeep'); |
|||
$attestationRight = unserialize($set['attestationRight']); |
|||
if(in_array($project,$attestationRight)){ |
|||
$attinfo = Attestation::checkAttestation($type,$objid); |
|||
if(empty($attinfo['attestation'])){ |
|||
return 1; |
|||
} |
|||
} |
|||
return 0; |
|||
} |
|||
|
|||
/** |
|||
* Comment: 获取服务项目基础信息 |
|||
* Author: wlf |
|||
* Date: 2021/05/24 13:48 |
|||
* @return array |
|||
*/ |
|||
public static function getServiceBaseInfo($id){ |
|||
$service = pdo_get('wlmerchant_housekeep_service',array('id' => $id),array('id','title','thumb','pricetype','price','salenum','unit')); |
|||
$service['thumb'] = tomedia($service['thumb']); |
|||
$service['price'] = self::getServicePrice($service['price'],$service['pricetype'],$service['unit']); |
|||
return $service; |
|||
} |
|||
|
|||
/** |
|||
* Comment: 服务金额优化 |
|||
* Author: wlf |
|||
* Date: 2021/05/24 13:58 |
|||
* @return array |
|||
*/ |
|||
public static function getServicePrice($price,$pricetype,$unit){ |
|||
if($pricetype == 1){ |
|||
$price = '预约金¥'.$price.'/'.$unit; |
|||
}else if($pricetype == 2){ |
|||
$price = '¥'.$price.'/'.$unit; |
|||
}else{ |
|||
$price = '价格面议'; |
|||
} |
|||
return $price; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 计算结算金额 |
|||
* Author: wlf |
|||
* Date: 2021/05/07 16:55 |
|||
* @return array |
|||
*/ |
|||
public static function getSettlementMoney($price,$pricetype,$type,$objid){ |
|||
global $_W; |
|||
if($type == 1){ |
|||
$merchant = pdo_get('wlmerchant_merchantdata',array('id' => $objid),array('groupid','settlementtext')); |
|||
$settlementtext = unserialize($merchant['settlementtext']); |
|||
if($pricetype == 1){ |
|||
$pro = $settlementtext['appsettpro']; |
|||
}else if($pricetype == 2){ |
|||
$pro = $settlementtext['truesettpro']; |
|||
} |
|||
if($pro < 0.01){ |
|||
$pro = pdo_getcolumn(PDO_NAME.'chargelist',array('id'=>$merchant['groupid']),'defaultrate'); |
|||
} |
|||
}else{ |
|||
$mealid = pdo_getcolumn(PDO_NAME.'housekeep_artificer',array('id'=>$objid),'mealid'); |
|||
$meal = pdo_get(PDO_NAME.'housekeep_meals',array('id' => $mealid),array('appsettpro','truesettpro')); |
|||
if($pricetype == 1){ |
|||
$pro = $meal['appsettpro']; |
|||
}else if($pricetype == 2){ |
|||
$pro = $meal['truesettpro']; |
|||
} |
|||
} |
|||
$settlementmoney = sprintf("%.2f",$price * $pro / 100); |
|||
return $settlementmoney; |
|||
} |
|||
|
|||
/** |
|||
* Comment: 订单结算 |
|||
* Author: wlf |
|||
* Date: 2021/05/07 17:20 |
|||
* @return array |
|||
*/ |
|||
public static function settlementOrder($id){ |
|||
global $_W; |
|||
$order = pdo_get('wlmerchant_order',array('id' => $id),array('fkid','price','settlementmoney','orderno','issettlement','specid','sid','aid')); |
|||
if (empty($order['issettlement'])){ |
|||
$flag = pdo_getcolumn(PDO_NAME.'autosettlement_record',['orderno' => $order['orderno']],'id'); //判断是否已结算 |
|||
if (!empty($flag)){$res = 1;} |
|||
$agentmoney = sprintf("%.2f",$order['price'] - $order['settlementmoney']); |
|||
$settlementmoney = $order['settlementmoney']; |
|||
$data = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $order['aid'] , |
|||
'type' => 17, |
|||
'merchantid' => $order['sid'] , |
|||
'orderid' => $id , |
|||
'orderno' => $order['orderno'] , |
|||
'goodsid' => $order['fkid'] , |
|||
'orderprice' => $order['price'] , |
|||
'agentmoney' => $agentmoney, |
|||
'merchantmoney' => $settlementmoney, |
|||
'createtime' => time() |
|||
]; |
|||
$res = pdo_insert(PDO_NAME . 'autosettlement_record' , $data); |
|||
$settlementid = pdo_insertid(); |
|||
if ($res) { |
|||
if (abs($settlementmoney) > 0) { //结算给商户 |
|||
if ($order['specid'] == 1) { |
|||
pdo_fetch("update" . tablename('wlmerchant_merchantdata') . "SET allmoney=allmoney+{$settlementmoney},nowmoney=nowmoney+{$settlementmoney} WHERE id = {$order['sid']}"); |
|||
$change['merchantnowmoney'] = pdo_getcolumn(PDO_NAME . 'merchantdata' , ['id' => $data['merchantid']] , 'nowmoney'); |
|||
Store::addcurrent(1 , 17 , $order['sid'] , $settlementmoney , $change['merchantnowmoney'] , $order['id'] , '' , $_W['uniacid'] , $order['aid']); |
|||
}else { |
|||
$mid = pdo_getcolumn(PDO_NAME.'housekeep_artificer',array('id'=>$order['sid']),'mid'); |
|||
Member::credit_update_credit2($mid,$settlementmoney,'家政服务项目结算'); |
|||
} |
|||
} |
|||
if (abs($data['agentmoney']) > 0) { |
|||
pdo_fetch("update" . tablename('wlmerchant_agentusers') . "SET allmoney=allmoney+{$data['agentmoney']},nowmoney=nowmoney+{$data['agentmoney']} WHERE id = {$data['aid']}"); |
|||
$change['agentnowmoney'] = pdo_getcolumn(PDO_NAME . 'agentusers' , ['id' => $data['aid']] , 'nowmoney'); |
|||
Store::addcurrent(2 , 17 , $data['aid'] , $data['agentmoney'] , $change['agentnowmoney'] , $order['id'] , '' , $_W['uniacid'] , $order['aid']); |
|||
} |
|||
pdo_update('wlmerchant_autosettlement_record' , $change , ['id' => $settlementid]); |
|||
pdo_update('wlmerchant_order',['issettlement' => 1,'settletime' => time()],['id' => $order['id']]); |
|||
} |
|||
}else{ |
|||
$res = 1; |
|||
} |
|||
return $res; |
|||
} |
|||
|
|||
/** |
|||
* Comment: 订单退款 |
|||
* Author: wlf |
|||
* Date: 2021/05/07 18:25 |
|||
* @return array |
|||
*/ |
|||
static function refund($id, $money = 0, $unline = '') { |
|||
$order = pdo_get(PDO_NAME . 'order', array('id' => $id)); |
|||
if($money < $order['blendcredit']){ |
|||
$blendcredit = $money; |
|||
$money = 0; |
|||
}else if($order['blendcredit'] > 0){ |
|||
$blendcredit = $order['blendcredit']; |
|||
$money = sprintf("%.2f",$money - $blendcredit); |
|||
} |
|||
if ($unline) { |
|||
$res['status'] = 1; |
|||
} else { |
|||
$res = wlPay::refundMoney($id, $money, '家政订单退款', 'housekeep', 2,$blendcredit); |
|||
} |
|||
if ($res['status']) { |
|||
//修改服务项目销量 |
|||
pdo_fetch("update" . tablename('wlmerchant_housekeep_service') . "SET salenum=salenum-{$order['num']} WHERE id = {$order['fkid']}"); |
|||
//修改退款申请记录 |
|||
pdo_update('wlmerchant_aftersale',array('status' => 2),array('orderid' => $id,'plugin' => 'housekeep')); |
|||
if ($order['applyrefund']) { |
|||
pdo_update('wlmerchant_order', array('status' => 7, 'refundtime' => time(), 'applyrefund' => 2), array('id' => $order['id'])); |
|||
$reason = '买家申请退款。'; |
|||
} else { |
|||
pdo_update('wlmerchant_order', array('status' => 7, 'refundtime' => time()), array('id' => $order['id'])); |
|||
$reason = '家政系统退款。'; |
|||
} |
|||
|
|||
News::refundNotice($id,'housekeep',$money,$reason); |
|||
} else { |
|||
pdo_fetch("update" . tablename('wlmerchant_order') . "SET failtimes = failtimes+1 WHERE id = {$id}"); |
|||
} |
|||
return $res; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 支付回调 |
|||
* Author: wlf |
|||
* Date: 2021/04/25 16:40 |
|||
* @return array |
|||
*/ |
|||
static function payHousekeepOrderNotify($params) |
|||
{ |
|||
Util::wl_log('payResult_notify',PATH_PLUGIN."housekeep/data/",$params); //写入异步日志记录 |
|||
$order = pdo_get('wlmerchant_order',['orderno' => $params['tid']],[ |
|||
'id', |
|||
'fightstatus', |
|||
'mid', |
|||
'uniacid', |
|||
'num', |
|||
'specid', |
|||
'price', |
|||
'orderno', |
|||
'fkid', |
|||
'aid', |
|||
'status' |
|||
]); |
|||
$_W['uniacid'] = $order['uniacid']; |
|||
$_W['aid'] = $order['aid']; |
|||
$data = [ |
|||
'status' => 3, |
|||
//'disorderid' => $disorderid, |
|||
'paytime' => time() |
|||
]; |
|||
$data['paytype'] = $params['type']; |
|||
if ($params['tag']['transaction_id']) $data['transid'] = $params['tag']['transaction_id']; |
|||
//业务逻辑 |
|||
if($order['fightstatus'] == 1){ |
|||
$data['status'] = 1; |
|||
//修改服务项目销量 |
|||
pdo_fetch("update" . tablename('wlmerchant_housekeep_service') . "SET salenum = salenum + {$order['num']} WHERE id = {$order['fkid']}"); |
|||
|
|||
$nickname = pdo_getcolumn(PDO_NAME.'member',array('id'=>$order['mid']),'nickname'); |
|||
$service = pdo_get('wlmerchant_housekeep_service',['id' => $order['fkid']],['type','objid','title']); |
|||
$first = "用户【{$nickname}】支付了[{$service['title']}]的家政服务";//消息头部 |
|||
$type = "家政服务";//业务类型 |
|||
$content = $service['title'];//业务内容 |
|||
$status = "待处理";//处理结果 |
|||
$remark = "请尽快联系客户处理!";//备注信息 |
|||
$time = $data['paytime'];//操作时间 |
|||
if($service['type'] == 1){ |
|||
News::noticeShopAdmin($service['objid'], $first , $type , $content , $status , $remark , $time); |
|||
}else{ |
|||
$mid = pdo_getcolumn(PDO_NAME.'housekeep_artificer',array('id'=>$service['objid']),'mid'); |
|||
News::jobNotice($mid,$first,$type,$content,$status,$remark,$time); |
|||
} |
|||
}else if ($order['fightstatus'] == 2) { //付费入驻 |
|||
$meal = pdo_get('wlmerchant_housekeep_meals',['id' => $order['specid']],['day','check']); |
|||
$artificer = pdo_get('wlmerchant_housekeep_artificer',['id' => $order['fkid']],['name','endtime']); |
|||
if ($meal['check'] > 0) { |
|||
$newinfo['status'] = 5; |
|||
} else { |
|||
$newinfo['status'] = 1; |
|||
} |
|||
//计算时间 |
|||
if ($artificer['endtime'] > time()) { |
|||
$newinfo['endtime'] = $artificer['endtime'] + $meal['day'] * 86400; |
|||
} else { |
|||
$newinfo['endtime'] = time() + $meal['day'] * 86400; |
|||
} |
|||
pdo_update('wlmerchant_housekeep_artificer',$newinfo,['id' => $order['fkid']]); |
|||
if ($newinfo['status'] == 5) { |
|||
$membername = pdo_getcolumn(PDO_NAME.'member',['id' => $order['mid']],'nickname'); |
|||
//发送模板消息 |
|||
$first = '您好,一个家政服务者入驻申请待审核'; |
|||
$type = '审核家政服务者入驻信息'; |
|||
$content = '服务者姓名:'.$artificer['name']; |
|||
$status = '待审核'; |
|||
$remark = "微信用户[".$membername."]入驻家政服务者申请,请管理员尽快前往后台审核"; |
|||
News::noticeAgent('housekeep',$_W['aid'],$first,$type,$content,$status,$remark,time(),''); |
|||
} |
|||
} else if ($order['fightstatus'] == 3) { //付费发布 |
|||
$set = Setting::agentsetting_read('housekeep'); |
|||
$demand = pdo_get('wlmerchant_housekeep_demand',['id' => $order['fkid']],['mid','topendtime','type']); |
|||
$getstatus = self::getStatus(2,$demand['mid'],$set,1); |
|||
if ($getstatus['status'] == 1) { //免审核 |
|||
pdo_update('wlmerchant_housekeep_demand',[ |
|||
'updatetime' => time(), |
|||
'status' => 1, |
|||
'createtime' => time() |
|||
],['id' => $order['fkid']]); |
|||
} else { |
|||
pdo_update('wlmerchant_housekeep_demand',[ |
|||
'updatetime' => time(), |
|||
'status' => 5, |
|||
'createtime' => time() |
|||
],['id' => $order['fkid']]); |
|||
$typetitle = pdo_getcolumn(PDO_NAME.'housekeep_type',['id' => $demand['type']],'title'); |
|||
$membername = pdo_getcolumn(PDO_NAME.'member',['id' => $order['mid']],'nickname'); |
|||
//发送模板消息 |
|||
$first = '您好,您有一个待审核任务需要处理'; |
|||
$type = '审核用户家政需求'; |
|||
$content = '需求类目:'.$typetitle; |
|||
$status = '待审核'; |
|||
$remark = "用户[".$membername."]发布了一个商品待审核,请管理员尽快前往后台审核"; |
|||
News::noticeAgent('housekeep',$order['aid'],$first,$type,$content,$status,$remark,time(),''); |
|||
} |
|||
} else if ($order['fightstatus'] == 4) { //置顶 |
|||
$demand = pdo_get('wlmerchant_housekeep_demand',['id' => $order['fkid']],['topendtime','type']); |
|||
if ($demand['topendtime'] > time()) { |
|||
$newtime = $demand['topendtime'] + 86400 * $order['num']; |
|||
} else { |
|||
$newtime = time() + 86400 * $order['num']; |
|||
} |
|||
pdo_update('wlmerchant_housekeep_demand',[ |
|||
'updatetime' => time(), |
|||
'topflag' => 1, |
|||
'topendtime' => $newtime |
|||
],['id' => $order['fkid']]); |
|||
} else if ($order['fightstatus'] == 5) { //刷新 |
|||
pdo_update('wlmerchant_housekeep_demand',['updatetime' => time()],['id' => $order['fkid']]); |
|||
} |
|||
//结算 |
|||
$res = pdo_update('wlmerchant_order',$data,['id' => $order['id']]); |
|||
if ($res && $order['fightstatus'] != 1) { |
|||
Store::ordersettlement($order['id']); |
|||
} |
|||
} |
|||
//计划任务 |
|||
static function doTask() |
|||
{ |
|||
global $_W; |
|||
//置顶时间过期,自动下线 |
|||
pdo_update('wlmerchant_housekeep_demand',['topflag' => 0],['topflag' => 1,'topendtime <' => time()]); |
|||
//删除过期订单 |
|||
$time = time() - 43200; |
|||
pdo_delete('wlmerchant_order',[ |
|||
'plugin' => 'housekeep', |
|||
'status' => 0, |
|||
'fightstatus >' => 2, |
|||
'createtime <' => $time |
|||
]); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 根据条件获取对应的列表 |
|||
* Author: zzw |
|||
* Date: 2021/5/6 13:57 |
|||
* @param int $serviceType 服务类型:0=全部,1=商户服务商,2=个人服务商,3=客户需求,4=服务项目 |
|||
* @param int $page 当前页 |
|||
* @param int $pageIndex 每页的数量 |
|||
* @param string $shopWhere 商户服务商条件 |
|||
* @param string $artificerWhere 个人服务商条件 |
|||
* @param string $demandWhere 客户需求条件 |
|||
* @param string $serviceWhere 服务项目条件 |
|||
* @param int $order 排序方式 |
|||
* -- service_type=0:1=推荐 |
|||
* -- service_type=1:1=推荐,2=时间,3=距离,4=销量 |
|||
* -- service_type=2:1=推荐,2=时间,3=距离 |
|||
* -- service_type=3:1=发布时间,2=上门时间,3=距离 |
|||
* -- service_type=4:1=推荐,2=时间,3=距离,4=销量 |
|||
* @param int $lng 经度 |
|||
* @param int $lat 纬度 |
|||
* @return array |
|||
*/ |
|||
public static function getList(int $serviceType = 0,$page = 1,$pageIndex = 10,$shopWhere = '',$artificerWhere = '', |
|||
$demandWhere = '',$serviceWhere = '',$order = 1,$lng = 0,$lat = 0,$aid = 0){ |
|||
global $_W; |
|||
//基本条件生成 |
|||
if(empty($aid)){$aid = $_W['aid'];} |
|||
$publicWhere = " WHERE uniacid = {$_W['uniacid']} AND aid = {$aid} "; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$distances = getDistancesSql($lat,$lng,'lat','lng'); |
|||
//根据类型生成对应的sql语句和排序方式 服务类型:0=全部,1=商户服务商,2=个人服务商,3=客户需求,4=服务项目 |
|||
switch ($serviceType){ |
|||
case 0: |
|||
//排序方式:1=推荐 |
|||
$orderBy = " ORDER BY createtime DESC "; |
|||
//sql语句 |
|||
$field = " *"; |
|||
$sql = "SELECT {$field} FROM (SELECT id,createtime,{$distances} as distances,'1' as service_type FROM ".tablename(PDO_NAME."merchantdata") |
|||
." {$publicWhere} {$shopWhere} " |
|||
." UNION ALL SELECT id,createtime,{$distances} as distances,'2' as service_type FROM ".tablename(PDO_NAME."housekeep_artificer") |
|||
." {$publicWhere} {$artificerWhere} " |
|||
." UNION ALL SELECT id,createtime,{$distances} as distances,'3' as service_type FROM ".tablename(PDO_NAME."housekeep_demand") |
|||
." {$publicWhere} {$demandWhere} " |
|||
." UNION ALL SELECT id,createtime,{$distances} as distances,'4' as service_type FROM ".tablename(PDO_NAME."housekeep_service") |
|||
." {$publicWhere} {$serviceWhere}) as a"; |
|||
break;//获取全部 |
|||
case 1: |
|||
//排序方式:1=推荐,2=时间,3=距离,4=销量 |
|||
switch ($order){ |
|||
case 1: $orderBy = " ORDER BY listorder DESC,id DESC ";break; |
|||
case 2: $orderBy = " ORDER BY createtime DESC ";break; |
|||
case 3: $orderBy = " ORDER BY distances ASC,createtime DESC ";break; |
|||
case 4: $orderBy = " ORDER BY salenum DESC ";break; |
|||
} |
|||
//sql语句 |
|||
$salenum = "SELECT sum(salenum) FROM ".tablename(PDO_NAME."housekeep_service") |
|||
." {$publicWhere} AND `type` = 1 and objid = shop_id "; |
|||
$field = "id,createtime,{$distances} as distances,'1' as service_type,id as shop_id,IFNULL(({$salenum}),0) as salenum"; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."merchantdata") |
|||
." {$publicWhere} {$shopWhere} "; |
|||
break;//获取商户服务商 |
|||
case 2: |
|||
//排序方式:1=推荐,2=时间,3=距离 |
|||
switch ($order){ |
|||
case 1:$orderBy = " ORDER BY sort DESC ";break; |
|||
case 2:$orderBy = " ORDER BY createtime DESC ";break; |
|||
case 3:$orderBy = " ORDER BY distances ASC,createtime DESC ";break; |
|||
case 4:$orderBy = " ORDER BY salenum DESC ";break; |
|||
} |
|||
//sql语句 |
|||
$salenum = "SELECT sum(salenum) FROM ".tablename(PDO_NAME."housekeep_service") |
|||
." {$publicWhere} AND `type` = 2 and objid = id "; |
|||
$field = "id,createtime,{$distances} as distances,'2' as service_type,IFNULL(({$salenum}),0) as salenum"; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."housekeep_artificer") |
|||
." {$publicWhere} {$artificerWhere} "; |
|||
break;//获取个人服务商 |
|||
case 3: |
|||
//排序方式:1=推荐,2=发布时间,3=上门时间,4=距离 |
|||
switch ($order){ |
|||
case 1:$orderBy = " ORDER BY topflag DESC,updatetime DESC ";break; |
|||
case 2:$orderBy = " ORDER BY topflag DESC,createtime DESC ";break; |
|||
case 3:$orderBy = " ORDER BY topflag DESC,visitingtime DESC ";break; |
|||
case 4:$orderBy = " ORDER BY topflag DESC,distances ASC ";break; |
|||
} |
|||
//sql语句 |
|||
$field = "id,createtime,{$distances} as distances,'3' as service_type,lat,lng"; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."housekeep_demand") |
|||
." {$publicWhere} {$demandWhere} "; |
|||
break;//获取客户需求 |
|||
case 4: |
|||
//排序方式:1=推荐,2=时间,3=距离,4=销量 |
|||
switch ($order){ |
|||
case 1:$orderBy = " ORDER BY sort DESC ";break; |
|||
case 2:$orderBy = " ORDER BY createtime DESC ";break; |
|||
case 3:$orderBy = " ORDER BY distances ASC,createtime DESC ";break; |
|||
case 4:$orderBy = " ORDER BY salenum DESC ";break; |
|||
} |
|||
//sql语句 |
|||
$field = "id,createtime,{$distances} as distances,'4' as service_type"; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."housekeep_service") |
|||
." {$publicWhere} {$serviceWhere} "; |
|||
break;//获取服务项目 |
|||
} |
|||
//运行sql语句获取信息列表 |
|||
$list = pdo_fetchall($sql.$orderBy.$limit); |
|||
$list = array_map(function ($item){ |
|||
//信息处理 |
|||
$itemRes = Housekeep::getDesc($item['id'],$item['service_type']); |
|||
//距离处理 |
|||
if($item['distances'] > 0){ |
|||
if($item['distances'] < 1000) $itemRes['distances'] = $item['distances'].'m'; |
|||
else $itemRes['distances'] = sprintf("%.2f",$item['distances'] / 1000).'km'; |
|||
} |
|||
return $itemRes; |
|||
},$list); |
|||
//获取总数信息 根据分页信息获取 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql); |
|||
//信息拼装 |
|||
$data = [ |
|||
'list' => $list, |
|||
'page' => $page, |
|||
'page_number' => ceil($total / $pageIndex) |
|||
]; |
|||
|
|||
return $data; |
|||
} |
|||
/** |
|||
* Comment: 获取服务详细信息 |
|||
* Author: zzw |
|||
* Date: 2021/4/30 17:45 |
|||
* @param int $id |
|||
* @param int $serviceType |
|||
* @return false|mixed |
|||
*/ |
|||
public static function getDesc($id,$serviceType){ |
|||
global $_W; |
|||
$isAuthentication = intval(0);//默认未认证 |
|||
$isBond = intval(0);//默认未交保证金 |
|||
//根据类型生成查询相关信息 类型:1=商户服务商,2=个人服务商,3=客户需求,4=服务项目 logo,thumbs,name,address, |
|||
switch ($serviceType){ |
|||
case 1: |
|||
$field = "logo,adv as thumbs,storename as name,address"; |
|||
$table = tablename(PDO_NAME."merchantdata"); |
|||
$tip = '商户服务商'; |
|||
//获取分类列表 |
|||
$labelList = self::getType(3,$id); |
|||
//获取服务项目 |
|||
$serviceList = self::getService(1,$id); |
|||
//判断是否获取保证金 |
|||
if(p('attestation')){ |
|||
$attestation = Attestation::checkAttestation(2,$id); |
|||
$isAuthentication = $attestation['attestation'] > 0 ? 1 : 0;//是否认证 |
|||
$isBond = $attestation['bondflag'] > 0 ? 1 : 0;//是否提交保证金 |
|||
} |
|||
|
|||
break;//商户服务商 |
|||
case 2: |
|||
$field = "thumb as logo,thumbs,name,address,mid"; |
|||
$table = tablename(PDO_NAME."housekeep_artificer"); |
|||
$tip = '个人服务商'; |
|||
$labelList = self::getType(2,$id); |
|||
//获取服务项目 |
|||
$serviceList = self::getService(2,$id); |
|||
//判断是否获取保证金 |
|||
if(p('attestation')){ |
|||
$mid = pdo_getcolumn(PDO_NAME."housekeep_artificer",['id'=>$id],'mid'); |
|||
$attestation = Attestation::checkAttestation(1,$mid); |
|||
$isAuthentication = $attestation['attestation'] > 0 ? 1 : 0;//是否认证 |
|||
$isBond = $attestation['bondflag'] > 0 ? 1 : 0;//是否提交保证金 |
|||
} |
|||
break;//个人服务商 |
|||
case 3: |
|||
$field = "'' as logo,thumbs,type as name,address,visitingtime,topflag,mid,detail,mobile,lat,lng"; |
|||
$table = tablename(PDO_NAME."housekeep_demand"); |
|||
$tip = '客户需求'; |
|||
$labelList = []; |
|||
break;//客户需求 |
|||
case 4: |
|||
$field = "thumb as logo,adv as thumbs,title as name,type as address,price,pricetype,unit,salenum"; |
|||
$table = tablename(PDO_NAME."housekeep_service"); |
|||
$tip = '服务项目'; |
|||
$labelList = self::getType(1,$id); |
|||
break;//服务项目 |
|||
} |
|||
//运行sql进行查询 |
|||
$info = pdo_fetch("SELECT {$field} FROM ".$table." WHERE id = {$id} "); |
|||
$info['id'] = $id; |
|||
$info['service_type'] = $serviceType; |
|||
$info['tip'] = $tip; |
|||
$info['label'] = $labelList ? : [];//分类列表 |
|||
$info['service'] = $serviceList ? : [];//服务项目列表 |
|||
$info['is_authentication'] = $isAuthentication;//是否认证 |
|||
$info['is_bond'] = $isBond;//是否提交保证金 |
|||
//公共信息处理 |
|||
$info['logo'] = tomedia($info['logo']); |
|||
$thumbs = unserialize($info['thumbs']); |
|||
$info['long_logo'] = is_array($thumbs) ? tomedia($thumbs[0]) : ''; |
|||
//私有信息处理 |
|||
switch ($serviceType){ |
|||
case 3: |
|||
//logo=long_logo |
|||
$info['logo'] = $info['long_logo']; |
|||
$info['thumbs'] = self::beautifyImgInfo($info['thumbs']); |
|||
$info['visitingtime'] = date('Y-m-d H:i',$info['visitingtime']); |
|||
//name = 需求类型标题 |
|||
$info['name'] = pdo_getcolumn(PDO_NAME."housekeep_type",['id'=>$info['name']],'title'); |
|||
$member = pdo_get('wlmerchant_member',array('id' => $info['mid']),array('nickname','avatar')); |
|||
$info['nickname'] = $member['nickname']; |
|||
$info['avatar'] = tomedia($member['avatar']); |
|||
break;//客户需求 |
|||
case 4: |
|||
//address = 发布类型 |
|||
if($info['type'] == 1){ |
|||
$info['address'] = '商户发布'; |
|||
} else{ |
|||
$info['address'] = '个人发布'; |
|||
} |
|||
$info['price'] = self::getServicePrice($info['price'],$info['pricetype'],$info['unit']); |
|||
break;//服务项目 |
|||
} |
|||
//删除多余的字段 |
|||
|
|||
return $info; |
|||
} |
|||
/** |
|||
* Comment: 根据类型获取所有二级分类 |
|||
* Author: zzw |
|||
* Date: 2021/5/6 10:11 |
|||
* @param int $type 类型:1=服务项目 2=个人服务商 3=商户服务商 |
|||
* @param int $id |
|||
* @return array |
|||
*/ |
|||
public static function getType(int $type,int $id){ |
|||
global $_W; |
|||
//获取二级分类id列表 |
|||
$idList = pdo_getall(PDO_NAME."housekeep_relation",['type'=>$type,'objid'=>$id],['twolevelid']); |
|||
if(!is_array($idList) || count($idList) <= 0) return []; |
|||
//获取二级分类标题列表 |
|||
$ids = array_column($idList,'twolevelid'); |
|||
$list = pdo_getall(PDO_NAME."housekeep_type",['uniacid'=>$_W['uniacid'],'aid'=>$_W['aid'],'id IN'=>$ids],['title']); |
|||
|
|||
return is_array($list) && count($list) > 0 ? array_column($list,'title') : []; |
|||
} |
|||
/** |
|||
* Comment: 根据条件获取服务项目信息列表 |
|||
* Author: zzw |
|||
* Date: 2021/5/6 16:54 |
|||
* @param int $type 1=商户发布 2=个人发布 |
|||
* @param int $id 商户/个人服务商id |
|||
* @param string $order 排序 |
|||
* @param int $page 当前页 |
|||
* @param int $pageIndex 每页的数量 |
|||
* @return array|false|mixed |
|||
*/ |
|||
public static function getService(int $type,int $id,$order = 'salenum DESC',$page = 1,$pageIndex = 2){ |
|||
$field = ['id','thumb','title','salenum','pricetype','price','unit']; |
|||
$list = pdo_getall(PDO_NAME."housekeep_service",['type'=>$type,'objid'=>$id,'status'=>1],$field,'',$order,[$page,$pageIndex]); |
|||
foreach($list as $key => &$val){ |
|||
//处理基本信息 |
|||
$val['thumb'] = tomedia($val['thumb']); |
|||
//处理价格 金额类型 0无金额 1预约金 2实价 |
|||
$val['price_text'] = self::getServicePrice($val['price'],$val['pricetype'],$val['unit']); |
|||
} |
|||
|
|||
return $list; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[家政服务]]></name> |
|||
<identifie><![CDATA[housekeep]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[expand]]></type> |
|||
<description><![CDATA[家政服务]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="true" /> |
|||
<system embed="true" /> |
|||
<task embed="false" /> |
|||
</setting> |
|||
<agentmenu> |
|||
<menu title="信息" font="fa-inbox" > |
|||
<entry title="项目列表" ac="KeepWeb" do="serviceList" iscover="true"></entry> |
|||
<entry title="需求列表" ac="KeepWeb" do="demandList"></entry> |
|||
<entry title="服务者列表" ac="KeepWeb" do="artificerList"></entry> |
|||
<entry title="服务商列表" ac="KeepWeb" do="storelist"></entry> |
|||
</menu> |
|||
<menu title="分类" font="fa-inbox"> |
|||
<entry title="服务类型" ac="KeepType" do="typelists"></entry> |
|||
<entry title="入驻套餐" ac="KeepType" do="mealLists"></entry> |
|||
</menu> |
|||
<menu title="订单" font="fa-inbox"> |
|||
<entry title="订单列表" ac="KeepType" do="orderlists"></entry> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox" > |
|||
<entry title="基础设置" ac="KeepWeb" do="basicsetting"></entry> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="信息" font="fa-inbox" > |
|||
<entry title="项目列表" ac="KeepWeb" do="serviceList" iscover="true"></entry> |
|||
<entry title="需求列表" ac="KeepWeb" do="demandList"></entry> |
|||
<entry title="服务者列表" ac="KeepWeb" do="artificerList"></entry> |
|||
<entry title="服务商列表" ac="KeepWeb" do="storelist"></entry> |
|||
</menu> |
|||
<menu title="分类" font="fa-inbox"> |
|||
<entry title="服务类型" ac="KeepType" do="typelists"></entry> |
|||
<entry title="入驻套餐" ac="KeepType" do="mealLists"></entry> |
|||
</menu> |
|||
<menu title="订单" font="fa-inbox"> |
|||
<entry title="订单列表" ac="KeepType" do="orderlists"></entry> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox" > |
|||
<entry title="基础设置" ac="KeepWeb" do="basicsetting"></entry> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 2.8 KiB |
@ -0,0 +1,366 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class KeepType_WeliamController { |
|||
/** |
|||
* Comment: 家政服务列表 |
|||
* Author: wlf |
|||
* Date: 2021/03/31 16:39 |
|||
*/ |
|||
public function typelists() { |
|||
global $_W, $_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$title = $_GPC['title'] ? : '';//活动名称 |
|||
//条件生成 |
|||
$where = " WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "; |
|||
if($title){ |
|||
$ids = pdo_fetchall("SELECT onelevelid FROM " |
|||
.tablename(PDO_NAME."housekeep_type") |
|||
.$where." AND title LIKE '%{$title}%' AND onelevelid > 0"); |
|||
$ids = array_column($ids,'onelevelid'); |
|||
$ids = $ids ? implode(',',$ids) : []; |
|||
$where .= " AND (title LIKE '%{$title}%' OR id IN ({$ids})) "; |
|||
} |
|||
//sql语句生成 |
|||
$field = "id,title,sort,status,color,img"; |
|||
$sql = "SELECT {$field} FROM " .tablename(PDO_NAME."housekeep_type"); |
|||
$order = " ORDER BY sort DESC,id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
//列表获取 |
|||
$list = pdo_fetchall($sql.$where." AND onelevelid = 0".$order.$limit); |
|||
foreach($list as $key => &$val){ |
|||
$val['list'] = pdo_fetchall($sql.$where." AND onelevelid = {$val['id']}".$order); |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where." AND onelevelid = 0"); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('keeptype/typelists'); |
|||
} |
|||
/** |
|||
* Comment: 导入默认服务类型 |
|||
* Author: wlf |
|||
* Date: 2021/03/31 15:20 |
|||
*/ |
|||
public function importType(){ |
|||
global $_W, $_GPC; |
|||
$list = Housekeep::defaultType(); |
|||
$tableName = PDO_NAME."housekeep_type"; |
|||
pdo_fetchall("update ".tablename($tableName)." set `sort` = 0 WHERE `sort` is null "); |
|||
$publicWhere = ['uniacid'=>$_W['uniacid'],'aid'=>$_W['aid']]; |
|||
foreach($list as $item){ |
|||
//判断当前行业是否已经存在 |
|||
$pid = pdo_getcolumn($tableName,array_merge($publicWhere,['title'=>$item['title']]),'id'); |
|||
if(!$pid){ |
|||
//不存在 添加信息 |
|||
$insertData = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $_W['aid'] , |
|||
'title' => $item['title'] , |
|||
'onelevelid' => 0 , |
|||
'createtime' => time() , |
|||
'img' => $item['img'], |
|||
'status' => 1, |
|||
'color' => '#000000' |
|||
]; |
|||
pdo_insert($tableName,$insertData); |
|||
$pid = pdo_insertid(); |
|||
} |
|||
//处理子行业信息 |
|||
foreach($item['list'] as $sub){ |
|||
//判断当前行业是否已经存在 |
|||
$isHave = pdo_getcolumn($tableName,array_merge($publicWhere,['title'=>$sub,'pid'=>$pid]),'id'); |
|||
if(!$isHave){ |
|||
//不存在 添加信息 |
|||
$subData = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $_W['aid'] , |
|||
'title' => $sub , |
|||
'onelevelid' => $pid , |
|||
'createtime' => time() , |
|||
'color' => '#000000', |
|||
'status' => 1, |
|||
]; |
|||
pdo_insert($tableName,$subData); |
|||
} |
|||
} |
|||
} |
|||
wl_json(1,'生成成功'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 修改分类状态 |
|||
* Author: wlf |
|||
* Date: 2021/03/31 17:20 |
|||
*/ |
|||
public function changeStatus (){ |
|||
global $_W , $_GPC; |
|||
//获取参数信息 |
|||
$id = $_GPC['id'] OR Commons::sRenderError('缺少参数:id'); |
|||
$status = $_GPC['status'] ? : 0; |
|||
//修改操作 |
|||
$res = pdo_update(PDO_NAME."housekeep_type",['status'=>$status],['id'=>$id]); |
|||
if($res) Commons::sRenderSuccess('修改成功'); |
|||
else Commons::sRenderError('修改失败,请刷新重试!'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 修改分类信息 |
|||
* Author: wlf |
|||
* Date: 2021/03/31 17:36 |
|||
*/ |
|||
public function setInfo (){ |
|||
global $_W , $_GPC; |
|||
//获取参数信息 |
|||
$id = $_GPC['id']; |
|||
$value = trim($_GPC['value']); |
|||
$type = $_GPC['type']; |
|||
$res = pdo_update(PDO_NAME."housekeep_type",array($type=>$value),array('id'=>$id)); |
|||
if($res){ |
|||
show_json(1, "修改成功"); |
|||
}else{ |
|||
show_json(0, "修改失败"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 删除分类信息 |
|||
* Author: wlf |
|||
* Date: 2021/03/31 17:45 |
|||
*/ |
|||
public function typeDel(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids'] ? :[] ; |
|||
pdo_delete(PDO_NAME."housekeep_type",['id IN'=>$ids]); |
|||
pdo_delete(PDO_NAME."housekeep_type",['onelevelid IN'=>$ids]); |
|||
show_json(1, "删除成功"); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 添加/编辑家政服务类型 |
|||
* Author: wlf |
|||
* Date: 2021/03/31 18:10 |
|||
*/ |
|||
public function editType(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$parentId = trim($_GPC['parentid']); |
|||
$id = $_GPC['id']; |
|||
//进入添加子分类页面 获取上级分类信息 |
|||
if ($id > 0) { |
|||
$data = Util::getSingelData("*", PDO_NAME . 'housekeep_type', array('id' => $id)); |
|||
$parentId = $data['onelevelid']; |
|||
} |
|||
if($parentId > 0){ |
|||
$parentTitle = pdo_getcolumn(PDO_NAME . 'housekeep_type',['id'=>$parentId],'title'); |
|||
} |
|||
if ($_W['ispost']){ |
|||
$data = $_GPC['data']; |
|||
$data['sort'] = sprintf("%.0f",$data['sort']); |
|||
if($data['id'] > 0){ |
|||
$res = pdo_update(PDO_NAME.'housekeep_type', $data,array('id' => $id)); |
|||
if($res){ |
|||
wl_message('修改成功', web_url('housekeep/KeepType/typelists'), 'success'); |
|||
}else{ |
|||
wl_message('修改失败,请刷新重试', referer(), 'error'); |
|||
} |
|||
}else{ |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$res = pdo_insert(PDO_NAME.'housekeep_type', $data); |
|||
if($res){ |
|||
wl_message('创建成功', web_url('housekeep/KeepType/typelists'), 'success'); |
|||
}else{ |
|||
wl_message('创建失败,请刷新重试', referer(), 'error'); |
|||
} |
|||
} |
|||
} |
|||
|
|||
include wl_template('keeptype/editType'); |
|||
} |
|||
|
|||
//套餐列表 |
|||
public function mealLists() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 15; |
|||
$lists = pdo_getslice('wlmerchant_housekeep_meals', array('uniacid' => $_W['uniacid'], 'aid' => $_W['aid']), array($pindex, $psize), $total, array(), '', "sort DESC"); |
|||
foreach ($lists as $key => &$val) { |
|||
$val['usenum'] = intval(pdo_getcolumn('wlmerchant_housekeep_artificer', array('uniacid' => $_W['uniacid'], 'mealid' => $val['id']), array('COUNT(id)'))); |
|||
} |
|||
$pager = wl_pagination($total, $pindex, $psize); |
|||
include wl_template('keeptype/mealLists'); |
|||
} |
|||
|
|||
//套餐编辑 |
|||
public function mealEdit() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
|
|||
if ($_W['ispost']) { |
|||
$data = $_GPC['item']; |
|||
$data['price'] = sprintf("%.2f",$data['price']); |
|||
if (!empty($id)) { |
|||
pdo_update('wlmerchant_housekeep_meals', $data, array('id' => $id)); |
|||
} else { |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
pdo_insert('wlmerchant_housekeep_meals', $data); |
|||
} |
|||
wl_message('编辑套餐成功', web_url('housekeep/KeepType/mealLists'), 'success'); |
|||
} |
|||
|
|||
if (!empty($id)) { |
|||
$item = pdo_get('wlmerchant_housekeep_meals', array('id' => $id)); |
|||
} else { |
|||
$item = ['sort' => 100, 'status' => 1]; |
|||
} |
|||
include wl_template('keeptype/mealEdit'); |
|||
} |
|||
|
|||
//套餐删除 |
|||
public function mealDel() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id'] ?: $_GPC['ids']; |
|||
|
|||
$items = pdo_getall('wlmerchant_housekeep_meals', array('id' => $id, 'uniacid' => $_W['uniacid']), array('id')); |
|||
foreach ($items as $item) { |
|||
pdo_delete('wlmerchant_housekeep_meals', array('id' => $item['id'])); |
|||
} |
|||
|
|||
show_json(1, array('url' => referer())); |
|||
} |
|||
|
|||
//修改套餐状态 |
|||
public function mealStatus() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$status = $_GPC['status'] ?: 0; |
|||
$res = pdo_update("wlmerchant_housekeep_meals", ['status' => $status], ['id' => $id]); |
|||
if ($res) { |
|||
Commons::sRenderSuccess('修改成功'); |
|||
} else { |
|||
Commons::sRenderError('修改失败,请刷新重试!'); |
|||
} |
|||
} |
|||
|
|||
public function orderlists(){ |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 20; |
|||
|
|||
$where = array(); |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['aid'] = $_W['aid']; |
|||
$where['plugin'] = 'housekeep'; |
|||
if(empty($_GPC['status'])){ |
|||
$where['status!='] = 5; |
|||
}else if($_GPC['status'] == 8){ |
|||
$where['status'] = 0; |
|||
}else{ |
|||
$where['status'] = $_GPC['status']; |
|||
} |
|||
|
|||
if($_GPC['fightstatus']){ |
|||
$where['fightstatus'] = $_GPC['fightstatus']; |
|||
} |
|||
if($_GPC['keyword']){ |
|||
$keyword = $_GPC['keyword']; |
|||
if($_GPC['keywordtype'] == 1){ |
|||
$params[':name'] = "%{$keyword}%"; |
|||
$members = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_member')." WHERE uniacid = {$_W['uniacid']} AND nickname LIKE :name",$params); |
|||
if($members){ |
|||
$mids = "("; |
|||
foreach ($members as $key => $v) { |
|||
if($key == 0){ |
|||
$mids.= $v['id']; |
|||
}else{ |
|||
$mids.= ",".$v['id']; |
|||
} |
|||
} |
|||
$mids.= ")"; |
|||
$where['mid#'] = $mids; |
|||
} |
|||
}else if($_GPC['keywordtype'] == 2){ |
|||
$params[':name'] = "%{$keyword}%"; |
|||
$members = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_member')." WHERE uniacid = {$_W['uniacid']} AND mobile LIKE :name",$params); |
|||
if($members){ |
|||
$mids = "("; |
|||
foreach ($members as $key => $v) { |
|||
if($key == 0){ |
|||
$mids.= $v['id']; |
|||
}else{ |
|||
$mids.= ",".$v['id']; |
|||
} |
|||
} |
|||
$mids.= ")"; |
|||
$where['mid#'] = $mids; |
|||
} |
|||
} |
|||
} |
|||
|
|||
if($_GPC['time_limit']){ |
|||
$time_limit = $_GPC['time_limit']; |
|||
$starttime = strtotime($_GPC['time_limit']['start']); |
|||
$endtime = strtotime($_GPC['time_limit']['end']) ; |
|||
$where['paytime>'] = $starttime; |
|||
$where['paytime<'] = $endtime+86400; |
|||
} |
|||
if (empty($starttime) || empty($endtime)) { |
|||
$starttime = strtotime('-1 month'); |
|||
$endtime = time(); |
|||
} |
|||
|
|||
$payonlinelist = Util::getNumData('*','wlmerchant_order',$where,'paytime DESC',$pindex,$psize,1); |
|||
$pager = $payonlinelist[1]; |
|||
$list = $payonlinelist[0]; |
|||
foreach ($list as $key => &$li) { |
|||
$member = pdo_get('wlmerchant_member',array('id' => $li['mid']),array('avatar','nickname')); |
|||
$li['avatar'] = tomedia($member['avatar']); |
|||
$li['nickname'] = $member['nickname']; |
|||
if($li['fightstatus'] == 1){ |
|||
$li['goodsname'] = pdo_getcolumn(PDO_NAME.'housekeep_service',array('id'=>$li['fkid']),'title'); |
|||
}else if($li['fightstatus'] == 2){ |
|||
$li['goodsname'] = pdo_getcolumn(PDO_NAME.'housekeep_meals',array('id'=>$li['specid']),'name'); |
|||
}else if($li['fightstatus'] == 3){ |
|||
$typetitle = pdo_getcolumn(PDO_NAME.'housekeep_type',array('id'=>$li['specid']),'name'); |
|||
$li['goodsname'] = '发布['.$typetitle.']需求'; |
|||
}else if($li['fightstatus'] == 4){ |
|||
$li['goodsname'] = '置顶需求'.$li['num'].'天'; |
|||
}else if($li['fightstatus'] == 5){ |
|||
$li['goodsname'] = '刷新需求'; |
|||
} |
|||
|
|||
$li['paytime'] = date('Y-m-d H:i:s',$li['paytime']); |
|||
} |
|||
include wl_template('keeptype/order_lists'); |
|||
} |
|||
|
|||
public function finish(){ |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$res = pdo_update('wlmerchant_order',array('status' => 2,'retype' => 3),array('id' => $id,'status' => 1)); |
|||
if($res){ |
|||
Housekeep::settlementOrder($id); //结算 |
|||
show_json(1, "操作成功"); |
|||
}else{ |
|||
show_json(1, "操作失败,请刷新重试"); |
|||
} |
|||
} |
|||
|
|||
public function refund(){ |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$res = Housekeep::refund($id); |
|||
if($res){ |
|||
show_json(1, "操作成功"); |
|||
}else{ |
|||
show_json(1, "操作失败,请刷新重试"); |
|||
} |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,813 @@ |
|||
<?php |
|||
class KeepWeb_WeliamController { |
|||
|
|||
public function serviceList() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
|
|||
$data = array(); |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
if($_GPC['status'] > 0){ |
|||
$data['status'] = $_GPC['status'] == 8 ? 0 : $_GPC['status']; |
|||
} |
|||
if($_GPC['type'] > 0){ |
|||
$data['type'] = $_GPC['type']; |
|||
} |
|||
if($_GPC['pricetype'] > 0){ |
|||
$data['pricetype'] = $_GPC['pricetype'] == 4 ? 0 : $_GPC['pricetype']; |
|||
} |
|||
if (!empty($_GPC['keyword'])) { |
|||
if (!empty($_GPC['keywordtype'])) { |
|||
switch ($_GPC['keywordtype']) { |
|||
case 1: |
|||
$data['@title@'] = $_GPC['keyword']; |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
} |
|||
if ($_GPC['keywordtype'] == 2) { |
|||
$keyword = $_GPC['keyword']; |
|||
$catearray = pdo_fetchall("SELECT id FROM ".tablename('wlmerchant_housekeep_type')."WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND onelevelid > 0 AND title LIKE '%{$keyword}%' ORDER BY id DESC"); |
|||
$cateids = array_column($catearray, 'id'); |
|||
$objids = pdo_getall('wlmerchant_housekeep_relation',array('twolevelid' => $cateids,'type'=>1),array('objid')); |
|||
$objids = array_column($objids, 'objid'); |
|||
$objids = array_unique($objids); |
|||
if ($objids) { |
|||
$ids = "("; |
|||
foreach ($objids as $key => $v) { |
|||
if ($key == 0) { |
|||
$ids .= $v['id']; |
|||
} else { |
|||
$ids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$ids .= ")"; |
|||
$data['id#'] = $ids; |
|||
} else { |
|||
$data['id#'] = "(0)"; |
|||
} |
|||
} |
|||
} |
|||
|
|||
$info = Util::getNumData('*', PDO_NAME . 'housekeep_service', $data, 'sort DESC,ID DESC', $pindex, $psize, 1); |
|||
$list = $info[0]; |
|||
$pager = $info[1]; |
|||
|
|||
foreach($list as &$st){ |
|||
if($st['type'] == 1){ |
|||
$store = pdo_get('wlmerchant_merchantdata',array('id' => $st['objid']),array('logo','storename')); |
|||
$st['artiftitle'] = $store['storename']; |
|||
$st['artifthumb'] = $store['logo']; |
|||
}else if($st['type'] == 2){ |
|||
$artif = pdo_get('wlmerchant_housekeep_artificer',array('id' => $st['objid']),array('name','thumb')); |
|||
$st['artiftitle'] = $artif['name']; |
|||
$st['artifthumb'] = $artif['thumb']; |
|||
} |
|||
|
|||
$st['levelarray'] = pdo_fetchall("SELECT b.title FROM ".tablename('wlmerchant_housekeep_relation')." a LEFT JOIN".tablename('wlmerchant_housekeep_type')." b ON a.twolevelid = b.id WHERE a.objid = {$st['id']} AND a.type = 1 ORDER BY b.sort DESC,b.id DESC"); |
|||
} |
|||
|
|||
include wl_template('keepweb/serviceList'); |
|||
} |
|||
|
|||
public function editService() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
if($id > 0){ |
|||
$service = pdo_get('wlmerchant_housekeep_service',array('id' => $id)); |
|||
$service['adv'] = unserialize($service['adv']); |
|||
$levelids = pdo_getall('wlmerchant_housekeep_relation', array('objid' => $id,'type' => 1), 'twolevelid'); |
|||
if (!empty($levelids)) { |
|||
$cateids = array_column($levelids, 'twolevelid'); |
|||
} |
|||
if(!empty($service['appointarray'])){ |
|||
$service['appointarray'] = unserialize($service['appointarray']); |
|||
} |
|||
} |
|||
$stores = pdo_getall('wlmerchant_merchantdata',array('uniacid' => $_W['uniacid'],'aid'=>$_W['aid'],'status' => 2,'enabled' =>1,'housekeepstatus' => 1),array('id','storename')); |
|||
$artificers = pdo_getall('wlmerchant_housekeep_artificer',array('uniacid' => $_W['uniacid'],'aid'=>$_W['aid'],'status' => 1),array('id','name')); |
|||
|
|||
$houseflag = 1; |
|||
//获取类目 |
|||
$categoryes = Housekeep::getCategory(); |
|||
//获取海报 |
|||
if (p('diyposter')) { |
|||
$posters = pdo_getall(PDO_NAME . 'poster', array('uniacid' => $_W['uniacid'], 'type' => 16), array('id', 'title')); |
|||
} |
|||
|
|||
if ($_W['ispost']) { |
|||
$service = $_GPC['service']; |
|||
$service['adv'] = serialize($service['adv']); |
|||
$service['detail'] = htmlspecialchars_decode($service['detail']); |
|||
$category = $_GPC['category']; |
|||
if(empty($service['title'])){ |
|||
wl_message('请输入服务项目标题'); |
|||
} |
|||
if(empty($_GPC['aobjid']) && empty($_GPC['sobjid'])){ |
|||
wl_message('选择服务商户或服务者'); |
|||
} |
|||
if(empty($service['thumb'])){ |
|||
wl_message('请设置服务项目缩略图'); |
|||
} |
|||
if(empty($category)){ |
|||
wl_message('请选择服务类目'); |
|||
} |
|||
if($service['pricetype'] > 0){ |
|||
if(empty($service['unit'])){ |
|||
wl_message('请设置服务方式单位'); |
|||
} |
|||
$service['price'] = sprintf("%.2f",$service['price']); |
|||
if($service['price'] < 0.01){ |
|||
wl_message('请设置服务费金额'); |
|||
} |
|||
} |
|||
//获取经纬度 |
|||
if($service['type'] == 1){ |
|||
$service['objid'] = $_GPC['sobjid']; |
|||
$storeinfo = pdo_get('wlmerchant_merchantdata',array('id' => $service['objid']),array('lat','lng')); |
|||
$service['lat'] = $storeinfo['lat']; |
|||
$service['lng'] = $storeinfo['lng']; |
|||
}else if($service['type'] == 2){ |
|||
$service['objid'] = $_GPC['aobjid']; |
|||
$artificerinfo = pdo_get('wlmerchant_housekeep_artificer',array('id' => $service['objid']),array('lat','lng')); |
|||
$service['lat'] = $artificerinfo['lat']; |
|||
$service['lng'] = $artificerinfo['lng']; |
|||
} |
|||
//预约数组 |
|||
if($service['appointstatus']>0){ |
|||
$appointarray = []; |
|||
$appstartTime = $_GPC['appstartTime']; |
|||
$appendTime = $_GPC['appendTime']; |
|||
$peoplenums = $_GPC['peoplenums']; |
|||
if(!is_array($appstartTime)){ |
|||
wl_message('请设置预约时间段信息!'); |
|||
} |
|||
foreach($appstartTime as $appkey => $appoint){ |
|||
$appinta['startTime'] = $appstartTime[$appkey]; |
|||
$appinta['endTime'] = $appendTime[$appkey]; |
|||
$appointarray[] = $appinta; |
|||
} |
|||
$service['appointarray'] = serialize($appointarray); |
|||
} |
|||
if($id > 0){ |
|||
$res = pdo_update('wlmerchant_housekeep_service',$service,array('id' => $id)); |
|||
}else{ |
|||
$service['uniacid'] = $_W['uniacid']; |
|||
$service['aid'] = $_W['aid']; |
|||
$service['createtime'] = time(); |
|||
$res = pdo_insert('wlmerchant_housekeep_service',$service); |
|||
$id = pdo_insertid(); |
|||
} |
|||
//处理分类 |
|||
pdo_delete('wlmerchant_housekeep_relation', array('type' => 1,'objid' => $id)); |
|||
if($id > 0){ |
|||
foreach ($category as $item) { |
|||
$scate = pdo_get(PDO_NAME . 'housekeep_type', array('id' => $item), array('onelevelid')); |
|||
$res = pdo_insert('wlmerchant_housekeep_relation', ['type' => 1,'objid' => $id, 'onelevelid' => $scate['onelevelid'], 'twolevelid' => $item]); |
|||
} |
|||
} |
|||
|
|||
if($res){ |
|||
wl_message('信息编辑成功',web_url('housekeep/KeepWeb/serviceList'), 'success'); |
|||
}else{ |
|||
wl_message('信息保存失败,请重试'); |
|||
} |
|||
|
|||
} |
|||
|
|||
include wl_template('keepweb/editService'); |
|||
} |
|||
|
|||
public function artificerList() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
|
|||
$data = array(); |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
if ($_GPC['status'] == 3) { |
|||
$data['status'] = 0; |
|||
} else if (!empty($_GPC['status'])) { |
|||
$data['status'] = intval($_GPC['status']); |
|||
} |
|||
|
|||
|
|||
if (!empty($_GPC['keyword'])) { |
|||
if (!empty($_GPC['keywordtype'])) { |
|||
switch ($_GPC['keywordtype']) { |
|||
case 1: |
|||
$data['@name@'] = $_GPC['keyword']; |
|||
break; |
|||
case 3: |
|||
$data['@mid@'] = $_GPC['keyword']; |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
} |
|||
if ($_GPC['keywordtype'] == 2) { |
|||
$keyword = $_GPC['keyword']; |
|||
$params[':nickname'] = "%{$keyword}%"; |
|||
$members = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_member') . "WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND nickname LIKE :nickname", $params); |
|||
if ($members) { |
|||
$mids = "("; |
|||
foreach ($members as $key => $v) { |
|||
if ($key == 0) { |
|||
$mids .= $v['id']; |
|||
} else { |
|||
$mids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$mids .= ")"; |
|||
$data['mid#'] = $mids; |
|||
} else { |
|||
$data['mid#'] = "(0)"; |
|||
} |
|||
}else if ($_GPC['keywordtype'] == 4) { |
|||
$keyword = $_GPC['keyword']; |
|||
$catearray = pdo_fetchall("SELECT id FROM ".tablename('wlmerchant_housekeep_type')."WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND onelevelid > 0 AND title LIKE '%{$keyword}%' ORDER BY id DESC"); |
|||
$cateids = array_column($catearray, 'id'); |
|||
$objids = pdo_getall('wlmerchant_housekeep_relation',array('twolevelid' => $cateids,'type'=>2),array('objid')); |
|||
$objids = array_column($objids, 'objid'); |
|||
$objids = array_unique($objids); |
|||
if ($objids) { |
|||
$ids = "("; |
|||
foreach ($objids as $key => $v) { |
|||
if ($key == 0) { |
|||
$ids .= $v['id']; |
|||
} else { |
|||
$ids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$ids .= ")"; |
|||
$data['id#'] = $ids; |
|||
} else { |
|||
$data['id#'] = "(0)"; |
|||
} |
|||
} |
|||
} |
|||
|
|||
$info = Util::getNumData('*', PDO_NAME . 'housekeep_artificer', $data, 'sort DESC,ID DESC', $pindex, $psize, 1); |
|||
$list = $info[0]; |
|||
$pager = $info[1]; |
|||
|
|||
foreach($list as &$st){ |
|||
$st['memberinfo'] = pdo_get('wlmerchant_member',array('id' => $st['mid']),array('nickname','id','avatar')); |
|||
$st['levelarray'] = pdo_fetchall("SELECT b.title FROM ".tablename('wlmerchant_housekeep_relation')." a LEFT JOIN".tablename('wlmerchant_housekeep_type')." b ON a.twolevelid = b.id WHERE a.objid = {$st['id']} AND a.type = 2 ORDER BY b.sort DESC,b.id DESC"); |
|||
if(p('attestation')){ //认证查询 |
|||
$st['attestation'] = Attestation::checkAttestation(1,$st['mid']); |
|||
} |
|||
} |
|||
|
|||
include wl_template('keepweb/artificerList'); |
|||
} |
|||
|
|||
public function editArtificer() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
if($id > 0){ |
|||
$artificer = pdo_get('wlmerchant_housekeep_artificer',array('id' => $id)); |
|||
$artificer['thumbs'] = unserialize($artificer['thumbs']); |
|||
$artificer['casethumbs'] = unserialize($artificer['casethumbs']); |
|||
$levelids = pdo_getall('wlmerchant_housekeep_relation', array('objid' => $id,'type' => 2), 'twolevelid'); |
|||
if (!empty($levelids)) { |
|||
$cateids = array_column($levelids, 'twolevelid'); |
|||
} |
|||
} |
|||
|
|||
//获取类目 |
|||
$categoryes = Housekeep::getCategory(); |
|||
|
|||
if ($_W['ispost']) { |
|||
$artificer = $_GPC['artificer']; |
|||
$artificer['mid'] = $_GPC['aMid']; |
|||
//校验是否已绑定 |
|||
if($artificer['mid'] > 0){ |
|||
$flagid = pdo_getcolumn('wlmerchant_housekeep_artificer',array('mid' => $artificer['mid']),'id'); |
|||
if($flagid > 0 && $flagid != $id){ |
|||
wl_message('此用户已绑定了服务者,无法重复绑定'); |
|||
} |
|||
} |
|||
$artificer['thumbs'] = serialize($artificer['thumbs']); |
|||
$artificer['casethumbs'] = serialize($artificer['casethumbs']); |
|||
$artificer['detail'] = htmlspecialchars_decode($artificer['detail']); |
|||
$category = $_GPC['category']; |
|||
if(empty($artificer['name'])){ |
|||
wl_message('请输入服务者姓名'); |
|||
} |
|||
// if(empty($artificer['mid'])){ |
|||
// wl_message('请设置绑定用户'); |
|||
// } |
|||
if(empty($artificer['mobile'])){ |
|||
wl_message('请设置联系方式'); |
|||
} |
|||
if(empty($artificer['thumb'])){ |
|||
wl_message('请设置头像照片'); |
|||
} |
|||
if(empty($category)){ |
|||
wl_message('请选择服务类目'); |
|||
} |
|||
if(empty($artificer['address']) || empty($artificer['lat']) || empty($artificer['lng'])){ |
|||
wl_message('请设置联系地址'); |
|||
} |
|||
|
|||
if($id > 0){ |
|||
$res = pdo_update('wlmerchant_housekeep_artificer',$artificer,array('id' => $id)); |
|||
}else{ |
|||
$artificer['uniacid'] = $_W['uniacid']; |
|||
$artificer['aid'] = $_W['aid']; |
|||
$res = pdo_insert('wlmerchant_housekeep_artificer',$artificer); |
|||
$id = pdo_insertid(); |
|||
} |
|||
//处理分类 |
|||
pdo_delete('wlmerchant_housekeep_relation', array('type' => 2,'objid' => $id)); |
|||
foreach ($category as $item) { |
|||
$scate = pdo_get(PDO_NAME . 'housekeep_type', array('id' => $item), array('onelevelid')); |
|||
$res = pdo_insert('wlmerchant_housekeep_relation', ['type' => 2,'objid' => $id, 'onelevelid' => $scate['onelevelid'], 'twolevelid' => $item]); |
|||
} |
|||
if($res){ |
|||
wl_message('信息编辑成功',web_url('housekeep/KeepWeb/artificerList'), 'success'); |
|||
}else{ |
|||
wl_message('信息保存失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
|
|||
include wl_template('keepweb/editArtificer'); |
|||
} |
|||
|
|||
public function changeArtificer(){ |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
$status = $_GPC['status']; |
|||
if($status == 7){ |
|||
$res = pdo_delete('wlmerchant_housekeep_artificer',array('id'=>$id));; |
|||
}else if($status == 6){ |
|||
$res = pdo_update('wlmerchant_housekeep_artificer',array('status' => $status,'reason' => trim($_GPC['reason'])),array('id' => $id)); |
|||
if($res){ |
|||
$mid = pdo_getcolumn('wlmerchant_housekeep_artificer',array('id'=>$id),'mid'); |
|||
$first = '您申请的家政服务者入驻已被审核人员驳回'; |
|||
$type = '家政服务'; |
|||
$content = '服务人员入驻'; |
|||
$status = '被驳回'; |
|||
$remark = '驳回原因:'.trim($_GPC['reason']).';点击重新编辑入驻信息。'; |
|||
$url = ''; |
|||
News::jobNotice($mid,$first,$type,$content,$status,$remark,time(),$url); |
|||
} |
|||
}else{ |
|||
$res = pdo_update('wlmerchant_housekeep_artificer',array('status' => $status),array('id' => $id)); |
|||
if($res && $_GPC['nflag'] > 0){ |
|||
$mid = pdo_getcolumn('wlmerchant_housekeep_artificer',array('id'=>$id),'mid'); |
|||
$first = '您申请的家政服务者入驻已经通过审核'; |
|||
$type = '家政服务'; |
|||
$content = '服务人员入驻'; |
|||
$status = '已审核'; |
|||
$remark = '点击进入个人服务中心'; |
|||
$url = ''; |
|||
News::jobNotice($mid,$first,$type,$content,$status,$remark,time(),$url); |
|||
} |
|||
} |
|||
if ($res) { |
|||
show_json(1, '操作成功'); |
|||
} else { |
|||
show_json(0, '操作失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
public function changeService(){ |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
$status = $_GPC['status']; |
|||
if($status == 7){ |
|||
$res = pdo_delete('wlmerchant_housekeep_service',array('id'=>$id));; |
|||
}else if($status == 6){ |
|||
$res = pdo_update('wlmerchant_housekeep_service',array('status' => $status,'reason' => trim($_GPC['reason'])),array('id' => $id)); |
|||
if($res){ |
|||
$info = pdo_get('wlmerchant_housekeep_service',array('id'=>$id),array('objid','type')); |
|||
if($info['type'] == 2){ |
|||
$mid = pdo_getcolumn('wlmerchant_housekeep_artificer',array('id'=>$info['objid']),'mid'); |
|||
$first = '您发布的服务项目已被审核人员驳回'; |
|||
$type = '家政服务'; |
|||
$content = '服务项目发布'; |
|||
$status = '被驳回'; |
|||
$remark = '驳回原因:'.trim($_GPC['reason']).';点击重新编辑服务信息。'; |
|||
$url = ''; |
|||
News::jobNotice($mid,$first,$type,$content,$status,$remark,time(),$url); |
|||
}else if($info['type'] == 1){ |
|||
$first = '您所属商户发布的服务项目已被审核人员驳回'; |
|||
$type = '家政服务'; |
|||
$content = '服务项目发布'; |
|||
$status = '被驳回'; |
|||
$remark = '驳回原因:'.trim($_GPC['reason']).';请重新编辑发布服务项目。'; |
|||
$url = ''; |
|||
News::noticeShopAdmin($info['objid'],$first,$type,$content,$status,$remark,time(),$url); |
|||
} |
|||
} |
|||
}else{ |
|||
$res = pdo_update('wlmerchant_housekeep_service',array('status' => $status),array('id' => $id)); |
|||
if($res && $_GPC['nflag'] > 0){ |
|||
$info = pdo_get('wlmerchant_housekeep_service',array('id'=>$id),array('objid','type')); |
|||
if($info['type'] == 2){ |
|||
$mid = pdo_getcolumn('wlmerchant_housekeep_artificer',array('id'=>$info['objid']),'mid'); |
|||
$first = '您发布的服务项目已通过审核'; |
|||
$type = '家政服务'; |
|||
$content = '服务项目发布'; |
|||
$status = '已审核'; |
|||
$remark = '点击查看服务项目详情'; |
|||
$url = ''; |
|||
News::jobNotice($mid,$first,$type,$content,$status,$remark,time(),$url); |
|||
}else if($info['type'] == 2){ |
|||
$first = '您所属商户发布的服务项目已通过审核'; |
|||
$type = '家政服务'; |
|||
$content = '服务项目发布'; |
|||
$status = '已审核'; |
|||
$remark = '点击查看服务项目详情'; |
|||
$url = ''; |
|||
News::noticeShopAdmin($info['objid'],$first,$type,$content,$status,$remark,time(),$url); |
|||
} |
|||
} |
|||
} |
|||
if ($res) { |
|||
show_json(1, '操作成功'); |
|||
} else { |
|||
show_json(0, '操作失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
public function allchangestatus(){ |
|||
global $_W, $_GPC; |
|||
$ids = $_GPC['ids']; |
|||
$status = $_GPC['status']; |
|||
foreach($ids as $v){ |
|||
if($status == 4){ |
|||
$astatus = pdo_getcolumn('wlmerchant_housekeep_artificer',array('id'=>$v),'status'); |
|||
if($astatus == 4){ |
|||
$res = pdo_delete('wlmerchant_housekeep_artificer',array('id'=>$v));; |
|||
}else{ |
|||
pdo_update('wlmerchant_housekeep_artificer',array('status' => 4),array('id' => $v)); |
|||
} |
|||
}else{ |
|||
pdo_update('wlmerchant_housekeep_artificer',array('status' => $status),array('id' => $v)); |
|||
} |
|||
} |
|||
show_json(1, '操作成功'); |
|||
} |
|||
|
|||
public function allChangeSerStatus(){ |
|||
global $_W, $_GPC; |
|||
$ids = $_GPC['ids']; |
|||
$status = $_GPC['status']; |
|||
foreach($ids as $v){ |
|||
if($status == 4){ |
|||
$astatus = pdo_getcolumn('wlmerchant_housekeep_service',array('id'=>$v),'status'); |
|||
if($astatus == 4){ |
|||
$res = pdo_delete('wlmerchant_housekeep_service',array('id'=>$v));; |
|||
}else{ |
|||
pdo_update('wlmerchant_housekeep_service',array('status' => 4),array('id' => $v)); |
|||
} |
|||
}else{ |
|||
pdo_update('wlmerchant_housekeep_service',array('status' => $status),array('id' => $v)); |
|||
} |
|||
} |
|||
show_json(1, '操作成功'); |
|||
} |
|||
|
|||
public function basicsetting(){ |
|||
global $_W, $_GPC; |
|||
$data = Setting::agentsetting_read('housekeep'); |
|||
$levels = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_halflevel') . "WHERE uniacid = {$_W['uniacid']} AND status = 1 ORDER BY sort DESC"); |
|||
$viparray = unserialize($data['viparray']); |
|||
$refarray = unserialize($data['refarray']); |
|||
$data['attestationRight'] = unserialize($data['attestationRight']); |
|||
$data['topprice'] = unserialize($data['topprice']); |
|||
|
|||
if ($_W['ispost']) { |
|||
$data = $_GPC['data']; |
|||
$vipleid = $_GPC['vipleid']; |
|||
$data['refhour'] = sprintf("%.0f",$data['refhour']); |
|||
$data['topnumber'] = sprintf("%.0f",$data['topnumber']); |
|||
$data['attestationRight'] = serialize($data['attestationRight']); |
|||
if($data['paystatus'] > 0){ //付费发布需求 |
|||
$vipprice = $_GPC['vipprice']; |
|||
$viparray = []; |
|||
foreach($vipleid as $key => $vle){ |
|||
$vipa = sprintf("%.2f",$vipprice[$key]); |
|||
$viparray[$vle] = $vipa; |
|||
} |
|||
$data['viparray'] = serialize($viparray); |
|||
} |
|||
if($data['paytopstatus'] > 0){ //付费置顶 |
|||
$day = $_GPC['day']; |
|||
$topprice = $_GPC['topprice']; |
|||
$topvipprice = $_GPC['topvipprice']; |
|||
$paramids = array(); |
|||
$len = count($day); |
|||
for ($k = 0; $k < $len; $k++) { |
|||
if(empty($day[$k])){ |
|||
wl_message('置顶天数不能为0'); |
|||
} |
|||
if($day[$k]>0){ |
|||
if(empty($topprice[$k]) || empty($topvipprice[$k])){ |
|||
wl_message('置顶金额不能为0'); |
|||
} |
|||
$paramids[$k]['day'] = sprintf("%.0f",$day[$k]); |
|||
$paramids[$k]['topprice'] = sprintf("%.2f",$topprice[$k]); |
|||
$paramids[$k]['topvipprice'] = sprintf("%.2f",$topvipprice[$k]); |
|||
} |
|||
} |
|||
$data['topprice'] = serialize($paramids); |
|||
} |
|||
if($data['payrefstatus'] > 0){ |
|||
$refprice = $_GPC['refprice']; |
|||
$refarray = []; |
|||
foreach($vipleid as $key => $vle){ |
|||
$refa = sprintf("%.2f",$refprice[$key]); |
|||
$refarray[$vle] = $refa; |
|||
} |
|||
$data['refarray'] = serialize($refarray); |
|||
} |
|||
|
|||
Setting::agentsetting_save($data, 'housekeep'); |
|||
wl_message('设置成功', web_url('housekeep/KeepWeb/basicsetting')); |
|||
} |
|||
|
|||
include wl_template('keepweb/basicsetting'); |
|||
|
|||
} |
|||
|
|||
public function demandList(){ |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
|
|||
$data = array(); |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
|
|||
if ($_GPC['status'] == 3) { |
|||
$data['status'] = 0; |
|||
} else if (!empty($_GPC['status'])) { |
|||
$data['status'] = intval($_GPC['status']); |
|||
} |
|||
|
|||
if (!empty($_GPC['keyword'])) { |
|||
if (!empty($_GPC['keywordtype'])) { |
|||
switch ($_GPC['keywordtype']) { |
|||
case 2: |
|||
$data['@mid@'] = $_GPC['keyword']; |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
} |
|||
if ($_GPC['keywordtype'] == 1) { |
|||
$keyword = $_GPC['keyword']; |
|||
$params[':nickname'] = "%{$keyword}%"; |
|||
$members = pdo_fetchall("SELECT id FROM " . tablename('wlmerchant_member') . "WHERE uniacid = {$_W['uniacid']} AND nickname LIKE :nickname", $params); |
|||
if ($members) { |
|||
$mids = "("; |
|||
foreach ($members as $key => $v) { |
|||
if ($key == 0) { |
|||
$mids .= $v['id']; |
|||
} else { |
|||
$mids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$mids .= ")"; |
|||
$data['mid#'] = $mids; |
|||
} else { |
|||
$data['mid#'] = "(0)"; |
|||
} |
|||
}else if ($_GPC['keywordtype'] == 3) { |
|||
$keyword = $_GPC['keyword']; |
|||
$params[':title'] = "%{$keyword}%"; |
|||
$types = pdo_fetchall("SELECT id FROM " . tablename('wlmerchant_housekeep_type') . "WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND title LIKE :title", $params); |
|||
if ($types) { |
|||
$typeids = "("; |
|||
foreach ($types as $key => $v) { |
|||
if ($key == 0) { |
|||
$typeids .= $v['id']; |
|||
} else { |
|||
$typeids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$typeids .= ")"; |
|||
$data['type#'] = $typeids; |
|||
} else { |
|||
$data['type#'] = "(0)"; |
|||
} |
|||
} |
|||
} |
|||
//时间 |
|||
if (!empty($_GPC['time_limit']) && $_GPC['timetype'] ) { |
|||
$starttime = strtotime($_GPC['time_limit']['start']); |
|||
$endtime = strtotime($_GPC['time_limit']['end']); |
|||
if($_GPC['timetype'] == 1){ |
|||
$data['visitingtime>'] = $starttime; |
|||
$data['visitingtime<'] = $endtime; |
|||
}else{ |
|||
$data['createtime>'] = $starttime; |
|||
$data['createtime<'] = $endtime; |
|||
} |
|||
} |
|||
if (empty($starttime) || empty($endtime)) { |
|||
$starttime = strtotime('-1 month'); |
|||
$endtime = time(); |
|||
} |
|||
|
|||
$info = Util::getNumData('*', PDO_NAME . 'housekeep_demand', $data, 'createtime DESC', $pindex, $psize, 1); |
|||
$list = $info[0]; |
|||
$pager = $info[1]; |
|||
foreach($list as &$st){ |
|||
$member = pdo_get('wlmerchant_member',array('id' => $st['mid']),array('nickname','mobile','avatar')); |
|||
$st['nickname'] = $member['nickname']; |
|||
$st['avatar'] = $member['avatar']; |
|||
$st['mobile'] = $member['mobile']; |
|||
$st['typetitle'] = pdo_getcolumn(PDO_NAME.'housekeep_type',array('id'=>$st['type']),'title'); |
|||
} |
|||
|
|||
|
|||
include wl_template('keepweb/demandList'); |
|||
} |
|||
|
|||
public function editDemand(){ |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
if(empty($id)){ |
|||
wl_message('缺少必要参数:id',web_url('housekeep/KeepWeb/demandList'), 'error'); |
|||
} |
|||
$demand = pdo_get('wlmerchant_housekeep_demand',array('id' => $id)); |
|||
if(!empty($demand['thumbs'])){ |
|||
$demand['thumbs'] = unserialize($demand['thumbs']); |
|||
} |
|||
$demand['nickname'] = pdo_getcolumn(PDO_NAME.'member',array('id'=>$demand['mid']),'nickname'); |
|||
//获取类目 |
|||
$categoryes = Housekeep::getCategory(); |
|||
|
|||
if ($_W['ispost']) { |
|||
$demand = $_GPC['demand']; |
|||
$demand['onetype'] = pdo_getcolumn(PDO_NAME.'housekeep_type',array('id'=>$demand['type']),'onelevelid'); |
|||
if(!empty($demand['thumbs'])){ |
|||
$demand['thumbs'] = serialize($demand['thumbs']); |
|||
} |
|||
$demand['visitingtime'] = strtotime($demand['visitingtime']); |
|||
$res = pdo_update('wlmerchant_housekeep_demand',$demand,array('id' => $id)); |
|||
if($res){ |
|||
wl_message('需求编辑成功',web_url('housekeep/KeepWeb/demandList'), 'success'); |
|||
}else{ |
|||
wl_message('需求保存失败,请重试'); |
|||
} |
|||
} |
|||
include wl_template('keepweb/editDemand'); |
|||
} |
|||
|
|||
public function changeDemand(){ |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
$status = $_GPC['status']; |
|||
if($status == 7){ |
|||
$res = pdo_delete('wlmerchant_housekeep_demand',array('id'=>$id));; |
|||
}else if($status == 6){ |
|||
$res = pdo_update('wlmerchant_housekeep_demand',array('status' => $status,'reason' => trim($_GPC['reason'])),array('id' => $id)); |
|||
if($res){ |
|||
$mid = pdo_getcolumn('wlmerchant_housekeep_demand',array('id'=>$id),'mid'); |
|||
$first = '您发布的一个家政服务需求已被审核人员驳回'; |
|||
$type = '家政服务'; |
|||
$content = '需求发布'; |
|||
$status = '被驳回'; |
|||
$remark = '驳回原因:'.trim($_GPC['reason']).';点击重新编辑需求。'; |
|||
$url = ''; |
|||
News::jobNotice($mid,$first,$type,$content,$status,$remark,time(),$url); |
|||
} |
|||
}else{ |
|||
$res = pdo_update('wlmerchant_housekeep_demand',array('status' => $status),array('id' => $id)); |
|||
if($res && $_GPC['nflag'] > 0){ |
|||
$mid = pdo_getcolumn('wlmerchant_housekeep_demand',array('id'=>$id),'mid'); |
|||
$first = '您发布的一个家政服务需求已经通过审核'; |
|||
$type = '家政服务'; |
|||
$content = '需求发布'; |
|||
$status = '已审核'; |
|||
$remark = '点击查看需求详情'; |
|||
$url = ''; |
|||
News::jobNotice($mid,$first,$type,$content,$status,$remark,time(),$url); |
|||
} |
|||
} |
|||
if ($res) { |
|||
show_json(1, '操作成功'); |
|||
} else { |
|||
show_json(0, '操作失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
public function allchangeDemstatus(){ |
|||
global $_W, $_GPC; |
|||
$ids = $_GPC['ids']; |
|||
$status = $_GPC['status']; |
|||
foreach($ids as $v){ |
|||
if($status == 4){ |
|||
$astatus = pdo_getcolumn('wlmerchant_housekeep_demand',array('id'=>$v),'status'); |
|||
if($astatus == 4){ |
|||
$res = pdo_delete('wlmerchant_housekeep_demand',array('id'=>$v));; |
|||
}else{ |
|||
pdo_update('wlmerchant_housekeep_demand',array('status' => 4),array('id' => $v)); |
|||
} |
|||
}else{ |
|||
pdo_update('wlmerchant_housekeep_demand',array('status' => $status),array('id' => $v)); |
|||
} |
|||
} |
|||
show_json(1, '操作成功'); |
|||
} |
|||
|
|||
public function storelist(){ |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
|
|||
$data = array(); |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$data['housekeepstatus'] = 1; |
|||
|
|||
if (!empty($_GPC['keyword'])){ |
|||
if ($_GPC['keywordtype'] == 1) { |
|||
$data['@storename@'] = $_GPC['keyword']; |
|||
} |
|||
if (!empty($_GPC['keywordtype'])) { |
|||
switch ($_GPC['keywordtype']) { |
|||
case 1: |
|||
$data['@storename@'] = $_GPC['keyword']; |
|||
break; |
|||
case 2: |
|||
$data['@mobile@'] = $_GPC['keyword']; |
|||
break; |
|||
case 3: |
|||
$data['@realname@'] = $_GPC['keyword']; |
|||
break; |
|||
case 4: |
|||
$data['@tel@'] = $_GPC['keyword']; |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
} |
|||
if($_GPC['keywordtype'] == 5){ |
|||
$keyword = $_GPC['keyword']; |
|||
$catearray = pdo_fetchall("SELECT id FROM ".tablename('wlmerchant_housekeep_type')."WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND onelevelid > 0 AND title LIKE '%{$keyword}%' ORDER BY id DESC"); |
|||
$cateids = array_column($catearray, 'id'); |
|||
$objids = pdo_getall('wlmerchant_housekeep_relation',array('twolevelid' => $cateids,'type'=>3),array('objid')); |
|||
$objids = array_column($objids, 'objid'); |
|||
$objids = array_unique($objids); |
|||
if ($objids) { |
|||
$ids = "("; |
|||
foreach ($objids as $key => $v) { |
|||
if ($key == 0) { |
|||
$ids .= $v; |
|||
} else { |
|||
$ids .= "," . $v; |
|||
} |
|||
} |
|||
$ids .= ")"; |
|||
$data['id#'] = $ids; |
|||
} else { |
|||
$data['id#'] = "(0)"; |
|||
} |
|||
} |
|||
} |
|||
|
|||
$info = Util::getNumData('id,logo,storename,mobile,realname,tel,createtime,endtime,enabled,nowmoney,groupid,housekeepstatus', PDO_NAME . 'merchantdata', $data, 'listorder desc,id desc', $pindex, $psize, 1); |
|||
$list = $info[0]; |
|||
$pager = $info[1]; |
|||
|
|||
foreach ($list as $key => &$value) { |
|||
//查询店员 |
|||
$value['groupname'] = $value['groupid'] ? pdo_getcolumn('wlmerchant_chargelist', array('id' => $value['groupid']), 'name') : ''; |
|||
//服务泪目数据 |
|||
$value['levelarray'] = pdo_fetchall("SELECT b.title FROM ".tablename('wlmerchant_housekeep_relation')." a LEFT JOIN".tablename('wlmerchant_housekeep_type')." b ON a.twolevelid = b.id WHERE a.objid = {$value['id']} AND a.type = 3 ORDER BY b.sort DESC,b.id DESC"); |
|||
if(p('attestation')){ //认证查询 |
|||
$value['attestation'] = Attestation::checkAttestation(2,$value['id']); |
|||
} |
|||
|
|||
} |
|||
include wl_template('keepweb/storelist'); |
|||
} |
|||
|
|||
public function dayandprice(){ |
|||
include wl_template('keepweb/dayandprice'); |
|||
} |
|||
|
|||
public function closeStore(){ |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$res = pdo_update('wlmerchant_merchantdata',array('housekeepstatus' => 0),array('id' => $id)); |
|||
if ($res) { |
|||
show_json(1, '操作成功'); |
|||
} else { |
|||
show_json(0, '操作失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
After Width: | Height: | Size: 971 B |
|
After Width: | Height: | Size: 838 B |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 629 B |
|
After Width: | Height: | Size: 645 B |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
@ -0,0 +1,136 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"> |
|||
<a href="#">编辑分类</a> |
|||
</li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate" id="form"> |
|||
<div class="form-group-title">编辑分类</div> |
|||
<div class="form-group {if $parentId <= 0}hide{/if}"> |
|||
<label class="col-sm-2 control-label">上级分类</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" value="{$parentTitle}" disabled/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="number" name="data[sort]" id="sort" class="form-control" value="{$data['sort']}" /> |
|||
<span class="help-block">提示:填写整数,数字越大越靠前</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分类名称</label> |
|||
<div class="col-sm-7"> |
|||
<input type="text" name="data[title]" id="title" class="form-control" value="{$data['title']}" /> |
|||
</div> |
|||
<div class="col-sm-2"> |
|||
<input type="color" name="data[color]" class="form-control" value="{$data['color']}" > |
|||
</div> |
|||
</div> |
|||
<div class="form-group {if $parentId > 0}hide{/if}" "> |
|||
<label class="col-sm-2 control-label">缩略图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[img]', $data['img']);} |
|||
<span class="help-block">图片建议为40X40</span> |
|||
</div> |
|||
</div> |
|||
<!-- 修改分类&添加子分类时隐藏种类标签 --> |
|||
<div class="form-group {if $_GPC['id'] > 0 || $parentId > 0}hide{/if}"> |
|||
<label class="col-sm-2 control-label">标签种类</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input onclick="show(0)" type="radio" id="inlineRadio3" name="data[type]" value="0" {if intval($data['type'])==0 }checked="checked" {/if}> |
|||
<label onclick="show(0)" for="inlineRadio3" style="padding-left:0px;"> 普通分类 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input onclick="show(1)" type="radio" id="inlineRadio2" name="data[type]" value="1" {if intval($data['type'])==1 }checked="checked" {/if}> |
|||
<label onclick="show(1)" for="inlineRadio2" style="padding-left:0px;"> 导航标签 </label> |
|||
</div> |
|||
<span class="help-block">提示:导航标签不会被视作分类,只在首页做导航使用,子分类只能作为普通分类。</span> |
|||
</div> |
|||
</div> |
|||
<!-- 普通分类 END --> |
|||
<!-- 导航标签 START --> |
|||
<div id="urll" class="form-group {if intval($data['type'])==0 }hide{/if}"> |
|||
<label class="col-sm-2 control-label">导航链接</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[url]" class="form-control" value="{$data['url']}" /> |
|||
</div> |
|||
</div> |
|||
<!-- 导航标签 END --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否显示</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="status1" name="data[status]" value="1" {if intval($data[ 'status'])==1 }checked="checked" {/if}> |
|||
<label for="status1" style="padding-left:0px;"> 是 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="status2" name="data[status]" value="0" {if intval($data[ 'status'])==0 }checked="checked" {/if}> |
|||
<label for="status2" style="padding-left:0px;"> 否 </label> |
|||
</div> |
|||
<span class="help-block">提示:分类不显示,其子分类也不显示</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="data[id]" value="{$data['id']}" /> |
|||
<input type="hidden" name="data[onelevelid]" value="{$parentId}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</from> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
//根据标签种类 显示隐藏相关设置 |
|||
function show(flag){ |
|||
if(flag){ |
|||
$('#urll').removeClass('hide'); |
|||
$('#tag').addClass('hide'); |
|||
}else{ |
|||
$('#urll').addClass('hide'); |
|||
$('#tag').removeClass('hide'); |
|||
} |
|||
} |
|||
//根据付费发帖金额 显示隐藏分销设置 |
|||
function showdis(asd){ |
|||
if($(asd).val()>0){ |
|||
$('#disdiv').removeClass('hide'); |
|||
}else{ |
|||
$('#disdiv').addClass('hide'); |
|||
} |
|||
} |
|||
//根据是否参与分销 显示隐藏分销佣金= |
|||
function distri(flag){ |
|||
if (flag == 1) { |
|||
$('#distridiv').removeClass('hide'); |
|||
} else{ |
|||
$('#distridiv').addClass('hide'); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
$('body').on('click','.addshux',function(){ |
|||
var valueinput = $(this).parent().find('input'); |
|||
var value = valueinput.val(); |
|||
if(value == ''){ |
|||
util.tips('请在编辑框输入内容');return false; |
|||
} |
|||
var valueelemt = $(this).parents('.data-data').find('.rule_pro'); |
|||
valueelemt.append(value+','); |
|||
var nowvalue = valueelemt.next().val(); |
|||
valueelemt.next().val(nowvalue+value+','); |
|||
valueinput.val('').focus(); |
|||
}); |
|||
$('body').on('click','.chongzhi',function(){ |
|||
$(this).parents('.data-data').find('.rule_pro').text('').next().val(''); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,99 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="{php echo web_url('yellowpage/yellowpage/meal_edit', array('id' => $item['id']))}">编辑套餐</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate"> |
|||
<div class="form-group-title">套餐信息</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="item[sort]" class="form-control" value="{$item['sort']}" placeholder="排序"> |
|||
<div class="help-block">排序由大到小,数值越大,顺序越靠前</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>套餐名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="item[name]" class="form-control" value="{$item['name']}" placeholder="请输入套餐名称" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">套餐资费</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[is_free]" value="0" onclick="$('.is_free').show()" {if empty($item['is_free'])}checked{/if}>付费 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[is_free]" value="1" onclick="$('.is_free').hide()" {if !empty($item['is_free'])}checked{/if}>免费 |
|||
</label> |
|||
<div class="help-block">个人服务者入驻是否需要付费</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group is_free" {if !empty($item['is_free'])}style="display: none;"{/if}> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>套餐金额</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" min="0.01" step="0.01" class="form-control" name="item[price]" value="{$item['price']}" placeholder="请输入套餐金额" required> |
|||
<span class="input-group-addon">元</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>套餐时间</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" class="form-control" name="item[day]" value="{$item['day']}" placeholder="请输入套餐时间" digits="true" required> |
|||
<span class="input-group-addon">天</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">入驻审核</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[check]" value="0" {if empty($item['check'])}checked{/if}>无需审核 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[check]" value="1" {if !empty($item['check'])}checked{/if}>需要审核 |
|||
</label> |
|||
<div class="help-block">服务商/服务者入驻是否需要审核</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>服务项目结算比例</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">预约金</span> |
|||
<input type="number" class="form-control" min="0" name="item[appsettpro]" value="{$item['appsettpro']}" placeholder="请输入服务者项目预约金结算比例" required> |
|||
<span class="input-group-addon">%,实价</span> |
|||
<input type="number" class="form-control" min="0" name="item[truesettpro]" value="{$item['truesettpro']}" placeholder="请输入服务者项目实价结算比例" required> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
<div class="help-block">根据这项百分比计算入驻服务者发布的服务项目订单的结算金额。</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[status]" value="0" {if empty($item['status'])}checked{/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[status]" value="1" {if !empty($item['status'])}checked{/if}>启用 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="id" value="{$item['id']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,76 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">套餐管理</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('housekeep/KeepType/mealEdit')}" class="btn btn-primary">添加套餐</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
{if !empty($lists)} |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center"><input type="checkbox" /></th> |
|||
<th class="text-center">排序</th> |
|||
<th class="text-center">套餐名称</th> |
|||
<th class="text-center">费用/时间</th> |
|||
<th class="text-center">审核</th> |
|||
<th class="text-center">已入驻</th> |
|||
<th class="text-center">状态</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $lists $list} |
|||
<tr class="text-center"> |
|||
<td> |
|||
<input type="checkbox" value="{$list['id']}" /> |
|||
</td> |
|||
<td> |
|||
{$list['sort']} |
|||
</td> |
|||
<td> |
|||
{$list['name']} |
|||
</td> |
|||
<td> |
|||
{if $list['is_free'] == 1}免费{else}¥{$list['price']}{/if}/入驻{$list['day']}天 |
|||
</td> |
|||
<td> |
|||
<span class='label {if $list['check']!=1}label-primary{else}label-warning{/if}'> |
|||
{if $list['check']!=1}无需审核{else}需要审核{/if}</span> |
|||
</td> |
|||
<td> |
|||
{$list['usenum']} |
|||
</td> |
|||
<td> |
|||
{php echo tpl_change_status('housekeep/KeepType/mealStatus&id='.$list['id'], $list['status'])} |
|||
</td> |
|||
<td> |
|||
<a class="btn btn-sm btn-primary" href="{php echo web_url('housekeep/KeepType/mealEdit', array('id' => $list['id']))}">编辑</a> |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('housekeep/KeepType/mealDel', array('id' => $list['id']))}" data-confirm="确定删除当前套餐?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default" type="button" data-toggle='batch-remove' data-confirm="确定删除当前选择的套餐?" data-href="{php echo web_url('housekeep/KeepType/mealDel')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
{else} |
|||
<div class="no-result"> |
|||
<p>还没有相关数据</p> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,163 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li><a href="javascript:;">支付记录</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="housekeep" /> |
|||
<input type="hidden" name="ac" value="KeepType" /> |
|||
<input type="hidden" name="do" value="orderlists" /> |
|||
<input type="hidden" name="fightstatus" value="{$_GPC['fightstatus']}" /> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">付费类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('fightstatus:0');}" class="btn {if intval($_GPC['fightstatus']) == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('fightstatus:1');}" class="btn {if $_GPC['fightstatus'] == 1}btn-primary{else}btn-default{/if}">项目下单</a> |
|||
<a href="{php echo wl_filter_url('fightstatus:2');}" class="btn {if $_GPC['fightstatus'] == 2}btn-primary{else}btn-default{/if}">付费入驻</a> |
|||
<a href="{php echo wl_filter_url('fightstatus:3');}" class="btn {if $_GPC['fightstatus'] == 3}btn-primary{else}btn-default{/if}">发布需求</a> |
|||
<a href="{php echo wl_filter_url('fightstatus:4');}" class="btn {if $_GPC['fightstatus'] == 4}btn-primary{else}btn-default{/if}">置顶需求</a> |
|||
<a href="{php echo wl_filter_url('fightstatus:4');}" class="btn {if $_GPC['fightstatus'] == 5}btn-primary{else}btn-default{/if}">刷新需求</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">订单状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if intval($_GPC['status']) == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('status:8');}" class="btn {if $_GPC['status'] == 8}btn-primary{else}btn-default{/if}">未支付</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $_GPC['status'] == 1}btn-primary{else}btn-default{/if}">待完成</a> |
|||
<a href="{php echo wl_filter_url('status:2');}" class="btn {if $_GPC['status'] == 2}btn-primary{else}btn-default{/if}">待评价</a> |
|||
<a href="{php echo wl_filter_url('status:3');}" class="btn {if $_GPC['status'] == 3}btn-primary{else}btn-default{/if}">已完成</a> |
|||
<a href="{php echo wl_filter_url('status:6');}" class="btn {if $_GPC['status'] == 6}btn-primary{else}btn-default{/if}">待退款</a> |
|||
<a href="{php echo wl_filter_url('status:7');}" class="btn {if $_GPC['status'] == 7}btn-primary{else}btn-default{/if}">已退款</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group form-inline"> |
|||
<label class="col-sm-2 control-label">用户</label> |
|||
<div class="col-sm-9"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>昵称</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>手机号</option> |
|||
</select> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">支付时间</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d',$starttime), 'endtime' => date('Y-m-d', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead class="navbar-inner"> |
|||
<tr> |
|||
<th style="width:15%;">订单编号</th> |
|||
<th style="width:15%;">用户信息</th> |
|||
<th style="width:10%;">付费类型</th> |
|||
<th style="width:15%;">付费项目</th> |
|||
<th style="width:5%;">订单金额</th> |
|||
<th style="width:5%;">订单状态</th> |
|||
<th style="width:10%;">支付方式</th> |
|||
<th style="width:10%;">支付时间</th> |
|||
<th style="width:15%;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $de} |
|||
<tr> |
|||
<td>{$de['orderno']}</td> |
|||
<td><img src="{$de['avatar']}" style="width: 30px;height: 30px;"> {$de['nickname']}</td> |
|||
<td> |
|||
{if $de['fightstatus'] == 1} |
|||
<span class="label label-danger">项目下单</span> |
|||
{else if $de['fightstatus'] == 2} |
|||
<span class="label label-info">付费入驻</span> |
|||
{else if $de['fightstatus'] == 3} |
|||
<span class="label label-success">发布需求</span> |
|||
{else if $de['fightstatus'] == 4} |
|||
<span class="label label-warning">置顶需求</span> |
|||
{else if $de['fightstatus'] == 5} |
|||
<span class="label label-default">刷新需求</span> |
|||
{/if} |
|||
</td> |
|||
<td >{$de['goodsname']}</td> |
|||
<td >¥{$de['price']}</td> |
|||
<td> |
|||
{if $de['status'] == 0} |
|||
<span class="label label-default">未支付</span> |
|||
{else if $de['status'] == 1} |
|||
<span class="label label-success">待完成</span> |
|||
{else if $de['status'] == 2} |
|||
<span class="label label-info">待评价</span> |
|||
{else if $de['status'] == 3} |
|||
<span class="label label-info">已完成</span> |
|||
{else if $de['status'] == 6} |
|||
<span class="label label-warning">待退款</span> |
|||
{else if $de['status'] == 7} |
|||
<span class="label label-danger">已退款</span> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $de['paytype'] == 2} |
|||
<span class="label label-success">微信支付</span> |
|||
{else if $de['paytype'] == 3} |
|||
<span class="label label-info">支付宝</span> |
|||
{else if $de['paytype'] == 1} |
|||
<span class="label label-warning">余额支付</span> |
|||
{else if $de['paytype'] == 5} |
|||
<span class="label label-default">小程序</span> |
|||
{else if $de['paytype'] == 6} |
|||
<span class="label label-danger">0元购</span> |
|||
{else if $de['paytype'] == 0} |
|||
<span class="label label-default">未支付</span> |
|||
{else} |
|||
<span class="label label-danger">其他方式</span> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if !empty($de['paytime'])}{$de['paytime']}{else} - 无 - {/if} |
|||
</td> |
|||
<td> |
|||
{if $de['status'] == 1} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepType/finish', array('id'=>$de['id']))}" data-toggle="ajaxRemove" data-confirm="确定此订单已经完成?">完成</a></p> |
|||
{/if} |
|||
{if $de['status'] == 6 || $de['status'] == 1} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepType/refund', array('id'=>$de['id']))}" data-toggle="ajaxRemove" data-confirm="确定退款此订单?">退款</a></p> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,229 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
td>i{cursor:pointer; display:inline-block; width:100%; height:100%; color:#428bca;} |
|||
.category-caret{display:inline-block; width:20px; margin: 0 10px; text-align:center; cursor:pointer; color: #d9534f;} |
|||
.clearfix{margin-top:10px;} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"> |
|||
<a href="#">分类列表</a> |
|||
</li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('housekeep/KeepType/editType')}" class="btn btn-primary">添加一级分类</a> |
|||
<a href="javascript:;" class="btn btn-default js-category-all js-collapse">折叠分类</a> |
|||
<a href="javascript:;" class="btn btn-info" id="createButton" title="一键生成默认的家政服务分类">导入默认分类</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="housekeep" /> |
|||
<input type="hidden" name="ac" value="KeepType" /> |
|||
<input type="hidden" name="do" value="typelists" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">类型名称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="title" value="{$title}" placeholder="请输入行业名称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('recruit/industryPosition/industryExport',['title'=>$title])}" class="btn btn-warning">导出</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="main panel panel-default"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th width="5%" class="text-center"><input type="checkbox" /></th> |
|||
<th width="8%" class="text-center">分类ID</th> |
|||
<th width="8%">分类图片</th> |
|||
<th width="24%">分类名称</th> |
|||
<th width="10%" class="text-center">标签种类</th> |
|||
<th width="10%" class="text-center">开启状态</th> |
|||
<th width="10%" class="text-center">排序参数(越大越靠前)</th> |
|||
<th width="25%" class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody > |
|||
{loop $list $item} |
|||
<tr class="text-center"> |
|||
<td> |
|||
<input type="checkbox" value="{$item['id']}" /> |
|||
</td> |
|||
<td> |
|||
<label class='label label-warning'>{$item['id']}</label> |
|||
</td> |
|||
<td > |
|||
<img class="scrollLoading" src="{php echo tomedia($item['img'])}" height="45" width="45" style='float:left;'/> |
|||
</td> |
|||
<td class="text-left"> |
|||
<div> |
|||
<span style="overflow: hidden; display:block;width:100px;text-align:left;float:left;margin-right:10px;text-overflow: ellipsis;white-space: nowrap;color: {$item['color']};"> |
|||
<a href="javascript:;" data-toggle="ajaxEdit" data-href="{php echo web_url('housekeep/KeepType/setInfo',array('id'=>$item['id'],'type'=>'title'))}" style="color: {$item['color']};">{$item['title']}</a> |
|||
</span> |
|||
</div> |
|||
<div class="{if $item['isnav'] ==1}hide{/if}"> |
|||
<span style='display:block;width:100px;text-align:left;float:left;'> |
|||
<a href="{php echo web_url('housekeep/KeepType/editType',array('parentid'=>$item['id']))}" class="add add_level1" title="添加子分类" > |
|||
<i class="fa fa-plus-circle"></i>添加子分类 |
|||
</a> |
|||
</span> |
|||
<span class="category-caret"> |
|||
<i class="fa fa-caret-down js-category-down" style="display:none;" pid="{$item['id']}"></i> |
|||
<i class="fa fa-caret-up js-category-up" pid="{$item['id']}"></i> |
|||
</span> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
{if $item['isnav'] ==1} |
|||
<label class='label label-primary'>导航标签</label> |
|||
{else} |
|||
<label class='label label-danger'>普通分类</label> |
|||
{/if} |
|||
</td> |
|||
<td>{php echo tpl_change_status('housekeep/KeepType/changeStatus&id='.$item['id'],$item['status'])}</td> |
|||
<td class="text-center"> |
|||
<a href="javascript:;" data-toggle="ajaxEdit" data-href="{php echo web_url('housekeep/KeepType/setInfo',array('id'=>$item['id'],'type'=>'sort'))}" style="color: #000;">{$item['sort']}</a> |
|||
</td> |
|||
<td class="text-center" style="position: relative"> |
|||
{if $item['isnav'] != 1} |
|||
{if p('wxplatform')} |
|||
<a href="javascript:;" data-id="{$category['id']}" data-url="{php echo h5_url('pages/subPages2/homemaking/homemakingMerchant/homemakingMerchant',['onelevelid'=>$item['id'],'twolevelid' =>0,'title'=>$item['title']])}" class="js-clip" > |
|||
复制链接 |
|||
</a> |
|||
- |
|||
{/if} |
|||
{if p('wxapp')} |
|||
<a href="javascript:;" data-id="{$category['id']}" data-url="pages/subPages2/homemaking/homemakingMerchant/homemakingMerchant?onelevelid={$item['id']}&title={$item['title']}&twolevelid=0" class="js-clip" > |
|||
复制路径 |
|||
</a> |
|||
- |
|||
{/if} |
|||
{/if} |
|||
<a href="{php echo web_url('housekeep/KeepType/editType',array('id'=>$item['id']))}">编辑 </a> |
|||
- |
|||
<a href="{php echo web_url('housekeep/KeepType/typeDel',array('ids'=>$item['id']))}" data-toggle="ajaxRemove" data-confirm="确定删除当前类型?">删除 </a> |
|||
</td> |
|||
</tr> |
|||
|
|||
{loop $item['list'] $iitem} |
|||
<tr class="js-collpase js-child-category text-center" pid="{$item['id']}" > |
|||
<td> |
|||
<input type="checkbox" value="{$iitem['id']}" /> |
|||
</td> |
|||
<td> |
|||
<label class='label label-default'>{$iitem['id']}</label> |
|||
</td> |
|||
<td></td> |
|||
<td class="text-left"> |
|||
<div style="padding-left:50px;height:30px;line-height:30px;background:url('./resource/images/bg_repno.gif') no-repeat -245px -545px;width: 200px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;color: {$iitem['color']};"> |
|||
<a href="javascript:;" data-toggle="ajaxEdit" data-href="{php echo web_url('housekeep/KeepType/setInfo',array('id'=>$iitem['id'],'type'=>'title'))}" style="color: {$iitem['color']};">{$iitem['title']}</a> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
{if $iitem['isnav'] ==1} |
|||
<label class='label label-primary'>导航标签</label> |
|||
{else} |
|||
<label class='label label-danger'>普通分类</label> |
|||
{/if} |
|||
</td> |
|||
<td>{php echo tpl_change_status('housekeep/KeepType/changeStatus&id='.$iitem['id'],$iitem['status'])}</td> |
|||
<td class="text-center"> |
|||
<a href="javascript:;" data-toggle="ajaxEdit" data-href="{php echo web_url('housekeep/KeepType/setInfo',array('id'=>$iitem['id'],'type'=>'sort'))}" style="color: #000;">{$iitem['sort']}</a> |
|||
</td> |
|||
<td class="text-center" style="position: relative"> |
|||
{if $iitem['isnav'] != 1} |
|||
{if p('wxplatform')} |
|||
<a href="javascript:;" data-id="{$category['id']}" data-url="{php echo h5_url('pages/subPages2/homemaking/homemakingMerchant/homemakingMerchant',['onelevelid'=>$item['id'],'twolevelid' =>$iitem['id'],'title'=>$iitem['title']])}" class="js-clip" > |
|||
复制链接 |
|||
</a> |
|||
- |
|||
{/if} |
|||
{if p('wxapp')} |
|||
<a href="javascript:;" data-id="{$category['id']}" data-url="pages/subPages2/homemaking/homemakingMerchant/homemakingMerchant?onelevelid={$item['id']}&title={$iitem['title']}&twolevelid={$iitem['id']}" class="js-clip" > |
|||
复制路径 |
|||
</a> |
|||
- |
|||
{/if} |
|||
{/if} |
|||
<a href="{php echo web_url('housekeep/KeepType/editType',array('id'=>$iitem['id']))}">编辑 </a> |
|||
- |
|||
<a href="{php echo web_url('housekeep/KeepType/typeDel',array('ids'=>$iitem['id']))}" data-toggle="ajaxRemove" data-confirm="确定删除当前类型?">删除 </a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<!--操作按钮 分页信息--> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default" type="button" data-toggle='batch-remove' data-confirm="删除一级类型将删除此类型下所有二级类型,确定删除当前选中的所有类型?" data-href="{php echo web_url('housekeep/KeepType/typeDel')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
//控制显示 |
|||
$(function(){ |
|||
$('.js-category-all').click(function() { |
|||
if($(this).hasClass('js-collapse')) { |
|||
$('.js-child-category').fadeOut("slow"); |
|||
$('.fa-caret-up').hide(); |
|||
$('.fa-caret-down').show(); |
|||
$(this).text('全部展开').removeClass('js-collapse'); |
|||
} else { |
|||
$('.js-child-category').fadeIn("slow"); |
|||
$('.fa-caret-up').show(); |
|||
$('.fa-caret-down').hide(); |
|||
$(this).text('全部折叠').addClass('js-collapse'); |
|||
} |
|||
}); |
|||
$('.js-category-up').click(function() { |
|||
var parentId = $(this).attr('pid'); |
|||
$('tr[pid="'+parentId+'"]').fadeOut("slow"); |
|||
$(this).prev().show(); |
|||
$(this).hide(); |
|||
}); |
|||
$('.js-category-down').click(function() { |
|||
var parentId = $(this).attr('pid'); |
|||
$('tr[pid="'+parentId+'"]').fadeIn("slow"); |
|||
$(this).next().show(); |
|||
$(this).hide(); |
|||
}); |
|||
}); |
|||
|
|||
/** |
|||
* 默认行业信息生成 |
|||
*/ |
|||
$("#createButton").on('click',function () { |
|||
tip.confirm('是否生成默认的家政服务分类数据?',function () { |
|||
//显示加载动画 |
|||
$("#page-loading").show(); |
|||
//请求生成 |
|||
let link = "{php echo web_url('housekeep/KeepType/importType');}"; |
|||
$.post(link,function (res) { |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
},'json'); |
|||
}); |
|||
}); |
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,271 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.order-rank img{width:16px; height:16px;} |
|||
.js-remark,.js-admin-remark{word-break:break-all; overflow:hidden; background: #FDEEEE;color: #ED5050;padding: 5px 10px;} |
|||
td.goods-info{position:relative; padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%; margin-top:-25px; background: url({IMAGE_LOADING}) center center no-repeat; width:50px;height:50px; } |
|||
.goods-info span {white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.status-text{cursor:pointer;} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="{php echo wl_filter_url('status:0');}">服务者列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('housekeep/KeepWeb/editArtificer')}" class="btn btn-primary">添加服务者</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="housekeep" /> |
|||
<input type="hidden" name="ac" value="KeepWeb" /> |
|||
<input type="hidden" name="do" value="artificerList" /> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">服务者状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if intval($_GPC['status']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $_GPC['status'] == 1}btn-primary{else}btn-default{/if}">营业中</a> |
|||
<a href="{php echo wl_filter_url('status:5');}" class="btn {if $_GPC['status'] == 5}btn-primary{else}btn-default{/if}">待审核</a> |
|||
<a href="{php echo wl_filter_url('status:3');}" class="btn {if $_GPC['status'] == 3}btn-primary{else}btn-default{/if}">已下架</a> |
|||
<a href="{php echo wl_filter_url('status:6');}" class="btn {if $_GPC['status'] == 6}btn-primary{else}btn-default{/if}">被驳回</a> |
|||
<a href="{php echo wl_filter_url('status:4');}" class="btn {if $_GPC['status'] == 4}btn-primary{else}btn-default{/if}">被删除</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-md-3"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="">关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>服务者姓名</option> |
|||
<option value="4" {if $_GPC['keywordtype']==4}selected="selected"{/if}>服务类目</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>用户昵称</option> |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>用户mid</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in order-list" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th width="3%" class="text-center"><input type="checkbox" name="checkall" value="" id="checkall" class="checkboxall" onclick="var ck = this.checked; $(':checkbox').each(function(){this.checked = ck});"/></th> |
|||
<th width="5%" style="text-align:center;">ID</th> |
|||
<th width="12%">服务者信息</th> |
|||
<th width="15%" style="text-align:center;">服务类目</th> |
|||
{if $_W['wlsetting']['attestation']['switch'] > 0} |
|||
<th width="10%" style="text-align:center;">认证</th> |
|||
{/if} |
|||
<th width="13%" style="text-align:center;">绑定用户</th> |
|||
<th width="17%" style="text-align:center;">联系地址</th> |
|||
<th width="10%" style="text-align:center;">状态</th> |
|||
<th width="15%" style="text-align:center;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr> |
|||
<td><center><input type="checkbox" name="items[]" value="{$item['id']}" class="checkbox" /></center></td> |
|||
<td class="text-center">{$item['id']}</td> |
|||
<td class="goods-info line-feed"> |
|||
<div class="img"><img class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['thumb'])}" height="50" width="50" onerror="this.src='{IMAGE_NOPIC_SMALL}'" ></div> |
|||
<div class="title" style="padding-left: 60px;"> |
|||
<span>{$item['name']}</span> |
|||
<span>{if $item['gender'] == 1}男{else}女{/if};{$item['mobile']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center"> |
|||
{loop $item['levelarray'] $key $it} |
|||
<span class="label {if $key%2 == 0} label-success {else if $key%3 == 0} label-info {else} label-warning {/if}">{$it['title']}</span> |
|||
{/loop} |
|||
</td> |
|||
{if $_W['wlsetting']['attestation']['switch'] > 0} |
|||
<td class="text-center"> |
|||
{if $item['attestation']['attestation'] > 0} |
|||
<img title="已认证" src="../../../../addons/{MODULE_NAME}/plugin/housekeep/web/resource/image/arwebrz.png" height="30" width="30" > |
|||
{else} |
|||
<img title="未认证" src="../../../../addons/{MODULE_NAME}/plugin/housekeep/web/resource/image/webrz.png" height="30" width="30" > |
|||
{/if} |
|||
{if $item['attestation']['bondflag'] > 0} |
|||
<img title="已缴纳保证金" src="../../../../addons/{MODULE_NAME}/plugin/housekeep/web/resource/image/arwebbzj.png" height="30" width="30" > |
|||
{else} |
|||
<img title="未缴纳保证金" src="../../../../addons/{MODULE_NAME}/plugin/housekeep/web/resource/image/webbzj.png" height="30" width="30" > |
|||
{/if} |
|||
</td> |
|||
{/if} |
|||
{if $item['mid'] > 0} |
|||
<td class="goods-info line-feed"> |
|||
<div class="img"><img class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['memberinfo']['avatar'])}" height="50" width="50" onerror="this.src='{IMAGE_NOPIC_SMALL}'" ></div> |
|||
<div class="title" style="padding-left: 60px;"> |
|||
<span>{$item['memberinfo']['nickname']}</span> |
|||
<span>MID:{$item['memberinfo']['id']}</span> |
|||
</div> |
|||
</td> |
|||
{else} |
|||
<td class="text-center"> |
|||
<span class="label label-warning">未绑定用户</span> |
|||
</td> |
|||
{/if} |
|||
<td class="text-center"> |
|||
{$item['address']} |
|||
</td> |
|||
<td class="text-center"> |
|||
{if $item['status'] == 0 }<span class="label label-default">歇业中</span>{/if} |
|||
{if $item['status'] == 1 }<span class="label label-success">服务中</span>{/if} |
|||
{if $item['status'] == 2 }<span class="label label-default">未支付</span>{/if} |
|||
{if $item['status'] == 3 }<span class="label label-warning">已过期</span>{/if} |
|||
{if $item['status'] == 4 }<span class="label label-danger">被删除</span>{/if} |
|||
{if $item['status'] == 5 }<span class="label label-info">待审核</span>{/if} |
|||
{if $item['status'] == 6 }<span class="label label-warning">被驳回</span>{/if} |
|||
</td> |
|||
<td class="text-center" style="position: relative;"> |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/editArtificer', array('id' => $item['id']))}">编辑</a> </p> |
|||
{if $item['status'] == 0 || $item['status'] == 4 || $item['status'] == 6} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeArtificer', array('id'=>$item['id'],'status'=> 1))}" data-toggle="ajaxRemove" data-confirm="确定此服务者开始服务?">启用</a></p> |
|||
{/if} |
|||
{if $item['status'] == 5} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeArtificer', array('id'=>$item['id'],'status'=> 1,'nflag' => 1))}" data-toggle="ajaxRemove" data-confirm="确定此服务者通过审核?">通过</a></p> |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="rejectdis" appid="{$item['id']}">驳回</a></p> |
|||
{/if} |
|||
{if $item['status'] == 1} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeArtificer', array('id'=>$item['id'],'status'=> 0))}" data-toggle="ajaxRemove" data-confirm="确定此服务者停止服务?">歇业</a></p> |
|||
{/if} |
|||
{if $item['status'] == 4} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeArtificer', array('id'=>$item['id'],'status'=> 7))}" data-toggle="ajaxRemove" data-confirm="确定彻底删除此服务者信息?">彻底删除</a></p> |
|||
{else} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeArtificer', array('id'=>$item['id'],'status'=> 4))}" data-toggle="ajaxRemove" data-confirm="确定删除此服务者信息?">删除</a></p> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default btn-sm" type="button" onclick="location.reload();"><i class="fa fa-refresh"></i></button> |
|||
<div class="btn-group btn-group-sm"> |
|||
<button class="btn btn-default" disabled="disabled" id="checkYse" onclick="checkOrDelete(1);">批量启用</button> |
|||
<button class="btn btn-default" disabled="disabled" id="checkNo" onclick="checkOrDelete(0);">批量歇业</button> |
|||
</div> |
|||
<button class="btn btn-default btn-sm" type="button" disabled="disabled" id="delete" onclick="checkOrDelete(4);"><i class="fa fa-trash"></i> 回收站</button> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div id="modal-module-gift22" class="modal fade" tabindex="-1"> |
|||
<div class="modal-dialog" style='width: 920px;'> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button> |
|||
<h3>驳回理由</h3> |
|||
</div> |
|||
<div class="modal-body" style="padding: 0;"> |
|||
<div class="modal-body"> |
|||
<textarea id="remark" name="admin_remark" class="form-control" rows="5"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer" style="padding:15px;"> |
|||
<a class="btn btn-default js-cancel" aria-hidden="true" data-dismiss="modal">取消</a> |
|||
<a class="btn btn-primary js-order-id-post" order-id="" data-dismiss="modal" aria-hidden="true">确定</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
<script> |
|||
|
|||
function checkOrDelete(check){ |
|||
var content = ''; |
|||
if(check==1) content = '确认启用选中服务者?'; |
|||
if(check==0) content = '确认歇业选中服务者?'; |
|||
if(check==4) content = '确认把选中服务者信息放入回收站?如果服务者信息已在回收站将会被彻底删除。'; |
|||
layer.open({ |
|||
title: [ |
|||
'提示', |
|||
'background-color:#18A689; color:#fff;' |
|||
] |
|||
,anim: 'up' |
|||
,content: content |
|||
,btn: ['确认', '取消'] |
|||
,yes:function(index){ |
|||
$('.layer-anim').remove(); |
|||
var ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
ids.push(this.value); |
|||
}; |
|||
}); |
|||
//处理 |
|||
$.post("{php echo web_url('housekeep/KeepWeb/allchangestatus')}", { ids : ids ,status:check}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("操作成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.message); |
|||
}; |
|||
}, 'json'); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
$(function(){ |
|||
$('.checkbox,.checkboxall').click(function(){ |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$('#check').attr('disabled',''); |
|||
if($checks.length>0) { |
|||
$('#checkYse').attr('disabled',false); |
|||
$('#checkNo').attr('disabled',false); |
|||
$('#delete').attr('disabled',false); |
|||
}else{ |
|||
$('#checkYse').attr('disabled',true); |
|||
$('#checkNo').attr('disabled',true); |
|||
$('#delete').attr('disabled',true); |
|||
} |
|||
}); |
|||
|
|||
//驳回申请理由 |
|||
$('.rejectdis').click(function(){ |
|||
var appid = $(this).attr('appid'); |
|||
$('.js-order-id-post').attr("order-id",appid); |
|||
popwin = $('#modal-module-gift22').modal(); |
|||
}); |
|||
|
|||
$('.js-order-id-post').click(function() { |
|||
var order_id = $(this).attr('order-id'); |
|||
var remark = $('#remark').val(); |
|||
$.post("{php echo web_url('housekeep/KeepWeb/changeArtificer')}",{status:6,id:order_id,reason:remark},function(d){ |
|||
if(!d.errno){ |
|||
util.tips('驳回成功!'); |
|||
location.reload(); |
|||
} |
|||
},"json"); |
|||
//$('#order-remark-container').hide(); |
|||
$('.main').css("opacity","1");$('.nav').css("opacity","1");$('.big-menu').css("opacity","1"); |
|||
}); |
|||
|
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,334 @@ |
|||
{php include wl_template('common/header');} |
|||
<div class="app-content"> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">基本设置</a></li> |
|||
<li><a href="#tab_pay">付费设置</a></li> |
|||
<li><a href="#tab_share">分享设置</a></li> |
|||
</ul> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">家政设置</div> |
|||
<div class="panel-body"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">家政服务</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="data[status]" {if $data['status']==1} checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="data[status]" {if $data['status']==0} checked {/if}>禁用 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商户完成订单</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="data[storefish]" {if $data['storefish']==1} checked {/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="data[storefish]" {if $data['storefish']==0} checked {/if}>启用 |
|||
</label> |
|||
<span class="help-block">禁用后,商户无法主动完成业务订单,只能由用户或联系后台管理员完成。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">发布需求审核</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="data[demandpass]" {if $data['demandpass']==1} checked {/if}>免审核 |
|||
</label> |
|||
{if p('attestation')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="2" name="data[demandpass]" {if $data['demandpass']==2} checked {/if}>认证后免审核 |
|||
</label> |
|||
{/if} |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="data[demandpass]" {if $data['demandpass']==0 || empty($data['demandpass'])} checked {/if}>需要审核 |
|||
</label> |
|||
<span class="help-block">开启后用户发布需求是否需要审核</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">个人服务项目发布审核</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="data[servicepass]" {if $data['servicepass']==1} checked {/if}>免审核 |
|||
</label> |
|||
{if p('attestation')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="2" name="data[servicepass]" {if $data['servicepass']==2} checked {/if}>认证后免审核 |
|||
</label> |
|||
{/if} |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="data[servicepass]" {if $data['servicepass']==0 || empty($data['servicepass'])} checked {/if}>需要审核 |
|||
</label> |
|||
<span class="help-block">开启后用户发布需求是否需要审核</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">评价留言</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="data[replystatus]" {if $data['replystatus']==1} checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="data[replystatus]" {if $data['replystatus']==0} checked {/if}>禁用 |
|||
</label> |
|||
<span class="help-block">开启后其他客户可以对用户发布评价留言</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">入驻类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="data[intostatus]" {if $data['intostatus']==1} checked {/if}>仅个人 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="2" name="data[intostatus]" {if $data['intostatus']==2} checked {/if}>仅商户 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="data[intostatus]" {if $data['intostatus']==0 || empty($data['intostatus'])} checked {/if}>个人和商户 |
|||
</label> |
|||
<span class="help-block">开启后其他客户可以对用户发布评价留言</span> |
|||
</div> |
|||
</div> |
|||
{if p('attestation')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">认证特权</label> |
|||
<div class="col-sm-9"> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="service" name="data[attestationRight][]" {if in_array('service',$data['attestationRight'])} checked {/if}>发布服务 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="demand" name="data[attestationRight][]" {if in_array('demand',$data['attestationRight'])} checked {/if}>发布需求 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="artificer" name="data[attestationRight][]" {if in_array('artificer',$data['attestationRight'])} checked {/if}>入驻成为个人服务者 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="reply" name="data[attestationRight][]" {if in_array('reply',$data['attestationRight'])} checked {/if}>评价留言 |
|||
</label> |
|||
<span class="help-block">认证过后的商户或服务者特权,勾选后的项目只有认证用户拥有权限,未勾选的项目所有用户均拥有权限。</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
<div class="tab-pane" id="tab_pay"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">需求付费发布</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" onclick="$('#paydiv').show()" name="data[paystatus]" {if $data['paystatus']==1} checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" onclick="$('#paydiv').hide()" name="data[paystatus]" {if $data['paystatus']==0} checked {/if}>禁用 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div id="paydiv" {if $data['paystatus'] != 1} style="display:none;" {/if}> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">付费金额</label> |
|||
<div class="col-sm-9"> |
|||
<div style="margin-top: 10px;"> |
|||
<div class="input-group data-item"> |
|||
<span class="input-group-addon">[普通用户]</span> |
|||
<input type="hidden" name="vipleid[]" class="form-control" value="N"> |
|||
<input type="number" min="0" name="vipprice[]" class="form-control" value="{$viparray['N']}"> |
|||
<span class="input-group-addon">元(最多保留两位小数)</span> |
|||
</div> |
|||
</div> |
|||
<div style="margin-top: 10px;"> |
|||
<div class="input-group data-item"> |
|||
<span class="input-group-addon">[{$_W['wlsetting']['halflevel']['name']}]</span> |
|||
<input type="hidden" name="vipleid[]" class="form-control" value="0"> |
|||
<input type="number" min="0" name="vipprice[]" class="form-control" value="{$viparray[0]}"> |
|||
<span class="input-group-addon">元(最多保留两位小数)</span> |
|||
</div> |
|||
</div> |
|||
{loop $levels $lpr} |
|||
<div style="margin-top: 10px;"> |
|||
<div class="input-group data-item"> |
|||
<span class="input-group-addon">[{$lpr['name']}]</span> |
|||
<input type="hidden" name="vipleid[]" class="form-control" value="{$lpr['id']}"> |
|||
<input type="number" min="0" name="vipprice[]" class="form-control" value="{$viparray[$lpr['id']]}"> |
|||
<span class="input-group-addon">元(最多保留两位小数)</span> |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
<span class="help-block">金额不填或填0则免费发布。</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">需求付费置顶</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" onclick="$('#toppaydiv').show()" name="data[paytopstatus]" {if $data['paytopstatus']==1} checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" onclick="$('#toppaydiv').hide()" name="data[paytopstatus]" {if $data['paytopstatus']==0} checked {/if}>禁用 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div id="toppaydiv" {if $data['paytopstatus'] != 1} style="display:none;" {/if}> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">置顶数量</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" min="0" name="data[topnumber]" class="form-control" value="{$data['topnumber']}" /> |
|||
<span class="input-group-addon">个</span> |
|||
</div> |
|||
<span class="help-block">置顶需求的数量,不填或填0则无限制。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">置顶价格</label> |
|||
<div class="col-sm-9"> |
|||
<div id="datas"> |
|||
{if empty($data['topprice'])} |
|||
{php include wl_template('keepweb/dayandprice');} |
|||
{else} |
|||
{loop $data['topprice'] $ba} |
|||
{php include wl_template('keepweb/dayandprice');} |
|||
{/loop} |
|||
{/if} |
|||
</div> |
|||
<span class="help-block">时间请填入整数,价格保留两位小数,置顶金额不能为0。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<a class="btn btn-info btn-add-type" href="javascript:;" onclick="addType();"> |
|||
<i class="fa fa-plus" title=""></i>增加一种置顶规则 |
|||
</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">需求刷新功能</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" onclick="$('#refpaydiv').show()" name="data[payrefstatus]" {if $data['payrefstatus']==1} checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" onclick="$('#refpaydiv').hide()" name="data[payrefstatus]" {if $data['payrefstatus']==0} checked {/if}>禁用 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div id="refpaydiv" {if $data['payrefstatus'] != 1} style="display:none;" {/if}> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">刷新间隔时间</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" min="0" name="data[refhour]" class="form-control" value="{$data['refhour']}" /> |
|||
<span class="input-group-addon">小时</span> |
|||
</div> |
|||
<span class="help-block">两次刷新之间间隔时间,不填或填0则无限制。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">付费刷新金额</label> |
|||
<div class="col-sm-9"> |
|||
<div style="margin-top: 10px;"> |
|||
<div class="input-group data-item"> |
|||
<span class="input-group-addon">[普通用户]</span> |
|||
<input type="number" min="0" name="refprice[]" class="form-control" value="{$refarray['N']}"> |
|||
<span class="input-group-addon">元(最多保留两位小数)</span> |
|||
</div> |
|||
</div> |
|||
<div style="margin-top: 10px;"> |
|||
<div class="input-group data-item"> |
|||
<span class="input-group-addon">[{$_W['wlsetting']['halflevel']['name']}]</span> |
|||
<input type="number" min="0" name="refprice[]" class="form-control" value="{$refarray[0]}"> |
|||
<span class="input-group-addon">元(最多保留两位小数)</span> |
|||
</div> |
|||
</div> |
|||
{loop $levels $lpr} |
|||
<div style="margin-top: 10px;"> |
|||
<div class="input-group data-item"> |
|||
<span class="input-group-addon">[{$lpr['name']}]</span> |
|||
<input type="number" min="0" name="refprice[]" class="form-control" value="{$refarray[$lpr['id']]}"> |
|||
<span class="input-group-addon">元(最多保留两位小数)</span> |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
<span class="help-block">金额不填或填0则免费刷新。</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_share"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-body"> |
|||
<div class="alert alert-info"> |
|||
<b>适用模板变量:[昵称] [时间] [系统名称] </b> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">公众号分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[share_image]', $data['share_image']);} |
|||
<span class="help-block">大小2M以下,建议尺寸500*500,如果不选择,默认为商品缩略图片</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">小程序分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[share_wxapp_image]', $data['share_wxapp_image']);} |
|||
<span class="help-block">大小2M以下,建议尺寸500*400,如果不选择,默认为商品缩略图片</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[share_title]" class="form-control" value="{$data['share_title']}" /> |
|||
<span class="help-block">如果不填写,默认为商品名称</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[share_desc]" class="form-control" value="{$data['share_desc']}" /> |
|||
<span class="help-block">如果不填写,默认为分享描述</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
|
|||
var kw = 1; |
|||
function addType() { |
|||
$(".btn-add-type").button("loading"); |
|||
$.ajax({ |
|||
url: "{php echo web_url('housekeep/KeepWeb/dayandprice')}&kw="+kw, |
|||
cache: false |
|||
}).done(function (html) { |
|||
$(".btn-add-type").button("reset"); |
|||
$("#datas").append(html); |
|||
}); |
|||
kw++; |
|||
} |
|||
function removes(asd){ |
|||
$(asd).closest('.data-item').remove(); |
|||
} |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,9 @@ |
|||
<div class="input-group data-item" style="margin-top: 10px;"> |
|||
<span class="input-group-addon">置顶时间(天)</span> |
|||
<input type="number" name="day[]" class="form-control" value="{$ba['day']}"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="number" name="topprice[]" class="form-control" value="{$ba['topprice']}"> |
|||
<span class="input-group-addon">会员¥</span> |
|||
<input type="number" name="topvipprice[]" class="form-control" value="{$ba['topvipprice']}"> |
|||
<span onclick="removes(this)" class="input-group-addon btn btn-default data-item-delete"><i class="fa fa-remove"></i> 删除</span> |
|||
</div> |
|||
@ -0,0 +1,252 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.order-rank img{width:16px; height:16px;} |
|||
.js-remark,.js-admin-remark{word-break:break-all; overflow:hidden; background: #FDEEEE;color: #ED5050;padding: 5px 10px;} |
|||
td.goods-info{position:relative; padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%; margin-top:-25px; background: url({IMAGE_LOADING}) center center no-repeat; width:50px;height:50px; } |
|||
.goods-info span {white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.status-text{cursor:pointer;} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="{php echo wl_filter_url('status:0');}">需求列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="housekeep" /> |
|||
<input type="hidden" name="ac" value="KeepWeb" /> |
|||
<input type="hidden" name="do" value="demandList" /> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">需求状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if intval($_GPC['status']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $_GPC['status'] == 1}btn-primary{else}btn-default{/if}">发布中</a> |
|||
<a href="{php echo wl_filter_url('status:5');}" class="btn {if $_GPC['status'] == 5}btn-primary{else}btn-default{/if}">待审核</a> |
|||
<a href="{php echo wl_filter_url('status:3');}" class="btn {if $_GPC['status'] == 3}btn-primary{else}btn-default{/if}">已关闭</a> |
|||
<a href="{php echo wl_filter_url('status:6');}" class="btn {if $_GPC['status'] == 6}btn-primary{else}btn-default{/if}">被驳回</a> |
|||
<a href="{php echo wl_filter_url('status:4');}" class="btn {if $_GPC['status'] == 4}btn-primary{else}btn-default{/if}">被删除</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-md-3"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="">关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>发布人昵称</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>发布人mid</option> |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>服务类目</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">时间筛选</label> |
|||
<div class="col-md-3"> |
|||
<select name="timetype" class="form-control"> |
|||
<option value="">请选择时间类型</option> |
|||
<option value="1" {if $_GPC['timetype']==1}selected="selected"{/if}>预约上门时间</option> |
|||
<option value="2" {if $_GPC['timetype']==2}selected="selected"{/if}>需求发布时间</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-2"> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d H:i',$starttime), 'endtime' => date('Y-m-d H:i', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in order-list" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th width="3%" class="text-center"><input type="checkbox" name="checkall" value="" id="checkall" class="checkboxall" onclick="var ck = this.checked; $(':checkbox').each(function(){this.checked = ck});"/></th> |
|||
<th width="5%" style="text-align:center;">ID</th> |
|||
<th width="15%">发布者信息</th> |
|||
<th width="15%" style="text-align:center;">服务类目</th> |
|||
<th width="15%" style="text-align:center;">预约上门/创建时间</th> |
|||
<th width="17%" style="text-align:center;">服务地址</th> |
|||
<th width="10%" style="text-align:center;">状态</th> |
|||
<th width="20%" style="text-align:center;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr> |
|||
<td><center><input type="checkbox" name="items[]" value="{$item['id']}" class="checkbox" /></center></td> |
|||
<td class="text-center">{$item['id']}</td> |
|||
<td class="goods-info line-feed"> |
|||
<div class="img"><img class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['avatar'])}" height="50" width="50" onerror="this.src='{IMAGE_NOPIC_SMALL}'" ></div> |
|||
<div class="title" style="padding-left: 60px;"> |
|||
<span>{$item['nickname']}</span> |
|||
<span>MID:{$item['mid']}</span> |
|||
<span>{$item['mobile']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center"> |
|||
<span class="label label-success">{$item['typetitle']}</span> |
|||
</td> |
|||
<td class="text-center"> |
|||
{php echo date('Y-m-d H:i',$item['visitingtime'])}<br/> |
|||
{php echo date('Y-m-d H:i',$item['createtime'])} |
|||
</td> |
|||
<td class="text-center"> |
|||
{$item['address']} |
|||
</td> |
|||
<td class="text-center"> |
|||
{if $item['status'] == 0 }<span class="label label-default">已关闭</span>{/if} |
|||
{if $item['status'] == 1 }<span class="label label-success">发布中</span>{/if} |
|||
{if $item['status'] == 3 }<span class="label label-default">待支付</span>{/if} |
|||
{if $item['status'] == 4 }<span class="label label-danger">被删除</span>{/if} |
|||
{if $item['status'] == 5 }<span class="label label-info">待审核</span>{/if} |
|||
{if $item['status'] == 6 }<span class="label label-warning">被驳回</span>{/if} |
|||
</td> |
|||
<td class="text-center" style="position: relative;"> |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/editDemand', array('id' => $item['id']))}">编辑</a> </p> |
|||
{if $item['status'] == 0 || $item['status'] == 4 || $item['status'] == 6} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeDemand', array('id'=>$item['id'],'status'=> 1))}" data-toggle="ajaxRemove" data-confirm="确定此服务者开始服务?">发布</a></p> |
|||
{/if} |
|||
{if $item['status'] == 5} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeDemand', array('id'=>$item['id'],'status'=> 1,'nflag' => 1))}" data-toggle="ajaxRemove" data-confirm="确定此服务者通过审核?">通过</a></p> |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="rejectdis" appid="{$item['id']}">驳回</a></p> |
|||
{/if} |
|||
{if $item['status'] == 1} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeDemand', array('id'=>$item['id'],'status'=> 0))}" data-toggle="ajaxRemove" data-confirm="确定此服务者停止服务?">关闭</a></p> |
|||
{/if} |
|||
{if $item['status'] == 4} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeDemand', array('id'=>$item['id'],'status'=> 7))}" data-toggle="ajaxRemove" data-confirm="确定彻底删除此服务者信息?">彻底删除</a></p> |
|||
{else} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeDemand', array('id'=>$item['id'],'status'=> 4))}" data-toggle="ajaxRemove" data-confirm="确定删除此服务者信息?">删除</a></p> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default btn-sm" type="button" onclick="location.reload();"><i class="fa fa-refresh"></i></button> |
|||
<div class="btn-group btn-group-sm"> |
|||
<button class="btn btn-default" disabled="disabled" id="checkYse" onclick="checkOrDelete(1);">批量发布</button> |
|||
<button class="btn btn-default" disabled="disabled" id="checkNo" onclick="checkOrDelete(0);">批量关闭</button> |
|||
</div> |
|||
<button class="btn btn-default btn-sm" type="button" disabled="disabled" id="delete" onclick="checkOrDelete(4);"><i class="fa fa-trash"></i> 回收站</button> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div id="modal-module-gift22" class="modal fade" tabindex="-1"> |
|||
<div class="modal-dialog" style='width: 920px;'> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button> |
|||
<h3>驳回理由</h3> |
|||
</div> |
|||
<div class="modal-body" style="padding: 0;"> |
|||
<div class="modal-body"> |
|||
<textarea id="remark" name="admin_remark" class="form-control" rows="5"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer" style="padding:15px;"> |
|||
<a class="btn btn-default js-cancel" aria-hidden="true" data-dismiss="modal">取消</a> |
|||
<a class="btn btn-primary js-order-id-post" order-id="" data-dismiss="modal" aria-hidden="true">确定</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
<script> |
|||
|
|||
function checkOrDelete(check){ |
|||
var content = ''; |
|||
if(check==1) content = '确认发布选中需求?'; |
|||
if(check==0) content = '确认关闭选中需求?'; |
|||
if(check==4) content = '确认把选中需求信息放入回收站?如果服务者信息已在回收站将会被彻底删除。'; |
|||
layer.open({ |
|||
title: [ |
|||
'提示', |
|||
'background-color:#18A689; color:#fff;' |
|||
] |
|||
,anim: 'up' |
|||
,content: content |
|||
,btn: ['确认', '取消'] |
|||
,yes:function(index){ |
|||
$('.layer-anim').remove(); |
|||
var ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
ids.push(this.value); |
|||
}; |
|||
}); |
|||
//处理 |
|||
$.post("{php echo web_url('housekeep/KeepWeb/allchangeDemstatus')}", { ids : ids ,status:check}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("操作成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.message); |
|||
}; |
|||
}, 'json'); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
$(function(){ |
|||
$('.checkbox,.checkboxall').click(function(){ |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$('#check').attr('disabled',''); |
|||
if($checks.length>0) { |
|||
$('#checkYse').attr('disabled',false); |
|||
$('#checkNo').attr('disabled',false); |
|||
$('#delete').attr('disabled',false); |
|||
}else{ |
|||
$('#checkYse').attr('disabled',true); |
|||
$('#checkNo').attr('disabled',true); |
|||
$('#delete').attr('disabled',true); |
|||
} |
|||
}); |
|||
|
|||
//驳回申请理由 |
|||
$('.rejectdis').click(function(){ |
|||
var appid = $(this).attr('appid'); |
|||
$('.js-order-id-post').attr("order-id",appid); |
|||
popwin = $('#modal-module-gift22').modal(); |
|||
}); |
|||
|
|||
$('.js-order-id-post').click(function() { |
|||
var order_id = $(this).attr('order-id'); |
|||
var remark = $('#remark').val(); |
|||
$.post("{php echo web_url('housekeep/KeepWeb/changeDemand')}",{status:6,id:order_id,reason:remark},function(d){ |
|||
if(!d.errno){ |
|||
util.tips('驳回成功!'); |
|||
location.reload(); |
|||
} |
|||
},"json"); |
|||
$('.main').css("opacity","1");$('.nav').css("opacity","1");$('.big-menu').css("opacity","1"); |
|||
}); |
|||
|
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,163 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">编辑服务者</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate"> |
|||
<div class="form-group-title">服务者信息</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">绑定用户</label> |
|||
<div class="col-sm-9"> |
|||
<input type='hidden' name="artificer[mid]" value="{$artificer['mid']}" /> |
|||
{php echo tpl_select_user('aMid',$artificer['mid']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>姓名</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="artificer[name]" maxlength="16" class="form-control" value="{$artificer['name']}" placeholder="请输入服务者姓名" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>性别</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="artificer[gender]" value="1" {if empty($artificer['gender']) || $artificer['gender'] == 1}checked{/if}> 男 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="artificer[gender]" value="2" {if $artificer['gender'] == 2} checked{/if}> 女 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>联系电话</label> |
|||
<div class="col-sm-9"> |
|||
<input type="number" name="artificer[mobile]" maxlength="16" class="form-control" value="{$artificer['mobile']}" placeholder="请输入服务者联系电话" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>头像照片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('artificer[thumb]', $artificer['thumb'])} |
|||
<span class="help-block">服务者头像照片,建议使用正方形图片</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>服务类目</label> |
|||
<div class="col-sm-9"> |
|||
<select name="category[]" class="form-control select2" multiple> |
|||
{loop $categoryes $parent} |
|||
<optgroup label="{$parent['title']}"> |
|||
{loop $parent['list'] $children} |
|||
<option value="{$children['id']}" {if in_array($children['id'], $cateids)}selected{/if}>{$children['title']}</option> |
|||
{/loop} |
|||
</optgroup> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>联系地址</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_select_address('artificer[address]','artificer[lng]','artificer[lat]',$artificer['address'],$artificer['lng'],$artificer['lat'])} |
|||
</div> |
|||
</div> |
|||
<!-- <div class="form-group">--> |
|||
<!-- <label class="col-sm-2 control-label">添加标签</label>--> |
|||
<!-- <div class="col-sm-9">--> |
|||
<!-- <div class="data-data">--> |
|||
<!-- <div class="col-sm-8" style="margin: 0px;padding-left: 0;float: left;margin-bottom: 1rem;">--> |
|||
<!-- <span class="rule_pro" style="position: relative;top: 5px;left: 5px;">{$artificer['tagarray']}</span>--> |
|||
<!-- <input type="hidden" name="artificer[tagarray]" class="form-control valid" value="{$artificer['tagarray']}">--> |
|||
<!-- </div>--> |
|||
<!-- <br/>--> |
|||
<!-- <div class="input-group" style="margin: 0px;padding-right: 0;float: left">--> |
|||
<!-- <input type="text" class="form-control valid" placeholder="在此输入一个标签,然后点击添加">--> |
|||
<!-- <span class="input-group-addon btn btn-default addshux">添加</span>--> |
|||
<!-- <span class="input-group-addon btn btn-default chongzhi">重置</span>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
|
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">工作照片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_multi('artificer[thumbs]',$artificer['thumbs']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">案例照片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_multi('artificer[casethumbs]',$artificer['casethumbs']);} |
|||
</div> |
|||
</div> |
|||
<!-- <div class="form-group">--> |
|||
<!-- <label class="col-sm-2 control-label">详细介绍</label>--> |
|||
<!-- <div class="col-sm-9">--> |
|||
<!-- {php echo tpl_diy_editor_create('artificer[detail]', $artificer['detail']);}--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">列表排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="number" name="artificer[sort]" maxlength="16" class="form-control" value="{$artificer['sort']}" placeholder="排序数字,数字越大越靠前"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">服务者状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="artificer[status]" value="1" {if $artificer['status'] == 1}checked{/if}> 营业中 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="artificer[status]" value="0" {if empty($artificer['status'])} checked{/if}> 歇业中 |
|||
</label> |
|||
{if $artificer['status'] == 4} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="artificer[status]" value="4" {if $artificer['status'] == 4} checked{/if}> 被删除 |
|||
</label> |
|||
{/if} |
|||
{if $artificer['status'] == 5} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="artificer[status]" value="5" {if $artificer['status'] == 5} checked{/if}> 待审核 |
|||
</label> |
|||
{/if} |
|||
{if $artificer['status'] == 6} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="artificer[status]" value="6" {if $artificer['status'] == 6} checked{/if}> 被驳回 |
|||
</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="id" value="{$artificer['id']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$('body').on('click','.addshux',function(){ |
|||
var valueinput = $(this).parent().find('input'); |
|||
var value = valueinput.val(); |
|||
if(value == ''){ |
|||
util.tips('请在编辑框输入内容');return false; |
|||
} |
|||
var valueelemt = $(this).parents('.data-data').find('.rule_pro'); |
|||
valueelemt.append(value+','); |
|||
var nowvalue = valueelemt.next().val(); |
|||
valueelemt.next().val(nowvalue+value+','); |
|||
valueinput.val('').focus(); |
|||
}); |
|||
$('body').on('click','.chongzhi',function(){ |
|||
$(this).parents('.data-data').find('.rule_pro').text('').next().val(''); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,93 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">需求详情</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate"> |
|||
<div class="form-group-title">需求信息</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">发布用户</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="nothing" class="form-control" value="{$demand['nickname']}" readonly="readonly"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>服务类目</label> |
|||
<div class="col-sm-9"> |
|||
<select name="demand[type]" class="form-control select2"> |
|||
{loop $categoryes $parent} |
|||
<optgroup label="{$parent['title']}"> |
|||
{loop $parent['list'] $children} |
|||
<option value="{$children['id']}" {if $demand['type'] == $children['id']}selected{/if}>{$children['title']}</option> |
|||
{/loop} |
|||
</optgroup> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>上门地址</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_select_address('demand[address]','demand[lng]','demand[lat]',$demand['address'],$demand['lng'],$demand['lat'])} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">上门时间</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
{php echo tpl_form_field_date('demand[visitingtime]', date('Y-m-d H:i', $demand['visitingtime']),true);} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">图集</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_multi('demand[thumbs]',$demand['thumbs']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">详情描述</label> |
|||
<div class="col-sm-9"> |
|||
<textarea name="demand[detail]" class="form-control" rows="8">{$demand['detail']}</textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">服务者状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="demand[status]" value="1" {if $demand['status'] == 1}checked{/if}> 发布中 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="demand[status]" value="0" {if empty($demand['status'])} checked{/if}> 已关闭 |
|||
</label> |
|||
{if $demand['status'] == 4} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="demand[status]" value="4" {if $demand['status'] == 4} checked{/if}> 被删除 |
|||
</label> |
|||
{/if} |
|||
{if $demand['status'] == 5} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="demand[status]" value="5" {if $demand['status'] == 5} checked{/if}> 待审核 |
|||
</label> |
|||
{/if} |
|||
{if $demand['status'] == 6} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="demand[status]" value="6" {if $demand['status'] == 6} checked{/if}> 被驳回 |
|||
</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="id" value="{$demand['id']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
|
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,316 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
label{font-weight:400;} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">基本信息</a></li> |
|||
<li><a href="#tab_detail">项目详情</a></li> |
|||
<!--<li><a href="#tab_appoint">预约设置</a></li>--> |
|||
<li><a href="#tab_share">分享设置</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="form-group-title">基本信息</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>服务者类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('#serstore').show();$('#artificer').hide();" > |
|||
<input type="radio" name="service[type]" value="1" {if empty($service['type']) || $service['type'] == 1}checked{/if}> 商户发布 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#serstore').hide();$('#artificer').show();"> |
|||
<input type="radio" name="service[type]" value="2" {if $service['type'] == 2} checked{/if}> 个人发布 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="serstore" {if $service['type'] == 2} style="display: none;" {/if}> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>服务商户</label> |
|||
<div class="col-sm-7 col-xs-6"> |
|||
<select name="sobjid" class="form-control select2 col-sm-7 col-xs-6" style="width: 100%;"> |
|||
{loop $stores $sto} |
|||
<option value="{$sto['id']}" {if $sto['id'] == $service['objid']} selected="selected" {/if}>{$sto['storename']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="artificer" {if $service['type'] == 1 || empty($service) } style="display: none;" {/if}> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>服务者</label> |
|||
<div class="col-sm-7 col-xs-6"> |
|||
<select name="aobjid" class="form-control select2 col-sm-7 col-xs-6" style="width: 100%;"> |
|||
{loop $artificers $art} |
|||
<option value="{$art['id']}" {if $art['id'] == $service['objid']} selected="selected" {/if}>{$art['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>服务标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="service[title]" maxlength="16" class="form-control" value="{$service['title']}" placeholder="请输入服务标题" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>服务类目</label> |
|||
<div class="col-sm-9"> |
|||
<select name="category[]" class="form-control select2" multiple> |
|||
{loop $categoryes $parent} |
|||
<optgroup label="{$parent['title']}"> |
|||
{loop $parent['list'] $children} |
|||
<option value="{$children['id']}" {if in_array($children['id'], $cateids)}selected{/if}>{$children['title']}</option> |
|||
{/loop} |
|||
</optgroup> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>支付金额类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('#pricediv').hide();" > |
|||
<input type="radio" name="service[pricetype]" value="0" {if empty($service['pricetype']) || $service['pricetype'] == 0}checked{/if}> 面议 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#pricediv').show();" > |
|||
<input type="radio" name="service[pricetype]" value="1" {if $service['pricetype'] == 1} checked{/if}> 订金 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#pricediv').show();" > |
|||
<input type="radio" name="service[pricetype]" value="2" {if $service['pricetype'] == 2} checked{/if}> 实价 |
|||
</label> |
|||
<span class="help-block">面议:下单时不需要支付任何金额,服务人员上门后面议金额;订金:用户下单时预先支付订金,服务人员上门后支付尾款;实价:用户下单时支付所有金额,后续不需要在支付金额。</span> |
|||
</div> |
|||
</div> |
|||
<div id="pricediv" class="form-group" {if $service['pricetype'] == 0 || empty($service)} style="display: none;" {/if} > |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>支付金额</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">金额¥</span> |
|||
<input type="number" name="service[price]" class="form-control" min="0" value="{$service['price']}" /> |
|||
<span class="input-group-addon">单位</span> |
|||
<input type="text" name="service[unit]" class="form-control" value="{$service['unit']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>缩略图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('service[thumb]', $service['thumb'])} |
|||
<span class="help-block">服务项目缩略图,建议使用正方形图片</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">列表排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="number" name="service[sort]" maxlength="16" class="form-control" value="{$service['sort']}" placeholder="排序数字,数字越大越靠前"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">服务状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="service[status]" value="1" {if $service['status'] == 1}checked{/if}> 销售中 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="service[status]" value="0" {if empty($service['status'])} checked{/if}> 已下架 |
|||
</label> |
|||
{if $service['status'] == 4} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="service[status]" value="4" {if $service['status'] == 4} checked{/if}> 被删除 |
|||
</label> |
|||
{/if} |
|||
{if $service['status'] == 5} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="service[status]" value="5" {if $service['status'] == 5} checked{/if}> 待审核 |
|||
</label> |
|||
{/if} |
|||
{if $service['status'] == 6} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="service[status]" value="6" {if $service['status'] == 6} checked{/if}> 被驳回 |
|||
</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_detail"> |
|||
<div class="form-group-title">项目详情</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">案例照片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_multi('service[adv]',$service['adv']);} |
|||
<span class="help-block">显示在服务详情页面顶部的幻灯片。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">视频链接</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" value="{$service['videourl']}" name="service[videourl]" class="form-control" autocomplete="off" id="cimg-videourl"> |
|||
<span class="input-group-btn"> |
|||
<button class="btn btn-default" type="button" data-toggle="selectVideo" data-input="#cimg-videourl" data-img="#pimg-videourl" >选择媒体文件</button> |
|||
</span> |
|||
</div> |
|||
<span class="help-block">显示在服务详情页面顶部的视频。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">虚拟销量</label> |
|||
<div class="col-sm-9"> |
|||
<input type="number" name="service[salenum]" min="0" maxlength="10" class="form-control" value="{$service['salenum']}" placeholder="请输入虚拟销量"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">详情介绍</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('service[detail]', $service['detail']);} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_appoint"> |
|||
<div class="form-group-title">预约设置</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">预约功能</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('#appointdiv').show();"> |
|||
<input type="radio" value="1" name="service[appointstatus]" {if $service['appointstatus']==1} checked {/if}> 开启 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#appointdiv').hide();"> |
|||
<input type="radio" value="0" name="service[appointstatus]" {if $service['appointstatus']==0 || empty($service['appointstatus'])} checked {/if}>关闭 |
|||
</label> |
|||
<span class="help-block">开启预约后,下单时需要提前选择预约时间。</span> |
|||
</div> |
|||
</div> |
|||
<div id="appointdiv" {if $service['appointstatus']==0 || empty($service['appointstatus'])} style="display:none;" {/if} > |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">预约小时</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">请于</span> |
|||
<input type="number" name="service[appointment]" min="0" class="form-control" value="{$service['appointment']}" /> |
|||
<span class="input-group-addon">小时前预约</span> |
|||
</div> |
|||
<span class="help-block">不填或填0即可立即预约。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">最近预约天数</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">最近可预约</span> |
|||
<input type="number" name="service[appointdays]" min="0" class="form-control" value="{$service['appointdays']}" /> |
|||
<span class="input-group-addon">天</span> |
|||
</div> |
|||
<span class="help-block">不填或填0即最多可以预约30天;如果填1,只能预约当天与明天的位置,填2即可预约当天,明天和后天的位置,以此类推。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">每日预约详情</label> |
|||
<div class="col-sm-9" id="appointarray"> |
|||
{if !empty($service['appointarray'])} |
|||
{loop $service['appointarray'] $appli} |
|||
{php include wl_template('goodshouse/appointhtml');} |
|||
{/loop} |
|||
{/if} |
|||
</div> |
|||
<div class="form-group sms-template-1" style="display:block;"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<a class="btn btn-default btn-add-type" href="javascript:;" onclick="addAppoint();"> |
|||
<i class="fa fa-plus" title=""></i>增加一个时间段 |
|||
</a> |
|||
<span class="help-block">接待人数填0或者不填即代表不限人数。</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_share"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-body"> |
|||
<div class="form-group-title">分享设置</div> |
|||
<div class="alert alert-info"> |
|||
<b>适用模板变量:[昵称] [时间] [项目名称] [价格] </b> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">公众号分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('service[share_image]', $service['share_image']);} |
|||
<span class="help-block">大小2M以下,建议尺寸500*500,如果不选择,默认为商品缩略图片</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">小程序分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('service[share_wxapp_image]', $service['share_wxapp_image']);} |
|||
<span class="help-block">大小2M以下,建议尺寸500*400,如果不选择,默认为商品缩略图片</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="service[share_title]" class="form-control" value="{$service['share_title']}" /> |
|||
<span class="help-block">如果不填写,默认为商品名称</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="service[share_desc]" class="form-control" value="{$service['share_desc']}" /> |
|||
<span class="help-block">如果不填写,默认为分享描述</span> |
|||
</div> |
|||
</div> |
|||
{if p('diyposter')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">自定义海报</label> |
|||
<div class="col-sm-9"> |
|||
<select name="service[diyposter]" class="form-control"> |
|||
<option value="0">默认海报</option> |
|||
{loop $posters $poster} |
|||
<option value="{$poster['id']}" {if $service['diyposter'] == $poster['id']}selected="selected"{/if}>{$poster['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="id" value="{$service['id']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$(function () { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function (e) { |
|||
e.preventDefault();//阻止a链接的跳转行为 |
|||
$(this).tab('show');//显示当前选中的链接及关联的content |
|||
}); |
|||
}); |
|||
|
|||
var kw = 0; |
|||
function addAppoint() { |
|||
$(".btn-add-type").html("loading....."); |
|||
$.ajax({ |
|||
url: "{php echo web_url('goodshouse/goodshouse/appointarray')}&house=1&kw="+kw, |
|||
cache: false |
|||
}).done(function (html) { |
|||
var rest = '<i class="fa fa-plus" title=""></i>增加一个时间段'; |
|||
$(".btn-add-type").html(rest); |
|||
$("#appointarray").append(html); |
|||
}); |
|||
kw++; |
|||
} |
|||
$(document).on('click', '.data-item-delete', function () { |
|||
$(this).closest('.data-item').remove(); |
|||
}); |
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,275 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.order-rank img{width:16px; height:16px;} |
|||
.js-remark,.js-admin-remark{word-break:break-all; overflow:hidden; background: #FDEEEE;color: #ED5050;padding: 5px 10px;} |
|||
td.goods-info{position:relative; padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%; margin-top:-25px; background: url({IMAGE_LOADING}) center center no-repeat; width:50px;height:50px; } |
|||
.goods-info span {white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.status-text{cursor:pointer;} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">服务项目列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('housekeep/KeepWeb/editService')}" class="btn btn-primary">添加服务项目</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="housekeep" /> |
|||
<input type="hidden" name="ac" value="KeepWeb" /> |
|||
<input type="hidden" name="do" value="serviceList" /> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}" /> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">服务项目状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if intval($_GPC['status']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $_GPC['status'] == 1}btn-primary{else}btn-default{/if}">销售中</a> |
|||
<a href="{php echo wl_filter_url('status:8');}" class="btn {if $_GPC['status'] == 8}btn-primary{else}btn-default{/if}">已下架</a> |
|||
<a href="{php echo wl_filter_url('status:5');}" class="btn {if $_GPC['status'] == 5}btn-primary{else}btn-default{/if}">待审核</a> |
|||
<a href="{php echo wl_filter_url('status:6');}" class="btn {if $_GPC['status'] == 6}btn-primary{else}btn-default{/if}">被驳回</a> |
|||
<a href="{php echo wl_filter_url('status:4');}" class="btn {if $_GPC['status'] == 4}btn-primary{else}btn-default{/if}">被删除</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">服务提供方</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('type:0');}" class="btn {if intval($_GPC['type']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('type:1');}" class="btn {if $_GPC['type'] == 1}btn-primary{else}btn-default{/if}">商户发布</a> |
|||
<a href="{php echo wl_filter_url('type:2');}" class="btn {if $_GPC['type'] == 2}btn-primary{else}btn-default{/if}">个人发布</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">服务收费</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('pricetype:0');}" class="btn {if intval($_GPC['pricetype']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('pricetype:4');}" class="btn {if $_GPC['pricetype'] == 4}btn-primary{else}btn-default{/if}">面议</a> |
|||
<a href="{php echo wl_filter_url('pricetype:1');}" class="btn {if $_GPC['pricetype'] == 1}btn-primary{else}btn-default{/if}">订金</a> |
|||
<a href="{php echo wl_filter_url('pricetype:2');}" class="btn {if $_GPC['pricetype'] == 2}btn-primary{else}btn-default{/if}">实价</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-md-3"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="">关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>服务项目标题</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>服务类目</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in order-list" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th width="3%" class="text-center"><input type="checkbox" name="checkall" value="" id="checkall" class="checkboxall" onclick="var ck = this.checked; $(':checkbox').each(function(){this.checked = ck});"/></th> |
|||
<th width="5%" style="text-align:center;">ID</th> |
|||
<th width="15%">项目标题</th> |
|||
<th width="15%" style="text-align:center;">服务类目</th> |
|||
<th width="15%" style="text-align:center;">服务提供方</th> |
|||
<th width="17%" style="text-align:center;">服务收费</th> |
|||
<th width="10%" style="text-align:center;">状态</th> |
|||
<th width="20%" style="text-align:center;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr> |
|||
<td><center><input type="checkbox" name="items[]" value="{$item['id']}" class="checkbox" /></center></td> |
|||
<td class="text-center">{$item['id']}</td> |
|||
<td class="goods-info line-feed"> |
|||
<div class="img"><img class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['thumb'])}" height="50" width="50" onerror="this.src='{IMAGE_NOPIC_SMALL}'" ></div> |
|||
<div class="title" style="padding-left: 60px;"> |
|||
<span>{$item['title']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center"> |
|||
{loop $item['levelarray'] $key $it} |
|||
<span class="label {if $key%2 == 0} label-success {else if $key%3 == 0} label-info {else} label-warning {/if}">{$it['title']}</span> |
|||
{/loop} |
|||
</td> |
|||
<td class="goods-info line-feed"> |
|||
<div class="img"><img class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['artifthumb'])}" height="50" width="50" onerror="this.src='{IMAGE_NOPIC_SMALL}'" ></div> |
|||
<div class="title" style="padding-left: 60px;"> |
|||
<span>{$item['artiftitle']}</span> |
|||
{if $item['type'] == 1}<span style="width:64px;" class="label label-success">商户发布</span>{else}<span style="width:64px;" class="label label-info">个人发布</span>{/if} |
|||
</div> |
|||
</td> |
|||
<td class="text-center"> |
|||
{if $item['pricetype'] == 0} |
|||
<span class="label label-info">面议</span> |
|||
{else if $item['pricetype'] == 1} |
|||
<span class="label label-warning">订金</span><br/> |
|||
{$item['price']}/{$item['unit']} |
|||
{else if $item['pricetype'] == 2} |
|||
<span class="label label-success">实价</span><br/> |
|||
{$item['price']}/{$item['unit']} |
|||
{/if} |
|||
</td> |
|||
<td class="text-center"> |
|||
{if $item['status'] == 0 }<span class="label label-default">已下架</span>{/if} |
|||
{if $item['status'] == 1 }<span class="label label-success">销售中</span>{/if} |
|||
{if $item['status'] == 4 }<span class="label label-danger">被删除</span>{/if} |
|||
{if $item['status'] == 5 }<span class="label label-info">待审核</span>{/if} |
|||
{if $item['status'] == 6 }<span class="label label-warning">被驳回</span>{/if} |
|||
</td> |
|||
<td class="text-center" style="position: relative;"> |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/editService', array('id' => $item['id']))}">编辑</a> </p> |
|||
{if $item['status'] == 0 || $item['status'] == 4 || $item['status'] == 6} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeService', array('id'=>$item['id'],'status'=> 1))}" data-toggle="ajaxRemove" data-confirm="确定上架此服务项目?">上架</a></p> |
|||
{/if} |
|||
{if $item['status'] == 5} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeService', array('id'=>$item['id'],'status'=> 1,'nflag' => 1))}" data-toggle="ajaxRemove" data-confirm="确定此服务项目通过审核?">通过</a></p> |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="rejectdis" appid="{$item['id']}">驳回</a></p> |
|||
{/if} |
|||
{if $item['status'] == 1} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeService', array('id'=>$item['id'],'status'=> 0))}" data-toggle="ajaxRemove" data-confirm="确定下架此服务项目?">下架</a></p> |
|||
{/if} |
|||
{if $item['status'] == 4} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeService', array('id'=>$item['id'],'status'=> 7))}" data-toggle="ajaxRemove" data-confirm="确定彻底删除此服务项目?">彻底删除</a></p> |
|||
{else} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/changeService', array('id'=>$item['id'],'status'=> 4))}" data-toggle="ajaxRemove" data-confirm="确定删除此服务项目?">删除</a></p> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default btn-sm" type="button" onclick="location.reload();"><i class="fa fa-refresh"></i></button> |
|||
<div class="btn-group btn-group-sm"> |
|||
<button class="btn btn-default" disabled="disabled" id="checkYse" onclick="checkOrDelete(1);">批量上架</button> |
|||
<button class="btn btn-default" disabled="disabled" id="checkNo" onclick="checkOrDelete(0);">批量下架</button> |
|||
</div> |
|||
<button class="btn btn-default btn-sm" type="button" disabled="disabled" id="delete" onclick="checkOrDelete(4);"><i class="fa fa-trash"></i> 回收站</button> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div id="modal-module-gift22" class="modal fade" tabindex="-1"> |
|||
<div class="modal-dialog" style='width: 920px;'> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button> |
|||
<h3>驳回理由</h3> |
|||
</div> |
|||
<div class="modal-body" style="padding: 0;"> |
|||
<div class="modal-body"> |
|||
<textarea id="remark" name="admin_remark" class="form-control" rows="5"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer" style="padding:15px;"> |
|||
<a class="btn btn-default js-cancel" aria-hidden="true" data-dismiss="modal">取消</a> |
|||
<a class="btn btn-primary js-order-id-post" order-id="" data-dismiss="modal" aria-hidden="true">确定</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
<script> |
|||
|
|||
function checkOrDelete(check){ |
|||
var content = ''; |
|||
if(check==1) content = '确认上架选中服务项目?'; |
|||
if(check==0) content = '确认下架选中服务项目?'; |
|||
if(check==4) content = '确认把选中服务项目放入回收站?如果服务项目已在回收站将会被彻底删除。'; |
|||
layer.open({ |
|||
title: [ |
|||
'提示', |
|||
'background-color:#18A689; color:#fff;' |
|||
] |
|||
,anim: 'up' |
|||
,content: content |
|||
,btn: ['确认', '取消'] |
|||
,yes:function(index){ |
|||
$('.layer-anim').remove(); |
|||
var ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
ids.push(this.value); |
|||
}; |
|||
}); |
|||
//处理 |
|||
$.post("{php echo web_url('housekeep/KeepWeb/allChangeSerStatus')}", { ids : ids ,status:check}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("操作成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.message); |
|||
}; |
|||
}, 'json'); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
$(function(){ |
|||
$('.checkbox,.checkboxall').click(function(){ |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$('#check').attr('disabled',''); |
|||
if($checks.length>0) { |
|||
$('#checkYse').attr('disabled',false); |
|||
$('#checkNo').attr('disabled',false); |
|||
$('#delete').attr('disabled',false); |
|||
}else{ |
|||
$('#checkYse').attr('disabled',true); |
|||
$('#checkNo').attr('disabled',true); |
|||
$('#delete').attr('disabled',true); |
|||
} |
|||
}); |
|||
|
|||
//驳回申请理由 |
|||
$('.rejectdis').click(function(){ |
|||
var appid = $(this).attr('appid'); |
|||
$('.js-order-id-post').attr("order-id",appid); |
|||
popwin = $('#modal-module-gift22').modal(); |
|||
}); |
|||
|
|||
$('.js-order-id-post').click(function() { |
|||
var order_id = $(this).attr('order-id'); |
|||
var remark = $('#remark').val(); |
|||
$.post("{php echo web_url('housekeep/KeepWeb/changeService')}",{status:6,id:order_id,reason:remark},function(d){ |
|||
if(!d.errno){ |
|||
util.tips('驳回成功!'); |
|||
location.reload(); |
|||
} |
|||
},"json"); |
|||
//$('#order-remark-container').hide(); |
|||
$('.main').css("opacity","1");$('.nav').css("opacity","1");$('.big-menu').css("opacity","1"); |
|||
}); |
|||
|
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,136 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.order-rank img{width:16px; height:16px;} |
|||
.js-remark,.js-admin-remark{word-break:break-all; overflow:hidden; background: #FDEEEE;color: #ED5050;padding: 5px 10px;} |
|||
td.goods-info{position:relative; padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%; margin-top:-25px; background: url({IMAGE_LOADING}) center center no-repeat; width:50px;height:50px; } |
|||
.goods-info span {white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.status-text{cursor:pointer;} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="{php echo wl_filter_url('status:0');}">服务商列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="housekeep" /> |
|||
<input type="hidden" name="ac" value="KeepWeb" /> |
|||
<input type="hidden" name="do" value="storelist" /> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-md-3"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="">关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>商户名</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>商户电话</option> |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>店长姓名</option> |
|||
<option value="4" {if $_GPC['keywordtype']==4}selected="selected"{/if}>店长电话</option> |
|||
<option value="5" {if $_GPC['keywordtype']==5}selected="selected"{/if}>服务类目</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in order-list" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th width="5%" style="text-align:center;">ID</th> |
|||
<th width="15%">商户</th> |
|||
<th width="15%" style="text-align:center;">服务类目</th> |
|||
{if $_W['wlsetting']['attestation']['switch'] > 0} |
|||
<th width="10%" style="text-align:center;">认证</th> |
|||
{/if} |
|||
<th width="15%" style="text-align:center;">店长</th> |
|||
<th width="10%" style="text-align:center;">所属套餐</th> |
|||
<th width="10%" style="text-align:center;">时间</th> |
|||
<th width="10%" style="text-align:center;">状态</th> |
|||
<th width="10%" style="text-align:center;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr> |
|||
<td class="text-center">{$item['id']}</td> |
|||
<td class="goods-info line-feed"> |
|||
<div class="img"><img class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['logo'])}" height="50" width="50" onerror="this.src='{IMAGE_NOPIC_SMALL}'" ></div> |
|||
<div class="title" style="padding-left: 60px;"> |
|||
<span>{$item['storename']}</span> |
|||
<span>{$item['mobile']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center"> |
|||
{loop $item['levelarray'] $key $it} |
|||
<span class="label {if $key%2 == 0} label-success {else if $key%3 == 0} label-info {else} label-warning {/if}">{$it['title']}</span> |
|||
{/loop} |
|||
</td> |
|||
{if $_W['wlsetting']['attestation']['switch'] > 0} |
|||
<td class="text-center"> |
|||
{if $item['attestation']['attestation'] > 0} |
|||
<img title="已认证" src="../../../../addons/{MODULE_NAME}/plugin/housekeep/web/resource/image/arwebrz.png" height="30" width="30" > |
|||
{else} |
|||
<img title="未认证" src="../../../../addons/{MODULE_NAME}/plugin/housekeep/web/resource/image/webrz.png" height="30" width="30" > |
|||
{/if} |
|||
{if $item['attestation']['bondflag'] > 0} |
|||
<img title="已缴纳保证金" src="../../../../addons/{MODULE_NAME}/plugin/housekeep/web/resource/image/arwebbzj.png" height="30" width="30" > |
|||
{else} |
|||
<img title="未缴纳保证金" src="../../../../addons/{MODULE_NAME}/plugin/housekeep/web/resource/image/webbzj.png" height="30" width="30" > |
|||
{/if} |
|||
</td> |
|||
{/if} |
|||
<td class="text-center"> |
|||
<span>{$item['realname']}</span><br/> |
|||
<span>{$item['tel']}</span> |
|||
</td> |
|||
<td class="text-center"> |
|||
{if $item['groupname']}<label class="label label-success">{$item['groupname']}</label>{/if} |
|||
</td> |
|||
<td class="text-center"> |
|||
<span>入驻:{php echo date('Y-m-d',$item['createtime'])}</span><br/> |
|||
<span>到期:{php echo date('Y-m-d',$item['endtime'])}</span> |
|||
</td> |
|||
<td class="text-center"> |
|||
{if $item['enabled']==0}<label class="label label-primary">待入驻</label> |
|||
{elseif $item['enabled']==1}<label class="label label-success">入驻中</label> |
|||
{elseif $item['enabled']==2}<label class="label label-warning">暂停中</label> |
|||
{elseif $item['enabled']==3}<label class="label label-danger">已到期</label> |
|||
{elseif $item['enabled']==4}<label class="label label-danger">可彻底删除</label> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center" style="position: relative;"> |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('store/merchant/edit',array('id'=>$item['id'],'houseflag'=>1))}">编辑</a> </p> |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('housekeep/KeepWeb/closeStore', array('id'=>$item['id']))}" data-toggle="ajaxRemove" data-confirm="确定关闭服务商的家政服务?关闭后只能在商户详情页面重新开启。">关闭</a></p> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
|
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,839 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
use EasyWeChat\Factory; |
|||
|
|||
class Live { |
|||
protected $wxApp ,//实例化EasyWeChat |
|||
$caCheKey = 'weliam_live';//缓存键 |
|||
|
|||
public function __construct(){ |
|||
//生成配置信息 |
|||
$set = Setting::wlsetting_read('wxapp_config'); |
|||
if(!$set['appid'] && !$set['secret']) throw new Exception('请完善小程序配置信息!'); |
|||
$config = [ |
|||
'app_id' => trim($set['appid']) , |
|||
'secret' => trim($set['secret']) , |
|||
'response_type' => 'array' , |
|||
]; |
|||
$this->wxApp = Factory::miniProgram($config); |
|||
|
|||
return $this; |
|||
} |
|||
/** |
|||
* Comment: 获取accessToken |
|||
* Author: zzw |
|||
* Date: 2020/10/26 13:57 |
|||
* @param bool $newToken |
|||
* @return array |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function getAccessToken($newToken = false){ |
|||
$accessTokenObj = $this->wxApp->access_token; |
|||
if($newToken){ |
|||
//强制重新从微信服务器获取新的token信息 |
|||
$accessToken = $accessTokenObj->getToken(true); |
|||
$this->wxApp['access_token']->setToken($accessToken['access_token'], 7000); |
|||
}else{ |
|||
//获取已存在的token信息 |
|||
$accessToken = $accessTokenObj->getToken(); |
|||
} |
|||
|
|||
return $accessToken; |
|||
} |
|||
/** |
|||
* Comment: 微信上传获取临时素材 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 13:57 |
|||
* @param $img |
|||
* @return array|bool|false|Memcache|mixed|Redis|string |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \GuzzleHttp\Exception\GuzzleException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
*/ |
|||
public function uploadTemporaryMaterial($img){ |
|||
global $_W; |
|||
//基本参数信息获取 |
|||
$link = tomedia($img); |
|||
$caCheName = md5($link);//当前图片缓存信息 防止同一张图片多次提交 |
|||
//获取缓存信息 |
|||
$mediaId = Cache::getCache('live_goods_img',$caCheName); |
|||
//上传图片 |
|||
if(!$mediaId){ |
|||
$imgInfo = pathinfo($link);//获取图片信息 |
|||
if(empty($_W['setting']['remote']['type']) && empty($_W['wlsetting']['enclosure']['service'])){ |
|||
$imgPath = PATH_ATTACHMENT ."images/" . MODULE_NAME.'/'.$_W['uniacid'].'/'.$imgInfo['basename']; |
|||
$res = 2; |
|||
}else{ |
|||
//将图片添加到临时存储目录 在本地临时存储 |
|||
$setting = $_W['setting']['upload']['image']; |
|||
$setting['folder'] = "images/" . MODULE_NAME; |
|||
$temporaryAddress = PATH_ATTACHMENT . $setting['folder'];//文件在本地服务器暂存文件 |
|||
if (!file_exists($temporaryAddress)) mkdirs($temporaryAddress);//判断临时文件目录是否存在 不存在建立 |
|||
$imgResources = file_get_contents($link);//获取图片二进制信息(图片资源) |
|||
$imgPath = $temporaryAddress . $imgInfo['basename'];//图片在本地的绝对路径 |
|||
$res = file_put_contents($imgPath , $imgResources); |
|||
} |
|||
if ($res) { |
|||
$info = $this->wxApp->media->uploadImage($imgPath); |
|||
if($info['errcode'] > 0){ |
|||
return $info['errmsg']; |
|||
} |
|||
if($res != 2 ){ |
|||
//删除临时图片 |
|||
unlink($imgPath); |
|||
} |
|||
//获取media_id 并且储存缓存 防止二次提交 |
|||
$mediaId = $info['media_id']; |
|||
Cache::setCache('live_goods_img',$caCheName,$mediaId); |
|||
}else { |
|||
throw new Exception("图片处理失败,请重试!"); |
|||
} |
|||
} |
|||
|
|||
return $mediaId; |
|||
} |
|||
|
|||
/****** 直播间信息处理 ***********************************************************************************************/ |
|||
/** |
|||
* Comment: 同步直播间信息 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 16:03 |
|||
* @param $pageStart |
|||
* @param $pageIndex |
|||
* @return mixed |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function liveInfoSynchronization($pageStart,$pageIndex){ |
|||
global $_W; |
|||
//基本参数信息设置 获取当前页的直播间信息数据 |
|||
$params = [ |
|||
'start' => $pageStart,// 起始拉取房间,start = 0 表示从第 1 个房间开始拉取 |
|||
'limit' => $pageIndex,// 每次拉取的个数上限,不要设置过大,建议 100 以内 |
|||
]; |
|||
$data = $this->getLiveList($params); |
|||
foreach($data['list'] as $key => $val){ |
|||
//判断是否存在商品 存在则通过商品获取aid 以第一个商品为主 |
|||
$goodInfo = []; |
|||
if(is_array($val['goods']) && count($val['goods'])) $goodInfo = $this->getUrlParams($val['goods'][0]['url']); |
|||
//查看当前直播间是否存在直播回放 |
|||
$playbackParams = [ |
|||
'action' => 'get_replay' , |
|||
'room_id' => $val['roomid'] , |
|||
'start' => 0 ,// 起始拉取房间,start = 0 表示从第 1 个房间开始拉取 |
|||
'limit' => 1 ,// 每次拉取的个数上限,不要设置过大,建议 100 以内 |
|||
]; |
|||
$isPlayback = $this->getPlaybackList($playbackParams); |
|||
//生成新的信息 |
|||
$newData = [ |
|||
'uniacid' => $goodInfo['uniacid'] ? : $_W['uniacid'] , |
|||
'aid' => $goodInfo['aid'] ? : $_W['aid'] , |
|||
'name' => $val['name'] , |
|||
'roomid' => $val['roomid'] , |
|||
'cover_img' => $val['cover_img'] , |
|||
'share_img' => $val['share_img'] , |
|||
'live_status' => $val['live_status'] , |
|||
'start_time' => $val['start_time'] , |
|||
'end_time' => $val['end_time'] , |
|||
'anchor_name' => $val['anchor_name'] , |
|||
'goods_list' => json_encode(array_column($val['goods'] , 'goods_id')) , |
|||
'is_playback' => $isPlayback['total'] > 0 ? 1 : 0, |
|||
'is_update' => 1, |
|||
]; |
|||
//判断直播间是否存在 存在则修改,不存在则添加 |
|||
$isHave = pdo_get(PDO_NAME."live",['roomid'=>$val['roomid']]); |
|||
if($isHave) pdo_update(PDO_NAME."live",$newData,['roomid'=>$val['roomid']]); |
|||
else pdo_insert(PDO_NAME."live",$newData); |
|||
} |
|||
|
|||
//返回信息数据 |
|||
return $data['total_page']; |
|||
} |
|||
/** |
|||
* Comment: 直播间列表信息获取 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 15:46 |
|||
* @param $params |
|||
* @param bool $newToken |
|||
* @return array |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
protected function getLiveList($params,$newToken = false){ |
|||
//token信息获取 |
|||
$accessToken = $this->getAccessToken($newToken); |
|||
//信息列表获取 |
|||
$api = "https://api.weixin.qq.com/wxa/business/getliveinfo?access_token={$accessToken['access_token']}"; |
|||
$res = curlPostRequest($api,\GuzzleHttp\json_encode($params)); |
|||
//信息返回 |
|||
if($res['errcode'] == 40001){ |
|||
return $this->getLiveList($params,true); |
|||
}else if($res['errcode'] == 9410000){ |
|||
//兼容没有直播间时 |
|||
return [ |
|||
'list' => [] , |
|||
'total_page' => ceil($res['total'] / $params['limit']) , |
|||
'total' => $res['total'] , |
|||
]; |
|||
}else if($res['errcode'] != 0){ |
|||
throw new Exception($res['errmsg']); |
|||
}else{ |
|||
return [ |
|||
'list' => $res['room_info'] , |
|||
'total_page' => ceil($res['total'] / $params['limit']) , |
|||
'total' => $res['total'] , |
|||
]; |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 直播回放获取 —— 获取当前直播间所有回放视频 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 17:01 |
|||
* @param $id |
|||
* @param int $page |
|||
* @param array $info |
|||
* @return array |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function getWholePlayback($id,$page = 0,$info = []){ |
|||
//基本参数信息设置 获取当前页的回放信息数据 |
|||
$pageIndex = 50; |
|||
$params = [ |
|||
'action' => 'get_replay' , |
|||
'room_id' => $id , |
|||
'start' => $page * $pageIndex ,// 起始拉取房间,start = 0 表示从第 1 个房间开始拉取 |
|||
'limit' => $pageIndex ,// 每次拉取的个数上限,不要设置过大,建议 100 以内 |
|||
]; |
|||
//信息获取 信息处理 |
|||
$data = $this->getPlaybackList($params); |
|||
if($info) $info['list'] = array_merge($info['list'],$data['list']); |
|||
else $info = $data; |
|||
$page++; |
|||
if($info['total_page'] > $page){ |
|||
return $this->getWholePlayback($id,$page,$info); |
|||
}else{ |
|||
return $info; |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 直播回放获取 —— 根据条件获取某页回放列表 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 16:53 |
|||
* @param $params |
|||
* @param bool $newToken |
|||
* @return array |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function getPlaybackList($params,$newToken = false){ |
|||
//token信息获取 |
|||
$accessToken = $this->getAccessToken($newToken); |
|||
//信息列表获取 |
|||
$api = "https://api.weixin.qq.com/wxa/business/getliveinfo?access_token={$accessToken['access_token']}"; |
|||
$res = curlPostRequest($api,\GuzzleHttp\json_encode($params)); |
|||
//处理返回参数信息 |
|||
if($res['errcode'] == 40001){ |
|||
return $this->getPlaybackList($params,true); |
|||
}else if($res['errcode'] != 0){ |
|||
throw new Exception($res['errmsg']); |
|||
}else{ |
|||
return [ |
|||
'list' => $res['live_replay'] , |
|||
'total_page' => ceil($res['total'] / $params['limit']) , |
|||
'total' => $res['total'] , |
|||
]; |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 申请添加直播间 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 11:33 |
|||
* @param $data |
|||
* @param bool $newToken |
|||
* @return mixed |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function addLive($data,$newToken = false){ |
|||
//token信息获取 |
|||
$data['feedsImg'] = $data['coverImg']; |
|||
$accessToken = $this->getAccessToken($newToken); |
|||
//建立直播间 |
|||
$api = "https://api.weixin.qq.com/wxaapi/broadcast/room/create?access_token={$accessToken['access_token']}"; |
|||
$headers = [ |
|||
"Content-type: application/json;charset='utf-8'" , |
|||
"Accept: application/json" , |
|||
"Cache-Control: no-cache" , |
|||
"Pragma: no-cache" |
|||
]; |
|||
$res = curlPostRequest($api , json_encode($data) , $headers); |
|||
if($res['errcode'] == 40001){ |
|||
return $this->addLive($data,true); |
|||
}else if($res['errcode'] != 0 && $res['errcode'] != 300036){ |
|||
throw new Exception("直播间添加:".$res['errmsg']); |
|||
}else{ |
|||
return $res; |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 直播间商品导入 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 11:32 |
|||
* @param $data |
|||
* @param bool $newToken |
|||
* @return mixed |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function importGoods($data,$newToken = false){ |
|||
//token信息获取 |
|||
$accessToken = $this->getAccessToken($newToken); |
|||
//建立直播间 |
|||
$api = "https://api.weixin.qq.com/wxaapi/broadcast/room/addgoods?access_token={$accessToken['access_token']}"; |
|||
$res = curlPostRequest($api , json_encode($data) , ["Content-type: application/json;charset='utf-8'"]); |
|||
if($res['errcode'] == 40001){ |
|||
return $this->importGoods($data,true); |
|||
}else if($res['errcode'] != 0){ |
|||
throw new Exception("商品导入:".$res['errmsg']); |
|||
}else{ |
|||
return $res; |
|||
} |
|||
} |
|||
|
|||
/****** 商品信息处理 *************************************************************************************************/ |
|||
/** |
|||
* Comment: 获取直播商品在本平台的储存信息 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 10:42 |
|||
* @param $where |
|||
* @param $page |
|||
* @param $pageIndex |
|||
* @return array |
|||
*/ |
|||
public static function getGoodsParamsList($where,$page,$pageIndex){ |
|||
global $_W; |
|||
//获取商品总数信息 |
|||
$total = pdo_count(PDO_NAME."live_goods",$where); |
|||
//获取商品列表 |
|||
$field = ['id','aid','goods_id','goods_img','title','price_type','price','price2','third_party_tag']; |
|||
$list = pdo_getall(PDO_NAME."live_goods" ,$where ,$field,'','goods_id DESC',[$page,$pageIndex]); |
|||
foreach($list as &$item){ |
|||
if($item['aid'] > 0) $item['agent_name'] = pdo_getcolumn(PDO_NAME."agentusers",['id'=>$item['aid']],'agentname'); |
|||
} |
|||
|
|||
return [$total,$list]; |
|||
} |
|||
/** |
|||
* Comment: 根据类型和id获取商品信息 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 13:43 |
|||
* @param $id |
|||
* @param $plugin |
|||
* @return bool|mixed |
|||
*/ |
|||
public static function getGoodsInfo($id,$plugin){ |
|||
//获取商品信息 |
|||
switch ($plugin) { |
|||
case 'rush': |
|||
$table = tablename(PDO_NAME."rush_activity"); |
|||
$field = 'name as goods_name,id as goods_id,"rush" as goods_plugin,sid,thumb as logo,price'; |
|||
break;//抢购商品 |
|||
case 'groupon': |
|||
$table = tablename(PDO_NAME."groupon_activity"); |
|||
$field = 'name as goods_name,id as goods_id,"groupon" as goods_plugin,sid,thumb as logo,price'; |
|||
break;//团购商品 |
|||
case 'wlfightgroup': |
|||
$table = tablename(PDO_NAME."fightgroup_goods"); |
|||
$field = 'name as goods_name,id as goods_id,"wlfightgroup" as goods_plugin,merchantid as sid,logo,price'; |
|||
break;//拼团商品 |
|||
case 'coupon': |
|||
$table = tablename(PDO_NAME."couponlist"); |
|||
$field = 'title as goods_name,id as goods_id,"coupon" as goods_plugin,merchantid as sid,logo,price'; |
|||
break;//优惠券 |
|||
case 'bargain': |
|||
$table = tablename(PDO_NAME."bargain_activity"); |
|||
$field = 'name as goods_name,id as goods_id,"bargain" as goods_plugin,sid,thumb as logo,price'; |
|||
break;//砍价商品 |
|||
} |
|||
$sql = "SELECT {$field} FROM ".$table." WHERE id = {$id}"; |
|||
$info = pdo_fetch($sql); |
|||
|
|||
return $info; |
|||
} |
|||
/** |
|||
* Comment: 根据类型获取id获取对应的小程序路径信息 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 17:40 |
|||
* @param $id |
|||
* @param $plugin |
|||
* @return string |
|||
*/ |
|||
public static function getWxAppPath($id,$plugin){ |
|||
global $_W; |
|||
switch ($plugin) { |
|||
case 'rush': |
|||
$url = "pages/subPages/goods/index?i={$_W['uniacid']}&type=1&id={$id}"; |
|||
break;//抢购商品 |
|||
case 'groupon': |
|||
$url = "pages/subPages/goods/index?i={$_W['uniacid']}&type=2&id={$id}"; |
|||
break;//团购商品 |
|||
case 'wlfightgroup': |
|||
$url = "pages/subPages/goods/index?i={$_W['uniacid']}&type=3&id={$id}"; |
|||
break;//拼团商品 |
|||
case 'coupon': |
|||
$url = "pages/subPages/goods/index?i={$_W['uniacid']}&type=5&id={$id}"; |
|||
break;//优惠券 |
|||
case 'bargain': |
|||
$url = "pages/subPages/goods/index?i={$_W['uniacid']}&type=7&id={$id}"; |
|||
break;//砍价商品 |
|||
} |
|||
|
|||
return $url; |
|||
} |
|||
/** |
|||
* Comment: 直播商品提交审核 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 13:57 |
|||
* @param $params |
|||
* @param bool $newToken |
|||
* @return mixed |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function submitGoods($params,$newToken = false){ |
|||
//token信息获取 |
|||
$accessToken = $this->getAccessToken($newToken); |
|||
//信息列表获取 |
|||
$api = "https://api.weixin.qq.com/wxaapi/broadcast/goods/add?access_token={$accessToken['access_token']}"; |
|||
$res = curlPostRequest($api,json_encode(['goodsInfo'=>$params]),["Content-type: application/json;charset='utf-8'"]); |
|||
//信息返回 |
|||
if($res['errcode'] == 40001){ |
|||
return $this->submitGoods($params,true); |
|||
}else if($res['errcode'] != 0){ |
|||
throw new Exception($res['errmsg']); |
|||
}else{ |
|||
return $res; |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 撤回待审核中的商品 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 9:39 |
|||
* @param $params |
|||
* @param bool $newToken |
|||
* @return mixed |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function withdrawGoods($params,$newToken = false){ |
|||
//token信息获取 |
|||
$accessToken = $this->getAccessToken($newToken); |
|||
//信息列表获取 |
|||
$api = "https://api.weixin.qq.com/wxaapi/broadcast/goods/resetaudit?access_token={$accessToken['access_token']}"; |
|||
$res = curlPostRequest($api,json_encode($params),["Content-type: application/json;charset='utf-8'"]); |
|||
//信息返回 |
|||
if($res['errcode'] == 40001){ |
|||
return $this->withdrawGoods($params,true); |
|||
}else if($res['errcode'] != 0){ |
|||
throw new Exception($res['errmsg']); |
|||
}else{ |
|||
return $res; |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 重新提交未审核的商品进行审核 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 9:40 |
|||
* @param $id |
|||
* @param bool $newToken |
|||
* @return mixed |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function reSubmitGoods($id,$newToken = false){ |
|||
//token信息获取 |
|||
$accessToken = $this->getAccessToken($newToken); |
|||
//信息列表获取 |
|||
$api = "https://api.weixin.qq.com/wxaapi/broadcast/goods/audit?access_token={$accessToken['access_token']}"; |
|||
$res = curlPostRequest($api,json_encode(['goodsId'=>$id]),["Content-type: application/json;charset='utf-8'"]); |
|||
//信息返回 |
|||
if($res['errcode'] == 40001){ |
|||
return $this->reSubmitGoods($id,true); |
|||
}else if($res['errcode'] != 0){ |
|||
throw new Exception($res['errmsg']); |
|||
}else{ |
|||
return $res; |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 请求删除商品 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 16:23 |
|||
* @param int|string $id |
|||
* @param bool $newToken |
|||
* @return mixed |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function deleteGoods($id,$newToken = false){ |
|||
//token信息获取 |
|||
$accessToken = $this->getAccessToken($newToken); |
|||
//信息列表获取 |
|||
$api = "https://api.weixin.qq.com/wxaapi/broadcast/goods/delete?access_token={$accessToken['access_token']}"; |
|||
$res = curlPostRequest($api,json_encode(['goodsId'=>$id]),["Content-type: application/json;charset='utf-8'"]); |
|||
//信息返回 |
|||
if($res['errcode'] == 40001){ |
|||
return $this->deleteGoods($id,true); |
|||
}else if($res['errcode'] != 0){ |
|||
throw new Exception($res['errmsg']); |
|||
}else{ |
|||
return $res; |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 修改商品信息 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 9:09 |
|||
* @param $params |
|||
* @param bool $newToken |
|||
* @return mixed |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function updateGoods($params,$newToken = false){ |
|||
//token信息获取 |
|||
$accessToken = $this->getAccessToken($newToken); |
|||
//信息列表获取 |
|||
$api = "https://api.weixin.qq.com/wxaapi/broadcast/goods/update?access_token={$accessToken['access_token']}"; |
|||
$res = curlPostRequest($api,json_encode(['goodsInfo'=>$params]),["Content-type: application/json;charset='utf-8'"]); |
|||
//信息返回 |
|||
if($res['errcode'] == 40001){ |
|||
return $this->updateGoods($params,true); |
|||
}else if($res['errcode'] != 0){ |
|||
throw new Exception($res['errmsg']); |
|||
}else{ |
|||
return $res; |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 根据小程序page路径信息获取商品信息 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 15:52 |
|||
* @param $url |
|||
* @return array|bool|mixed |
|||
* @throws Exception |
|||
*/ |
|||
public function getUrlParams($url){ |
|||
//根据url获取参数信息 |
|||
$str = explode('?',$url)[1]; |
|||
$strArr = explode("&",$str); |
|||
$strArr = is_array($strArr) ? $strArr : []; |
|||
$params = []; |
|||
foreach($strArr as $key => $val){ |
|||
$valArr = explode("=",$val); |
|||
$params[$valArr[0]] = $valArr[1]; |
|||
} |
|||
if(!$params['id'] || $params['id'] <= 0) throw new Exception("商品信息不存在,请刷新重试!"); |
|||
if(!$params['type']) throw new Exception("商品类型错误,请刷新重试!"); |
|||
//获取商品信息 |
|||
switch ($params['type']) { |
|||
case 1: |
|||
$table = tablename(PDO_NAME."rush_activity"); |
|||
$field = 'uniacid,aid,name as goods_name,id as goods_id,"rush" as goods_plugin,sid'; |
|||
break;//抢购商品 |
|||
case 2: |
|||
$table = tablename(PDO_NAME."groupon_activity"); |
|||
$field = 'uniacid,aid,name as goods_name,id as goods_id,"groupon" as goods_plugin,sid'; |
|||
break;//团购商品 |
|||
case 3: |
|||
$table = tablename(PDO_NAME."fightgroup_goods"); |
|||
$field = 'uniacid,aid,name as goods_name,id as goods_id,"wlfightgroup" as goods_plugin,merchantid as sid'; |
|||
break;//拼团商品 |
|||
case 5: |
|||
$table = tablename(PDO_NAME."couponlist"); |
|||
$field = 'uniacid,aid,title as goods_name,id as goods_id,"coupon" as goods_plugin,merchantid as sid'; |
|||
break;//优惠券 |
|||
case 7: |
|||
$table = tablename(PDO_NAME."bargain_activity"); |
|||
$field = 'uniacid,aid,name as goods_name,id as goods_id,"bargain" as goods_plugin,sid'; |
|||
break;//砍价商品 |
|||
} |
|||
$sql = "SELECT {$field} FROM ".$table." WHERE id = {$params['id']}"; |
|||
$goodsInfo = pdo_fetch($sql); |
|||
|
|||
return is_array($goodsInfo) ? $goodsInfo : []; |
|||
} |
|||
/** |
|||
* Comment: 商品信息同步 —— 代理商信息同步(仅当前代理商商品) |
|||
* Author: zzw |
|||
* Date: 2020/10/26 16:14 |
|||
* @param array ids |
|||
* @param bool $newToken |
|||
* @return bool |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function goodsInfoSynchronization($ids,$newToken = false){ |
|||
global $_W; |
|||
//判断是否存在需要同步信息的内容 |
|||
if(!is_array($ids) && count($ids)> 0) return false; |
|||
//token信息获取 |
|||
$accessToken = $this->getAccessToken($newToken); |
|||
//信息列表获取 |
|||
$api = "https://api.weixin.qq.com/wxa/business/getgoodswarehouse?access_token={$accessToken['access_token']}"; |
|||
$res = curlPostRequest($api,json_encode(['goods_ids'=>$ids]),["Content-type: application/json;charset='utf-8'"]); |
|||
//信息返回 |
|||
if($res['errcode'] == 40001){ |
|||
return $this->goodsInfoSynchronization($ids,true); |
|||
}else if($res['errcode'] != 0){ |
|||
throw new Exception($res['errmsg']); |
|||
}else{ |
|||
$list = $res['goods']; |
|||
foreach($list as $item){ |
|||
//获取商品信息 |
|||
$goods = $this->getUrlParams($item['url']); |
|||
if($goods['goods_id'] > 0){ |
|||
$params = [ |
|||
'uniacid' => $goods['uniacid'] ? : $_W['uniacid'] , |
|||
'aid' => $goods['aid'] ? : 0 , |
|||
'wl_goods_id' => $goods['goods_id'] , |
|||
'goods_plugin' => $goods['goods_plugin'] , |
|||
'audit_status' => $item['audit_status'] , |
|||
'title' => $item['name'] , |
|||
'goods_img' => $item['cover_img_url'] , |
|||
'price_type' => $item['price_type'] , |
|||
'price' => $item['price'] , |
|||
'price2' => $item['price2'] , |
|||
'third_party_tag' => $item['third_party_tag'] , |
|||
]; |
|||
pdo_update(PDO_NAME."live_goods",$params,['goods_id'=>$item['goods_id']]); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 商品信息同步 —— 总后台信息同步(平台全部商品) |
|||
* Author: zzw |
|||
* Date: 2020/10/28 10:00 |
|||
* @param int $pageStart |
|||
* @param int $pageIndex |
|||
* @param int $status |
|||
* @return mixed |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function wholeGoodsInfoSynchronization(int $pageStart,int $pageIndex,int $status){ |
|||
global $_W; |
|||
//商品列表信息获取 |
|||
$params = [ |
|||
'offset' => $pageStart , |
|||
'limit' => $pageIndex , |
|||
'status' => $status , |
|||
]; |
|||
$info = $this->getPageGoodsList($params); |
|||
if(is_array($info['list']) && count($info['list']) > 0) { |
|||
//循环同步商品基本信息(除状态信息) |
|||
foreach ($info['list'] as $key => $item) { |
|||
//获取当前商品在本平台的信息 商品存在则同步信息 不存在则删除信息 |
|||
$goods = $this->getUrlParams($item['url']); |
|||
if($goods['goods_id'] > 0) { |
|||
$params = [ |
|||
'uniacid' => $goods['uniacid'] ? : $_W['uniacid'] , |
|||
'aid' => $goods['aid'] ? : 0 , |
|||
'wl_goods_id' => $goods['goods_id'] , |
|||
'goods_plugin' => $goods['goods_plugin'] , |
|||
'goods_id' => $item['goodsId'] , |
|||
'title' => $item['name'] , |
|||
'goods_img' => $item['coverImgUrl'] , |
|||
'price_type' => $item['priceType'] , |
|||
'price' => $item['price'] , |
|||
'price2' => $item['price2'] , |
|||
'third_party_tag' => $item['thirdPartyTag'] , |
|||
]; |
|||
//判断商品是否存在 存在则修改信息,不存在则添加信息 |
|||
$isHave = pdo_get(PDO_NAME . "live_goods" , ['goods_id' => $params['goods_id']]); |
|||
if ($isHave) pdo_update(PDO_NAME . "live_goods" , $params , ['goods_id' => $params['goods_id']]); |
|||
else pdo_insert(PDO_NAME . "live_goods" , $params); |
|||
}else{ |
|||
pdo_delete(PDO_NAME . "live_goods" , ['goods_id' => $item['goodsId']]); |
|||
} |
|||
} |
|||
//获取商品状态信息 同步当前页面所有商品的状态信息 |
|||
$goodIds = array_column($info['list'] , 'goodsId'); |
|||
$this->goodsInfoSynchronization($goodIds); |
|||
} |
|||
|
|||
return $info['total_page']; |
|||
} |
|||
/** |
|||
* Comment: 获取指定页数的商户信息列表 |
|||
* Author: zzw |
|||
* Date: 2020/10/28 9:56 |
|||
* @param $params |
|||
* @param bool $newToken |
|||
* @return array |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function getPageGoodsList($params,$newToken = false){ |
|||
//token信息获取 |
|||
$accessToken = $this->getAccessToken($newToken); |
|||
//信息列表获取 |
|||
$api = "https://api.weixin.qq.com/wxaapi/broadcast/goods/getapproved?access_token={$accessToken['access_token']}&".http_build_query($params); |
|||
$res = curlGetRequest($api); |
|||
//信息返回 |
|||
if($res['errcode'] == 40001){ |
|||
return $this->getPageGoodsList($params,true); |
|||
}else if($res['errcode'] != 0){ |
|||
throw new Exception($res['errmsg']); |
|||
}else{ |
|||
return [ |
|||
'list' => $res['goods'] , |
|||
'total_page' => ceil($res['total'] / $params['limit']) , |
|||
'total' => $res['total'] , |
|||
]; |
|||
} |
|||
} |
|||
|
|||
/****** 直播成员信息管理 *********************************************************************************************/ |
|||
/** |
|||
* Comment: 添加设置成员信息 |
|||
* Author: zzw |
|||
* Date: 2020/11/5 13:47 |
|||
* @param array $params |
|||
* @param bool $newToken |
|||
* @return mixed |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function addMemberInfo($params,$newToken = false){ |
|||
//token信息获取 |
|||
$accessToken = $this->getAccessToken($newToken); |
|||
//信息列表获取 |
|||
$api = "https://api.weixin.qq.com/wxaapi/broadcast/role/addrole?access_token={$accessToken['access_token']}"; |
|||
$res = curlPostRequest($api,json_encode($params),["Content-type: application/json;charset='utf-8'"]); |
|||
//信息返回 |
|||
if($res['errcode'] == 40001){ |
|||
return $this->addMemberInfo($params,true); |
|||
}else if($res['errcode'] == 400001){ |
|||
throw new Exception('微信号不合规'); |
|||
}else if($res['errcode'] == 400002){ |
|||
throw new Exception('微信号需要实名认证'); |
|||
}else if($res['errcode'] == 400003){ |
|||
throw new Exception('添加角色达到上限'); |
|||
}else if($res['errcode'] != 0){ |
|||
throw new Exception($res['msg']); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 根据参数获取成员信息 |
|||
* Author: zzw |
|||
* Date: 2020/11/5 10:08 |
|||
* @param $params |
|||
* @param bool $newToken |
|||
* @return array |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function memberInfoSynchronization($params,$newToken = false){ |
|||
global $_W; |
|||
//token信息获取 |
|||
$accessToken = $this->getAccessToken($newToken); |
|||
//信息列表获取 |
|||
$api = "https://api.weixin.qq.com/wxaapi/broadcast/role/getrolelist?access_token={$accessToken['access_token']}&".http_build_query($params); |
|||
$res = curlGetRequest($api); |
|||
//信息返回 |
|||
if($res['errcode'] == 40001){ |
|||
return $this->memberInfoSynchronization($params,true); |
|||
}else if($res['errcode'] != 0){ |
|||
throw new Exception($res['errmsg']); |
|||
}else{ |
|||
return [ |
|||
'list' => $res['list'] , |
|||
'total_page' => ceil($res['total'] / $params['limit']) , |
|||
'total' => $res['total'] , |
|||
]; |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 删除成员角色信息 |
|||
* Author: zzw |
|||
* Date: 2020/11/5 13:58 |
|||
* @param $params |
|||
* @param bool $newToken |
|||
* @return mixed |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\RuntimeException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
* @throws \EasyWeChat\Kernel\Exceptions\HttpException |
|||
*/ |
|||
public function deleteMember($params,$newToken = false){ |
|||
global $_W; |
|||
//token信息获取 |
|||
$accessToken = $this->getAccessToken($newToken); |
|||
//信息列表获取 |
|||
$api = "https://api.weixin.qq.com/wxaapi/broadcast/role/deleterole?access_token={$accessToken['access_token']}"; |
|||
$res = curlPostRequest($api,json_encode($params),["Content-type: application/json;charset='utf-8'"]); |
|||
//信息返回 |
|||
if($res['errcode'] == 40001){ |
|||
return $this->deleteMember($params,true); |
|||
}else if($res['errcode'] != 0){ |
|||
throw new Exception($res['msg']); |
|||
} |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[直播管理]]></name> |
|||
<identifie><![CDATA[live]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[expand]]></type> |
|||
<description><![CDATA[直播管理]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="true" /> |
|||
<system embed="true" /> |
|||
<task embed="false" /> |
|||
</setting> |
|||
<agentmenu> |
|||
<menu title="直播管理" font="fa-inbox"> |
|||
<entry title="直播管理" ac="live" do="liveList" actions='["do",["liveList","addLive"]]' iscover="true" /> |
|||
<entry title="商品管理" ac="goods" do="goodsList" actions='["do",["goodsList","add","editGoods"]]'/> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="直播管理" font="fa-inbox"> |
|||
<entry title="直播管理" ac="live" do="liveList" actions='["do",["liveList","addLive"]]' iscover="true" /> |
|||
<entry title="商品管理" ac="goods" do="goodsList" actions='["do",["goodsList","add","editGoods"]]'/> |
|||
<entry title="成员管理" ac="member" do="memberIndex" actions='["do",["memberIndex","addMember"]]'/> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,341 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Goods_WeliamController { |
|||
/** |
|||
* Comment: 商品列表信息获取 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 15:07 |
|||
*/ |
|||
public function goodsList(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$status = $_GPC['status'] ? : 0;//商品状态,0:未审核。1:审核中,2:审核通过,3:审核驳回 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = 10; |
|||
//条件生成 |
|||
$where = ['uniacid'=>$_W['uniacid'],'audit_status'=>$status]; |
|||
if($_W['aid'] > 0) $where['aid'] = $_W['aid']; |
|||
//信息获取 |
|||
list($total,$list) = Live::getGoodsParamsList($where,$page,$pageIndex); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template("goods/list"); |
|||
} |
|||
/** |
|||
* Comment: 直播商品提交审核 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 14:08 |
|||
* @throws \GuzzleHttp\Exception\GuzzleException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function add(){ |
|||
global $_W,$_GPC; |
|||
if($_W['ispost']){ |
|||
//信息获取 |
|||
$data = $_GPC['data']; |
|||
if (!$data['goods_id']) wl_message("请选择商品!" , referer() , 'error'); |
|||
if (($data['priceType'] == 2 || $data['priceType'] == 3) && !$data['price'] && !$data['price2']) wl_message("请完善价格信息!" , referer(), 'error'); |
|||
//获取商品信息 |
|||
$goods = Live::getGoodsInfo($data['goods_id'],$data['goods_plugin']); |
|||
//基本信息参数配置 |
|||
$params = [ |
|||
'coverImgUrl' => $data['coverImgUrl'] ? tomedia($data['coverImgUrl']) : '' ,//图片 |
|||
'name' => $data['name'] ? : '' ,//商品名称 |
|||
'priceType' => $data['priceType'] ,//价格类型 1:一口价;2:价格区间;3:显示折扣价 |
|||
'price' => $data['price'] ? sprintf("%.2f" , $data['price']) : '' ,//价格一 |
|||
'price2' => $data['price2'] ? sprintf("%.2f" , $data['price2']) : '' ,//价格二 |
|||
'url' => '' ,//跳转链接 |
|||
]; |
|||
//商品名称不存在 使用当前商品名称 |
|||
if(!$params['name']){ |
|||
$goodsName = $goods['goods_name']; |
|||
if(mb_strlen($goodsName) > 14) $goodsName = mb_substr($goodsName,0,14,'utf-8'); |
|||
$params['name'] = $goodsName; |
|||
} |
|||
//价格一不存在 默认使用一口价 价格为商品当前价格 |
|||
if(!$params['price'] || $params['price'] <= 0 ){ |
|||
$params['priceType'] = intval(1); |
|||
$params['price'] = sprintf("%.2f",$goods['price']); |
|||
} |
|||
//图片不存在 使用当前商品logo图片 |
|||
if(!$params['coverImgUrl']) { |
|||
//判断图片信息 微信规则限制 图片大小不能大于300像素*300像素; |
|||
list($width,$height) = getimagesize(tomedia($goods['logo']));//获取图片信息 |
|||
if($width > 300 || $height > 300 ) wl_message("商品logo图片过大,请自行上传图片!", referer() , 'error'); |
|||
//使用商品logo图片 |
|||
$params['coverImgUrl'] = tomedia($goods['logo']); |
|||
} |
|||
//获取跳转地址 |
|||
$params['url'] = Live::getWxAppPath($data['goods_id'],$data['goods_plugin']); |
|||
//提交商品信息 |
|||
try{ |
|||
//判断图片信息 微信规则限制 图片大小不能大于300像素*300像素; |
|||
list($width,$height) = getimagesize($params['coverImgUrl']);//获取图片信息 |
|||
if($width > 300 || $height > 300 ) wl_message("图片超出限制,宽高不能大于300像素!", referer() , 'error'); |
|||
//商品图片信息处理 |
|||
$coverImgUrl = $params['coverImgUrl']; |
|||
$params['coverImgUrl'] = (new Live())->uploadTemporaryMaterial($params['coverImgUrl']); |
|||
//提交商品 |
|||
$res = (new Live())->submitGoods($params); |
|||
//记录商品提交信息 |
|||
$data = [ |
|||
'aid' => $_W['aid'] ? : 0 , |
|||
'uniacid' => $_W['uniacid'] , |
|||
'goods_id' => $res['goodsId'] , |
|||
'audit_id' => $res['auditId'] , |
|||
'wl_goods_id' => $data['goods_id'] , |
|||
'goods_plugin' => $data['goods_plugin'] , |
|||
'title' => $params['name'] , |
|||
'goods_img' => $coverImgUrl , |
|||
'price_type' => $params['priceType'] , |
|||
'price' => $params['price'] , |
|||
'price2' => $params['price2'] ? : '' , |
|||
]; |
|||
pdo_insert(PDO_NAME."live_goods",$data); |
|||
|
|||
wl_message('提交成功,请等待审核结果!' , web_url('live/goods/goodsList',['status'=>1]) , 'success'); |
|||
}catch (Exception $e){ |
|||
wl_message($e->getMessage(), referer() , 'error'); |
|||
} |
|||
} |
|||
|
|||
include wl_template("goods/add"); |
|||
} |
|||
/** |
|||
* Comment: 请求撤回正在审核中的商品 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 16:31 |
|||
*/ |
|||
public function cancelAdd(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] OR Commons::sRenderError("不存在的商品信息,请刷新重试!"); |
|||
//获取直播商品提交审核记录信息 |
|||
$info = pdo_get(PDO_NAME."live_goods",['goods_id'=>$id]); |
|||
try{ |
|||
//申请撤回商品 |
|||
$params = [ |
|||
'auditId' => $info['audit_id'], |
|||
'goodsId' => $info['goods_id'] |
|||
]; |
|||
$res = (new Live())->withdrawGoods($params); |
|||
//返回操作结果 |
|||
if($res['errcode'] == 0) { |
|||
pdo_update(PDO_NAME."live_goods",['audit_status'=>0],['goods_id'=>$id]); |
|||
Commons::sRenderSuccess("操作成功"); |
|||
}else Commons::sRenderError("操作失败"); |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 请求让未审核的商品进行审核操作 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 9:41 |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function reSubmit(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] OR Commons::sRenderError("不存在的商品信息,请刷新重试!"); |
|||
try{ |
|||
//请求重新提交商品 |
|||
$res = (new Live())->reSubmitGoods($id); |
|||
if($res['errcode'] == 0){ |
|||
//修改 提交审核记录 |
|||
pdo_update(PDO_NAME."live_goods" |
|||
,['audit_id'=>$res['auditId'],'audit_status'=>1],['goods_id'=>$id]); |
|||
|
|||
Commons::sRenderSuccess("操作成功"); |
|||
}else { |
|||
Commons::sRenderError("操作失败"); |
|||
} |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 请求删除商品 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 16:23 |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function deleteLiveGoods(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] OR Commons::sRenderError("不存在的商品信息,请刷新重试!"); |
|||
try{ |
|||
//请求删除商品 |
|||
$res = (new Live())->deleteGoods($id); |
|||
if($res['errcode'] == 0){ |
|||
//商品删除成功 删除商品提交审核记录 |
|||
pdo_delete(PDO_NAME."live_goods",['goods_id'=>$id]); |
|||
|
|||
Commons::sRenderSuccess("操作成功"); |
|||
}else { |
|||
Commons::sRenderError("操作失败"); |
|||
} |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 编辑商品信息 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 9:31 |
|||
* @throws \GuzzleHttp\Exception\GuzzleException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function editGoods(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$status = $_GPC['status'] ? : 0; |
|||
$goods_id = $_GPC['goods_id'] OR wl_message("商品不存在,请刷新重试!" ,web_url('live/goods/goodsList',['status'=>$status]), 'error'); |
|||
//商品信息获取 |
|||
$params = pdo_get(PDO_NAME."live_goods",['goods_id'=>$goods_id]);//直播商品 |
|||
$info = Live::getGoodsInfo($params['wl_goods_id'],$params['goods_plugin']);//平台商品 |
|||
//信息修改操作 |
|||
if($_W['ispost']){ |
|||
//参数信息获取 |
|||
$data = $_GPC['data'];//修改后新的直播商品信息 |
|||
$data['wl_goods_id'] = $data['goods_id']; |
|||
unset($data['goods_name'],$data['goods_id'],$data['sid']); |
|||
//判断值是否被修改 |
|||
if($status == 0) $allowUpdateFiled = ['coverImgUrl' , 'name' , 'priceType' , 'price' , 'price2' , 'url'];//所有信息都可以更新 |
|||
else $allowUpdateFiled = ['priceType' , 'price' , 'price2'];//仅允许更新 价格类型和价格 |
|||
$updateData['goodsId'] = $goods_id;//需要修改的信息 |
|||
if(($data['goods_plugin'] != $params['goods_plugin'] || $data['wl_goods_id'] != $params['wl_goods_id']) && in_array('url',$allowUpdateFiled)){ |
|||
//商品被修改 从新获取链接 |
|||
$updateData['url'] = Live::getWxAppPath($data['goods_id'],$data['goods_plugin']); |
|||
} |
|||
if($data['goods_img'] != $params['goods_img'] && in_array('coverImgUrl',$allowUpdateFiled)){ |
|||
//图片被修改 获取新图片的信息 |
|||
if(!$data['goods_img']) $data['goods_img'] = tomedia($info['logo']); |
|||
else $data['goods_img'] = tomedia($data['goods_img']); |
|||
//判断图片信息 微信规则限制 图片大小不能大于300像素*300像素; |
|||
list($width,$height) = getimagesize($data['goods_img']);//获取图片信息 |
|||
if($width > 300 || $height > 300 ) wl_message("图片超出限制,宽高不能大于300像素!", web_url('live/goods/editGoods',['status'=>$status,'goods_id'=>$goods_id]) , 'error'); |
|||
|
|||
$updateData['coverImgUrl'] = $data['goods_img']; |
|||
} |
|||
if($data['title'] != $params['title'] && in_array('name',$allowUpdateFiled)){ |
|||
//商品名称被修改 获取新的商品名称 |
|||
if(!$data['title']){ |
|||
//商品名称不存在 使用当前商品名称 |
|||
$goodsName = $info['goods_name']; |
|||
if(mb_strlen($goodsName) > 14) $goodsName = mb_substr($goodsName,0,14,'utf-8'); |
|||
$updateData['name'] = $goodsName; |
|||
}else{ |
|||
$updateData['name'] = $data['title']; |
|||
} |
|||
} |
|||
if($data['price_type'] != $params['price_type'] && in_array('priceType',$allowUpdateFiled)){ |
|||
//价格类型被修改 获取新的价格类型 |
|||
$updateData['priceType'] = $data['price_type']; |
|||
} |
|||
if($data['price'] != $params['price'] && in_array('price',$allowUpdateFiled)){ |
|||
//左价格被修改 获取新的价格 |
|||
$updateData['price'] = sprintf("%.2f" , $data['price']); |
|||
} |
|||
if($data['price2'] != $params['price2'] && in_array('price2',$allowUpdateFiled)){ |
|||
//右价格被修改 获取新的价格 |
|||
$updateData['price2'] = sprintf("%.2f" , $data['price2']); |
|||
} |
|||
//价格一不存在 默认使用一口价 价格为商品当前价格 |
|||
if (!$updateData['price'] || $updateData['price'] <= 0) { |
|||
$updateData['priceType'] = intval(1); |
|||
$updateData['price'] = sprintf("%.2f" , $data['price']); |
|||
$updateData['price2'] = ''; |
|||
} |
|||
//请求编辑信息 |
|||
try{ |
|||
//是否需要处理图片信息 |
|||
if(array_key_exists('coverImgUrl',$updateData) && !empty($updateData['coverImgUrl'])){ |
|||
$imgInfo = pathinfo($updateData['coverImgUrl']);//获取图片信息 |
|||
if($imgInfo['basename']) $updateData['coverImgUrl'] = (new Live())->uploadTemporaryMaterial($updateData['coverImgUrl']); |
|||
} |
|||
//修改价格信息则三个价格参数都要传递 |
|||
if(array_key_exists('price',$updateData) || array_key_exists('price2',$updateData) || array_key_exists('priceType',$updateData)){ |
|||
$updateData['priceType'] = $data['price_type']; |
|||
$updateData['price'] = $data['price']; |
|||
$updateData['price2'] = $data['price2']; |
|||
} |
|||
//请求修改商品信息 |
|||
$res = (new Live())->updateGoods($updateData); |
|||
if($res['errcode'] == 0) { |
|||
pdo_update(PDO_NAME."live_goods",$data,['goods_id'=>$goods_id]); |
|||
|
|||
wl_message("操作成功!" ,web_url('live/goods/goodsList',['status'=>$status]) , 'success'); |
|||
}else wl_message("操作失败!", web_url('live/goods/goodsList',['status'=>$status]) , 'error'); |
|||
}catch (Exception $e){ |
|||
wl_message($e->getMessage(), web_url('live/goods/goodsList',['status'=>$status]) , 'error'); |
|||
} |
|||
} |
|||
|
|||
include wl_template("goods/edit"); |
|||
} |
|||
/** |
|||
* Comment: 信息同步 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 16:15 |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function infoSynchronization(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$page = $_GPC['page'] ? : 1; |
|||
//根据总后台和代理商后台 调用不同的同步操作 |
|||
try{ |
|||
if($_W['aid'] > 0){ |
|||
//代理商后台 |
|||
$pageIndex = 50; |
|||
$where = ['uniacid' => $_W['uniacid'],'aid'=>$_W['aid']];//条件生成 |
|||
//获取商品相关信息 |
|||
$total = pdo_count(PDO_NAME."live_goods",$where);//商品总数信息 |
|||
$list = pdo_getall(PDO_NAME."live_goods" ,$where ,['goods_id'],'','goods_id DESC',[$page,$pageIndex]);//商品列表 |
|||
|
|||
(new Live())->goodsInfoSynchronization(array_column($list,'goods_id')); |
|||
$totalPage = ceil($total / $pageIndex); |
|||
}else{ |
|||
//总后台 商品状态,0:未审核。1:审核中,2:审核通过,3:审核驳回 |
|||
$pageIndex = 15; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$res0 = (new Live())->wholeGoodsInfoSynchronization($pageStart,$pageIndex,0); |
|||
$res1 = (new Live())->wholeGoodsInfoSynchronization($pageStart,$pageIndex,1); |
|||
$res2 = (new Live())->wholeGoodsInfoSynchronization($pageStart,$pageIndex,2); |
|||
$res3 = (new Live())->wholeGoodsInfoSynchronization($pageStart,$pageIndex,3); |
|||
$totalPage = max([$res0,$res1,$res2,$res3]); |
|||
} |
|||
|
|||
Commons::sRenderSuccess("同步成功",['total_page' => $totalPage]); |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 直播商品选择器 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 11:03 |
|||
*/ |
|||
public function selectGoods(){ |
|||
global $_W,$_GPC; |
|||
try{ |
|||
//基本参数信息获取 商品状态,0:未审核。1:审核中,2:审核通过,3:审核驳回 |
|||
$status = intval(2);//选择商品 商品状态固定为2:审核通过 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = $_GPC['page_index'] ? : 10; |
|||
//条件生成 |
|||
$where = ['uniacid'=>$_W['uniacid'],'audit_status'=>$status]; |
|||
if($_W['aid'] > 0) $where['aid'] = $_W['aid']; |
|||
//信息获取 |
|||
list($total,$list) = Live::getGoodsParamsList($where,$page,$pageIndex); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
if($_GPC['is_block']) include wl_template("goods/select_goods"); |
|||
else include wl_template("goods/select"); |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,184 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException; |
|||
class Live_WeliamController { |
|||
/** |
|||
* Comment: 获取直播间列表 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 14:54 |
|||
*/ |
|||
public function liveList(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = 10; |
|||
//条件生成 |
|||
$where = ['uniacid'=>$_W['uniacid']]; |
|||
if($_W['aid']) $where['aid'] = $_W['aid']; |
|||
//获取直播相关信息 |
|||
$total = pdo_count(PDO_NAME."live",$where); |
|||
$field = ['name','roomid','cover_img','share_img','live_status','start_time','end_time','anchor_name','goods_list','is_playback']; |
|||
$list = pdo_getall(PDO_NAME."live",$where,$field,'','start_time DESC',[$page,$pageIndex]); |
|||
$goodsField = ['wl_goods_id','goods_plugin','title','goods_img','price_type','price','price2']; |
|||
foreach($list as &$item){ |
|||
//商品信息处理 |
|||
$goodsIds = json_decode($item['goods_list'],true); |
|||
$item['goods'] = pdo_getall(PDO_NAME."live_goods",['goods_id IN'=>$goodsIds],$goodsField); |
|||
//时间信息处理 |
|||
$item['start_time'] = date("Y-m-d H:i",$item['start_time']); |
|||
$item['end_time'] = date("Y-m-d H:i",$item['end_time']); |
|||
} |
|||
//分页操作 |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template("live/list"); |
|||
} |
|||
/** |
|||
* Comment: 添加直播间操作 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 14:36 |
|||
* @throws \GuzzleHttp\Exception\GuzzleException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function addLive(){ |
|||
global $_W,$_GPC; |
|||
if($_W['ispost']){ |
|||
$data = $_GPC['data']; |
|||
$time = $_GPC['time']; |
|||
$liveGoods = $_GPC['live_goods']; |
|||
try{ |
|||
//判断信息数据是否完善 |
|||
!$data['name'] && Commons::sRenderError('请输入房间名称'); |
|||
!$data['coverImg'] && Commons::sRenderError('请上传背景图'); |
|||
!$data['anchorName'] && Commons::sRenderError('请输入主播昵称'); |
|||
!$data['anchorWechat'] && Commons::sRenderError('请输入主播微信'); |
|||
!$data['shareImg'] && Commons::sRenderError('请上传分享图'); |
|||
$wxAppModel = (new Live()); |
|||
//处理信息 |
|||
$coverImg = tomedia($data['coverImg']); |
|||
$shareImg = tomedia($data['shareImg']); |
|||
$data['coverImg'] = $wxAppModel->uploadTemporaryMaterial(tomedia($data['coverImg'])); |
|||
$data['shareImg'] = $wxAppModel->uploadTemporaryMaterial(tomedia($data['shareImg'])); |
|||
$data['startTime'] = strtotime($time['start']); |
|||
$data['endTime'] = strtotime($time['end']); |
|||
//直播间建立 |
|||
$liveRes = $wxAppModel->addLive($data); |
|||
if($liveRes['errcode'] == 300036){ |
|||
//主播未认证 进行认证操作 |
|||
Commons::sRenderError('请进行主播认证操作',['qrcode_url'=>$liveRes['qrcode_url']]); |
|||
}else{ |
|||
//直播间添加成功 开始导入商品 |
|||
if(is_array($liveGoods) && count($liveGoods) > 0){ |
|||
$importParams = [ |
|||
'ids' => $liveGoods, |
|||
'roomId' => $liveRes['roomId'] |
|||
]; |
|||
$wxAppModel->importGoods($importParams); |
|||
} |
|||
//直播间添加成功 记录直播间信息 |
|||
$liveInfo = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $_W['aid'] , |
|||
'name' => $data['name'] ,//直播间名称 |
|||
'roomid' => $liveRes['roomId'] ,//直播间ID |
|||
'cover_img' => $coverImg ,//直播间背景图链接 |
|||
'share_img' => $shareImg ,//直播间分享图链接 |
|||
'live_status' => 102 ,//直播间状态。101:直播中,102:未开始,103已结束,104禁播,105:暂停,106:异常,107:已过期 |
|||
'start_time' => $data['startTime'] ,//直播间开始时间 |
|||
'end_time' => $data['endTime'] ,//直播计划结束时间 |
|||
'anchor_name' => $data['anchorName'] ,//主播名 |
|||
'goods_list' => json_encode($liveGoods) ,//当前直播间相关联的商品列表 |
|||
]; |
|||
pdo_insert(PDO_NAME."live",$liveInfo); |
|||
} |
|||
|
|||
Commons::sRenderSuccess("操作成功"); |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
}catch (InvalidArgumentException $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
|
|||
include wl_template("live/add"); |
|||
} |
|||
/** |
|||
* Comment: 获取直播回放列表 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 17:01 |
|||
*/ |
|||
public function getPlayback(){ |
|||
global $_W,$_GPC; |
|||
try{ |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] OR wl_json(0 , "不存在的直播间,请刷新重试!"); |
|||
$caCheKey = 'live_playback';//缓存键 |
|||
$caCheName = md5("uniacid={$_W['uniacid']}&aid={$_W['aid']}&room_id={$id}");//缓存名 |
|||
//获取缓存中的回放信息 |
|||
$info = Cache::getCache($caCheKey,$caCheName); |
|||
if($info){ |
|||
$info = json_decode($info,true); |
|||
if($info['end_time'] <= time()) $info = [];//清除缓存数据 |
|||
} |
|||
//获取新的回放列表信息 |
|||
if(!is_array($info) || !$info['list']){ |
|||
$info = (new Live())->getWholePlayback($id); |
|||
//循环处理信息 |
|||
foreach($info['list'] as $index => &$item){ |
|||
$item['create_time'] = date("Y-m-d H:i:s",strtotime($item['create_time'])); |
|||
$item['expire_time'] = date("Y-m-d H:i:s",strtotime($item['expire_time'])); |
|||
} |
|||
$info['end_time'] = time() + (3600 * 34);//缓存一天 |
|||
Cache::setCache($caCheKey,$caCheName,json_encode($info)); |
|||
} |
|||
|
|||
include wl_template("live/playback"); |
|||
}catch (Exception $e){ |
|||
wl_json(0 , $e->getMessage()); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 开播二维码获取 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 15:09 |
|||
*/ |
|||
public function getOpenLiveQrCode(){ |
|||
global $_W,$_GPC; |
|||
//生成二维码 |
|||
$path = "plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id={$_GPC['id']}&type=9"; |
|||
$qrcode = WeApp::getQrCode($path , 'qrcode_live_' . md5($path) . '.png'); |
|||
$qrcode = tomedia($qrcode); |
|||
|
|||
include wl_template('live/qrcode'); |
|||
} |
|||
/** |
|||
* Comment: 直播间信息同步 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 16:26 |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function infoSynchronization(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
//直播信息同步操作 |
|||
try{ |
|||
//初始化更新状态 |
|||
if($page == 1) pdo_update(PDO_NAME."live",['is_update'=>0]); |
|||
//循环处理直播间信息 |
|||
$totalPage = (new Live())->liveInfoSynchronization($pageStart,$pageIndex); |
|||
//删除未更新的直播间 |
|||
if($page == $totalPage || $totalPage == 0) pdo_delete(PDO_NAME."live",['is_update'=>0]); |
|||
|
|||
Commons::sRenderSuccess("操作成功",['total_page'=>$totalPage]); |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
}catch (InvalidArgumentException $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,136 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
|
|||
class Member_WeliamController { |
|||
/** |
|||
* Comment: 获取成员列表 |
|||
* Author: zzw |
|||
* Date: 2020/11/5 11:19 |
|||
*/ |
|||
public function memberIndex(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = 10; |
|||
$nickname = $_GPC['nickname'] ? : ''; |
|||
$memberRole = $_GPC['member_role'] ? : ''; |
|||
//条件生成 |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
if($nickname) $where['nickname LIKE'] = "%{$nickname}%"; |
|||
if($memberRole) $where['member_role'] = $memberRole; |
|||
if($memberRole == 5) $where['member_role'] = 0; |
|||
//获取直播相关信息 |
|||
$total = pdo_count(PDO_NAME."live_member",$where); |
|||
$field = ['id','nickname','avatar','openid','member_role','update_time','account_number']; |
|||
$list = pdo_getall(PDO_NAME."live_member",$where,$field,'','update_time DESC',[$page,$pageIndex]); |
|||
//分页操作 |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('member/list'); |
|||
} |
|||
/** |
|||
* Comment: 添加成员信息 |
|||
* Author: zzw |
|||
* Date: 2020/11/5 11:48 |
|||
*/ |
|||
public function addMember(){ |
|||
global $_W,$_GPC; |
|||
if($_W['ispost']){ |
|||
//参数信息获取 |
|||
$data = $_GPC['data']; |
|||
//请求添加设置成员信息 |
|||
try{ |
|||
(new Live())->addMemberInfo($data); |
|||
|
|||
wl_message('操作成功' , web_url('live/member/memberIndex') , 'success'); |
|||
}catch (Exception $e){ |
|||
wl_message($e->getMessage() , referer() , 'error'); |
|||
} |
|||
} |
|||
|
|||
include wl_template('member/add'); |
|||
} |
|||
/** |
|||
* Comment: 同步成员信息 |
|||
* Author: zzw |
|||
* Date: 2020/11/5 10:41 |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function infoSynchronization(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = 30; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
if($page == 1) pdo_update(PDO_NAME . "live_member" , ['is_synchronization'=>0]); |
|||
//请求获取列表信息 |
|||
$params = [ |
|||
'role' => -1 ,//取值 [-1:所有成员, 0:超级管理员,1:管理员,2:主播,3:运营者] |
|||
'offset' => $pageStart ,// 起始偏移量 |
|||
'limit' => $pageIndex ,// 查询个数,最大30,默认10 |
|||
'keyword' => '' ,// 搜索的微信号,不传返回全部 |
|||
]; |
|||
try{ |
|||
$info = (new Live())->memberInfoSynchronization($params); |
|||
//循环处理列表信息 |
|||
foreach($info['list'] as $item){ |
|||
foreach($item['roleList'] as $role){ |
|||
$data = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'nickname' => $item['nickname'] ,//昵称 |
|||
'avatar' => $item['headingimg'] ,//头像 |
|||
'openid' => $item['openid'] ,//用户openid 唯一标识 |
|||
'member_role' => $role ,//具有的身份 [0:超级管理员,1:管理员,2:主播,3:运营者] |
|||
'update_time' => $item['updateTimestamp'] ,//更新时间 |
|||
'account_number' => $item['username'] ,//脱敏微信号 |
|||
'is_synchronization' => 1 ,//信息是否同步:0=未同步;1=已经同步 |
|||
]; |
|||
//判断是否存在成员信息 不存在则添加、存在则修改 |
|||
$isHave = pdo_get(PDO_NAME . "live_member" , [ |
|||
'uniacid' => $data['uniacid'] , |
|||
'openid' => $data['openid'] , |
|||
'member_role' => $data['member_role'] , |
|||
]); |
|||
if ($isHave) pdo_update(PDO_NAME . "live_member" , $data , ['id' => $isHave['id']]); |
|||
else pdo_insert(PDO_NAME . "live_member" , $data); |
|||
} |
|||
} |
|||
//同步信息完成后 删除未同步的数据 这些数据就是在微信后台已经删除的成员信息 |
|||
if ($page == $info['total_page']) pdo_delete(PDO_NAME . "live_member" , ['is_synchronization' => 0]); |
|||
Commons::sRenderSuccess("操作成功",['total_page'=>$info['total_page']]); |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 点击删除成员信息 |
|||
* Author: zzw |
|||
* Date: 2020/11/5 13:57 |
|||
*/ |
|||
public function deleteMemberInfo(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$username = $_GPC['username'] OR Commons::sRenderError('请输入微信号!'); |
|||
$id = $_GPC['id'] OR Commons::sRenderError('参数错误,请刷新重试!'); |
|||
//请求删除 |
|||
try{ |
|||
//获取角色信息 |
|||
$role = pdo_getcolumn(PDO_NAME."live_member",['id'=>$id],'member_role'); |
|||
//请求删除角色信息 |
|||
$params = [ |
|||
'username' => $username , |
|||
'role' => $role , |
|||
]; |
|||
(new Live())->deleteMember($params); |
|||
//删除本平台角色信息 |
|||
pdo_delete(PDO_NAME."live_member",['id'=>$id]); |
|||
|
|||
Commons::sRenderSuccess("操作成功"); |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage() ? : '非法请求,请确认微信号是否正确'); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,101 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('live/goods/goodsList')}">商品列表</a></li> |
|||
<li class="active"><a href="{php echo web_url('live/goods/add')}">发布商品</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<div class="form-group" id="goods"> |
|||
<label class="col-sm-2 control-label must">选择商品</label> |
|||
<div class="col-sm-9 is_judge" is_judge="false"> |
|||
{php echo tpl_select_goods([]);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[coverImgUrl]', '');} |
|||
<span class="help-block">图片尺寸最大300像素*300像素,如果不传图片则默认使用当前商品logo图片</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must ">商品名称</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" minlength="3" maxlength="14" name="data[name]"/> |
|||
<div class="help-block">最少3汉字6字母;最大14个汉字28字母。不填则默认使用商品当前名称,超出长度则截取前14位。</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">价格类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[priceType]" value="1" checked="checked"> 一口价 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[priceType]" value="2"> 价格区间 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[priceType]" value="3"> 折扣价 |
|||
</label> |
|||
<div class="help-block">默认使用一口价类型。价格为当前商品价格</div> |
|||
</div> |
|||
</div> |
|||
<!-- 价格类型 --> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must" id="price">售价</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" name="data[price]"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group hide"> |
|||
<div class="col-sm-2 control-label must" id="price2"></div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" name="data[price2]"/> |
|||
</div> |
|||
</div> |
|||
<!--添加按钮--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="id" value="{$info['id']}" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 更换价格类型 |
|||
*/ |
|||
$("[name='data[priceType]']").on('change',function () { |
|||
//基本参数信息获取 |
|||
let _this = $(this), |
|||
_val = _this.val(); |
|||
//根据价格类型进行对应的操作 |
|||
if(_val == 1){ |
|||
//标题信息替换 |
|||
$("#price").html('售价'); |
|||
$("#price2").html(''); |
|||
//隐藏价格二 |
|||
$("#price2").parent(".form-group").addClass('hide'); |
|||
}else if(_val == 2){ |
|||
//标题信息替换 |
|||
$("#price").html('最低价'); |
|||
$("#price2").html('最高价'); |
|||
//显示价格二 |
|||
$("#price2").parent(".form-group").removeClass('hide'); |
|||
}else if(_val == 3){ |
|||
//标题信息替换 |
|||
$("#price").html('原价'); |
|||
$("#price2").html('现价'); |
|||
//显示价格二 |
|||
$("#price2").parent(".form-group").removeClass('hide'); |
|||
} |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,198 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('live/goods/goodsList')}">商品列表</a></li> |
|||
<li class="active"><a href="javascript:;">编辑商品</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="alert alert-warning"> |
|||
{if $status == 0} |
|||
可以更新所有信息 |
|||
{else} |
|||
仅允许更新价格类型与价格信息 |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<!--商品状态,0:未审核。1:审核中,2:审核通过,3:审核驳回--> |
|||
<!--审核通过的商品仅允许更新价格类型与价格,未审核的商品允许更新所有字段--> |
|||
{if $status == 0} |
|||
<!-- 可以更新所有信息 --> |
|||
<div class="form-group" id="goods"> |
|||
<label class="col-sm-2 control-label must">选择商品</label> |
|||
<div class="col-sm-9 is_judge" is_judge="false"> |
|||
<div class="input-group"> |
|||
<input type="text" placeholder="请选择商品!" name="data[goods_name]" readonly="readonly" value="{$info['goods_name']}" class="form-control selectGoods_name" autocomplete="off"> |
|||
<input type="text" placeholder="请选择商品!" name="data[goods_id]" readonly="readonly" value="{$info['goods_id']}" class="form-control hide selectGoods_id" autocomplete="off"> |
|||
<input type="text" placeholder="请选择商品!" name="data[goods_plugin]" readonly="readonly" value="{$info['goods_plugin']}" class="form-control hide selectGoods_plugin" autocomplete="off"> |
|||
<input type="text" placeholder="请选择商品!" name="data[sid]" readonly="readonly" value="{$info['sid']}" class="form-control hide selectGoods_sid" autocomplete="off"> |
|||
<span class="input-group-btn"> |
|||
<button class="btn btn-default" type="button" data-toggle="selectGoods">选择商品</button> |
|||
</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品图片</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="data[goods_img]" value="{$params['goods_img']}" class="form-control" autocomplete="off" id="cimg-data_goods_img"> |
|||
<span class="input-group-btn"> |
|||
<button class="btn btn-default" type="button" data-toggle="selectAttachment" data-input="#cimg-data_goods_img" data-img="#pimg-data_goods_img">选择图片</button> |
|||
</span> |
|||
</div> |
|||
<div class="input-group " style="margin-top:.5em;"> |
|||
<img src="{$params['goods_img']}" id="pimg-data_goods_img" class="img-responsive img-thumbnail" width="150" onerror="this.src='{IMAGE_NOPIC_SMALL}'" data-times="1"> |
|||
<em class="close" style="position:absolute; top: 0px; right: -14px;" onclick="$('#cimg-data_goods_img').val('');$('#pimg-data_goods_img').attr('src','');">×</em> |
|||
</div> |
|||
<span class="help-block">图片尺寸最大300像素*300像素,如果不传图片则默认使用当前商品logo图片</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must ">商品名称</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" minlength="3" maxlength="14" name="data[title]" value="{$params['title']}"/> |
|||
<div class="help-block">最少3汉字6字母;最大14个汉字28字母。不填则默认使用商品当前名称,超出长度则截取前14位。</div> |
|||
</div> |
|||
</div> |
|||
{else} |
|||
<!--仅允许更新价格类型与价格信息--> |
|||
<div class="form-group" id="goods"> |
|||
<label class="col-sm-2 control-label must">选择商品</label> |
|||
<div class="col-sm-9 is_judge" is_judge="false"> |
|||
<div class="input-group"> |
|||
<input type="text" placeholder="请选择商品!" readonly="readonly" value="{$info['goods_name']}" class="form-control selectGoods_name" autocomplete="off"> |
|||
<input type="text" placeholder="请选择商品!" name="data[goods_id]" readonly="readonly" value="{$info['goods_id']}" class="form-control hide selectGoods_id" autocomplete="off"> |
|||
<input type="text" placeholder="请选择商品!" readonly="readonly" value="{$info['goods_plugin']}" class="form-control hide selectGoods_plugin" autocomplete="off"> |
|||
<input type="text" placeholder="请选择商品!" readonly="readonly" value="{$info['sid']}" class="form-control hide selectGoods_sid" autocomplete="off"> |
|||
<span class="input-group-btn"> |
|||
<button class="btn btn-default" type="button" disabled="disabled">选择商品</button> |
|||
</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品图片</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" value="{$params['goods_img']}" disabled="disabled" class="form-control" autocomplete="off"> |
|||
<span class="input-group-btn"> |
|||
<button class="btn btn-default" type="button" disabled="disabled">选择图片</button> |
|||
</span> |
|||
</div> |
|||
<div class="input-group " style="margin-top:.5em;"> |
|||
<img src="{$params['goods_img']}" class="img-responsive img-thumbnail" width="150" onerror="this.src='{IMAGE_NOPIC_SMALL}'" data-times="1"> |
|||
</div> |
|||
<span class="help-block">图片尺寸最大300像素*300像素,如果不传图片则默认使用当前商品logo图片</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must ">商品名称</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" minlength="3" maxlength="14" disabled="disabled" value="{$params['title']}"/> |
|||
<div class="help-block">最少3汉字6字母;最大14个汉字28字母。不填则默认使用商品当前名称,超出长度则截取前14位。</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<!-- 价格类型 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>价格类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[price_type]" value="1" {if $params['price_type'] == 1}checked="checked"{/if}> 一口价 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[price_type]" value="2" {if $params['price_type'] == 2}checked="checked"{/if}> 价格区间 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[price_type]" value="3" {if $params['price_type'] == 3}checked="checked"{/if}> 折扣价 |
|||
</label> |
|||
<div class="help-block">默认使用一口价类型。价格为当前商品价格</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label" id="price"> |
|||
{if $params['price_type'] == 1} |
|||
售价 |
|||
{elseif $params['price_type'] == 2} |
|||
最低价 |
|||
{elseif $params['price_type'] == 3} |
|||
原价 |
|||
{/if} |
|||
</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" step="0.01" name="data[price]" value="{$params['price']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group {if $params['price_type'] == 1}hide{/if}"> |
|||
<div class="col-sm-2 control-label" id="price2"> |
|||
{if $params['price_type'] == 1} |
|||
|
|||
{elseif $params['price_type'] == 2} |
|||
最高价 |
|||
{elseif $params['price_type'] == 3} |
|||
现价 |
|||
{/if} |
|||
</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" step="0.01" name="data[price2]" value="{$params['price2']}"/> |
|||
</div> |
|||
</div> |
|||
<!--提交按钮--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="goods_id" value="{$params['goods_id']}" /> |
|||
<input type="hidden" name="status" value="{$status}" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 更换价格类型 |
|||
*/ |
|||
$("[name='data[price_type]']").on('change',function () { |
|||
//基本参数信息获取 |
|||
let _this = $(this), |
|||
_val = _this.val(); |
|||
//根据价格类型进行对应的操作 |
|||
if(_val == 1){ |
|||
//标题信息替换 |
|||
$("#price").html('售价'); |
|||
$("#price2").html(''); |
|||
//隐藏价格二 |
|||
$("#price2").parent(".form-group").addClass('hide'); |
|||
}else if(_val == 2){ |
|||
//标题信息替换 |
|||
$("#price").html('最低价'); |
|||
$("#price2").html('最高价'); |
|||
//显示价格二 |
|||
$("#price2").parent(".form-group").removeClass('hide'); |
|||
}else if(_val == 3){ |
|||
//标题信息替换 |
|||
$("#price").html('原价'); |
|||
$("#price2").html('现价'); |
|||
//显示价格二 |
|||
$("#price2").parent(".form-group").removeClass('hide'); |
|||
} |
|||
}); |
|||
/** |
|||
* 提交判断信息 |
|||
* @returns {boolean} |
|||
*/ |
|||
function formcheck(){ |
|||
let gid = $("[name='data[goods_id]']").val(); |
|||
if(!gid){ |
|||
tip.alert('请选择商品!'); |
|||
return false; |
|||
} |
|||
} |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,163 @@ |
|||
{php include wl_template('common/header');} |
|||
<meta name="referrer" content="never"> |
|||
<div class="app-content"> |
|||
<ul class="nav nav-tabs"> |
|||
<li {if $status == '0'} class="active" {/if}><a href="{php echo web_url('live/goods/goodsList', array('status'=>0));}">未审核</a></li> |
|||
<li {if $status == '1'} class="active" {/if}><a href="{php echo web_url('live/goods/goodsList', array('status'=>1));}">审核中</a></li> |
|||
<li {if $status == '2'} class="active" {/if}><a href="{php echo web_url('live/goods/goodsList', array('status'=>2));}">通过(使用中)</a></li> |
|||
<li {if $status == '3'} class="active" {/if}><a href="{php echo web_url('live/goods/goodsList', array('status'=>3));}">驳回(未通过)</a></li> |
|||
</ul> |
|||
<div class="app-filter"> |
|||
<div class="alert alert-warning"> |
|||
注意事项:<br /> |
|||
1、商品列表每天只能查看10000次<br> |
|||
2、商品信息每天限制1000次(信息同步每50条消耗一次,不足50条也会消耗一次。每次进入商品编辑页面消耗一次)<br> |
|||
3、每天最多只能进行500次商品添加请求(重新提交也会消耗一次)<br> |
|||
4、每天最多只能进行1000次商品删除<br> |
|||
5、审核通过的商品仅允许修改价格类型与价格,未审核的商品允许修改所有信息,其他状态的商品不允许修改<br> |
|||
6、对商品进行添加、删除、重新审核、修改信息操作后请使用信息同步,否则可能数据和微信公众号后台不一致<br> |
|||
7、直播间请勿在微信公众号后台进行删除,否则可能导致平台直播间数据和微信公众号后台不一致<br> |
|||
8、同步商品信息时,如果商品在本平台不存在则不会同步且不会显示在本平台<br> |
|||
</div> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('live/goods/add');}" class="btn btn-primary">发布商品</a> |
|||
<a href="javascript:;" id="infoSynchronization" class="btn btn-info">信息同步</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">商品ID</th> |
|||
<th class="text-center">所属代理</th> |
|||
<th class="text-center">商品图片</th> |
|||
<th class="text-center">商品名称</th> |
|||
<th class="text-center">价格</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $val} |
|||
<tr class="text-center"> |
|||
<td>{$val['goods_id']}</td> |
|||
<td>{$val['agent_name']}</td> |
|||
<td> |
|||
<img class="scrollLoading" src="{$val['goods_img']}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="50" width="50"/> |
|||
</td> |
|||
<td>{$val['title']}</td> |
|||
<td> |
|||
<!-- 价格类型,1:一口价,2:价格区间,3:显示折扣价 --> |
|||
{if $val['price_type'] == 1} |
|||
<label class="label label-success">售价:{$val['price']}</label> |
|||
{elseif $val['price_type'] == 2} |
|||
<label class="label label-info">售价:{$val['price']} ~ {$val['price2']}</label> |
|||
{else} |
|||
<label class="label label-primary">原价:{$val['price']}</label><br /> |
|||
<label class="label label-danger" style="display: inline-block;margin-top: 5px;">现价:{$val['price2']}</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<!--商品来源(thirdPartyTag),1、2:表示是为 API 添加商品,否则是直播控制台添加的商品--> |
|||
{if in_array($val['third_party_tag'],[1,2])} |
|||
<!--商品状态,0:未审核。1:审核中,2:审核通过,3:审核驳回--> |
|||
{if $status == 0} |
|||
<a href="javascript:;" class="btn btn-sm btn-success reSubmitButton" data-id="{$val['goods_id']}">重新提交</a> |
|||
<a href="{php echo web_url('live/goods/editGoods',['goods_id'=>$val['goods_id'],'status'=>$status]);}" class="btn btn-sm btn-info">编辑商品</a> |
|||
{elseif $status == 1} |
|||
<a href="javascript:;" class="btn btn-sm btn-info withdrawButton" data-id="{$val['goods_id']}">撤回审核</a> |
|||
{elseif $status == 2} |
|||
<a href="{php echo web_url('live/goods/editGoods',['goods_id'=>$val['goods_id'],'status'=>$status]);}" class="btn btn-sm btn-info">编辑商品</a> |
|||
{elseif $status == 3} |
|||
<!--审核驳回--> |
|||
{/if} |
|||
<a href="javascript:;" class="btn btn-sm btn-danger deleteGoodsButton" data-id="{$val['goods_id']}">删除商品</a> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"></div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 请求撤回正在审核中的商品 |
|||
*/ |
|||
$(".withdrawButton").on('click',function () { |
|||
//基本参数信息获取 |
|||
let id = $(this).data('id'); |
|||
//请求进行撤回操作 |
|||
$.post("{php echo web_url('live/goods/cancelAdd');}", { |
|||
id: id, |
|||
}, function(res) { |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
}, 'json'); |
|||
}); |
|||
/** |
|||
* 重新提交商品进行审核 |
|||
*/ |
|||
$(".reSubmitButton").on('click',function () { |
|||
//基本参数信息获取 |
|||
let id = $(this).data('id'); |
|||
//请求进行撤回操作 |
|||
$.post("{php echo web_url('live/goods/reSubmit');}", { |
|||
id: id, |
|||
}, function(res) { |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
}, 'json'); |
|||
}); |
|||
/** |
|||
* 删除直播商品 |
|||
*/ |
|||
$(".deleteGoodsButton").on('click',function () { |
|||
//基本参数信息获取 |
|||
let id = $(this).data('id'); |
|||
//请求进行撤回操作 |
|||
$.post("{php echo web_url('live/goods/deleteLiveGoods');}", { |
|||
id: id, |
|||
}, function(res) { |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
}, 'json'); |
|||
}); |
|||
/** |
|||
* 点击进行信息同步 |
|||
*/ |
|||
$("#infoSynchronization").on('click',function () { |
|||
$('#page-loading').show(); |
|||
let synchronizatio = function(page){ |
|||
$.post("{php echo web_url('live/goods/infoSynchronization')}",{page:page},function (res) { |
|||
//判断是否成功 |
|||
if(res.errno == 1){ |
|||
page++; |
|||
if(res.data['total_page'] >= page){ |
|||
//总页数大于等于 下一页则继续进行信息同步 |
|||
synchronizatio(page); |
|||
}else{ |
|||
//信息同步完成 |
|||
tip.alert("同步完成",function () { |
|||
history.go(0); |
|||
}); |
|||
} |
|||
}else{ |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
} |
|||
},'json'); |
|||
} |
|||
synchronizatio(1); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,71 @@ |
|||
<div class="modal-dialog" id="selectLiveGoodsInfo" style="min-width: 60%!important;"> |
|||
<!--css样式--> |
|||
<style> |
|||
#selectLiveGoodsInfo{ |
|||
padding-right: 4px; |
|||
position: fixed; |
|||
top: 15%; |
|||
left: 25%; |
|||
} |
|||
#selectLiveGoodsList .userAvatar img{ |
|||
width: 50px!important; |
|||
height: 50px!important; |
|||
} |
|||
#selectLiveGoodsList .modal-content{ |
|||
max-height: 1000px!important; |
|||
} |
|||
#selectLiveGoodsList .modal-body.form-horizontal{ |
|||
padding-bottom: 0!important; |
|||
} |
|||
#selectLiveGoodsList svg{ |
|||
display: inline-block!important; |
|||
} |
|||
</style> |
|||
<!--列表信息--> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">请选择商品</h4> |
|||
</div> |
|||
<div class="modal-body form-horizontal"> |
|||
<div class="app-table-list" id="selectLiveGoodsList"> |
|||
{php include wl_template('goods/select_goods');} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!--js样式--> |
|||
<script> |
|||
/** |
|||
* 分页操作 |
|||
*/ |
|||
$('#selectLiveGoodsList').on('click','.pull-right li a',function (event) { |
|||
//禁止跳转 |
|||
event.preventDefault(); |
|||
//参数信息获取 |
|||
let _this = $(this), |
|||
href = _this.attr('href'); |
|||
//请求获取信息 |
|||
$.ajax(href, { |
|||
data:{is_block:1}, |
|||
type: "POST", |
|||
dataType: "html", |
|||
cache: false, |
|||
}).done(function(html) { |
|||
$(document).find("#selectLiveGoodsList").html(html); |
|||
}); |
|||
return false; |
|||
}); |
|||
/** |
|||
* 选中商品 调用方法进行处理 |
|||
*/ |
|||
$('#selectLiveGoodsList').on('click','.selectedLiveGoods',function () { |
|||
//基本参数信息获取 |
|||
let _this = $(this), |
|||
params = _this.data('params'); |
|||
//调用处理方法 |
|||
liveGoodsSelected(params); |
|||
//自动关闭选择器 |
|||
$(document).find("#closeButton").click(); |
|||
}); |
|||
</script> |
|||
</div> |
|||
@ -0,0 +1,44 @@ |
|||
<div class="panel panel-default" style="height: 500px;overflow: auto;"> |
|||
<table class="table table-hover table-responsive table-bordered" style="border: 1px solid #e5e5e5;"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">商品ID</th> |
|||
<th class="text-center">商品图片</th> |
|||
<th class="text-center">商品名称</th> |
|||
<th class="text-center">价格</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody class="text-center" id="selectLiveGoodsList"> |
|||
{loop $list $val} |
|||
<tr class="text-center"> |
|||
<td>{$val['goods_id']}</td> |
|||
<td> |
|||
<img class="scrollLoading" src="{$val['goods_img']}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="50" width="50"/> |
|||
</td> |
|||
<td>{$val['title']}</td> |
|||
<td> |
|||
<!-- 价格类型,1:一口价,2:价格区间,3:显示折扣价 --> |
|||
{if $val['price_type'] == 1} |
|||
<label class="label label-success">售价:{$val['price']}</label> |
|||
{elseif $val['price_type'] == 2} |
|||
<label class="label label-info">售价:{$val['price']} ~ {$val['price2']}</label> |
|||
{else} |
|||
<label class="label label-primary">原价:{$val['price']}</label><br /> |
|||
<label class="label label-danger" style="display: inline-block;margin-top: 5px;">现价:{$val['price2']}</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<a href="javascript:;" class="btn btn-sm btn-primary selectedLiveGoods" data-params='{php echo json_encode($val);}'>选择</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button type="button" class="btn btn-danger min-width" id="closeButton" data-dismiss="modal">取消</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
@ -0,0 +1,317 @@ |
|||
{php include wl_template('common/header');} |
|||
<meta name="referrer" content="never"> |
|||
<style> |
|||
.goodsBlock{ |
|||
width: 300px; |
|||
height: 120px; |
|||
float: left; |
|||
margin-right: 15px; |
|||
border: 1px solid #CCCCCC; |
|||
margin-bottom: 15px; |
|||
padding: 5px; |
|||
} |
|||
.goodsBlock .img{ |
|||
width: 120px; |
|||
height: 100%; |
|||
float: left; |
|||
margin-right: 10px; |
|||
position: relative; |
|||
} |
|||
.goodsBlock .img img{ |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
.goodsBlock .img .deleteGoods{ |
|||
position: absolute; |
|||
top: 0; |
|||
right: 0; |
|||
color: red; |
|||
padding: 2px 6px; |
|||
font-size: 13px; |
|||
cursor: pointer; |
|||
} |
|||
.goodsBlock .info{ |
|||
float: left; |
|||
width: calc(100% - 135px); |
|||
height: 100%; |
|||
font-size: 13px; |
|||
} |
|||
.goodsBlock .info .title{ |
|||
display: -webkit-box; |
|||
overflow: hidden; |
|||
-webkit-box-orient: vertical; |
|||
text-overflow: ellipsis; |
|||
-webkit-line-clamp: 2; |
|||
height: 40px; |
|||
line-height: 20px; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('live/live/liveList')}">直播间列表</a></li> |
|||
<li class="active"><a href="javascript:;">添加直播间</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
{if $_W['aid']} |
|||
<div class="app-filter"> |
|||
<div class="alert alert-warning"> |
|||
请添加商品信息,如果不添加商品信息则当前直播间在同步信息后会自动移动到总后台 |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<!-- 房间名字 --> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"><span class="form-must">*</span>房间名称</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" name="data[name]" minlength="3" maxlength="15"/> |
|||
</div> |
|||
</div> |
|||
<!-- 背景图 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>背景图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[coverImg]', '');} |
|||
<div class="help-block">建议像素1080*1920,大小不超过1M</div> |
|||
</div> |
|||
</div> |
|||
<!-- 开始时间 - 结束时间 --> |
|||
<div class="form-group"> |
|||
<label class="control-label col-xs-12 col-sm-2"><span class="form-must">*</span>开始时间:</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
{php echo tpl_select_time_info('time', ['starttime' => date('Y-m-d H:i',strtotime(' +15 minute')), 'endtime' => date('Y-m-d H:i', strtotime('+1 hour +15 minute'))]);} |
|||
<div class="input_tip">开播时间需要在当前时间的10分钟后 并且 开始时间不能在 6 个月后</div> |
|||
</div> |
|||
</div> |
|||
<!-- 主播昵称 --> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must "><span class="form-must">*</span>主播昵称</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" name="data[anchorName]" minlength="3" maxlength="15"/> |
|||
</div> |
|||
</div> |
|||
<!-- 主播微信号 --> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must "><span class="form-must">*</span>主播微信</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" name="data[anchorWechat]"/> |
|||
<!-- <div class="input_tip">如果未实名认证,需要先前往<a href="https://mp.weixin.qq.com/" target="_blank">小程序直播</a>小程序进行实名验证</div>--> |
|||
</div> |
|||
</div> |
|||
<!-- 分享图 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>分享图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[shareImg]', '');} |
|||
<div class="input_tip">建议像素800*640,大小不超过1M</div> |
|||
</div> |
|||
</div> |
|||
<!-- 直播类型 1=推流;0=手机直播 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">直播类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="0" checked="checked"> 手机直播 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="1"> 推流 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<!-- 画面尺寸 1=横屏;0=竖屏--> |
|||
<div class="form-group hide" id="screenType"> |
|||
<label class="col-sm-2 control-label">画面尺寸</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[screenType]" value="0"> 竖屏 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[screenType]" value="1" checked="checked"> 横屏 |
|||
</label> |
|||
<div class="input_tip">横屏:视频宽高比为16:9、4:3、1.85:1 ;竖屏:视频宽高比为9:16、2:3</div> |
|||
</div> |
|||
</div> |
|||
<!-- 点赞 1=关闭;0=开启--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">点赞</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[closeLike]" value="0" checked="checked"> 开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[closeLike]" value="1"> 关闭 |
|||
</label> |
|||
<div class="input_tip">若关闭,直播开始后不允许开启</div> |
|||
</div> |
|||
</div> |
|||
<!-- 货架 1=关闭;0=开启 转为后台判断--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">货架</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[closeGoods]" value="0" checked="checked"> 开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[closeGoods]" value="1"> 关闭 |
|||
</label> |
|||
<div class="input_tip">若关闭,直播开始后不允许开启</div> |
|||
</div> |
|||
</div> |
|||
<!-- 评论 1=关闭;0=开启--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">评论</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[closeComment]" value="0" checked="checked"> 开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[closeComment]" value="1"> 关闭 |
|||
</label> |
|||
<div class="input_tip">若关闭,直播开始后不允许开启</div> |
|||
</div> |
|||
</div> |
|||
<!-- 选择商品信息 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">选择商品</label> |
|||
<div class="col-sm-9"> |
|||
<input type="button" value="选择商品" class="btn btn-info col-sm-1 min-width" id="selectLiveGoods"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9" id="selectedLiveGoodsList"> |
|||
<!--已选中的直播商品列表--> |
|||
</div> |
|||
</div> |
|||
<!-- 主播认证 --> |
|||
<div class="form-group hide" id="authentication"> |
|||
<label class="col-sm-2 control-label">主播认证</label> |
|||
<div class="col-sm-9"> |
|||
<img src="" width="200" height="200"/> |
|||
</div> |
|||
</div> |
|||
<!-- 提交按钮 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="button" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" id="submitInfo" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 打开直播商品选择模态框 |
|||
*/ |
|||
$("#selectLiveGoods").on('click',function () { |
|||
$.ajax({ |
|||
url: "{php echo web_url('live/goods/selectGoods')}", |
|||
type: "post", |
|||
dataType: "html", |
|||
success:function (res) { |
|||
//判断是否为json格式数据 |
|||
try { |
|||
//如果能够成功转换 则为json格式数据信息 |
|||
let obj = JSON.parse(res); |
|||
if(obj){ |
|||
tip.alert(obj.message) |
|||
} |
|||
} catch(e) { |
|||
//json 转换失败 为html格式数据 |
|||
$("#selectLiveGoodsInfo").remove(); |
|||
$("body").append(res); |
|||
$("#selectLiveGoodsInfo").modal(); |
|||
} |
|||
}, |
|||
}); |
|||
}); |
|||
/** |
|||
* 点击删除商品 |
|||
*/ |
|||
$("#selectedLiveGoodsList").on('click','.deleteGoods',function () { |
|||
$(this).closest(".goodsBlock").remove(); |
|||
}); |
|||
/** |
|||
* 根据直播类型 显示隐藏画面尺寸 |
|||
*/ |
|||
$("[name='data[type]']").on('change',function () { |
|||
let val = $(this).val(); |
|||
if(parseInt(val) === 0){ |
|||
//手机直播 |
|||
$("#screenType").addClass('hide'); |
|||
}else{ |
|||
//推流 |
|||
$("#screenType").removeClass('hide'); |
|||
} |
|||
}); |
|||
/** |
|||
* 选中直播商品后的操作 |
|||
* @param params |
|||
*/ |
|||
function liveGoodsSelected(params) { |
|||
//价格信息获取 价格类型,1:一口价,2:价格区间,3:显示折扣价 |
|||
let priceHtml = '<label class="label label-success">售价:'+params['price']+'</label>'; |
|||
if(params['price_type'] == 2){ |
|||
priceHtml = '<label class="label label-info">售价:'+params['price']+' ~ '+params['price2']+'</label>'; |
|||
}else if(params['price_type'] == 3){ |
|||
priceHtml = '<label class="label label-primary">原价:'+params['price']+'</label>' + |
|||
'<label class="label label-danger" style="display: inline-block;margin-top: 5px;">现价:'+params['price2']+'</label>'; |
|||
} |
|||
//商品信息不存在 生成商品块 |
|||
let goodsBlockId = "livegoods"+params['goods_id']; |
|||
if($('#'+goodsBlockId).length == 0){ |
|||
//不存在 建立商品块 |
|||
let html = '<div class="goodsBlock" id="'+goodsBlockId+'">\n' + |
|||
' <div class="img">\n' + |
|||
' <img src="'+params['goods_img']+'">\n' + |
|||
' <span class="deleteGoods">删除</span>\n' + |
|||
' </div>\n' + |
|||
' <div class="info">\n' + |
|||
' <div class="title">'+params['title']+'</div>\n' +priceHtml+ |
|||
' <input type="hidden" name="live_goods[]" value="'+params['goods_id']+'">\n' + |
|||
' </div>\n' + |
|||
'</div>'; |
|||
$("#selectedLiveGoodsList").append(html); |
|||
} |
|||
} |
|||
/** |
|||
* 点击提交信息 |
|||
*/ |
|||
$("#submitInfo").on('click',function () { |
|||
$('#page-loading').show(); |
|||
//获取并且处理表单信息 |
|||
let formArr = $("form").serializeArray(); |
|||
let params = {}; |
|||
$.each(formArr,function (k,v) { |
|||
params[v['name']] = v['value']; |
|||
}); |
|||
delete params['live_goods[]']; |
|||
//获取商品信息 |
|||
let goodsList = $("[name='live_goods[]']").serializeArray(); |
|||
$.each(goodsList,function (k,v) { |
|||
params['live_goods['+k+']'] = v['value']; |
|||
}); |
|||
//请求后台 |
|||
$.post("{php echo web_url('live/live/addLive');}",params,function (res) { |
|||
if(res.data['qrcode_url'] && res.errno == 1){ |
|||
//认证操作 |
|||
$("#authentication").removeClass('hide'); |
|||
$("#authentication").find("img").attr('src',res.data['qrcode_url']); |
|||
tip.alert(res.message); |
|||
}else if(res.errno == 1){ |
|||
//错误抛出 |
|||
$('#page-loading').hide(); |
|||
tip.alert(res.message); |
|||
}else{ |
|||
//成功 跳转列表页面 |
|||
tip.alert(res.message,function () { |
|||
window.location.href = "{php echo web_url('live/live/liveList')}"; |
|||
}); |
|||
} |
|||
},'json'); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,382 @@ |
|||
{php include wl_template('common/header');} |
|||
<meta name="referrer" content="never"> |
|||
<style> |
|||
.goods_list{ |
|||
position: absolute; |
|||
z-index: 1000; |
|||
top: calc((100% - 590px) / 2); |
|||
left: 25%; |
|||
width: 50%; |
|||
max-height: 60%; |
|||
} |
|||
.goods_list .goods_title{ |
|||
float: left; |
|||
width: 100%; |
|||
height: 40px; |
|||
font-weight: 600; |
|||
font-family: arial, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', '宋体', \5b8b\4f53, Tahoma, Arial, Helvetica, STHeiti; |
|||
text-align: center; |
|||
border-bottom: 1px solid #DDD; |
|||
background-color: #f2f2f2; |
|||
} |
|||
.goods_list .goods_title div{ |
|||
width: 25%; |
|||
float: left; |
|||
padding: 10px; |
|||
height: 100%; |
|||
} |
|||
.goods_content{ |
|||
float: left; |
|||
width: 100%; |
|||
height: 500px; |
|||
overflow-y: auto; |
|||
background: #FFFFFF; |
|||
} |
|||
.goods_goodList{ |
|||
float: left; |
|||
width: 100%; |
|||
height: 50px; |
|||
font-family: arial, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', '宋体', \5b8b\4f53, Tahoma, Arial, Helvetica, STHeiti; |
|||
font-size: 14px; |
|||
color: #333; |
|||
text-align: center; |
|||
box-sizing: border-box; |
|||
border-top: 1px solid #e7eaec; |
|||
} |
|||
.goods_goodList div{ |
|||
float: left; |
|||
width: 25%; |
|||
height: 50px; |
|||
line-height: 50px; |
|||
} |
|||
.goods_close{ |
|||
text-align: right; |
|||
padding-right: 10%; |
|||
background: #FFFFFF; |
|||
height: 50px; |
|||
line-height: 50px; |
|||
margin: 0; |
|||
width: 100%; |
|||
float: left; |
|||
border-top: 1px solid #e7eaec; |
|||
} |
|||
#playback{ |
|||
position: absolute; |
|||
z-index: 1000; |
|||
top: 15%; |
|||
left: 20%; |
|||
width: 60%; |
|||
background: #FFFFFF; |
|||
height: 70%; |
|||
padding: 0!important; |
|||
} |
|||
#playbacklist{ |
|||
float: left; |
|||
width: calc(100% + 4.3px); |
|||
height: calc(100% - 50px); |
|||
overflow-y: auto; |
|||
padding: 20px; |
|||
} |
|||
#playback .playback_close{ |
|||
float: left; |
|||
height: 50px; |
|||
width: 100%; |
|||
text-align: right; |
|||
padding-right: 50px; |
|||
border-top: 1px solid #CCCCCC; |
|||
line-height: 50px; |
|||
} |
|||
.block{ |
|||
width: calc((100vw - 40vw - 45px) / 4); |
|||
height: calc((calc((100vw - 40vw - 45px) / 4))/ 9 * 16); |
|||
float: left; |
|||
padding: 10px; |
|||
font-size: 15px; |
|||
} |
|||
.block-video{ |
|||
width: 100%; |
|||
height: calc(100% - 60px); |
|||
text-align: center; |
|||
border: 1px solid #CCC; |
|||
} |
|||
.block .block-video video{ |
|||
width: 100% !important; |
|||
height: 100% !important; |
|||
object-fit: fill; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
margin-bottom: 50px; |
|||
} |
|||
.block .block-time{ |
|||
font-size: 14px; |
|||
height: 40px; |
|||
line-height: 20px; |
|||
} |
|||
#openLive{ |
|||
position: fixed; |
|||
top: 20%; |
|||
left: 30%; |
|||
padding: 15px; |
|||
z-index: 1000; |
|||
width: 500px; |
|||
height: 300px; |
|||
text-align: center; |
|||
} |
|||
#openLive .qrcode{ |
|||
width: 200px; |
|||
height: 200px; |
|||
} |
|||
#openLive img{ |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
#openLive .openLive_close{ |
|||
margin-top: 25px; |
|||
text-align: right; |
|||
|
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">直播间列表</a></li> |
|||
</ul> |
|||
<!-- 直播间信息列表 --> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="alert alert-warning"> |
|||
注意事项:<br /> |
|||
1、如果发现直播间信息有异常,请点击信息同步。<br /> |
|||
2、直播信息接口每天最多只能使用100000次(查看直播回放、信息同步消耗一定次数)<br> |
|||
3、信息同步所需时间根据直播间总数量决定。请定期删除无效或者无用的直播间<br /> |
|||
</div> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('live/live/addLive');}" class="btn btn-primary">添加直播间</a> |
|||
<a href="javascript:;" class="btn btn-info" id="infoSynchronization">信息同步</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" width="5%">ID</th> |
|||
<th class="text-center" width="10%">直播间名称</th> |
|||
<th class="text-center" width="10%">背景图</th> |
|||
<th class="text-center" width="10%">分享图</th> |
|||
<th class="text-center" width="20%">商品信息</th> |
|||
<th class="text-center" width="5%">状态</th> |
|||
<th class="text-center" width="20%">直播时间</th> |
|||
<th class="text-center" width="10%">主播</th> |
|||
<th class="text-center" width="10%">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $val} |
|||
<tr class="text-center"> |
|||
<td>{$val['roomid']}</td> |
|||
<td>{$val['name']}</td> |
|||
<td> |
|||
<img class="scrollLoading" src="{$val['cover_img']}" data-url="{php echo tomedia($mem['avatar'])}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="50" width="50"/> |
|||
</td> |
|||
<td> |
|||
<img class="scrollLoading" src="{$val['share_img']}" data-url="{php echo tomedia($mem['avatar'])}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="50" width="50"/> |
|||
</td> |
|||
<td> |
|||
{if $val['goods']} |
|||
<a href="javascript:;" class="btn btn-sm btn-info goodsInfo">查看商品</a> |
|||
<div class="goods_list hide"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">商品名称</th> |
|||
<th class="text-center">封面图</th> |
|||
<th class="text-center">商品类型</th> |
|||
<th class="text-center">售价</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $val['goods'] $good} |
|||
<tr class="text-center"> |
|||
<td>{$good['title']}</td> |
|||
<td> |
|||
<img class="scrollLoading" src="{$good['goods_img']}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="30" width="30"/> |
|||
</td> |
|||
<td> |
|||
{if $good['goods_plugin'] == 'rush'} |
|||
抢购商品 |
|||
{elseif $good['goods_plugin'] == 'groupon'} |
|||
团购商品 |
|||
{elseif $good['goods_plugin'] == 'wlfightgroup'} |
|||
拼团商品 |
|||
{elseif $good['goods_plugin'] == 'coupon'} |
|||
优惠券 |
|||
{elseif $good['goods_plugin'] == 'bargain'} |
|||
砍价商品 |
|||
{else} |
|||
—— |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $good['price_type'] == 1} |
|||
<label class="label label-success">{$good['price']}</label> |
|||
{elseif $good['price_type'] == 2} |
|||
<label class="label label-info">{$good['price']} ~ {$good['price2']}</label> |
|||
{else} |
|||
<label class="label label-primary">原价:{$good['price']}</label><br /> |
|||
<label class="label label-danger" style="display: inline-block;margin-top: 5px;">现价:{$good['price2']}</label> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
<!-- 关闭按钮 --> |
|||
<tr class="text-center"> |
|||
<td></td> |
|||
<td></td> |
|||
<td></td> |
|||
<td><a href="javascript:;" class="btn btn-sm btn-danger closeGoodsInfo">关闭</a></td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center"> |
|||
{if $val['live_status'] == 101} |
|||
<span class="label label-success">直播中</span> |
|||
{elseif $val['live_status'] == 102} |
|||
<span class="label label-primary">未开始</span> |
|||
{elseif $val['live_status'] == 103} |
|||
<span class="label label-warning">已结束</span> |
|||
{elseif $val['live_status'] == 104} |
|||
<span class="label label-danger">禁播</span> |
|||
{elseif $val['live_status'] == 105} |
|||
<span class="label label-default">暂停</span> |
|||
{elseif $val['live_status'] == 106} |
|||
<span class="label label-info">异常</span> |
|||
{elseif $val['live_status'] == 107} |
|||
<span class="label label-danger">已过期</span> |
|||
{/if} |
|||
</td> |
|||
<td>{$val['start_time']} - {$val['end_time']}</td> |
|||
<td>{$val['anchor_name']}</td> |
|||
<td> |
|||
{if $val['is_playback'] == 1} |
|||
<a href="javascript:;" class="btn btn-sm btn-primary playbackList" data-roomid="{$val['roomid']}">回放列表</a> |
|||
{/if} |
|||
{if in_array($val['live_status'],[101,102])} |
|||
<a href="{php echo web_url('live/live/getOpenLiveQrCode',array('id'=>$val['roomid']))}" data-toggle="ajaxModal" class="btn btn-sm btn-default">直播二维码</a> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"></div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 直播间回放列表 --> |
|||
<div id="playback" class="hide"> |
|||
<!--回放列表--> |
|||
<div id="playbacklist"></div> |
|||
<!--取消按钮--> |
|||
<div class="playback_close"> |
|||
<a href="javascript:;" class="btn btn-sm btn-danger closePlayback">关闭</a> |
|||
</div> |
|||
</div> |
|||
<!--开始直播二维码弹框--> |
|||
<div id="openLive" class="hide"> |
|||
<div class="qrcode"> |
|||
<img src="" id="openLiveQrCode"/> |
|||
</div> |
|||
<!--取消按钮--> |
|||
<div class="openLive_close"> |
|||
<a href="javascript:;" class="btn btn-sm btn-danger closeOpenLive">关闭</a> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 商品信息查看模态框的弹出&关闭 |
|||
*/ |
|||
$(".goodsInfo").on('click',function () { |
|||
//基本信息处理 |
|||
let _this = $(this), |
|||
position = _this.siblings('.goods_list'); |
|||
//打开模态框 |
|||
position.modal(); |
|||
position.removeClass('hide'); |
|||
//点击关闭模态框 |
|||
$(".closeGoodsInfo").on('click',function () { |
|||
position.modal('hide'); |
|||
position.addClass('hide'); |
|||
}); |
|||
}); |
|||
/** |
|||
* 获取当前直播间回放视频列表 |
|||
*/ |
|||
$(".playbackList").on('click',function () { |
|||
//基本参数信息获取 |
|||
let _this = $(this), |
|||
playback = $("#playback"), |
|||
playbacklist = $("#playbacklist"), |
|||
id = _this.data("roomid"); |
|||
//请求获取信息 |
|||
$.ajax({ |
|||
url: "{php echo web_url('live/live/getPlayback')}", |
|||
type: "post", |
|||
data: {id : id}, |
|||
dataType: "html", |
|||
success:function (res) { |
|||
//判断是否为json格式数据 |
|||
try { |
|||
//如果能够成功转换 则为json格式数据信息 |
|||
let obj = JSON.parse(res); |
|||
if(obj){ |
|||
tip.alert(obj.message) |
|||
} |
|||
} catch(e) { |
|||
//json 转换失败 为html格式数据 |
|||
playbacklist.html(res); |
|||
playback.modal(); |
|||
playback.removeClass('hide'); |
|||
//点击关闭当前模态框 |
|||
$(".closePlayback").on('click',function () { |
|||
playback.modal('hide'); |
|||
playback.addClass('hide'); |
|||
playbacklist.html(''); |
|||
}); |
|||
} |
|||
}, |
|||
}); |
|||
}); |
|||
/** |
|||
* 信息同步 |
|||
*/ |
|||
$("#infoSynchronization").on('click',function () { |
|||
$('#page-loading').show(); |
|||
let synchronizatio = function(page){ |
|||
$.post("{php echo web_url('live/live/infoSynchronization')}",{page:page},function (res) { |
|||
if(res.errno == 0){ |
|||
page++; |
|||
if(res.data['total_page'] >= page){ |
|||
//总页数大于等于 下一页则继续进行信息同步 |
|||
synchronizatio(page); |
|||
}else{ |
|||
//信息同步完成 |
|||
tip.alert("同步完成",function () { |
|||
history.go(0); |
|||
}); |
|||
} |
|||
}else{ |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
} |
|||
},'json'); |
|||
} |
|||
synchronizatio(1); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,27 @@ |
|||
{loop $info['list'] $vo} |
|||
<div class="block"> |
|||
<div class="block-video" data-link="{$vo['media_url']}" > |
|||
<video src="{$vo['media_url']}" controls="controls" loop="loop" onerror="notSupper(this);"> |
|||
您的浏览器不支持 video 标签。请更新或者更换浏览器 |
|||
</video> |
|||
</div> |
|||
<div class="block-time"> |
|||
生成时间:{$vo['create_time']}<br /> |
|||
失效时间:{$vo['expire_time']} |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
<script> |
|||
//处理不能加载视频的兼容操作 |
|||
function notSupper(_this) { |
|||
$(_this).parent('.block-video').addClass('openVideo'); |
|||
$(_this).parent('.block-video').css("cursor","pointer"); |
|||
let html = "暂不支持该格式视频播放!<br />点击下载或查看视频"; |
|||
$(_this).parent('.block-video').html(html); |
|||
} |
|||
//点击不能加载的视频 在新的页面打开|下载 视频 |
|||
$(document).on('click','.openVideo',function () { |
|||
let link = $(this).data('link'); |
|||
window.open(link); |
|||
}); |
|||
</script> |
|||
@ -0,0 +1,23 @@ |
|||
<style> |
|||
.wx-qrcode{} |
|||
.wx-qrcode .qrcode-img{border: 1px solid #eee; padding: 20px;width: 220px; height: 220px;margin: auto;} |
|||
.wx-qrcode .qrcode-img img {width:180px;height:180px;} |
|||
.wx-qrcode .qrcode-title{line-height: 40px;text-align: center;} |
|||
.wx-qrcode .qrcode-btn{display: block;text-align: center;line-height: 160px;} |
|||
|
|||
</style> |
|||
<div class="modal-dialog"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">直播二维码</h4> |
|||
</div> |
|||
<div class="modal-body" style="height: 350px;"> |
|||
<div class="wx-qrcode"> |
|||
<div class="qrcode-img"> |
|||
<img src="{$qrcode}" > |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,43 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('live/member/memberIndex')}">成员列表</a></li> |
|||
<li class="active"><a href="javascript:;">添加成员</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">用户微信号</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" name="data[username]"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">角色</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[role]" value="1" checked="checked"> 管理员 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[role]" value="2"> 主播 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[role]" value="3"> 运营者 |
|||
</label> |
|||
<div class="help-block">设置为主播角色时,微信号需要实名认证。未认证请先认证后在设置。</div> |
|||
</div> |
|||
</div> |
|||
<!--添加按钮--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,164 @@ |
|||
{php include wl_template('common/header');} |
|||
<meta name="referrer" content="never"> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">成员列表</a></li> |
|||
</ul> |
|||
<!-- 直播间信息列表 --> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<!--顶部提示信息--> |
|||
<div class="alert alert-warning"> |
|||
注意事项:<br /> |
|||
1、如果发现信息有异常,请点击信息同步。<br /> |
|||
2、添加成员每日最多操作10000次;删除成员每日最多操作10000次;信息同步每日最多请求10000次,每次同步消耗若干次。<br> |
|||
3、角色数量限制信息:管理员10个,运营者500个,主播500个<br /> |
|||
4、添加角色信息后请同步信息,否则不会显示添加的角色信息;如果添加多个角色,建议在添加完所有角色后再同步信息防止同步接口次数浪费<br /> |
|||
5、管理员和运营者角色不能重复,一个用户只能存在其中一个角色。<br /> |
|||
</div> |
|||
<!--操作按钮--> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('live/member/addMember');}" class="btn btn-primary">添加成员</a> |
|||
<a href="javascript:;" class="btn btn-info" id="infoSynchronization">信息同步</a> |
|||
</div> |
|||
<!--搜索操作内容--> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="live" /> |
|||
<input type="hidden" name="ac" value="member" /> |
|||
<input type="hidden" name="do" value="memberIndex" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">成员昵称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="nickname" value="{$nickname}" placeholder="请输入成员昵称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">角色{$memberRole}类型</label> |
|||
<div class="col-sm-9"> |
|||
<!-- 具有的身份:0:超级管理员,1:管理员,2:主播,3:运营者 --> |
|||
<select name="member_role" class="form-control"> |
|||
<option value="" {if !$memberRole}selected{/if}>全部</option> |
|||
<option value="5" {if $memberRole == 5}selected{/if}>超级管理员</option> |
|||
<option value="1" {if $memberRole == 1}selected{/if}>管理员</option> |
|||
<option value="2" {if $memberRole == 2}selected{/if}>主播</option> |
|||
<option value="3" {if $memberRole == 3}selected{/if}>运营者</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('live/member/memberIndex')}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" width="10%">头像</th> |
|||
<th class="text-center" width="10%">昵称</th> |
|||
<th class="text-center" width="25%">openid</th> |
|||
<th class="text-center" width="10%">角色</th> |
|||
<th class="text-center" width="25%">更新时间</th> |
|||
<th class="text-center" width="10%">微信号</th> |
|||
<th class="text-center" width="10%">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $val} |
|||
<tr class="text-center"> |
|||
<td> |
|||
<img class="scrollLoading" src="{$val['avatar']}" data-url="{php echo tomedia($mem['avatar'])}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="50" width="50"/> |
|||
</td> |
|||
<td>{$val['nickname']}</td> |
|||
<td>{$val['openid']}</td> |
|||
<td> |
|||
<!-- 具有的身份:0:超级管理员,1:管理员,2:主播,3:运营者 --> |
|||
{if $val['member_role'] == 0} |
|||
<span class="label label-success">超级管理员</span> |
|||
{elseif $val['member_role'] == 1} |
|||
<span class="label label-primary">管理员</span> |
|||
{elseif $val['member_role'] == 2} |
|||
<span class="label label-warning">主播</span> |
|||
{elseif $val['member_role'] == 3} |
|||
<span class="label label-danger">运营者</span> |
|||
{/if} |
|||
</td> |
|||
<td>{php echo date("Y-m-d H:i:s",$val['update_time']);}</td> |
|||
<td>{$val['account_number']}</td> |
|||
<td> |
|||
{if $val['member_role'] != 0} |
|||
<a href="javascript:;" class="btn btn-sm btn-danger deleteGoodsButton" data-id="{$val['id']}">删除成员</a> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"></div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 信息同步 |
|||
*/ |
|||
$("#infoSynchronization").on('click',function () { |
|||
$('#page-loading').show(); |
|||
let synchronizatio = function(page){ |
|||
$.post("{php echo web_url('live/member/infoSynchronization')}",{page:page},function (res) { |
|||
if(res.errno == 0){ |
|||
page++; |
|||
if(res.data['total_page'] >= page){ |
|||
//总页数大于等于 下一页则继续进行信息同步 |
|||
synchronizatio(page); |
|||
}else{ |
|||
//信息同步完成 |
|||
tip.alert("同步完成",function () { |
|||
history.go(0); |
|||
}); |
|||
} |
|||
}else{ |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
} |
|||
},'json'); |
|||
}; |
|||
synchronizatio(1); |
|||
}); |
|||
/** |
|||
* 点击删除角色信息 |
|||
*/ |
|||
$(".deleteGoodsButton").on('click',function(){ |
|||
//基本参数信息获取 |
|||
let _this = $(this), |
|||
id = _this.data('id'); |
|||
//获取微信号 并且请求后台进行删除操作 |
|||
tip.prompt('请输入当前角色用户的微信号,如果输入他人微信号可能导致删除错误!',function (text) { |
|||
//判断是否存在微信号 |
|||
if(text.length <= 0){ |
|||
tip.alert('请输入微信号'); |
|||
return false; |
|||
} |
|||
//请求后台进行删除操作 |
|||
$.post("{php echo web_url('live/member/deleteMemberInfo')}",{id:id,username:text},function (res) { |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
},'json'); |
|||
}); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,341 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Goods_WeliamController { |
|||
/** |
|||
* Comment: 商品列表信息获取 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 15:07 |
|||
*/ |
|||
public function goodsList(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$status = $_GPC['status'] ? : 0;//商品状态,0:未审核。1:审核中,2:审核通过,3:审核驳回 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = 10; |
|||
//条件生成 |
|||
$where = ['uniacid'=>$_W['uniacid'],'audit_status'=>$status]; |
|||
if($_W['aid'] > 0) $where['aid'] = $_W['aid']; |
|||
//信息获取 |
|||
list($total,$list) = Live::getGoodsParamsList($where,$page,$pageIndex); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template("goods/list"); |
|||
} |
|||
/** |
|||
* Comment: 直播商品提交审核 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 14:08 |
|||
* @throws \GuzzleHttp\Exception\GuzzleException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function add(){ |
|||
global $_W,$_GPC; |
|||
if($_W['ispost']){ |
|||
//信息获取 |
|||
$data = $_GPC['data']; |
|||
if (!$data['goods_id']) wl_message("请选择商品!" , referer() , 'error'); |
|||
if (($data['priceType'] == 2 || $data['priceType'] == 3) && !$data['price'] && !$data['price2']) wl_message("请完善价格信息!" , referer(), 'error'); |
|||
//获取商品信息 |
|||
$goods = Live::getGoodsInfo($data['goods_id'],$data['goods_plugin']); |
|||
//基本信息参数配置 |
|||
$params = [ |
|||
'coverImgUrl' => $data['coverImgUrl'] ? tomedia($data['coverImgUrl']) : '' ,//图片 |
|||
'name' => $data['name'] ? : '' ,//商品名称 |
|||
'priceType' => $data['priceType'] ,//价格类型 1:一口价;2:价格区间;3:显示折扣价 |
|||
'price' => $data['price'] ? sprintf("%.2f" , $data['price']) : '' ,//价格一 |
|||
'price2' => $data['price2'] ? sprintf("%.2f" , $data['price2']) : '' ,//价格二 |
|||
'url' => '' ,//跳转链接 |
|||
]; |
|||
//商品名称不存在 使用当前商品名称 |
|||
if(!$params['name']){ |
|||
$goodsName = $goods['goods_name']; |
|||
if(mb_strlen($goodsName) > 14) $goodsName = mb_substr($goodsName,0,14,'utf-8'); |
|||
$params['name'] = $goodsName; |
|||
} |
|||
//价格一不存在 默认使用一口价 价格为商品当前价格 |
|||
if(!$params['price'] || $params['price'] <= 0 ){ |
|||
$params['priceType'] = intval(1); |
|||
$params['price'] = sprintf("%.2f",$goods['price']); |
|||
} |
|||
//图片不存在 使用当前商品logo图片 |
|||
if(!$params['coverImgUrl']) { |
|||
//判断图片信息 微信规则限制 图片大小不能大于300像素*300像素; |
|||
list($width,$height) = getimagesize(tomedia($goods['logo']));//获取图片信息 |
|||
if($width > 300 || $height > 300 ) wl_message("商品logo图片过大,请自行上传图片!", referer() , 'error'); |
|||
//使用商品logo图片 |
|||
$params['coverImgUrl'] = tomedia($goods['logo']); |
|||
} |
|||
//获取跳转地址 |
|||
$params['url'] = Live::getWxAppPath($data['goods_id'],$data['goods_plugin']); |
|||
//提交商品信息 |
|||
try{ |
|||
//判断图片信息 微信规则限制 图片大小不能大于300像素*300像素; |
|||
list($width,$height) = getimagesize($params['coverImgUrl']);//获取图片信息 |
|||
if($width > 300 || $height > 300 ) wl_message("图片超出限制,宽高不能大于300像素!", referer() , 'error'); |
|||
//商品图片信息处理 |
|||
$coverImgUrl = $params['coverImgUrl']; |
|||
$params['coverImgUrl'] = (new Live())->uploadTemporaryMaterial($params['coverImgUrl']); |
|||
//提交商品 |
|||
$res = (new Live())->submitGoods($params); |
|||
//记录商品提交信息 |
|||
$data = [ |
|||
'aid' => $_W['aid'] ? : 0 , |
|||
'uniacid' => $_W['uniacid'] , |
|||
'goods_id' => $res['goodsId'] , |
|||
'audit_id' => $res['auditId'] , |
|||
'wl_goods_id' => $data['goods_id'] , |
|||
'goods_plugin' => $data['goods_plugin'] , |
|||
'title' => $params['name'] , |
|||
'goods_img' => $coverImgUrl , |
|||
'price_type' => $params['priceType'] , |
|||
'price' => $params['price'] , |
|||
'price2' => $params['price2'] ? : '' , |
|||
]; |
|||
pdo_insert(PDO_NAME."live_goods",$data); |
|||
|
|||
wl_message('提交成功,请等待审核结果!' , web_url('live/goods/goodsList',['status'=>1]) , 'success'); |
|||
}catch (Exception $e){ |
|||
wl_message($e->getMessage(), referer() , 'error'); |
|||
} |
|||
} |
|||
|
|||
include wl_template("goods/add"); |
|||
} |
|||
/** |
|||
* Comment: 请求撤回正在审核中的商品 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 16:31 |
|||
*/ |
|||
public function cancelAdd(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] OR Commons::sRenderError("不存在的商品信息,请刷新重试!"); |
|||
//获取直播商品提交审核记录信息 |
|||
$info = pdo_get(PDO_NAME."live_goods",['goods_id'=>$id]); |
|||
try{ |
|||
//申请撤回商品 |
|||
$params = [ |
|||
'auditId' => $info['audit_id'], |
|||
'goodsId' => $info['goods_id'] |
|||
]; |
|||
$res = (new Live())->withdrawGoods($params); |
|||
//返回操作结果 |
|||
if($res['errcode'] == 0) { |
|||
pdo_update(PDO_NAME."live_goods",['audit_status'=>0],['goods_id'=>$id]); |
|||
Commons::sRenderSuccess("操作成功"); |
|||
}else Commons::sRenderError("操作失败"); |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 请求让未审核的商品进行审核操作 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 9:41 |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function reSubmit(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] OR Commons::sRenderError("不存在的商品信息,请刷新重试!"); |
|||
try{ |
|||
//请求重新提交商品 |
|||
$res = (new Live())->reSubmitGoods($id); |
|||
if($res['errcode'] == 0){ |
|||
//修改 提交审核记录 |
|||
pdo_update(PDO_NAME."live_goods" |
|||
,['audit_id'=>$res['auditId'],'audit_status'=>1],['goods_id'=>$id]); |
|||
|
|||
Commons::sRenderSuccess("操作成功"); |
|||
}else { |
|||
Commons::sRenderError("操作失败"); |
|||
} |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 请求删除商品 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 16:23 |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function deleteLiveGoods(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] OR Commons::sRenderError("不存在的商品信息,请刷新重试!"); |
|||
try{ |
|||
//请求删除商品 |
|||
$res = (new Live())->deleteGoods($id); |
|||
if($res['errcode'] == 0){ |
|||
//商品删除成功 删除商品提交审核记录 |
|||
pdo_delete(PDO_NAME."live_goods",['goods_id'=>$id]); |
|||
|
|||
Commons::sRenderSuccess("操作成功"); |
|||
}else { |
|||
Commons::sRenderError("操作失败"); |
|||
} |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 编辑商品信息 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 9:31 |
|||
* @throws \GuzzleHttp\Exception\GuzzleException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function editGoods(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$status = $_GPC['status'] ? : 0; |
|||
$goods_id = $_GPC['goods_id'] OR wl_message("商品不存在,请刷新重试!" ,web_url('live/goods/goodsList',['status'=>$status]), 'error'); |
|||
//商品信息获取 |
|||
$params = pdo_get(PDO_NAME."live_goods",['goods_id'=>$goods_id]);//直播商品 |
|||
$info = Live::getGoodsInfo($params['wl_goods_id'],$params['goods_plugin']);//平台商品 |
|||
//信息修改操作 |
|||
if($_W['ispost']){ |
|||
//参数信息获取 |
|||
$data = $_GPC['data'];//修改后新的直播商品信息 |
|||
$data['wl_goods_id'] = $data['goods_id']; |
|||
unset($data['goods_name'],$data['goods_id'],$data['sid']); |
|||
//判断值是否被修改 |
|||
if($status == 0) $allowUpdateFiled = ['coverImgUrl' , 'name' , 'priceType' , 'price' , 'price2' , 'url'];//所有信息都可以更新 |
|||
else $allowUpdateFiled = ['priceType' , 'price' , 'price2'];//仅允许更新 价格类型和价格 |
|||
$updateData['goodsId'] = $goods_id;//需要修改的信息 |
|||
if(($data['goods_plugin'] != $params['goods_plugin'] || $data['wl_goods_id'] != $params['wl_goods_id']) && in_array('url',$allowUpdateFiled)){ |
|||
//商品被修改 从新获取链接 |
|||
$updateData['url'] = Live::getWxAppPath($data['goods_id'],$data['goods_plugin']); |
|||
} |
|||
if($data['goods_img'] != $params['goods_img'] && in_array('coverImgUrl',$allowUpdateFiled)){ |
|||
//图片被修改 获取新图片的信息 |
|||
if(!$data['goods_img']) $data['goods_img'] = tomedia($info['logo']); |
|||
else $data['goods_img'] = tomedia($data['goods_img']); |
|||
//判断图片信息 微信规则限制 图片大小不能大于300像素*300像素; |
|||
list($width,$height) = getimagesize($data['goods_img']);//获取图片信息 |
|||
if($width > 300 || $height > 300 ) wl_message("图片超出限制,宽高不能大于300像素!", web_url('live/goods/editGoods',['status'=>$status,'goods_id'=>$goods_id]) , 'error'); |
|||
|
|||
$updateData['coverImgUrl'] = $data['goods_img']; |
|||
} |
|||
if($data['title'] != $params['title'] && in_array('name',$allowUpdateFiled)){ |
|||
//商品名称被修改 获取新的商品名称 |
|||
if(!$data['title']){ |
|||
//商品名称不存在 使用当前商品名称 |
|||
$goodsName = $info['goods_name']; |
|||
if(mb_strlen($goodsName) > 14) $goodsName = mb_substr($goodsName,0,14,'utf-8'); |
|||
$updateData['name'] = $goodsName; |
|||
}else{ |
|||
$updateData['name'] = $data['title']; |
|||
} |
|||
} |
|||
if($data['price_type'] != $params['price_type'] && in_array('priceType',$allowUpdateFiled)){ |
|||
//价格类型被修改 获取新的价格类型 |
|||
$updateData['priceType'] = $data['price_type']; |
|||
} |
|||
if($data['price'] != $params['price'] && in_array('price',$allowUpdateFiled)){ |
|||
//左价格被修改 获取新的价格 |
|||
$updateData['price'] = sprintf("%.2f" , $data['price']); |
|||
} |
|||
if($data['price2'] != $params['price2'] && in_array('price2',$allowUpdateFiled)){ |
|||
//右价格被修改 获取新的价格 |
|||
$updateData['price2'] = sprintf("%.2f" , $data['price2']); |
|||
} |
|||
//价格一不存在 默认使用一口价 价格为商品当前价格 |
|||
if (!$updateData['price'] || $updateData['price'] <= 0) { |
|||
$updateData['priceType'] = intval(1); |
|||
$updateData['price'] = sprintf("%.2f" , $data['price']); |
|||
$updateData['price2'] = ''; |
|||
} |
|||
//请求编辑信息 |
|||
try{ |
|||
//是否需要处理图片信息 |
|||
if(array_key_exists('coverImgUrl',$updateData) && !empty($updateData['coverImgUrl'])){ |
|||
$imgInfo = pathinfo($updateData['coverImgUrl']);//获取图片信息 |
|||
if($imgInfo['basename']) $updateData['coverImgUrl'] = (new Live())->uploadTemporaryMaterial($updateData['coverImgUrl']); |
|||
} |
|||
//修改价格信息则三个价格参数都要传递 |
|||
if(array_key_exists('price',$updateData) || array_key_exists('price2',$updateData) || array_key_exists('priceType',$updateData)){ |
|||
$updateData['priceType'] = $data['price_type']; |
|||
$updateData['price'] = $data['price']; |
|||
$updateData['price2'] = $data['price2']; |
|||
} |
|||
//请求修改商品信息 |
|||
$res = (new Live())->updateGoods($updateData); |
|||
if($res['errcode'] == 0) { |
|||
pdo_update(PDO_NAME."live_goods",$data,['goods_id'=>$goods_id]); |
|||
|
|||
wl_message("操作成功!" ,web_url('live/goods/goodsList',['status'=>$status]) , 'success'); |
|||
}else wl_message("操作失败!", web_url('live/goods/goodsList',['status'=>$status]) , 'error'); |
|||
}catch (Exception $e){ |
|||
wl_message($e->getMessage(), web_url('live/goods/goodsList',['status'=>$status]) , 'error'); |
|||
} |
|||
} |
|||
|
|||
include wl_template("goods/edit"); |
|||
} |
|||
/** |
|||
* Comment: 信息同步 |
|||
* Author: zzw |
|||
* Date: 2020/10/26 16:15 |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function infoSynchronization(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$page = $_GPC['page'] ? : 1; |
|||
//根据总后台和代理商后台 调用不同的同步操作 |
|||
try{ |
|||
if($_W['aid'] > 0){ |
|||
//代理商后台 |
|||
$pageIndex = 50; |
|||
$where = ['uniacid' => $_W['uniacid'],'aid'=>$_W['aid']];//条件生成 |
|||
//获取商品相关信息 |
|||
$total = pdo_count(PDO_NAME."live_goods",$where);//商品总数信息 |
|||
$list = pdo_getall(PDO_NAME."live_goods" ,$where ,['goods_id'],'','goods_id DESC',[$page,$pageIndex]);//商品列表 |
|||
|
|||
(new Live())->goodsInfoSynchronization(array_column($list,'goods_id')); |
|||
$totalPage = ceil($total / $pageIndex); |
|||
}else{ |
|||
//总后台 商品状态,0:未审核。1:审核中,2:审核通过,3:审核驳回 |
|||
$pageIndex = 15; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$res0 = (new Live())->wholeGoodsInfoSynchronization($pageStart,$pageIndex,0); |
|||
$res1 = (new Live())->wholeGoodsInfoSynchronization($pageStart,$pageIndex,1); |
|||
$res2 = (new Live())->wholeGoodsInfoSynchronization($pageStart,$pageIndex,2); |
|||
$res3 = (new Live())->wholeGoodsInfoSynchronization($pageStart,$pageIndex,3); |
|||
$totalPage = max([$res0,$res1,$res2,$res3]); |
|||
} |
|||
|
|||
Commons::sRenderSuccess("同步成功",['total_page' => $totalPage]); |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 直播商品选择器 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 11:03 |
|||
*/ |
|||
public function selectGoods(){ |
|||
global $_W,$_GPC; |
|||
try{ |
|||
//基本参数信息获取 商品状态,0:未审核。1:审核中,2:审核通过,3:审核驳回 |
|||
$status = intval(2);//选择商品 商品状态固定为2:审核通过 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = $_GPC['page_index'] ? : 10; |
|||
//条件生成 |
|||
$where = ['uniacid'=>$_W['uniacid'],'audit_status'=>$status]; |
|||
if($_W['aid'] > 0) $where['aid'] = $_W['aid']; |
|||
//信息获取 |
|||
list($total,$list) = Live::getGoodsParamsList($where,$page,$pageIndex); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
if($_GPC['is_block']) include wl_template("goods/select_goods"); |
|||
else include wl_template("goods/select"); |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,184 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException; |
|||
class Live_WeliamController { |
|||
/** |
|||
* Comment: 获取直播间列表 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 14:54 |
|||
*/ |
|||
public function liveList(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = 10; |
|||
//条件生成 |
|||
$where = ['uniacid'=>$_W['uniacid']]; |
|||
if($_W['aid']) $where['aid'] = $_W['aid']; |
|||
//获取直播相关信息 |
|||
$total = pdo_count(PDO_NAME."live",$where); |
|||
$field = ['name','roomid','cover_img','share_img','live_status','start_time','end_time','anchor_name','goods_list','is_playback']; |
|||
$list = pdo_getall(PDO_NAME."live",$where,$field,'','start_time DESC',[$page,$pageIndex]); |
|||
$goodsField = ['wl_goods_id','goods_plugin','title','goods_img','price_type','price','price2']; |
|||
foreach($list as &$item){ |
|||
//商品信息处理 |
|||
$goodsIds = json_decode($item['goods_list'],true); |
|||
$item['goods'] = pdo_getall(PDO_NAME."live_goods",['goods_id IN'=>$goodsIds],$goodsField); |
|||
//时间信息处理 |
|||
$item['start_time'] = date("Y-m-d H:i",$item['start_time']); |
|||
$item['end_time'] = date("Y-m-d H:i",$item['end_time']); |
|||
} |
|||
//分页操作 |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template("live/list"); |
|||
} |
|||
/** |
|||
* Comment: 添加直播间操作 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 14:36 |
|||
* @throws \GuzzleHttp\Exception\GuzzleException |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function addLive(){ |
|||
global $_W,$_GPC; |
|||
if($_W['ispost']){ |
|||
$data = $_GPC['data']; |
|||
$time = $_GPC['time']; |
|||
$liveGoods = $_GPC['live_goods']; |
|||
try{ |
|||
//判断信息数据是否完善 |
|||
!$data['name'] && Commons::sRenderError('请输入房间名称'); |
|||
!$data['coverImg'] && Commons::sRenderError('请上传背景图'); |
|||
!$data['anchorName'] && Commons::sRenderError('请输入主播昵称'); |
|||
!$data['anchorWechat'] && Commons::sRenderError('请输入主播微信'); |
|||
!$data['shareImg'] && Commons::sRenderError('请上传分享图'); |
|||
$wxAppModel = (new Live()); |
|||
//处理信息 |
|||
$coverImg = tomedia($data['coverImg']); |
|||
$shareImg = tomedia($data['shareImg']); |
|||
$data['coverImg'] = $wxAppModel->uploadTemporaryMaterial(tomedia($data['coverImg'])); |
|||
$data['shareImg'] = $wxAppModel->uploadTemporaryMaterial(tomedia($data['shareImg'])); |
|||
$data['startTime'] = strtotime($time['start']); |
|||
$data['endTime'] = strtotime($time['end']); |
|||
//直播间建立 |
|||
$liveRes = $wxAppModel->addLive($data); |
|||
if($liveRes['errcode'] == 300036){ |
|||
//主播未认证 进行认证操作 |
|||
Commons::sRenderError('请进行主播认证操作',['qrcode_url'=>$liveRes['qrcode_url']]); |
|||
}else{ |
|||
//直播间添加成功 开始导入商品 |
|||
if(is_array($liveGoods) && count($liveGoods) > 0){ |
|||
$importParams = [ |
|||
'ids' => $liveGoods, |
|||
'roomId' => $liveRes['roomId'] |
|||
]; |
|||
$wxAppModel->importGoods($importParams); |
|||
} |
|||
//直播间添加成功 记录直播间信息 |
|||
$liveInfo = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $_W['aid'] , |
|||
'name' => $data['name'] ,//直播间名称 |
|||
'roomid' => $liveRes['roomId'] ,//直播间ID |
|||
'cover_img' => $coverImg ,//直播间背景图链接 |
|||
'share_img' => $shareImg ,//直播间分享图链接 |
|||
'live_status' => 102 ,//直播间状态。101:直播中,102:未开始,103已结束,104禁播,105:暂停,106:异常,107:已过期 |
|||
'start_time' => $data['startTime'] ,//直播间开始时间 |
|||
'end_time' => $data['endTime'] ,//直播计划结束时间 |
|||
'anchor_name' => $data['anchorName'] ,//主播名 |
|||
'goods_list' => json_encode($liveGoods) ,//当前直播间相关联的商品列表 |
|||
]; |
|||
pdo_insert(PDO_NAME."live",$liveInfo); |
|||
} |
|||
|
|||
Commons::sRenderSuccess("操作成功"); |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
}catch (InvalidArgumentException $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
|
|||
include wl_template("live/add"); |
|||
} |
|||
/** |
|||
* Comment: 获取直播回放列表 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 17:01 |
|||
*/ |
|||
public function getPlayback(){ |
|||
global $_W,$_GPC; |
|||
try{ |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] OR wl_json(0 , "不存在的直播间,请刷新重试!"); |
|||
$caCheKey = 'live_playback';//缓存键 |
|||
$caCheName = md5("uniacid={$_W['uniacid']}&aid={$_W['aid']}&room_id={$id}");//缓存名 |
|||
//获取缓存中的回放信息 |
|||
$info = Cache::getCache($caCheKey,$caCheName); |
|||
if($info){ |
|||
$info = json_decode($info,true); |
|||
if($info['end_time'] <= time()) $info = [];//清除缓存数据 |
|||
} |
|||
//获取新的回放列表信息 |
|||
if(!is_array($info) || !$info['list']){ |
|||
$info = (new Live())->getWholePlayback($id); |
|||
//循环处理信息 |
|||
foreach($info['list'] as $index => &$item){ |
|||
$item['create_time'] = date("Y-m-d H:i:s",strtotime($item['create_time'])); |
|||
$item['expire_time'] = date("Y-m-d H:i:s",strtotime($item['expire_time'])); |
|||
} |
|||
$info['end_time'] = time() + (3600 * 34);//缓存一天 |
|||
Cache::setCache($caCheKey,$caCheName,json_encode($info)); |
|||
} |
|||
|
|||
include wl_template("live/playback"); |
|||
}catch (Exception $e){ |
|||
wl_json(0 , $e->getMessage()); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 开播二维码获取 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 15:09 |
|||
*/ |
|||
public function getOpenLiveQrCode(){ |
|||
global $_W,$_GPC; |
|||
//生成二维码 |
|||
$path = "plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id={$_GPC['id']}&type=9"; |
|||
$qrcode = WeApp::getQrCode($path , 'qrcode_live_' . md5($path) . '.png'); |
|||
$qrcode = tomedia($qrcode); |
|||
|
|||
include wl_template('live/qrcode'); |
|||
} |
|||
/** |
|||
* Comment: 直播间信息同步 |
|||
* Author: zzw |
|||
* Date: 2020/10/27 16:26 |
|||
* @throws \Psr\SimpleCache\InvalidArgumentException |
|||
*/ |
|||
public function infoSynchronization(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
//直播信息同步操作 |
|||
try{ |
|||
//初始化更新状态 |
|||
if($page == 1) pdo_update(PDO_NAME."live",['is_update'=>0]); |
|||
//循环处理直播间信息 |
|||
$totalPage = (new Live())->liveInfoSynchronization($pageStart,$pageIndex); |
|||
//删除未更新的直播间 |
|||
if($page == $totalPage || $totalPage == 0) pdo_delete(PDO_NAME."live",['is_update'=>0]); |
|||
|
|||
Commons::sRenderSuccess("操作成功",['total_page'=>$totalPage]); |
|||
}catch (Exception $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
}catch (InvalidArgumentException $e){ |
|||
Commons::sRenderError($e->getMessage()); |
|||
} |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,101 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('live/goods/goodsList')}">商品列表</a></li> |
|||
<li class="active"><a href="{php echo web_url('live/goods/add')}">发布商品</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<div class="form-group" id="goods"> |
|||
<label class="col-sm-2 control-label must">选择商品</label> |
|||
<div class="col-sm-9 is_judge" is_judge="false"> |
|||
{php echo tpl_select_goods([]);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[coverImgUrl]', '');} |
|||
<span class="help-block">图片尺寸最大300像素*300像素,如果不传图片则默认使用当前商品logo图片</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must ">商品名称</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" minlength="3" maxlength="14" name="data[name]"/> |
|||
<div class="help-block">最少3汉字6字母;最大14个汉字28字母。不填则默认使用商品当前名称,超出长度则截取前14位。</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">价格类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[priceType]" value="1" checked="checked"> 一口价 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[priceType]" value="2"> 价格区间 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[priceType]" value="3"> 折扣价 |
|||
</label> |
|||
<div class="help-block">默认使用一口价类型。价格为当前商品价格</div> |
|||
</div> |
|||
</div> |
|||
<!-- 价格类型 --> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must" id="price">售价</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" name="data[price]"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group hide"> |
|||
<div class="col-sm-2 control-label must" id="price2"></div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" name="data[price2]"/> |
|||
</div> |
|||
</div> |
|||
<!--添加按钮--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="id" value="{$info['id']}" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 更换价格类型 |
|||
*/ |
|||
$("[name='data[priceType]']").on('change',function () { |
|||
//基本参数信息获取 |
|||
let _this = $(this), |
|||
_val = _this.val(); |
|||
//根据价格类型进行对应的操作 |
|||
if(_val == 1){ |
|||
//标题信息替换 |
|||
$("#price").html('售价'); |
|||
$("#price2").html(''); |
|||
//隐藏价格二 |
|||
$("#price2").parent(".form-group").addClass('hide'); |
|||
}else if(_val == 2){ |
|||
//标题信息替换 |
|||
$("#price").html('最低价'); |
|||
$("#price2").html('最高价'); |
|||
//显示价格二 |
|||
$("#price2").parent(".form-group").removeClass('hide'); |
|||
}else if(_val == 3){ |
|||
//标题信息替换 |
|||
$("#price").html('原价'); |
|||
$("#price2").html('现价'); |
|||
//显示价格二 |
|||
$("#price2").parent(".form-group").removeClass('hide'); |
|||
} |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,198 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('live/goods/goodsList')}">商品列表</a></li> |
|||
<li class="active"><a href="javascript:;">编辑商品</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="alert alert-warning"> |
|||
{if $status == 0} |
|||
可以更新所有信息 |
|||
{else} |
|||
仅允许更新价格类型与价格信息 |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<!--商品状态,0:未审核。1:审核中,2:审核通过,3:审核驳回--> |
|||
<!--审核通过的商品仅允许更新价格类型与价格,未审核的商品允许更新所有字段--> |
|||
{if $status == 0} |
|||
<!-- 可以更新所有信息 --> |
|||
<div class="form-group" id="goods"> |
|||
<label class="col-sm-2 control-label must">选择商品</label> |
|||
<div class="col-sm-9 is_judge" is_judge="false"> |
|||
<div class="input-group"> |
|||
<input type="text" placeholder="请选择商品!" name="data[goods_name]" readonly="readonly" value="{$info['goods_name']}" class="form-control selectGoods_name" autocomplete="off"> |
|||
<input type="text" placeholder="请选择商品!" name="data[goods_id]" readonly="readonly" value="{$info['goods_id']}" class="form-control hide selectGoods_id" autocomplete="off"> |
|||
<input type="text" placeholder="请选择商品!" name="data[goods_plugin]" readonly="readonly" value="{$info['goods_plugin']}" class="form-control hide selectGoods_plugin" autocomplete="off"> |
|||
<input type="text" placeholder="请选择商品!" name="data[sid]" readonly="readonly" value="{$info['sid']}" class="form-control hide selectGoods_sid" autocomplete="off"> |
|||
<span class="input-group-btn"> |
|||
<button class="btn btn-default" type="button" data-toggle="selectGoods">选择商品</button> |
|||
</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品图片</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="data[goods_img]" value="{$params['goods_img']}" class="form-control" autocomplete="off" id="cimg-data_goods_img"> |
|||
<span class="input-group-btn"> |
|||
<button class="btn btn-default" type="button" data-toggle="selectAttachment" data-input="#cimg-data_goods_img" data-img="#pimg-data_goods_img">选择图片</button> |
|||
</span> |
|||
</div> |
|||
<div class="input-group " style="margin-top:.5em;"> |
|||
<img src="{$params['goods_img']}" id="pimg-data_goods_img" class="img-responsive img-thumbnail" width="150" onerror="this.src='{IMAGE_NOPIC_SMALL}'" data-times="1"> |
|||
<em class="close" style="position:absolute; top: 0px; right: -14px;" onclick="$('#cimg-data_goods_img').val('');$('#pimg-data_goods_img').attr('src','');">×</em> |
|||
</div> |
|||
<span class="help-block">图片尺寸最大300像素*300像素,如果不传图片则默认使用当前商品logo图片</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must ">商品名称</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" minlength="3" maxlength="14" name="data[title]" value="{$params['title']}"/> |
|||
<div class="help-block">最少3汉字6字母;最大14个汉字28字母。不填则默认使用商品当前名称,超出长度则截取前14位。</div> |
|||
</div> |
|||
</div> |
|||
{else} |
|||
<!--仅允许更新价格类型与价格信息--> |
|||
<div class="form-group" id="goods"> |
|||
<label class="col-sm-2 control-label must">选择商品</label> |
|||
<div class="col-sm-9 is_judge" is_judge="false"> |
|||
<div class="input-group"> |
|||
<input type="text" placeholder="请选择商品!" readonly="readonly" value="{$info['goods_name']}" class="form-control selectGoods_name" autocomplete="off"> |
|||
<input type="text" placeholder="请选择商品!" name="data[goods_id]" readonly="readonly" value="{$info['goods_id']}" class="form-control hide selectGoods_id" autocomplete="off"> |
|||
<input type="text" placeholder="请选择商品!" readonly="readonly" value="{$info['goods_plugin']}" class="form-control hide selectGoods_plugin" autocomplete="off"> |
|||
<input type="text" placeholder="请选择商品!" readonly="readonly" value="{$info['sid']}" class="form-control hide selectGoods_sid" autocomplete="off"> |
|||
<span class="input-group-btn"> |
|||
<button class="btn btn-default" type="button" disabled="disabled">选择商品</button> |
|||
</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品图片</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" value="{$params['goods_img']}" disabled="disabled" class="form-control" autocomplete="off"> |
|||
<span class="input-group-btn"> |
|||
<button class="btn btn-default" type="button" disabled="disabled">选择图片</button> |
|||
</span> |
|||
</div> |
|||
<div class="input-group " style="margin-top:.5em;"> |
|||
<img src="{$params['goods_img']}" class="img-responsive img-thumbnail" width="150" onerror="this.src='{IMAGE_NOPIC_SMALL}'" data-times="1"> |
|||
</div> |
|||
<span class="help-block">图片尺寸最大300像素*300像素,如果不传图片则默认使用当前商品logo图片</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must ">商品名称</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" minlength="3" maxlength="14" disabled="disabled" value="{$params['title']}"/> |
|||
<div class="help-block">最少3汉字6字母;最大14个汉字28字母。不填则默认使用商品当前名称,超出长度则截取前14位。</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<!-- 价格类型 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>价格类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[price_type]" value="1" {if $params['price_type'] == 1}checked="checked"{/if}> 一口价 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[price_type]" value="2" {if $params['price_type'] == 2}checked="checked"{/if}> 价格区间 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[price_type]" value="3" {if $params['price_type'] == 3}checked="checked"{/if}> 折扣价 |
|||
</label> |
|||
<div class="help-block">默认使用一口价类型。价格为当前商品价格</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label" id="price"> |
|||
{if $params['price_type'] == 1} |
|||
售价 |
|||
{elseif $params['price_type'] == 2} |
|||
最低价 |
|||
{elseif $params['price_type'] == 3} |
|||
原价 |
|||
{/if} |
|||
</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" step="0.01" name="data[price]" value="{$params['price']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group {if $params['price_type'] == 1}hide{/if}"> |
|||
<div class="col-sm-2 control-label" id="price2"> |
|||
{if $params['price_type'] == 1} |
|||
|
|||
{elseif $params['price_type'] == 2} |
|||
最高价 |
|||
{elseif $params['price_type'] == 3} |
|||
现价 |
|||
{/if} |
|||
</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" step="0.01" name="data[price2]" value="{$params['price2']}"/> |
|||
</div> |
|||
</div> |
|||
<!--提交按钮--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="goods_id" value="{$params['goods_id']}" /> |
|||
<input type="hidden" name="status" value="{$status}" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 更换价格类型 |
|||
*/ |
|||
$("[name='data[price_type]']").on('change',function () { |
|||
//基本参数信息获取 |
|||
let _this = $(this), |
|||
_val = _this.val(); |
|||
//根据价格类型进行对应的操作 |
|||
if(_val == 1){ |
|||
//标题信息替换 |
|||
$("#price").html('售价'); |
|||
$("#price2").html(''); |
|||
//隐藏价格二 |
|||
$("#price2").parent(".form-group").addClass('hide'); |
|||
}else if(_val == 2){ |
|||
//标题信息替换 |
|||
$("#price").html('最低价'); |
|||
$("#price2").html('最高价'); |
|||
//显示价格二 |
|||
$("#price2").parent(".form-group").removeClass('hide'); |
|||
}else if(_val == 3){ |
|||
//标题信息替换 |
|||
$("#price").html('原价'); |
|||
$("#price2").html('现价'); |
|||
//显示价格二 |
|||
$("#price2").parent(".form-group").removeClass('hide'); |
|||
} |
|||
}); |
|||
/** |
|||
* 提交判断信息 |
|||
* @returns {boolean} |
|||
*/ |
|||
function formcheck(){ |
|||
let gid = $("[name='data[goods_id]']").val(); |
|||
if(!gid){ |
|||
tip.alert('请选择商品!'); |
|||
return false; |
|||
} |
|||
} |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,163 @@ |
|||
{php include wl_template('common/header');} |
|||
<meta name="referrer" content="never"> |
|||
<div class="app-content"> |
|||
<ul class="nav nav-tabs"> |
|||
<li {if $status == '0'} class="active" {/if}><a href="{php echo web_url('live/goods/goodsList', array('status'=>0));}">未审核</a></li> |
|||
<li {if $status == '1'} class="active" {/if}><a href="{php echo web_url('live/goods/goodsList', array('status'=>1));}">审核中</a></li> |
|||
<li {if $status == '2'} class="active" {/if}><a href="{php echo web_url('live/goods/goodsList', array('status'=>2));}">通过(使用中)</a></li> |
|||
<li {if $status == '3'} class="active" {/if}><a href="{php echo web_url('live/goods/goodsList', array('status'=>3));}">驳回(未通过)</a></li> |
|||
</ul> |
|||
<div class="app-filter"> |
|||
<div class="alert alert-warning"> |
|||
注意事项:<br /> |
|||
1、商品列表每天只能查看10000次<br> |
|||
2、商品信息每天限制1000次(信息同步每50条消耗一次,不足50条也会消耗一次。每次进入商品编辑页面消耗一次)<br> |
|||
3、每天最多只能进行500次商品添加请求(重新提交也会消耗一次)<br> |
|||
4、每天最多只能进行1000次商品删除<br> |
|||
5、审核通过的商品仅允许修改价格类型与价格,未审核的商品允许修改所有信息,其他状态的商品不允许修改<br> |
|||
6、对商品进行添加、删除、重新审核、修改信息操作后请使用信息同步,否则可能数据和微信公众号后台不一致<br> |
|||
7、直播间请勿在微信公众号后台进行删除,否则可能导致平台直播间数据和微信公众号后台不一致<br> |
|||
8、同步商品信息时,如果商品在本平台不存在则不会同步且不会显示在本平台<br> |
|||
</div> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('live/goods/add');}" class="btn btn-primary">发布商品</a> |
|||
<a href="javascript:;" id="infoSynchronization" class="btn btn-info">信息同步</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">商品ID</th> |
|||
<th class="text-center">所属代理</th> |
|||
<th class="text-center">商品图片</th> |
|||
<th class="text-center">商品名称</th> |
|||
<th class="text-center">价格</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $val} |
|||
<tr class="text-center"> |
|||
<td>{$val['goods_id']}</td> |
|||
<td>{$val['agent_name']}</td> |
|||
<td> |
|||
<img class="scrollLoading" src="{$val['goods_img']}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="50" width="50"/> |
|||
</td> |
|||
<td>{$val['title']}</td> |
|||
<td> |
|||
<!-- 价格类型,1:一口价,2:价格区间,3:显示折扣价 --> |
|||
{if $val['price_type'] == 1} |
|||
<label class="label label-success">售价:{$val['price']}</label> |
|||
{elseif $val['price_type'] == 2} |
|||
<label class="label label-info">售价:{$val['price']} ~ {$val['price2']}</label> |
|||
{else} |
|||
<label class="label label-primary">原价:{$val['price']}</label><br /> |
|||
<label class="label label-danger" style="display: inline-block;margin-top: 5px;">现价:{$val['price2']}</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<!--商品来源(thirdPartyTag),1、2:表示是为 API 添加商品,否则是直播控制台添加的商品--> |
|||
{if in_array($val['third_party_tag'],[1,2])} |
|||
<!--商品状态,0:未审核。1:审核中,2:审核通过,3:审核驳回--> |
|||
{if $status == 0} |
|||
<a href="javascript:;" class="btn btn-sm btn-success reSubmitButton" data-id="{$val['goods_id']}">重新提交</a> |
|||
<a href="{php echo web_url('live/goods/editGoods',['goods_id'=>$val['goods_id'],'status'=>$status]);}" class="btn btn-sm btn-info">编辑商品</a> |
|||
{elseif $status == 1} |
|||
<a href="javascript:;" class="btn btn-sm btn-info withdrawButton" data-id="{$val['goods_id']}">撤回审核</a> |
|||
{elseif $status == 2} |
|||
<a href="{php echo web_url('live/goods/editGoods',['goods_id'=>$val['goods_id'],'status'=>$status]);}" class="btn btn-sm btn-info">编辑商品</a> |
|||
{elseif $status == 3} |
|||
<!--审核驳回--> |
|||
{/if} |
|||
<a href="javascript:;" class="btn btn-sm btn-danger deleteGoodsButton" data-id="{$val['goods_id']}">删除商品</a> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"></div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 请求撤回正在审核中的商品 |
|||
*/ |
|||
$(".withdrawButton").on('click',function () { |
|||
//基本参数信息获取 |
|||
let id = $(this).data('id'); |
|||
//请求进行撤回操作 |
|||
$.post("{php echo web_url('live/goods/cancelAdd');}", { |
|||
id: id, |
|||
}, function(res) { |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
}, 'json'); |
|||
}); |
|||
/** |
|||
* 重新提交商品进行审核 |
|||
*/ |
|||
$(".reSubmitButton").on('click',function () { |
|||
//基本参数信息获取 |
|||
let id = $(this).data('id'); |
|||
//请求进行撤回操作 |
|||
$.post("{php echo web_url('live/goods/reSubmit');}", { |
|||
id: id, |
|||
}, function(res) { |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
}, 'json'); |
|||
}); |
|||
/** |
|||
* 删除直播商品 |
|||
*/ |
|||
$(".deleteGoodsButton").on('click',function () { |
|||
//基本参数信息获取 |
|||
let id = $(this).data('id'); |
|||
//请求进行撤回操作 |
|||
$.post("{php echo web_url('live/goods/deleteLiveGoods');}", { |
|||
id: id, |
|||
}, function(res) { |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
}, 'json'); |
|||
}); |
|||
/** |
|||
* 点击进行信息同步 |
|||
*/ |
|||
$("#infoSynchronization").on('click',function () { |
|||
$('#page-loading').show(); |
|||
let synchronizatio = function(page){ |
|||
$.post("{php echo web_url('live/goods/infoSynchronization')}",{page:page},function (res) { |
|||
//判断是否成功 |
|||
if(res.errno == 1){ |
|||
page++; |
|||
if(res.data['total_page'] >= page){ |
|||
//总页数大于等于 下一页则继续进行信息同步 |
|||
synchronizatio(page); |
|||
}else{ |
|||
//信息同步完成 |
|||
tip.alert("同步完成",function () { |
|||
history.go(0); |
|||
}); |
|||
} |
|||
}else{ |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
} |
|||
},'json'); |
|||
} |
|||
synchronizatio(1); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,71 @@ |
|||
<div class="modal-dialog" id="selectLiveGoodsInfo" style="min-width: 60%!important;"> |
|||
<!--css样式--> |
|||
<style> |
|||
#selectLiveGoodsInfo{ |
|||
padding-right: 4px; |
|||
position: fixed; |
|||
top: 15%; |
|||
left: 25%; |
|||
} |
|||
#selectLiveGoodsList .userAvatar img{ |
|||
width: 50px!important; |
|||
height: 50px!important; |
|||
} |
|||
#selectLiveGoodsList .modal-content{ |
|||
max-height: 1000px!important; |
|||
} |
|||
#selectLiveGoodsList .modal-body.form-horizontal{ |
|||
padding-bottom: 0!important; |
|||
} |
|||
#selectLiveGoodsList svg{ |
|||
display: inline-block!important; |
|||
} |
|||
</style> |
|||
<!--列表信息--> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">请选择商品</h4> |
|||
</div> |
|||
<div class="modal-body form-horizontal"> |
|||
<div class="app-table-list" id="selectLiveGoodsList"> |
|||
{php include wl_template('goods/select_goods');} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!--js样式--> |
|||
<script> |
|||
/** |
|||
* 分页操作 |
|||
*/ |
|||
$('#selectLiveGoodsList').on('click','.pull-right li a',function (event) { |
|||
//禁止跳转 |
|||
event.preventDefault(); |
|||
//参数信息获取 |
|||
let _this = $(this), |
|||
href = _this.attr('href'); |
|||
//请求获取信息 |
|||
$.ajax(href, { |
|||
data:{is_block:1}, |
|||
type: "POST", |
|||
dataType: "html", |
|||
cache: false, |
|||
}).done(function(html) { |
|||
$(document).find("#selectLiveGoodsList").html(html); |
|||
}); |
|||
return false; |
|||
}); |
|||
/** |
|||
* 选中商品 调用方法进行处理 |
|||
*/ |
|||
$('#selectLiveGoodsList').on('click','.selectedLiveGoods',function () { |
|||
//基本参数信息获取 |
|||
let _this = $(this), |
|||
params = _this.data('params'); |
|||
//调用处理方法 |
|||
liveGoodsSelected(params); |
|||
//自动关闭选择器 |
|||
$(document).find("#closeButton").click(); |
|||
}); |
|||
</script> |
|||
</div> |
|||
@ -0,0 +1,44 @@ |
|||
<div class="panel panel-default" style="height: 500px;overflow: auto;"> |
|||
<table class="table table-hover table-responsive table-bordered" style="border: 1px solid #e5e5e5;"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">商品ID</th> |
|||
<th class="text-center">商品图片</th> |
|||
<th class="text-center">商品名称</th> |
|||
<th class="text-center">价格</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody class="text-center" id="selectLiveGoodsList"> |
|||
{loop $list $val} |
|||
<tr class="text-center"> |
|||
<td>{$val['goods_id']}</td> |
|||
<td> |
|||
<img class="scrollLoading" src="{$val['goods_img']}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="50" width="50"/> |
|||
</td> |
|||
<td>{$val['title']}</td> |
|||
<td> |
|||
<!-- 价格类型,1:一口价,2:价格区间,3:显示折扣价 --> |
|||
{if $val['price_type'] == 1} |
|||
<label class="label label-success">售价:{$val['price']}</label> |
|||
{elseif $val['price_type'] == 2} |
|||
<label class="label label-info">售价:{$val['price']} ~ {$val['price2']}</label> |
|||
{else} |
|||
<label class="label label-primary">原价:{$val['price']}</label><br /> |
|||
<label class="label label-danger" style="display: inline-block;margin-top: 5px;">现价:{$val['price2']}</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<a href="javascript:;" class="btn btn-sm btn-primary selectedLiveGoods" data-params='{php echo json_encode($val);}'>选择</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button type="button" class="btn btn-danger min-width" id="closeButton" data-dismiss="modal">取消</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
@ -0,0 +1,317 @@ |
|||
{php include wl_template('common/header');} |
|||
<meta name="referrer" content="never"> |
|||
<style> |
|||
.goodsBlock{ |
|||
width: 300px; |
|||
height: 120px; |
|||
float: left; |
|||
margin-right: 15px; |
|||
border: 1px solid #CCCCCC; |
|||
margin-bottom: 15px; |
|||
padding: 5px; |
|||
} |
|||
.goodsBlock .img{ |
|||
width: 120px; |
|||
height: 100%; |
|||
float: left; |
|||
margin-right: 10px; |
|||
position: relative; |
|||
} |
|||
.goodsBlock .img img{ |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
.goodsBlock .img .deleteGoods{ |
|||
position: absolute; |
|||
top: 0; |
|||
right: 0; |
|||
color: red; |
|||
padding: 2px 6px; |
|||
font-size: 13px; |
|||
cursor: pointer; |
|||
} |
|||
.goodsBlock .info{ |
|||
float: left; |
|||
width: calc(100% - 135px); |
|||
height: 100%; |
|||
font-size: 13px; |
|||
} |
|||
.goodsBlock .info .title{ |
|||
display: -webkit-box; |
|||
overflow: hidden; |
|||
-webkit-box-orient: vertical; |
|||
text-overflow: ellipsis; |
|||
-webkit-line-clamp: 2; |
|||
height: 40px; |
|||
line-height: 20px; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('live/live/liveList')}">直播间列表</a></li> |
|||
<li class="active"><a href="javascript:;">添加直播间</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
{if $_W['aid']} |
|||
<div class="app-filter"> |
|||
<div class="alert alert-warning"> |
|||
请添加商品信息,如果不添加商品信息则当前直播间在同步信息后会自动移动到总后台 |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<!-- 房间名字 --> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"><span class="form-must">*</span>房间名称</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" name="data[name]" minlength="3" maxlength="15"/> |
|||
</div> |
|||
</div> |
|||
<!-- 背景图 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>背景图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[coverImg]', '');} |
|||
<div class="help-block">建议像素1080*1920,大小不超过1M</div> |
|||
</div> |
|||
</div> |
|||
<!-- 开始时间 - 结束时间 --> |
|||
<div class="form-group"> |
|||
<label class="control-label col-xs-12 col-sm-2"><span class="form-must">*</span>开始时间:</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
{php echo tpl_select_time_info('time', ['starttime' => date('Y-m-d H:i',strtotime(' +15 minute')), 'endtime' => date('Y-m-d H:i', strtotime('+1 hour +15 minute'))]);} |
|||
<div class="input_tip">开播时间需要在当前时间的10分钟后 并且 开始时间不能在 6 个月后</div> |
|||
</div> |
|||
</div> |
|||
<!-- 主播昵称 --> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must "><span class="form-must">*</span>主播昵称</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" name="data[anchorName]" minlength="3" maxlength="15"/> |
|||
</div> |
|||
</div> |
|||
<!-- 主播微信号 --> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must "><span class="form-must">*</span>主播微信</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" name="data[anchorWechat]"/> |
|||
<!-- <div class="input_tip">如果未实名认证,需要先前往<a href="https://mp.weixin.qq.com/" target="_blank">小程序直播</a>小程序进行实名验证</div>--> |
|||
</div> |
|||
</div> |
|||
<!-- 分享图 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>分享图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[shareImg]', '');} |
|||
<div class="input_tip">建议像素800*640,大小不超过1M</div> |
|||
</div> |
|||
</div> |
|||
<!-- 直播类型 1=推流;0=手机直播 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">直播类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="0" checked="checked"> 手机直播 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="1"> 推流 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<!-- 画面尺寸 1=横屏;0=竖屏--> |
|||
<div class="form-group hide" id="screenType"> |
|||
<label class="col-sm-2 control-label">画面尺寸</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[screenType]" value="0"> 竖屏 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[screenType]" value="1" checked="checked"> 横屏 |
|||
</label> |
|||
<div class="input_tip">横屏:视频宽高比为16:9、4:3、1.85:1 ;竖屏:视频宽高比为9:16、2:3</div> |
|||
</div> |
|||
</div> |
|||
<!-- 点赞 1=关闭;0=开启--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">点赞</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[closeLike]" value="0" checked="checked"> 开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[closeLike]" value="1"> 关闭 |
|||
</label> |
|||
<div class="input_tip">若关闭,直播开始后不允许开启</div> |
|||
</div> |
|||
</div> |
|||
<!-- 货架 1=关闭;0=开启 转为后台判断--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">货架</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[closeGoods]" value="0" checked="checked"> 开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[closeGoods]" value="1"> 关闭 |
|||
</label> |
|||
<div class="input_tip">若关闭,直播开始后不允许开启</div> |
|||
</div> |
|||
</div> |
|||
<!-- 评论 1=关闭;0=开启--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">评论</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[closeComment]" value="0" checked="checked"> 开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[closeComment]" value="1"> 关闭 |
|||
</label> |
|||
<div class="input_tip">若关闭,直播开始后不允许开启</div> |
|||
</div> |
|||
</div> |
|||
<!-- 选择商品信息 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">选择商品</label> |
|||
<div class="col-sm-9"> |
|||
<input type="button" value="选择商品" class="btn btn-info col-sm-1 min-width" id="selectLiveGoods"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9" id="selectedLiveGoodsList"> |
|||
<!--已选中的直播商品列表--> |
|||
</div> |
|||
</div> |
|||
<!-- 主播认证 --> |
|||
<div class="form-group hide" id="authentication"> |
|||
<label class="col-sm-2 control-label">主播认证</label> |
|||
<div class="col-sm-9"> |
|||
<img src="" width="200" height="200"/> |
|||
</div> |
|||
</div> |
|||
<!-- 提交按钮 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="button" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" id="submitInfo" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 打开直播商品选择模态框 |
|||
*/ |
|||
$("#selectLiveGoods").on('click',function () { |
|||
$.ajax({ |
|||
url: "{php echo web_url('live/goods/selectGoods')}", |
|||
type: "post", |
|||
dataType: "html", |
|||
success:function (res) { |
|||
//判断是否为json格式数据 |
|||
try { |
|||
//如果能够成功转换 则为json格式数据信息 |
|||
let obj = JSON.parse(res); |
|||
if(obj){ |
|||
tip.alert(obj.message) |
|||
} |
|||
} catch(e) { |
|||
//json 转换失败 为html格式数据 |
|||
$("#selectLiveGoodsInfo").remove(); |
|||
$("body").append(res); |
|||
$("#selectLiveGoodsInfo").modal(); |
|||
} |
|||
}, |
|||
}); |
|||
}); |
|||
/** |
|||
* 点击删除商品 |
|||
*/ |
|||
$("#selectedLiveGoodsList").on('click','.deleteGoods',function () { |
|||
$(this).closest(".goodsBlock").remove(); |
|||
}); |
|||
/** |
|||
* 根据直播类型 显示隐藏画面尺寸 |
|||
*/ |
|||
$("[name='data[type]']").on('change',function () { |
|||
let val = $(this).val(); |
|||
if(parseInt(val) === 0){ |
|||
//手机直播 |
|||
$("#screenType").addClass('hide'); |
|||
}else{ |
|||
//推流 |
|||
$("#screenType").removeClass('hide'); |
|||
} |
|||
}); |
|||
/** |
|||
* 选中直播商品后的操作 |
|||
* @param params |
|||
*/ |
|||
function liveGoodsSelected(params) { |
|||
//价格信息获取 价格类型,1:一口价,2:价格区间,3:显示折扣价 |
|||
let priceHtml = '<label class="label label-success">售价:'+params['price']+'</label>'; |
|||
if(params['price_type'] == 2){ |
|||
priceHtml = '<label class="label label-info">售价:'+params['price']+' ~ '+params['price2']+'</label>'; |
|||
}else if(params['price_type'] == 3){ |
|||
priceHtml = '<label class="label label-primary">原价:'+params['price']+'</label>' + |
|||
'<label class="label label-danger" style="display: inline-block;margin-top: 5px;">现价:'+params['price2']+'</label>'; |
|||
} |
|||
//商品信息不存在 生成商品块 |
|||
let goodsBlockId = "livegoods"+params['goods_id']; |
|||
if($('#'+goodsBlockId).length == 0){ |
|||
//不存在 建立商品块 |
|||
let html = '<div class="goodsBlock" id="'+goodsBlockId+'">\n' + |
|||
' <div class="img">\n' + |
|||
' <img src="'+params['goods_img']+'">\n' + |
|||
' <span class="deleteGoods">删除</span>\n' + |
|||
' </div>\n' + |
|||
' <div class="info">\n' + |
|||
' <div class="title">'+params['title']+'</div>\n' +priceHtml+ |
|||
' <input type="hidden" name="live_goods[]" value="'+params['goods_id']+'">\n' + |
|||
' </div>\n' + |
|||
'</div>'; |
|||
$("#selectedLiveGoodsList").append(html); |
|||
} |
|||
} |
|||
/** |
|||
* 点击提交信息 |
|||
*/ |
|||
$("#submitInfo").on('click',function () { |
|||
$('#page-loading').show(); |
|||
//获取并且处理表单信息 |
|||
let formArr = $("form").serializeArray(); |
|||
let params = {}; |
|||
$.each(formArr,function (k,v) { |
|||
params[v['name']] = v['value']; |
|||
}); |
|||
delete params['live_goods[]']; |
|||
//获取商品信息 |
|||
let goodsList = $("[name='live_goods[]']").serializeArray(); |
|||
$.each(goodsList,function (k,v) { |
|||
params['live_goods['+k+']'] = v['value']; |
|||
}); |
|||
//请求后台 |
|||
$.post("{php echo web_url('live/live/addLive');}",params,function (res) { |
|||
if(res.data['qrcode_url'] && res.errno == 1){ |
|||
//认证操作 |
|||
$("#authentication").removeClass('hide'); |
|||
$("#authentication").find("img").attr('src',res.data['qrcode_url']); |
|||
tip.alert(res.message); |
|||
}else if(res.errno == 1){ |
|||
//错误抛出 |
|||
$('#page-loading').hide(); |
|||
tip.alert(res.message); |
|||
}else{ |
|||
//成功 跳转列表页面 |
|||
tip.alert(res.message,function () { |
|||
window.location.href = "{php echo web_url('live/live/liveList')}"; |
|||
}); |
|||
} |
|||
},'json'); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,382 @@ |
|||
{php include wl_template('common/header');} |
|||
<meta name="referrer" content="never"> |
|||
<style> |
|||
.goods_list{ |
|||
position: absolute; |
|||
z-index: 1000; |
|||
top: calc((100% - 590px) / 2); |
|||
left: 25%; |
|||
width: 50%; |
|||
max-height: 60%; |
|||
} |
|||
.goods_list .goods_title{ |
|||
float: left; |
|||
width: 100%; |
|||
height: 40px; |
|||
font-weight: 600; |
|||
font-family: arial, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', '宋体', \5b8b\4f53, Tahoma, Arial, Helvetica, STHeiti; |
|||
text-align: center; |
|||
border-bottom: 1px solid #DDD; |
|||
background-color: #f2f2f2; |
|||
} |
|||
.goods_list .goods_title div{ |
|||
width: 25%; |
|||
float: left; |
|||
padding: 10px; |
|||
height: 100%; |
|||
} |
|||
.goods_content{ |
|||
float: left; |
|||
width: 100%; |
|||
height: 500px; |
|||
overflow-y: auto; |
|||
background: #FFFFFF; |
|||
} |
|||
.goods_goodList{ |
|||
float: left; |
|||
width: 100%; |
|||
height: 50px; |
|||
font-family: arial, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', '宋体', \5b8b\4f53, Tahoma, Arial, Helvetica, STHeiti; |
|||
font-size: 14px; |
|||
color: #333; |
|||
text-align: center; |
|||
box-sizing: border-box; |
|||
border-top: 1px solid #e7eaec; |
|||
} |
|||
.goods_goodList div{ |
|||
float: left; |
|||
width: 25%; |
|||
height: 50px; |
|||
line-height: 50px; |
|||
} |
|||
.goods_close{ |
|||
text-align: right; |
|||
padding-right: 10%; |
|||
background: #FFFFFF; |
|||
height: 50px; |
|||
line-height: 50px; |
|||
margin: 0; |
|||
width: 100%; |
|||
float: left; |
|||
border-top: 1px solid #e7eaec; |
|||
} |
|||
#playback{ |
|||
position: absolute; |
|||
z-index: 1000; |
|||
top: 15%; |
|||
left: 20%; |
|||
width: 60%; |
|||
background: #FFFFFF; |
|||
height: 70%; |
|||
padding: 0!important; |
|||
} |
|||
#playbacklist{ |
|||
float: left; |
|||
width: calc(100% + 4.3px); |
|||
height: calc(100% - 50px); |
|||
overflow-y: auto; |
|||
padding: 20px; |
|||
} |
|||
#playback .playback_close{ |
|||
float: left; |
|||
height: 50px; |
|||
width: 100%; |
|||
text-align: right; |
|||
padding-right: 50px; |
|||
border-top: 1px solid #CCCCCC; |
|||
line-height: 50px; |
|||
} |
|||
.block{ |
|||
width: calc((100vw - 40vw - 45px) / 4); |
|||
height: calc((calc((100vw - 40vw - 45px) / 4))/ 9 * 16); |
|||
float: left; |
|||
padding: 10px; |
|||
font-size: 15px; |
|||
} |
|||
.block-video{ |
|||
width: 100%; |
|||
height: calc(100% - 60px); |
|||
text-align: center; |
|||
border: 1px solid #CCC; |
|||
} |
|||
.block .block-video video{ |
|||
width: 100% !important; |
|||
height: 100% !important; |
|||
object-fit: fill; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
margin-bottom: 50px; |
|||
} |
|||
.block .block-time{ |
|||
font-size: 14px; |
|||
height: 40px; |
|||
line-height: 20px; |
|||
} |
|||
#openLive{ |
|||
position: fixed; |
|||
top: 20%; |
|||
left: 30%; |
|||
padding: 15px; |
|||
z-index: 1000; |
|||
width: 500px; |
|||
height: 300px; |
|||
text-align: center; |
|||
} |
|||
#openLive .qrcode{ |
|||
width: 200px; |
|||
height: 200px; |
|||
} |
|||
#openLive img{ |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
#openLive .openLive_close{ |
|||
margin-top: 25px; |
|||
text-align: right; |
|||
|
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">直播间列表</a></li> |
|||
</ul> |
|||
<!-- 直播间信息列表 --> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="alert alert-warning"> |
|||
注意事项:<br /> |
|||
1、如果发现直播间信息有异常,请点击信息同步。<br /> |
|||
2、直播信息接口每天最多只能使用100000次(查看直播回放、信息同步消耗一定次数)<br> |
|||
3、信息同步所需时间根据直播间总数量决定。请定期删除无效或者无用的直播间<br /> |
|||
</div> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('live/live/addLive');}" class="btn btn-primary">添加直播间</a> |
|||
<a href="javascript:;" class="btn btn-info" id="infoSynchronization">信息同步</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" width="5%">ID</th> |
|||
<th class="text-center" width="10%">直播间名称</th> |
|||
<th class="text-center" width="10%">背景图</th> |
|||
<th class="text-center" width="10%">分享图</th> |
|||
<th class="text-center" width="20%">商品信息</th> |
|||
<th class="text-center" width="5%">状态</th> |
|||
<th class="text-center" width="20%">直播时间</th> |
|||
<th class="text-center" width="10%">主播</th> |
|||
<th class="text-center" width="10%">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $val} |
|||
<tr class="text-center"> |
|||
<td>{$val['roomid']}</td> |
|||
<td>{$val['name']}</td> |
|||
<td> |
|||
<img class="scrollLoading" src="{$val['cover_img']}" data-url="{php echo tomedia($mem['avatar'])}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="50" width="50"/> |
|||
</td> |
|||
<td> |
|||
<img class="scrollLoading" src="{$val['share_img']}" data-url="{php echo tomedia($mem['avatar'])}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="50" width="50"/> |
|||
</td> |
|||
<td> |
|||
{if $val['goods']} |
|||
<a href="javascript:;" class="btn btn-sm btn-info goodsInfo">查看商品</a> |
|||
<div class="goods_list hide"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">商品名称</th> |
|||
<th class="text-center">封面图</th> |
|||
<th class="text-center">商品类型</th> |
|||
<th class="text-center">售价</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $val['goods'] $good} |
|||
<tr class="text-center"> |
|||
<td>{$good['title']}</td> |
|||
<td> |
|||
<img class="scrollLoading" src="{$good['goods_img']}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="30" width="30"/> |
|||
</td> |
|||
<td> |
|||
{if $good['goods_plugin'] == 'rush'} |
|||
抢购商品 |
|||
{elseif $good['goods_plugin'] == 'groupon'} |
|||
团购商品 |
|||
{elseif $good['goods_plugin'] == 'wlfightgroup'} |
|||
拼团商品 |
|||
{elseif $good['goods_plugin'] == 'coupon'} |
|||
优惠券 |
|||
{elseif $good['goods_plugin'] == 'bargain'} |
|||
砍价商品 |
|||
{else} |
|||
—— |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $good['price_type'] == 1} |
|||
<label class="label label-success">{$good['price']}</label> |
|||
{elseif $good['price_type'] == 2} |
|||
<label class="label label-info">{$good['price']} ~ {$good['price2']}</label> |
|||
{else} |
|||
<label class="label label-primary">原价:{$good['price']}</label><br /> |
|||
<label class="label label-danger" style="display: inline-block;margin-top: 5px;">现价:{$good['price2']}</label> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
<!-- 关闭按钮 --> |
|||
<tr class="text-center"> |
|||
<td></td> |
|||
<td></td> |
|||
<td></td> |
|||
<td><a href="javascript:;" class="btn btn-sm btn-danger closeGoodsInfo">关闭</a></td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center"> |
|||
{if $val['live_status'] == 101} |
|||
<span class="label label-success">直播中</span> |
|||
{elseif $val['live_status'] == 102} |
|||
<span class="label label-primary">未开始</span> |
|||
{elseif $val['live_status'] == 103} |
|||
<span class="label label-warning">已结束</span> |
|||
{elseif $val['live_status'] == 104} |
|||
<span class="label label-danger">禁播</span> |
|||
{elseif $val['live_status'] == 105} |
|||
<span class="label label-default">暂停</span> |
|||
{elseif $val['live_status'] == 106} |
|||
<span class="label label-info">异常</span> |
|||
{elseif $val['live_status'] == 107} |
|||
<span class="label label-danger">已过期</span> |
|||
{/if} |
|||
</td> |
|||
<td>{$val['start_time']} - {$val['end_time']}</td> |
|||
<td>{$val['anchor_name']}</td> |
|||
<td> |
|||
{if $val['is_playback'] == 1} |
|||
<a href="javascript:;" class="btn btn-sm btn-primary playbackList" data-roomid="{$val['roomid']}">回放列表</a> |
|||
{/if} |
|||
{if in_array($val['live_status'],[101,102])} |
|||
<a href="{php echo web_url('live/live/getOpenLiveQrCode',array('id'=>$val['roomid']))}" data-toggle="ajaxModal" class="btn btn-sm btn-default">直播二维码</a> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"></div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 直播间回放列表 --> |
|||
<div id="playback" class="hide"> |
|||
<!--回放列表--> |
|||
<div id="playbacklist"></div> |
|||
<!--取消按钮--> |
|||
<div class="playback_close"> |
|||
<a href="javascript:;" class="btn btn-sm btn-danger closePlayback">关闭</a> |
|||
</div> |
|||
</div> |
|||
<!--开始直播二维码弹框--> |
|||
<div id="openLive" class="hide"> |
|||
<div class="qrcode"> |
|||
<img src="" id="openLiveQrCode"/> |
|||
</div> |
|||
<!--取消按钮--> |
|||
<div class="openLive_close"> |
|||
<a href="javascript:;" class="btn btn-sm btn-danger closeOpenLive">关闭</a> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 商品信息查看模态框的弹出&关闭 |
|||
*/ |
|||
$(".goodsInfo").on('click',function () { |
|||
//基本信息处理 |
|||
let _this = $(this), |
|||
position = _this.siblings('.goods_list'); |
|||
//打开模态框 |
|||
position.modal(); |
|||
position.removeClass('hide'); |
|||
//点击关闭模态框 |
|||
$(".closeGoodsInfo").on('click',function () { |
|||
position.modal('hide'); |
|||
position.addClass('hide'); |
|||
}); |
|||
}); |
|||
/** |
|||
* 获取当前直播间回放视频列表 |
|||
*/ |
|||
$(".playbackList").on('click',function () { |
|||
//基本参数信息获取 |
|||
let _this = $(this), |
|||
playback = $("#playback"), |
|||
playbacklist = $("#playbacklist"), |
|||
id = _this.data("roomid"); |
|||
//请求获取信息 |
|||
$.ajax({ |
|||
url: "{php echo web_url('live/live/getPlayback')}", |
|||
type: "post", |
|||
data: {id : id}, |
|||
dataType: "html", |
|||
success:function (res) { |
|||
//判断是否为json格式数据 |
|||
try { |
|||
//如果能够成功转换 则为json格式数据信息 |
|||
let obj = JSON.parse(res); |
|||
if(obj){ |
|||
tip.alert(obj.message) |
|||
} |
|||
} catch(e) { |
|||
//json 转换失败 为html格式数据 |
|||
playbacklist.html(res); |
|||
playback.modal(); |
|||
playback.removeClass('hide'); |
|||
//点击关闭当前模态框 |
|||
$(".closePlayback").on('click',function () { |
|||
playback.modal('hide'); |
|||
playback.addClass('hide'); |
|||
playbacklist.html(''); |
|||
}); |
|||
} |
|||
}, |
|||
}); |
|||
}); |
|||
/** |
|||
* 信息同步 |
|||
*/ |
|||
$("#infoSynchronization").on('click',function () { |
|||
$('#page-loading').show(); |
|||
let synchronizatio = function(page){ |
|||
$.post("{php echo web_url('live/live/infoSynchronization')}",{page:page},function (res) { |
|||
if(res.errno == 0){ |
|||
page++; |
|||
if(res.data['total_page'] >= page){ |
|||
//总页数大于等于 下一页则继续进行信息同步 |
|||
synchronizatio(page); |
|||
}else{ |
|||
//信息同步完成 |
|||
tip.alert("同步完成",function () { |
|||
history.go(0); |
|||
}); |
|||
} |
|||
}else{ |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
} |
|||
},'json'); |
|||
} |
|||
synchronizatio(1); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,27 @@ |
|||
{loop $info['list'] $vo} |
|||
<div class="block"> |
|||
<div class="block-video" data-link="{$vo['media_url']}" > |
|||
<video src="{$vo['media_url']}" controls="controls" loop="loop" onerror="notSupper(this);"> |
|||
您的浏览器不支持 video 标签。请更新或者更换浏览器 |
|||
</video> |
|||
</div> |
|||
<div class="block-time"> |
|||
生成时间:{$vo['create_time']}<br /> |
|||
失效时间:{$vo['expire_time']} |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
<script> |
|||
//处理不能加载视频的兼容操作 |
|||
function notSupper(_this) { |
|||
$(_this).parent('.block-video').addClass('openVideo'); |
|||
$(_this).parent('.block-video').css("cursor","pointer"); |
|||
let html = "暂不支持该格式视频播放!<br />点击下载或查看视频"; |
|||
$(_this).parent('.block-video').html(html); |
|||
} |
|||
//点击不能加载的视频 在新的页面打开|下载 视频 |
|||
$(document).on('click','.openVideo',function () { |
|||
let link = $(this).data('link'); |
|||
window.open(link); |
|||
}); |
|||
</script> |
|||
@ -0,0 +1,23 @@ |
|||
<style> |
|||
.wx-qrcode{} |
|||
.wx-qrcode .qrcode-img{border: 1px solid #eee; padding: 20px;width: 220px; height: 220px;margin: auto;} |
|||
.wx-qrcode .qrcode-img img {width:180px;height:180px;} |
|||
.wx-qrcode .qrcode-title{line-height: 40px;text-align: center;} |
|||
.wx-qrcode .qrcode-btn{display: block;text-align: center;line-height: 160px;} |
|||
|
|||
</style> |
|||
<div class="modal-dialog"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">直播二维码</h4> |
|||
</div> |
|||
<div class="modal-body" style="height: 350px;"> |
|||
<div class="wx-qrcode"> |
|||
<div class="qrcode-img"> |
|||
<img src="{$qrcode}" > |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,41 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[锦鲤抽奖]]></name> |
|||
<identifie><![CDATA[luckydraw]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[expand]]></type> |
|||
<description><![CDATA[锦鲤抽奖]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="true" /> |
|||
<system embed="true" /> |
|||
<task embed="true" /> |
|||
</setting> |
|||
<agentmenu> |
|||
<menu title="活动管理" font="fa-inbox"> |
|||
<entry title="活动管理" ac="luckydraw" do="index" actions='["do",["index","add","edit"]]' iscover="true" /> |
|||
<entry title="奖品管理" ac="luckygoods" do="goodsIndex" actions='["do",["goodsIndex","goodsAdd","goodsEdit"]]'/> |
|||
</menu> |
|||
<menu title="抽奖码管理" font="fa-inbox"> |
|||
<entry title="抽奖码管理" ac="luckydraw" do="prizeIndex" actions='["do",["prizeIndex"]]' /> |
|||
</menu> |
|||
<menu title="基本设置" font="fa-inbox"> |
|||
<entry title="基本设置" ac="luckydraw" do="set" actions='["do",["set"]]'/> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="活动管理" font="fa-inbox"> |
|||
<entry title="活动管理" ac="luckydraw" do="index" actions='["do",["index","add","edit"]]' iscover="true" /> |
|||
<entry title="奖品管理" ac="luckygoods" do="goodsIndex" actions='["do",["goodsIndex","goodsAdd"]]'/> |
|||
</menu> |
|||
<menu title="抽奖码管理" font="fa-inbox"> |
|||
<entry title="抽奖码管理" ac="luckydraw" do="prizeIndex" actions='["do",["prizeIndex"]]' /> |
|||
</menu> |
|||
<menu title="基本设置" font="fa-inbox"> |
|||
<entry title="基本设置" ac="luckydraw" do="set" actions='["do",["set"]]'/> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 2.4 KiB |
@ -0,0 +1,528 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class LuckydrawModuleUniapp extends Uniapp { |
|||
|
|||
/** |
|||
* Comment: 抽奖页面信息 |
|||
* Author: wlf |
|||
* Date: 2021/12/07 11:39 |
|||
*/ |
|||
public function drawPageInfo(){ |
|||
global $_GPC, $_W; |
|||
$set = Setting::agentsetting_read('luckydraw'); |
|||
if(empty($set['status'])){ |
|||
$this->renderError("活动已关闭,无法访问",['url'=>h5_url('pages/mainPages/index/index')]); |
|||
} |
|||
$id = $_GPC['id']; |
|||
$recordid = $_GPC['recordid']; |
|||
$lat = $_GPC['lat']; |
|||
$lng = $_GPC['lng']; |
|||
if(empty($recordid) && empty($id)){ |
|||
$this->renderError("参数错误,无法访问",['url'=>h5_url('pages/mainPages/index/index')]); |
|||
} |
|||
if($recordid > 0){ |
|||
$id = pdo_getcolumn(PDO_NAME.'luckydraw_record',array('id'=>$recordid),'drawid'); |
|||
} |
|||
$drawinfo = pdo_get('wlmerchant_luckydraw',array('id' => $id)); |
|||
if(empty($recordid) && $drawinfo['status'] != 1){ |
|||
//查询最后一次记录 |
|||
$recordid = pdo_getcolumn(PDO_NAME.'luckydraw_record',array('uniacid'=>$_W['uniacid'],'drawid'=>$id),'id'); |
|||
if(empty($recordid)){ |
|||
$this->renderError("活动未开始",['url'=>h5_url('pages/mainPages/index/index')]); |
|||
} |
|||
} |
|||
if(empty($recordid)){ |
|||
$recordid = pdo_getcolumn(PDO_NAME.'luckydraw_record',array('uniacid'=>$_W['uniacid'],'drawid'=>$id,'status' => 0),'id'); |
|||
if(empty($recordid)){ |
|||
//创建活动 |
|||
if($drawinfo['drawstatus'] > 0 ){ |
|||
$countall = pdo_fetchcolumn('SELECT count(id) FROM '.tablename('wlmerchant_luckydraw_record')." WHERE drawid = {$id}"); |
|||
if($countall > $drawinfo['drawsucnum'] || $countall == $drawinfo['drawsucnum']){ |
|||
$this->renderError("活动已结束",['url'=>h5_url('pages/mainPages/index/index')]); |
|||
} |
|||
}else{ |
|||
if($drawinfo['endtime'] < time()){ |
|||
$this->renderError("活动已结束",['url'=>h5_url('pages/mainPages/index/index')]); |
|||
} |
|||
} |
|||
$recordid = Luckydraw::createNewRecodrd($drawinfo); |
|||
} |
|||
} |
|||
$recordinfo = pdo_get('wlmerchant_luckydraw_record',array('id' => $recordid)); |
|||
//数据组装 |
|||
$data = []; |
|||
//活动状态 |
|||
$data['status'] = $recordinfo['status']; |
|||
$data['id'] = $id; |
|||
$data['recordid'] = $recordid; |
|||
//幻灯片 |
|||
$advs = unserialize($drawinfo['advarray']); |
|||
foreach ($advs as &$ad){ |
|||
$ad['thumb'] = tomedia($ad['thumb']); |
|||
} |
|||
$data['adv'] = $advs; |
|||
//中奖记录 |
|||
$luckyList = pdo_fetchall("SELECT draw_goods_id,mid FROM ".tablename('wlmerchant_luckydraw_drawcode')."WHERE uniacid = {$_W['uniacid']} AND draw_goods_id > 0 ORDER BY drawtime DESC LIMIT 10"); |
|||
if(!empty($luckyList)){ |
|||
foreach ($luckyList as &$luckyli){ |
|||
$member = pdo_get('wlmerchant_member',array('id' => $luckyli['mid']),array('nickname','avatar')); |
|||
$luckyli['nickname'] = $member['nickname']; |
|||
$luckyli['avatar'] = tomedia($member['avatar']); |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'luckydraw_goods',array('id'=>$luckyli['draw_goods_id']),'title'); |
|||
$luckyli['goodsname'] = $goodsname; |
|||
} |
|||
}else{ |
|||
$luckyList = []; |
|||
} |
|||
$data['luckylist'] = $luckyList; |
|||
//剩余时间或人数 |
|||
$data['supstatus'] = $recordinfo['drawstatus']; |
|||
if(empty($recordinfo['status'])){ |
|||
if($data['supstatus'] > 0){ |
|||
// $allcodenum = pdo_fetchcolumn('SELECT count(id) FROM '.tablename('wlmerchant_luckydraw_drawcode')." WHERE draw_reid = {$recordid}"); |
|||
// $recordinfo['lacknum'] = $recordinfo['drawcodenum'] - $allcodenum; |
|||
// if($recordinfo['lacknum'] < 0){ |
|||
// $recordinfo['lacknum'] = 0; |
|||
// } |
|||
$data['supnum'] = $recordinfo['lacknum']; |
|||
//pdo_update('wlmerchant_luckydraw_record',array('lacknum' => $recordinfo['lacknum']),array('id' => $recordid)); |
|||
}else{ |
|||
$data['supnum'] = $recordinfo['endtime'] - time(); |
|||
} |
|||
if($data['supnum'] < 0){ |
|||
$data['supnum'] = 0; |
|||
} |
|||
}else{ |
|||
$data['supnum'] = 0; |
|||
} |
|||
//奖品展示 |
|||
$one = pdo_get('wlmerchant_luckydraw_goods',array('id' => $drawinfo['oneprizeid']),array('title','image')); |
|||
$one['image'] = tomedia($one['image']); |
|||
$one['number'] = $drawinfo['oneprizenum']; |
|||
$prize[] = $one; |
|||
if($drawinfo['twoprizeid'] > 0 && $drawinfo['twoprizenum'] > 0){ |
|||
$two = pdo_get('wlmerchant_luckydraw_goods',array('id' => $drawinfo['twoprizeid']),array('title','image')); |
|||
$two['image'] = tomedia($two['image']); |
|||
$two['number'] = $drawinfo['twoprizenum']; |
|||
$prize[] = $two; |
|||
} |
|||
if($drawinfo['threeprizeid'] > 0 && $drawinfo['threeprizenum'] > 0){ |
|||
$thr = pdo_get('wlmerchant_luckydraw_goods',array('id' => $drawinfo['threeprizeid']),array('title','image')); |
|||
$thr['image'] = tomedia($thr['image']); |
|||
$thr['number'] = $drawinfo['threeprizenum']; |
|||
$prize[] = $thr; |
|||
} |
|||
$data['prize'] = $prize; |
|||
//提示文本 |
|||
$data['tips'] = $set['statement'] ? : "100%开奖·绝对公平公正·快来加入吧"; |
|||
//参与人头像和人数 |
|||
$headlist = pdo_fetchall('select distinct mid from ' . tablename('wlmerchant_luckydraw_drawcode')."WHERE uniacid = {$_W['uniacid']} AND draw_reid = {$recordid} ORDER BY createtime DESC LIMIT 5"); |
|||
if(!empty($headlist)){ |
|||
foreach ($headlist as &$head){ |
|||
$member = pdo_get('wlmerchant_member',array('id' => $head['mid']),array('avatar')); |
|||
$head['avatar'] = tomedia($member['avatar']); |
|||
} |
|||
} |
|||
$joinnum = pdo_fetchcolumn('SELECT count(id) FROM '.tablename('wlmerchant_luckydraw_drawcode')." WHERE draw_reid = {$recordid}"); |
|||
$data['headlist'] = $headlist; |
|||
$data['joinnum'] = $joinnum; |
|||
//我的抽奖码或中奖信息 |
|||
if($data['status'] == 2){ |
|||
//一等奖名单 |
|||
$onedrawlist = pdo_getall('wlmerchant_luckydraw_drawcode',array('status' => 2,'draw_reid' => $recordid),array('codenum','mid')); |
|||
$onedrawlist = Luckydraw::beautifulList($onedrawlist,$_W['mid']); |
|||
$data['onecodes'] = $onedrawlist; |
|||
$data['onecodenum'] = count($onedrawlist); |
|||
//二等奖名单 |
|||
$twodrawlist = pdo_getall('wlmerchant_luckydraw_drawcode',array('status' => 3,'draw_reid' => $recordid),array('codenum','mid')); |
|||
if(!empty($twodrawlist)){ |
|||
$twodrawlist = Luckydraw::beautifulList($twodrawlist,$_W['mid']); |
|||
} |
|||
$data['twocodes'] = $twodrawlist; |
|||
$data['twocodenum'] = count($twodrawlist); |
|||
//三等奖名单 |
|||
$thrdrawlist = pdo_getall('wlmerchant_luckydraw_drawcode',array('status' => 4,'draw_reid' => $recordid),array('codenum','mid')); |
|||
if(!empty($thrdrawlist)){ |
|||
$thrdrawlist = Luckydraw::beautifulList($thrdrawlist,$_W['mid']); |
|||
} |
|||
$data['thrcodes'] = $thrdrawlist; |
|||
$data['thrcodenum'] = count($thrdrawlist); |
|||
//查询自己中奖记录 |
|||
$mydrawlist = pdo_fetchall("SELECT id,draw_goods_id,status FROM ".tablename('wlmerchant_luckydraw_drawcode')."WHERE uniacid = {$_W['uniacid']} AND draw_reid = {$recordid} AND mid = {$_W['mid']} AND status IN (2,3,4) AND is_get = 0 ORDER BY status ASC"); |
|||
if(!empty($mydrawlist)){ |
|||
$mydraw = $mydrawlist[0]; |
|||
$drawgoods = pdo_get('wlmerchant_luckydraw_goods',array('id' => $mydraw['draw_goods_id']),array('title','image')); |
|||
$data['mycodeid'] = $mydraw['id']; |
|||
$data['mycodestatus'] = $mydraw['status']; |
|||
$data['mygoodstitle'] = $drawgoods['title']; |
|||
$data['mygoodslogo'] = tomedia($drawgoods['image']); |
|||
}else{ |
|||
$data['mycodeid'] = 0; |
|||
} |
|||
}else{ |
|||
$mycode = pdo_getall('wlmerchant_luckydraw_drawcode',array('mid' => $_W['mid'],'draw_reid' => $recordid),array('codenum')); |
|||
$data['mycode'] = $mycode; |
|||
$data['mycodenum'] = count($mycode); |
|||
} |
|||
//说明 |
|||
$data['detail'] = htmlspecialchars_decode(base64_decode($drawinfo['detail'])); |
|||
//购买的商品列表 |
|||
$data['buygoodslist'] = Luckydraw::getBuyGoodsList($id,$lat,$lng,1); |
|||
//额外获取抽奖码方式 |
|||
$data['drawvideostatus'] = $drawinfo['drawvideostatus']; |
|||
$data['videoid'] = trim($drawinfo['videoid']); |
|||
$data['drawsharestatus'] = $drawinfo['drawsharestatus']; |
|||
//手机号 |
|||
$mastmobile = unserialize($_W['wlsetting']['userset']['plugin']); |
|||
if (empty($_W['wlmember']['mobile']) && in_array('luckydraw',$mastmobile)){ |
|||
$data['nomobile'] = 1; |
|||
}else{ |
|||
$data['nomobile'] = 0; |
|||
} |
|||
|
|||
$this->renderSuccess('活动页面初始化',$data); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 看视频获取抽奖码 |
|||
* Author: wlf |
|||
* Date: 2021/12/07 22:20 |
|||
*/ |
|||
public function getVideoCode(){ |
|||
global $_GPC, $_W; |
|||
$id = $_GPC['id']; |
|||
$recordid = $_GPC['recordid']; |
|||
if(empty($id) || empty($recordid)){ |
|||
$this->renderError("参数错误,请刷新重试"); |
|||
} |
|||
$drawinfo = pdo_get('wlmerchant_luckydraw',array('id' => $id),['drawvideostatus','videonum','dayvideonum']); |
|||
if($drawinfo['drawvideostatus'] > 0){ |
|||
//判断是否绑定手机号 |
|||
$mobile = pdo_getcolumn(PDO_NAME.'member',array('id'=>$_W['mid']),'mobile'); |
|||
if(empty($mobile)){ |
|||
$this->renderError("未绑定手机号,请绑定手机号再试"); |
|||
} |
|||
if($drawinfo['videonum'] > 0){ |
|||
//查询已获取的抽奖码 |
|||
$allnum = pdo_fetchcolumn('SELECT count(id) FROM '.tablename('wlmerchant_luckydraw_drawcode')." WHERE mid = {$_W['mid']} AND plugin = 'drawvideo' AND draw_reid = {$recordid}"); |
|||
if($allnum > $drawinfo['videonum'] || $allnum == $drawinfo['videonum']){ |
|||
$this->renderError("您已经获取所有激励抽奖码"); |
|||
} |
|||
} |
|||
|
|||
if($drawinfo['dayvideonum'] > 0){ |
|||
//查询已获取的抽奖码 |
|||
$daytime = strtotime(date('Y-m-d')); |
|||
$dayallnum = pdo_fetchcolumn('SELECT count(id) FROM '.tablename('wlmerchant_luckydraw_drawcode')." WHERE mid = {$_W['mid']} AND plugin = 'drawvideo' AND draw_reid = {$recordid} AND createtime > {$daytime} "); |
|||
if($dayallnum > $drawinfo['dayvideonum'] || $dayallnum == $drawinfo['dayvideonum']){ |
|||
$this->renderError("您已获取所有今天的激励抽奖码,请明天再来"); |
|||
} |
|||
} |
|||
|
|||
|
|||
//获取抽奖码 |
|||
$res = Luckydraw::getDrawCode($id,$_W['mid'],0,'drawvideo',0,1,$recordid); |
|||
if($res){ |
|||
$this->renderSuccess('获取抽奖码成功'); |
|||
}else{ |
|||
$this->renderError("获取抽奖码失败,请刷新重试"); |
|||
} |
|||
|
|||
}else{ |
|||
$this->renderError("激励渠道已关闭"); |
|||
} |
|||
|
|||
} |
|||
|
|||
/** |
|||
* Comment: 分享活动获取抽奖码 |
|||
* Author: wlf |
|||
* Date: 2021/12/07 22:41 |
|||
*/ |
|||
public function getShareCode(){ |
|||
global $_GPC, $_W; |
|||
$recordid = $_GPC['recordid']; //抽奖记录id |
|||
$sharemid = $_GPC['sharemid']; //分享人mid |
|||
if(empty($sharemid) || empty($recordid)){ |
|||
$this->renderError("参数错误,请刷新重试"); |
|||
} |
|||
$id = pdo_getcolumn(PDO_NAME.'luckydraw_record',array('id'=>$recordid),'drawid'); |
|||
$drawinfo = pdo_get('wlmerchant_luckydraw',array('id' => $id),['drawsharestatus','sharenum','daysharenum']); |
|||
if($drawinfo['drawsharestatus'] > 0) { |
|||
//判断分享者 |
|||
if(strstr($sharemid,',')){ |
|||
$nono = 1; |
|||
} |
|||
//判断是否绑定手机号 |
|||
$mastmobile = unserialize($_W['wlsetting']['userset']['plugin']); |
|||
if (in_array('luckydraw',$mastmobile)){ |
|||
$mobile = pdo_getcolumn(PDO_NAME.'member',array('id'=>$sharemid),'mobile'); |
|||
if(empty($mobile)){ |
|||
$nono = 1; |
|||
} |
|||
} |
|||
//判断已获取数量 |
|||
if($drawinfo['sharenum'] > 0 && empty($nono)){ |
|||
$allnum = pdo_fetchcolumn('SELECT count(id) FROM '.tablename('wlmerchant_luckydraw_drawcode')." WHERE mid = {$sharemid} AND plugin = 'drawshare' AND draw_reid = {$recordid}"); |
|||
if($allnum > $drawinfo['sharenum'] || $allnum == $drawinfo['sharenum']) { |
|||
$nono = 1; |
|||
} |
|||
} |
|||
if($drawinfo['daysharenum'] > 0 && empty($nono)){ |
|||
//查询已获取的抽奖码 |
|||
$daytime = strtotime(date('Y-m-d')); |
|||
$dayallnum = pdo_fetchcolumn('SELECT count(id) FROM '.tablename('wlmerchant_luckydraw_drawcode')." WHERE mid = {$sharemid} AND plugin = 'drawshare' AND draw_reid = {$recordid} AND createtime > {$daytime} "); |
|||
if($dayallnum > $drawinfo['daysharenum'] || $dayallnum == $drawinfo['daysharenum'] || empty($daytime) ){ |
|||
$nono = 1; |
|||
} |
|||
} |
|||
//判断用户与分享人是否添加过 |
|||
if(empty($nono)){ |
|||
$flag = pdo_getcolumn(PDO_NAME . 'luckydraw_share_record', array('sharemid' => $sharemid, 'mid' => $_W['mid'], 'recordid' => $recordid), 'id'); |
|||
if (empty($flag)) { |
|||
pdo_insert(PDO_NAME . 'luckydraw_share_record', array('sharemid' => $sharemid, 'mid' => $_W['mid'], 'recordid' => $recordid)); |
|||
Luckydraw::getDrawCode($id, $sharemid, 0, 'drawshare', 0, 1, $recordid); |
|||
} |
|||
} |
|||
} |
|||
$this->renderSuccess($nono); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 活动商品列表页面 |
|||
* Author: wlf |
|||
* Date: 2021/12/07 23:14 |
|||
*/ |
|||
public function goodsListInfo(){ |
|||
global $_GPC, $_W; |
|||
$id = $_GPC['id']; //抽奖活动id |
|||
if(empty($id)){ |
|||
$this->renderError("参数错误,请返回重试"); |
|||
} |
|||
$lat = $_GPC['lat']; |
|||
$lng = $_GPC['lng']; |
|||
$data = []; |
|||
$drawinfo = pdo_get('wlmerchant_luckydraw',array('id' => $id),['advarray']); |
|||
//幻灯片 |
|||
$advs = unserialize($drawinfo['advarray']); |
|||
foreach ($advs as &$ad){ |
|||
$ad['thumb'] = tomedia($ad['thumb']); |
|||
} |
|||
$data['adv'] = $advs; |
|||
$data['buygoodslist'] = Luckydraw::getBuyGoodsList($id,$lat,$lng); |
|||
|
|||
|
|||
$this->renderSuccess("商品列表页",$data); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 我的抽奖码列表 |
|||
* Author: wlf |
|||
* Date: 2021/12/07 23:32 |
|||
*/ |
|||
public function getCodeList(){ |
|||
global $_GPC, $_W; |
|||
$page = $_GPC['page'] ? $_GPC['page'] : 1; |
|||
$page_start = $page * 10 - 10; |
|||
$status = $_GPC['status']; //抽奖码状态 1 = 未开奖 2 = 已中奖 3 = 未中奖 |
|||
$whewe = " WHERE uniacid = {$_W['uniacid']} AND mid = {$_W['mid']}"; |
|||
if($status == 1){ |
|||
$whewe .= " AND status = 0"; |
|||
}else if($status == 2){ |
|||
$whewe .= " AND status > 1"; |
|||
}else if($status == 3){ |
|||
$whewe .= " AND status = 1"; |
|||
} |
|||
|
|||
$records = pdo_fetchall("SELECT * FROM " . tablename("wlmerchant_luckydraw_drawcode") . $whewe ." ORDER BY createtime DESC LIMIT {$page_start},10"); |
|||
$allnum = pdo_fetchcolumn('SELECT count(id) FROM ' . tablename('wlmerchant_luckydraw_drawcode') .$whewe); |
|||
$newrecords = []; |
|||
|
|||
if (!empty($records)) { |
|||
foreach ($records as $red){ |
|||
$new = []; |
|||
//构建数组 |
|||
$new['id'] = $red['id']; |
|||
$new['drawid'] = $red['draw_acid']; |
|||
$new['recordid'] = $red['draw_reid']; |
|||
$new['codenum'] = $red['codenum']; |
|||
$new['status'] = $red['status']; |
|||
$new['is_get'] = $red['is_get']; |
|||
$new['plugin'] = $red['plugin']; |
|||
$new['drawname'] = pdo_getcolumn(PDO_NAME.'luckydraw',array('id'=>$red['draw_acid']),'title'); |
|||
if($red['draw_goods_id'] > 0){ |
|||
$goods = pdo_get(PDO_NAME.'luckydraw_goods',array('id' => $red['draw_goods_id']),array('title','image')); |
|||
$new['goodname'] = $goods['title']; |
|||
$new['goodlogo'] = tomedia($goods['image']); |
|||
} |
|||
if($red['token_id'] > 0){ |
|||
$code = pdo_getcolumn(PDO_NAME."token",['id'=>$red['token_id']],'number'); |
|||
$new['code'] = $code['number']; |
|||
} |
|||
|
|||
$newrecords[] = $new; |
|||
} |
|||
} |
|||
$data['list'] = $newrecords; |
|||
$data['pagetotal'] = ceil($allnum / 10); |
|||
|
|||
$this->renderSuccess('抽奖码列表' , $data); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* Comment: 领取奖品 |
|||
* Author: wlf |
|||
* Date: 2021/12/07 23:51 |
|||
*/ |
|||
|
|||
public function getDrawGoods(){ |
|||
global $_GPC, $_W; |
|||
$id = $_GPC['id']; //抽奖码id |
|||
if(empty($id)){ |
|||
$this->renderError("参数错误,请返回重试"); |
|||
} |
|||
$record = pdo_get('wlmerchant_luckydraw_drawcode',array('id' => $id),array('draw_goods_id','is_get','draw_acid','order_no')); |
|||
if($record['is_get'] > 0){ |
|||
$this->renderError("已领取奖品,请勿重复领取!"); |
|||
} |
|||
$drawgoods = pdo_get('wlmerchant_luckydraw_goods',array('id' => $record['draw_goods_id'])); |
|||
//其他信息获取 |
|||
$info = array_merge($record,$drawgoods); |
|||
$info['draw_title'] = pdo_getcolumn(PDO_NAME."luckydraw",['id'=>$record['draw_acid']],'title');//活动标题 |
|||
$info['source'] = $_W['source'] ? : 1;//渠道信息:1=公众号(默认);2=h5;3=小程序 |
|||
|
|||
//生成奖品领取信息 |
|||
try { |
|||
switch (intval($info['type'])) { |
|||
case 1: |
|||
//判断领取方式 领取方式:1=发送现金红包,2=增加到余额 |
|||
if ($info['get_type'] == 1) { |
|||
//订单号生成 |
|||
if (!$info['order_no']) { |
|||
$info['order_no'] = 'LD'.date("YmdHis").random(4,true);//订单号生成 |
|||
pdo_update(PDO_NAME . "luckydraw_drawcode" , ['order_no' => $info['order_no']] , ['id' => $id]); |
|||
} |
|||
//发送现金红包 |
|||
Payment::cashRedPack($info); |
|||
Luckydraw::changeIsGetStatus($id); |
|||
$this->renderSuccess("领取成功"); |
|||
}else { |
|||
//增加到余额 |
|||
$remark = "活动【{$info['draw_title']}】奖品【{$info['title']}】"; |
|||
if (Member::credit_update_credit2($_W['mid'] , $info['prize_number'] , $remark)) { |
|||
Luckydraw::changeIsGetStatus($id); |
|||
$this->renderSuccess("领取成功"); |
|||
} |
|||
} |
|||
break;//现金红包 |
|||
case 2: |
|||
//线上红包领取 |
|||
$res = Redpack::pack_send($_W['mid'] , $info['goods_id'] , 'draw' , $info['source']); |
|||
if ($res['errno'] == 1) { |
|||
throw new Exception($res['message']); |
|||
}else { |
|||
Luckydraw::changeIsGetStatus($id); |
|||
$this->renderSuccess("领取成功"); |
|||
} |
|||
break;//线上红包 |
|||
case 3: |
|||
$remark = "活动【{$info['draw_title']}】奖品【{$info['title']}】"; |
|||
if (Member::credit_update_credit1($_W['mid'] , $info['prize_number'] , $remark)) { |
|||
Luckydraw::changeIsGetStatus($id); |
|||
$this->renderSuccess("领取成功"); |
|||
} |
|||
break;//积分 |
|||
case 4: |
|||
//判断是否已经领取过激活码 |
|||
if ($info['token_id']) { |
|||
$code = pdo_getcolumn(PDO_NAME."token",['id'=>$info['token_id']],'number'); |
|||
|
|||
$this->renderSuccess("领取成功",['code'=>$code]); |
|||
}else { |
|||
//获取一个激活码 |
|||
$codeInfo = Halfcard::getActivationCode($info['code_keyword']); |
|||
if ($codeInfo['errno'] == 1) { |
|||
//记录激活码信息 |
|||
$params = [ |
|||
'token_id' => $codeInfo['id'] , |
|||
'is_get' => 1 ,//修改状态为已领取 但是激活码未使用 |
|||
]; |
|||
pdo_update(PDO_NAME . "luckydraw_drawcode" , $params , ['id' => $id]); |
|||
|
|||
$this->renderSuccess("领取成功",['code'=>$codeInfo['number']]); |
|||
}else { |
|||
throw new Exception($codeInfo['message']); |
|||
} |
|||
} |
|||
break;//激活码 |
|||
case 5: |
|||
$this->renderSuccess("实物商品,请下单",['goodsid' => $info['goods_id'],'plugin' => $info['goods_plugin']]); |
|||
break;//商品 |
|||
} |
|||
}catch (Exception $e){ |
|||
$this->renderError($e->getMessage()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 往期列表 |
|||
* Author: wlf |
|||
* Date: 2021/12/24 15:22 |
|||
*/ |
|||
public function getRecordList(){ |
|||
global $_GPC, $_W; |
|||
$id = $_GPC['id']; //抽奖活动id |
|||
if(empty($id)){ |
|||
$this->renderError("参数错误,请返回重试"); |
|||
} |
|||
//参数获取 |
|||
$page = max(1, intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
//条件筛选 |
|||
$where = array(); |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['aid'] = $_W['aid']; |
|||
$drawid = $id; |
|||
$where['drawid'] = $drawid; |
|||
$draw = pdo_get('wlmerchant_luckydraw',array('id' => $drawid),array('title','oneprizeid')); |
|||
if(empty($draw)){ |
|||
$this->renderError("活动信息错误,请返回重试"); |
|||
} |
|||
$oneprice = pdo_get('wlmerchant_luckydraw_goods',array('id' => $draw['oneprizeid']),array('image')); |
|||
$logo = tomedia($oneprice['image']); |
|||
|
|||
$recordlist = Util::getNumData('id,status,drawtime,issueno','wlmerchant_luckydraw_record',$where,'createtime DESC',$page,$pageIndex,1); |
|||
$list = $recordlist[0]; |
|||
foreach ($list as &$li){ |
|||
$li['drawid'] = $id; |
|||
$li['title'] = $draw['title']; |
|||
$li['logo'] = $logo; |
|||
if($li['drawtime'] > 0 ){ |
|||
$li['drawtime'] = date('Y-m-d H:i',$li['drawtime']); |
|||
} |
|||
} |
|||
$this->renderSuccess('往期列表' , $list); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,468 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
/** |
|||
* Comment: 抽奖活动管理 |
|||
* Author: wlf |
|||
* Class luckydraw_WeliamController |
|||
*/ |
|||
class Luckydraw_WeliamController { |
|||
/** |
|||
* Comment: 获取抽奖活动信息列表 |
|||
* Author: wlf |
|||
* Date: 2021/12/01 11:33 |
|||
*/ |
|||
public function index(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1, intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$title = $_GPC['title'] ? : '';//活动名称 |
|||
$type = intval($_GPC['type']) ? : 0;//奖品类型:1=现金红包,2=线上红包,3=积分,4=激活码,5=商品 |
|||
$status = intval($_GPC['status']) ? : 0;//状态:1=开启,2=关闭 |
|||
//条件生成 |
|||
$where = array(); |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['aid'] = $_W['aid']; |
|||
if($title) $where['title@'] = "%{$title}%"; |
|||
if($type > 0){ |
|||
if($type == 2){ |
|||
$where['drawstatus'] = 0; |
|||
}else{ |
|||
$where['drawstatus'] = $type; |
|||
} |
|||
} |
|||
if($status > 0){ |
|||
if($status == 2){ |
|||
$where['status'] = 0; |
|||
}else{ |
|||
$where['status'] = $type; |
|||
} |
|||
} |
|||
//查询 |
|||
$goodslist = Util::getNumData('*','wlmerchant_luckydraw',$where,'id DESC',$page,$pageIndex,1); |
|||
$pager = $goodslist[1]; |
|||
$list = $goodslist[0]; |
|||
//信息处理 |
|||
foreach ($list as &$li){ |
|||
$li['starttime'] = date('Y-m-d H:i',$li['starttime']); |
|||
$li['endtime'] = date('Y-m-d H:i',$li['endtime']); |
|||
$li['createtime'] = date('Y-m-d H:i',$li['createtime']); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
include wl_template('luckydraw/index'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 编辑抽奖活动 |
|||
* Author: wlf |
|||
* Date: 2021/12/02 11:36 |
|||
*/ |
|||
public function edit(){ |
|||
global $_W,$_GPC; |
|||
$id = $_GPC['id']; |
|||
//获取奖品信息 |
|||
$prizelist = pdo_getall('wlmerchant_luckydraw_goods',array('status' => 1,'uniacid' => $_W['uniacid'],'aid' => $_W['aid']),array('id','title')); |
|||
|
|||
if($id > 0){ |
|||
$draw = pdo_get('wlmerchant_luckydraw',array('id' => $id)); |
|||
$draw['detail'] = htmlspecialchars_decode(base64_decode($draw['detail'])); |
|||
$draw['adv'] = unserialize($draw['advarray']); |
|||
}else{ |
|||
$draw = [ |
|||
'starttime' => time(), |
|||
'endtime' => time() + 86400*30, |
|||
]; |
|||
} |
|||
if($_W['ispost']) { |
|||
$data = $_GPC['draw']; |
|||
$advlogo = $_GPC['advlogo']; |
|||
$advlink = $_GPC['advlink']; |
|||
$advarray = []; |
|||
foreach($advlogo as $dkey => $dle){ |
|||
$dlea['thumb'] = $advlogo[$dkey]; |
|||
$dlea['link'] = $advlink[$dkey]; |
|||
$advarray[] = $dlea; |
|||
} |
|||
$data['advarray'] = serialize($advarray); |
|||
$data['detail'] = base64_encode(htmlspecialchars_decode($data['detail'])); |
|||
$time = $_GPC['time']; |
|||
$data['starttime'] = strtotime($time['start']); |
|||
$data['endtime'] = strtotime($time['end']); |
|||
//一堆的校验和数据规范 (组团数 中奖数 数量规范) |
|||
if(empty($data['oneprizeid'])){ |
|||
wl_message('请设置一等奖奖品!' , referer() , 'error'); |
|||
} |
|||
if(empty($data['oneprizenum'])){ |
|||
wl_message('请设置一等奖中奖人数!' , referer() , 'error'); |
|||
} |
|||
if(empty($data['twoprizenum']) && !empty($data['twoprizeid'])){ |
|||
wl_message('请设置二等奖中奖人数!' , referer() , 'error'); |
|||
} |
|||
if(empty($data['threeprizenum']) && !empty($data['threeprizeid'])){ |
|||
wl_message('请设置三等奖中奖人数!' , referer() , 'error'); |
|||
} |
|||
|
|||
if($data['drawstatus'] > 0){ |
|||
if(empty($data['drawsucnum'])){ |
|||
$data['drawsucnum'] = 1; |
|||
} |
|||
$allprizenum = $data['oneprizenum']; |
|||
if(!empty($data['twoprizeid'])){ |
|||
$allprizenum += $data['twoprizenum']; |
|||
} |
|||
if(!empty($data['threeprizeid'])){ |
|||
$allprizenum += $data['threeprizenum']; |
|||
} |
|||
if($data['drawcodenum'] < $allprizenum){ |
|||
wl_message('组团抽奖码个数不能少于中奖数!' , referer() , 'error'); |
|||
} |
|||
} |
|||
|
|||
if($id > 0){ |
|||
$res = pdo_update('wlmerchant_luckydraw',$data,array('id' => $id)); |
|||
}else{ |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$data['createtime'] = time(); |
|||
|
|||
$res = pdo_insert(PDO_NAME . 'luckydraw', $data); |
|||
} |
|||
if ($res){ |
|||
wl_message('操作成功' , web_url('luckydraw/luckydraw/index') , 'success'); |
|||
} else{ |
|||
wl_message('操作失败,请刷新重试!' , referer() , 'error'); |
|||
} |
|||
} |
|||
include wl_template('luckydraw/edit'); |
|||
} |
|||
|
|||
public function advinfo(){ |
|||
global $_W,$_GPC; |
|||
$kw = $_GPC['kw']; |
|||
include wl_template('luckydraw/advinfo'); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 删除抽奖活动 |
|||
* Author: wlf |
|||
* Date: 2021/12/06 11:24 |
|||
*/ |
|||
public function delete(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = $_GPC['id'] OR show_json(0, '参数错误,请刷新重试!'); |
|||
$mysqlFun = new MysqlFunction(); |
|||
//删除内容 |
|||
$mysqlFun->startTrans(); |
|||
$res = pdo_delete(PDO_NAME."luckydraw",['id'=>$id]); |
|||
//if($res && pdo_count(PDO_NAME."draw_join",['draw_id'=>$id]) > 0) $res = pdo_delete(PDO_NAME."draw_join",['draw_id'=>$id]); |
|||
if ($res) { |
|||
$mysqlFun->commit(); |
|||
show_json(1 , '删除成功'); |
|||
}else { |
|||
$mysqlFun->rollback(); |
|||
show_json(0 , '删除失败,请刷新重试'); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 基础设置 |
|||
* Author: wlf |
|||
* Date: 2021/12/09 16:11 |
|||
*/ |
|||
public function set(){ |
|||
global $_W,$_GPC; |
|||
$settings = Setting::agentsetting_read('luckydraw'); |
|||
if (checksubmit('submit')) { |
|||
$base = $_GPC['set']; |
|||
|
|||
|
|||
Setting::agentsetting_save($base, 'luckydraw'); |
|||
wl_message('更新设置成功!', web_url('luckydraw/luckydraw/set')); |
|||
} |
|||
|
|||
include wl_template("luckydraw/set"); |
|||
|
|||
|
|||
} |
|||
/** |
|||
* Comment: 抽奖码列表 |
|||
* Author: wlf |
|||
* Date: 2021/12/09 21:34 |
|||
*/ |
|||
public function prizeIndex(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1, intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
//条件筛选 |
|||
$where = array(); |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['aid'] = $_W['aid']; |
|||
$status = $_GPC['status']; |
|||
if($status > 0){ |
|||
if($status == 5){ |
|||
$where['status'] = 0; |
|||
}else{ |
|||
$where['status'] = $status; |
|||
} |
|||
} |
|||
$recordid = $_GPC['recordid']; |
|||
if($_GPC['keyword']){ |
|||
$keyword = $_GPC['keyword']; |
|||
if($_GPC['keywordtype'] == 1){ |
|||
$params[':name'] = "%{$keyword}%"; |
|||
$members = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_member')." WHERE uniacid = {$_W['uniacid']} AND nickname LIKE :name",$params); |
|||
if($members){ |
|||
$mids = "("; |
|||
foreach ($members as $key => $v) { |
|||
if($key == 0){ |
|||
$mids.= $v['id']; |
|||
}else{ |
|||
$mids.= ",".$v['id']; |
|||
} |
|||
} |
|||
$mids.= ")"; |
|||
$where['mid#'] = $mids; |
|||
}else{ |
|||
$where['mid'] = 0; |
|||
} |
|||
}else if($_GPC['keywordtype'] == 2){ |
|||
$params[':mobile'] = "%{$keyword}%"; |
|||
$members = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_member')." WHERE uniacid = {$_W['uniacid']} AND mobile LIKE :mobile",$params); |
|||
if($members){ |
|||
$mids = "("; |
|||
foreach ($members as $key => $v) { |
|||
if($key == 0){ |
|||
$mids.= $v['id']; |
|||
}else{ |
|||
$mids.= ",".$v['id']; |
|||
} |
|||
} |
|||
$mids.= ")"; |
|||
$where['mid#'] = $mids; |
|||
}else{ |
|||
$where['mid'] = 0; |
|||
} |
|||
}else if($_GPC['keywordtype'] == 3){ |
|||
$where['codenum@'] = "%{$keyword}%"; |
|||
}else if($_GPC['keywordtype'] == 4){ |
|||
$where['draw_reid'] = $keyword; |
|||
} |
|||
} |
|||
if($_GPC['time_limit']){ |
|||
$time_limit = $_GPC['time_limit']; |
|||
$starttime = strtotime($_GPC['time_limit']['start']); |
|||
$endtime = strtotime($_GPC['time_limit']['end']); |
|||
if($_GPC['timetype'] == 1){ |
|||
$where['drawtime>'] = $starttime; |
|||
$where['drawtime<'] = $endtime+86400; |
|||
}else if($_GPC['timetype'] == 2){ |
|||
$where['gettime>'] = $starttime; |
|||
$where['gettime<'] = $endtime+86400; |
|||
} |
|||
} |
|||
if (empty($starttime) || empty($endtime)) { |
|||
$starttime = strtotime('-1 month'); |
|||
$endtime = time(); |
|||
} |
|||
|
|||
$codelist = Util::getNumData('*','wlmerchant_luckydraw_drawcode',$where,'createtime DESC',$page,$pageIndex,1); |
|||
$pager = $codelist[1]; |
|||
$list = $codelist[0]; |
|||
foreach ($list as $key => &$li) { |
|||
$member = pdo_get('wlmerchant_member',array('id' => $li['mid']),array('avatar','nickname','mobile')); |
|||
$li['avatar'] = tomedia($member['avatar']); |
|||
$li['nickname'] = $member['nickname']; |
|||
$li['mobile'] = $member['mobile']; |
|||
if($li['draw_goods_id'] > 0){ |
|||
$goods = pdo_get('wlmerchant_luckydraw_goods',array('id' => $li['draw_goods_id']),array('title','image')); |
|||
$li['goodslogo'] = tomedia($goods['image']); |
|||
$li['goodsname'] = $goods['title']; |
|||
} |
|||
|
|||
if($li['createtime'] > 0){ |
|||
$li['createtime'] = date('Y-m-d H:i:s',$li['createtime']); |
|||
} |
|||
if($li['gettime'] > 0){ |
|||
$li['gettime'] = date('Y-m-d H:i:s',$li['gettime']); |
|||
} |
|||
if($li['drawtime'] > 0){ |
|||
$li['drawtime'] = date('Y-m-d H:i:s',$li['drawtime']); |
|||
} |
|||
|
|||
switch ($li['plugin']){ |
|||
case 'rush': |
|||
$type = 1; |
|||
$li['pluginname'] = '抢购'; |
|||
break; |
|||
case 'groupon': |
|||
$type = 10; |
|||
$li['pluginname'] = '团购'; |
|||
break; |
|||
case 'wlfightgroup': |
|||
$type = 2; |
|||
$li['pluginname'] = '拼团'; |
|||
break; |
|||
case 'coupon': |
|||
$type = 3; |
|||
$li['pluginname'] = '超级券'; |
|||
break; |
|||
case 'bargain': |
|||
$type = 12; |
|||
$li['pluginname'] = '砍价'; |
|||
break; |
|||
case 'activity': |
|||
$type = 9; |
|||
$li['pluginname'] = '同城活动'; |
|||
break; |
|||
case 'citydelivery': |
|||
$type = 14; |
|||
$li['pluginname'] = '同城配送'; |
|||
break; |
|||
case 'payonline': |
|||
$type = 11; |
|||
$li['pluginname'] = '在线买单'; |
|||
break; |
|||
case 'drawvideo': |
|||
$type = 0; |
|||
$li['pluginname'] = '激励视频'; |
|||
break; |
|||
case 'drawshare': |
|||
$type = 0; |
|||
$li['pluginname'] = '分享好友'; |
|||
break; |
|||
} |
|||
if($li['orderid'] > 0 && $type > 0){ |
|||
$li['url'] = web_url('order/wlOrder/orderdetail',['orderid' => $li['orderid'],'type' => $type]); |
|||
} |
|||
$draw_activity = pdo_get(PDO_NAME.'luckydraw',array('id'=>$li['draw_acid']),['title','twoprizenum','threeprizenum']); |
|||
|
|||
$li['drawtitle'] = $draw_activity['title']; |
|||
$li['twoprizenum'] = $draw_activity['twoprizenum']; |
|||
$li['threeprizenum'] = $draw_activity['threeprizenum']; |
|||
|
|||
} |
|||
|
|||
include wl_template("luckydraw/prizeIndex"); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 活动记录表 |
|||
* Author: wlf |
|||
* Date: 2021/12/09 23:28 |
|||
*/ |
|||
public function recordIndex(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1, intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
//条件筛选 |
|||
$where = array(); |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['aid'] = $_W['aid']; |
|||
$drawid = $_GPC['activityid']; |
|||
|
|||
$where['drawid'] = $drawid; |
|||
$status = $_GPC['status']; |
|||
if($status > 0){ |
|||
if($status == 3){ |
|||
$where['status'] = 0; |
|||
}else{ |
|||
$where['status'] = $status; |
|||
} |
|||
} |
|||
$draw = pdo_get('wlmerchant_luckydraw',array('id' => $drawid),array('title')); |
|||
if(empty($draw)){ |
|||
wl_message('活动id错误!', web_url('luckydraw/luckydraw/index')); |
|||
} |
|||
$recordlist = Util::getNumData('*','wlmerchant_luckydraw_record',$where,'createtime DESC',$page,$pageIndex,1); |
|||
$pager = $recordlist[1]; |
|||
$list = $recordlist[0]; |
|||
|
|||
|
|||
include wl_template("luckydraw/recordIndex"); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* Comment: 活动开奖 |
|||
* Author: wlf |
|||
* Date: 2021/12/09 23:28 |
|||
*/ |
|||
public function drawing(){ |
|||
global $_W,$_GPC; |
|||
$id = $_GPC['id']; |
|||
$mysqlFun = new MysqlFunction(); |
|||
//删除内容 |
|||
$mysqlFun->startTrans(); |
|||
$res = Luckydraw::drawIng($id); |
|||
if ($res) { |
|||
$mysqlFun->commit(); |
|||
show_json(1 , '操作成功'); |
|||
}else { |
|||
$mysqlFun->rollback(); |
|||
show_json(0 , '操作失败,请刷新重试'); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 内定奖励 |
|||
* Author: wlf |
|||
* Date: 2022/01/10 17:45 |
|||
*/ |
|||
public function setPreset(){ |
|||
global $_W,$_GPC; |
|||
$id = $_GPC['id']; |
|||
$preset = $_GPC['preset']; |
|||
$acid = $_GPC['acid']; |
|||
$reid = $_GPC['reid']; |
|||
$activity = pdo_get(PDO_NAME.'luckydraw',array('id'=>$acid),['oneprizenum','twoprizenum','threeprizenum']); |
|||
|
|||
if($preset == 1){ |
|||
$maxnum = $activity['oneprizenum']; |
|||
$tiptext = '一等奖'; |
|||
}else if($preset == 2){ |
|||
$maxnum = $activity['twoprizenum']; |
|||
$tiptext = '二等奖'; |
|||
}else if($preset == 3){ |
|||
$maxnum = $activity['threeprizenum']; |
|||
$tiptext = '三等奖'; |
|||
} |
|||
//查询已内定人数 |
|||
$anum = pdo_fetchcolumn('SELECT count(id) FROM '.tablename('wlmerchant_luckydraw_drawcode')." WHERE draw_reid = {$reid} AND preset = {$preset}"); |
|||
if($anum < $maxnum){ |
|||
$res = pdo_update('wlmerchant_luckydraw_drawcode',array('preset' => $preset),array('id' => $id)); |
|||
}else{ |
|||
show_json(0,'已内定全部'.$maxnum.'位'.$tiptext.'人数'); |
|||
} |
|||
if($res){ |
|||
show_json(1 , '操作成功'); |
|||
}else{ |
|||
show_json(0 , '操作失败,请刷新重试'); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 取消内定 |
|||
* Author: wlf |
|||
* Date: 2022/01/10 17:56 |
|||
*/ |
|||
public function cancelPreset(){ |
|||
global $_W,$_GPC; |
|||
$id = $_GPC['id']; |
|||
$res = pdo_update('wlmerchant_luckydraw_drawcode',array('preset' => 0),array('id' => $id)); |
|||
if($res){ |
|||
show_json(1 , '操作成功'); |
|||
}else{ |
|||
show_json(0 , '操作失败,请刷新重试'); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,114 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
/** |
|||
* Comment: 奖品管理 |
|||
* Author: wlf |
|||
* Class Luckygoods_WeliamController |
|||
*/ |
|||
class Luckygoods_WeliamController { |
|||
/** |
|||
* Comment: 获取奖品信息列表 |
|||
* Author: wlf |
|||
* Date: 2021/12/01 11:40 |
|||
*/ |
|||
public function goodsIndex(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1, intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$title = $_GPC['title'] ? : '';//奖品名称 |
|||
$type = intval($_GPC['type']) ? : 0;//奖品类型:1=现金红包,2=线上红包,3=积分,4=激活码,5=商品 |
|||
$status = intval($_GPC['status']) ? : 0;//状态:1=开启,2=关闭 |
|||
//条件生成 |
|||
$where = array(); |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['aid'] = $_W['aid']; |
|||
if($title) $where['title@'] = "%{$title}%"; |
|||
if($type > 0) $where['type'] = $type; |
|||
if($status > 0) $where['status'] = $status; |
|||
//查询 |
|||
$goodslist = Util::getNumData('*','wlmerchant_luckydraw_goods',$where,'id DESC',$page,$pageIndex,1); |
|||
$pager = $goodslist[1]; |
|||
$list = $goodslist[0]; |
|||
//信息处理 |
|||
|
|||
|
|||
include wl_template('luckygoods/index'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 编辑奖品信息 |
|||
* Author: wlf |
|||
* Date: 2021/12/01 11:46 |
|||
*/ |
|||
public function goodsEdit(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = intval($_GPC['id']); |
|||
if($_W['ispost']){ |
|||
//处理修改后的信息 |
|||
$data = $_GPC['data']; |
|||
//判断是否存在对应类型的必须条件 |
|||
if ($data['type'] == 1 && ($data['prize_number'] <= 0 || !$data['prize_number'])) wl_message('请填写红包金额!' , referer() , 'error'); |
|||
if ($data['type'] == 2 && !$data['red_pack_id']) wl_message('请选择红包!' , referer() , 'error'); |
|||
if ($data['type'] == 3 && ($data['prize_number'] <= 0 || !$data['prize_number'])) wl_message('请填写积分数量!' , referer() , 'error'); |
|||
if ($data['type'] == 4 && !$data['code_keyword']) wl_message('请选择一个激活码序列!' , referer() , 'error'); |
|||
if ($data['type'] == 5 && !$data['goods_id']) wl_message('请选择一个商品!' , referer() , 'error'); |
|||
if (!$data['image']) wl_message('请上传奖品logo!' , referer() , 'error'); |
|||
//判断是否已经存在同名称的奖品 |
|||
$isHave = pdo_get(PDO_NAME . "luckydraw_goods" , ['title' => $data['title'],'id <>'=>$id,'uniacid' => $_W['uniacid']]); |
|||
if ($isHave) wl_message('已存在同名称奖品!' , referer() , 'error'); |
|||
//奖品类型为线上红包时 修改字段内容信息 |
|||
if ($data['type'] == 2) { |
|||
$data['goods_id'] = $data['red_pack_id']; |
|||
$data['goods_plugin'] = 'red_pack'; |
|||
} |
|||
//删除多余信息字段 |
|||
unset($data['red_pack_name']); |
|||
unset($data['red_pack_id']); |
|||
unset($data['goods_name']); |
|||
//添加内容 |
|||
if($id > 0){ |
|||
$res = pdo_update(PDO_NAME . "luckydraw_goods" , $data,['id'=>$id]); |
|||
}else{ |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$data['create_time'] = time(); |
|||
$res = pdo_insert(PDO_NAME . 'luckydraw_goods', $data); |
|||
} |
|||
if ($res) wl_message('操作成功' , web_url('luckydraw/luckygoods/goodsIndex') , 'success'); |
|||
else wl_message('操作失败,请刷新重试!' , referer() , 'error'); |
|||
} |
|||
//进入修改页面 获取当前奖品的基本信息 |
|||
if($id > 0 ){ |
|||
$info = Luckydraw::prizeInfo($id); |
|||
}else{ |
|||
$info = [ |
|||
'type' => 1 |
|||
]; |
|||
} |
|||
//获取激活码分组信息 |
|||
$codeList = Halfcard::getGroupList(); |
|||
|
|||
|
|||
include wl_template('luckygoods/edit'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 删除奖品信息 |
|||
* Author: wlf |
|||
* Date: 2021/12/01 16:51 |
|||
*/ |
|||
public function delete(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$ids = $_GPC['ids'] OR show_json(0, '参数错误,请刷新重试!'); |
|||
//删除内容 |
|||
$res = pdo_delete(PDO_NAME."luckydraw_goods",['id IN'=>$ids]); |
|||
if($res) show_json(1, '删除成功'); |
|||
else show_json(0, '删除失败,请刷新重试'); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
<div class="adv removedav"> |
|||
<div class="form-group" style="margin-bottom:10px;"> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group" style="margin: 0;"> |
|||
<div class="input-group-addon" style="padding: 3px;"> |
|||
<input type="hidden" name="advlogo[]" value="{$adv['thumb']}" id="advlogo_{$kw}" > |
|||
<img {if $adv['thumb']} src="{php echo tomedia($adv['thumb'])}" {else} src="{URL_MODULE}web/resource/image/store.png" {/if} id="pimg_{$kw}" style="height:25px;width:25px;cursor: pointer" data-toggle="selectAttachment" data-input="#advlogo_{$kw}" data-img="#pimg_{$kw}"> |
|||
</div> |
|||
<input type="text" name="advlink[]" class="form-control" value="{$adv['link']}" readonly="readonly" placeholder="" id="advlink_{$kw}"> |
|||
<span data-input="#advlink_{$kw}" data-toggle="selectUrl" class="input-group-addon btn btn-default">选择链接</span> |
|||
<span onclick="removes(this)" class="input-group-addon btn btn-default clearinput">X</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,292 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
red{color: #ed5565;} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">活动信息</a></li> |
|||
<li><a href="#tab_prize">奖品设置</a></li> |
|||
<li><a href="#tab_share">分享设置</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="form-group-title">活动信息</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>活动名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="draw[title]" maxlength="16" class="form-control" value="{$draw['title']}" placeholder="请输入抽奖活动名称" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">开奖类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('#drawstatusdiv').hide();$('#drawstatus0div').show();" > |
|||
<input type="radio" name="draw[drawstatus]" value="0" {if empty($draw['drawstatus']) || $draw['drawstatus'] == 0}checked{/if}> 定时开奖 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#drawstatusdiv').show();;$('#drawstatus0div').hide();" > |
|||
<input type="radio" name="draw[drawstatus]" value="1" {if $draw['drawstatus'] == 1} checked{/if}> 组团开奖 |
|||
</label> |
|||
<span class="help-block">定时开奖:在活动时间结束时开奖;组团开奖:当抽奖码达到一定数量时就会开奖。</span> |
|||
</div> |
|||
</div> |
|||
<div id="drawstatus0div" {if $draw['drawstatus'] == 1} style="display: none" {/if} > |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">活动时间</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_select_time_info('time', array('starttime'=>date('Y-m-d H:i:s', $draw['starttime']),'endtime'=>date('Y-m-d H:i:s', $draw['endtime'])));} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div id="drawstatusdiv" {if empty($draw['drawstatus']) || $draw['drawstatus'] == 0} style="display: none" {/if} > |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>组团抽奖码个数</label> |
|||
<div class="col-sm-9"> |
|||
<input type="number" name="draw[drawcodenum]" maxlength="16" class="form-control" value="{$draw['drawcodenum']}" placeholder="请输入抽奖团抽奖码个数" required> |
|||
<span class="help-block">组团抽奖码个数不能小于中奖名额数量,请填入正整数。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">开奖次数</label> |
|||
<div class="col-sm-9"> |
|||
<input type="number" name="draw[drawsucnum]" maxlength="16" class="form-control" value="{$draw['drawsucnum']}" placeholder="请输入开奖次数" required> |
|||
<span class="help-block">抽奖活动的开奖次数,请填入正整数,填0即在活动时间内每次组团成功都进行开奖。</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">开奖方式</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="draw[drawtype]" value="0" {if empty($draw['drawtype']) || $draw['drawtype'] == 0}checked{/if}> 自动开奖 |
|||
</label> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="draw[drawtype]" value="1" {if $draw['drawtype'] == 1} checked{/if}> 手动开奖 |
|||
</label> |
|||
<span class="help-block">自动开奖:在达成开奖条件时系统自动开奖;手动开奖:需要管理员在后台手动开奖。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">视频广告赠码</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('#drawvideodiv').show();" > |
|||
<input type="radio" name="draw[drawvideostatus]" value="1" {if $draw['drawvideostatus'] == 1} checked{/if}> 开启 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#drawvideodiv').hide();" > |
|||
<input type="radio" name="draw[drawvideostatus]" value="0" {if empty($draw['drawvideostatus']) || $draw['drawvideostatus'] == 0}checked{/if}> 关闭 |
|||
</label> |
|||
<span class="help-block">开启后,用户可以通过观看视频广告获取抽奖码,每观看一次获取一个抽奖码。</span> |
|||
</div> |
|||
</div> |
|||
<div id="drawvideodiv" {if empty($draw['drawvideostatus']) || $draw['drawvideostatus'] == 0} style="display: none" {/if}> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">视频广告设置</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">广告ID</span> |
|||
<input type="text" name="draw[videoid]" class="form-control" value="{$draw['videoid']}" /> |
|||
<span class="input-group-addon">可获得抽奖码总数</span> |
|||
<input type="number" name="draw[videonum]" class="form-control" min="0" value="{$draw['videonum']}" /> |
|||
<span class="input-group-addon">个,每日数量</span> |
|||
<input type="number" name="draw[dayvideonum]" class="form-control" min="0" value="{$draw['dayvideonum']}" /> |
|||
<span class="input-group-addon">个</span> |
|||
</div> |
|||
<span class="help-block">仅小程序可用,可获得抽奖码数量不填或填0则不限制获取数量。</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享活动赠码</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('#drawsharediv').show();" > |
|||
<input type="radio" name="draw[drawsharestatus]" value="1" {if $draw['drawsharestatus'] == 1} checked{/if}> 开启 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#drawsharediv').hide();" > |
|||
<input type="radio" name="draw[drawsharestatus]" value="0" {if empty($draw['drawsharestatus']) || $draw['drawsharestatus'] == 0}checked{/if}> 关闭 |
|||
</label> |
|||
<span class="help-block">开启后,用户可以通过分享抽奖活动获取抽奖码,每分享一次获取一个抽奖码。</span> |
|||
</div> |
|||
</div> |
|||
<div id="drawsharediv" {if empty($draw['drawsharestatus']) || $draw['drawsharestatus'] == 0} style="display: none" {/if}> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享可获得抽奖码数量</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" name="draw[sharenum]" class="form-control" min="0" value="{$draw['sharenum']}" /> |
|||
<span class="input-group-addon">个,每日数量</span> |
|||
<input type="number" name="draw[daysharenum]" class="form-control" min="0" value="{$draw['daysharenum']}" /> |
|||
<span class="input-group-addon">个</span> |
|||
</div> |
|||
<span class="help-block">可获得抽奖码数量不填或填0则不限制获取数量。</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">活动幻灯片</label> |
|||
<div class="col-sm-9"> |
|||
<div id="datas"> |
|||
{loop $draw['adv'] $kw $adv} |
|||
{php include wl_template('luckydraw/advinfo');} |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<a class="btn btn-info btn-add-type" href="javascript:;" onclick="addType();"> |
|||
<i class="fa fa-plus" title=""></i>增加一张幻灯片 |
|||
</a> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">抽奖说明</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('draw[detail]',$draw['detail']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">活动状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="draw[status]" value="1" {if $draw['status'] == 1} checked{/if}> 开启 |
|||
</label> |
|||
<label class="radio-inline" > |
|||
<input type="radio" name="draw[status]" value="0" {if empty($draw['status']) || $draw['status'] == 0}checked{/if}> 关闭 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_prize"> |
|||
<div class="form-group-title">奖品设置</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">一等奖</label> |
|||
<div class="col-sm-9"> |
|||
<select name="draw[oneprizeid]" class="form-control"> |
|||
<option value="0">- 无 -</option> |
|||
{loop $prizelist $one} |
|||
<option value="{$one['id']}" {if $draw['oneprizeid'] == $one['id']}selected="selected"{/if}>{$one['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block">一等奖必须设置。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">二等奖</label> |
|||
<div class="col-sm-9"> |
|||
<select name="draw[twoprizeid]" class="form-control"> |
|||
<option value="0">- 无 -</option> |
|||
{loop $prizelist $two} |
|||
<option value="{$two['id']}" {if $draw['twoprizeid'] == $two['id']}selected="selected"{/if}>{$two['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block">二等奖可以不进行设置。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">三等奖</label> |
|||
<div class="col-sm-9"> |
|||
<select name="draw[threeprizeid]" class="form-control"> |
|||
<option value="0">- 无 -</option> |
|||
{loop $prizelist $three} |
|||
<option value="{$three['id']}" {if $draw['threeprizeid'] == $three['id']}selected="selected"{/if}>{$three['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block">三等奖可以不进行设置。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">中奖人数设置</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">一等奖</span> |
|||
<input type="number" name="draw[oneprizenum]" class="form-control" value="{$draw['oneprizenum']}" /> |
|||
<span class="input-group-addon">二等奖</span> |
|||
<input type="number" name="draw[twoprizenum]" class="form-control" value="{$draw['twoprizenum']}" /> |
|||
<span class="input-group-addon">三等奖</span> |
|||
<input type="number" name="draw[threeprizenum]" class="form-control" value="{$draw['threeprizenum']}" /> |
|||
</div> |
|||
<span class="help-block">已设置奖品的奖项必须设置中奖人数。</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="tab-pane" id="tab_share"> |
|||
<div class="alert alert-info"> |
|||
<b>适用模板变量:[昵称] [时间] [活动名称] [系统名称] </b> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">公众号分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('draw[share_image]', $draw['share_image']);} |
|||
<span class="help-block">大小2M以下,建议尺寸500*500,如果不选择,默认为系统图片</span> |
|||
</div> |
|||
</div> |
|||
{if p('wxapp')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">小程序分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('draw[share_wxapp_image]', $draw['share_wxapp_image']);} |
|||
<span class="help-block">大小2M以下,建议尺寸500*400,如果不选择,默认为系统图片</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="draw[share_title]" class="form-control" value="{$draw['share_title']}" /> |
|||
<span class="help-block">如果不填写,默认为活动名称</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="draw[share_desc]" class="form-control" value="{$draw['share_desc']}" /> |
|||
<span class="help-block">如果不填写,默认为系统描述</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 提交按钮 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="id" value="{$draw['id']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$(function () { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function (e) { |
|||
e.preventDefault();//阻止a链接的跳转行为 |
|||
$(this).tab('show');//显示当前选中的链接及关联的content |
|||
}); |
|||
}); |
|||
|
|||
var kw = 100; |
|||
function addType() { |
|||
$(".btn-add-type").button("loading"); |
|||
$.ajax({ |
|||
url: "{php echo web_url('luckydraw/luckydraw/advinfo')}&kw="+kw, |
|||
cache: false |
|||
}).done(function (html) { |
|||
$(".btn-add-type").button("reset"); |
|||
$("#datas").append(html); |
|||
}); |
|||
kw++; |
|||
} |
|||
|
|||
function removes(asd){ |
|||
$(asd).closest('.removedav').remove(); |
|||
} |
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,125 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">活动列表</a></li> |
|||
</ul> |
|||
<!-- 直播间信息列表 --> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('luckydraw/luckydraw/edit')}" class="btn btn-primary">添加活动</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="luckydraw" /> |
|||
<input type="hidden" name="ac" value="luckydraw" /> |
|||
<input type="hidden" name="do" value="index" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">活动名称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="title" value="{$title}" placeholder="请输入活动名称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">开奖类型</label> |
|||
<div class="col-sm-9"> |
|||
<select name="type" class="form-control"> |
|||
<option value="0" {if $type == 0}selected{/if}>全部</option> |
|||
<option value="2" {if $type == 2}selected{/if}>定时开奖</option> |
|||
<option value="1" {if $type == 1}selected{/if}>组图开奖</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<select name="status" class="form-control"> |
|||
<option value="0" {if $status == 0}selected{/if}>全部</option> |
|||
<option value="1" {if $status == 1}selected{/if}>已开启</option> |
|||
<option value="2" {if $status == 2}selected{/if}>禁用中</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('luckydraw/luckydraw/index')}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">活动主题</th> |
|||
<th class="text-center">活动类型</th> |
|||
<th class="text-center">状态</th> |
|||
<th class="text-center">活动内容</th> |
|||
<th class="text-center">创建时间</th> |
|||
<th class="text-center">奖品数量</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr class="text-center"> |
|||
<td>{$item['title']}</td> |
|||
<td> |
|||
{if $item['drawstatus'] == 1} |
|||
<label class="label label-info">组团开奖</label> |
|||
{else} |
|||
<label class="label label-danger">定时开奖</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
|
|||
{if $item['status'] == 1} |
|||
<label class="label label-primary">使用中</label> |
|||
{else} |
|||
<label class="label label-danger">未开启</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['drawstatus'] == 1} |
|||
成团数量:{$item['drawcodenum']}个<br /> |
|||
成团次数:{$item['drawsucnum']}次 |
|||
{else} |
|||
开始时间:{$item['starttime']}<br /> |
|||
结束时间:{$item['endtime']} |
|||
{/if} |
|||
</td> |
|||
<td>{$item['createtime']}</td> |
|||
<td> |
|||
一等奖:{$item['oneprizenum']}个 |
|||
{if !empty($item['twoprizeid'])} <br/> 二等奖:{$item['twoprizenum']}个 {/if} |
|||
{if !empty($item['threeprizeid'])} <br/> 三等奖:{$item['threeprizenum']}个 {/if} |
|||
</td> |
|||
<td> |
|||
{if p('wxplatform')} |
|||
<a class="btn btn-info btn-sm js-clip" data-url="{php echo h5_url('pages/subPages2/lottery/lotteryIndex/lotteryIndex',['id'=>$item['id']]);}" href="javascript:;">复制链接</a> |
|||
{/if} |
|||
{if p('wxapp')} |
|||
<a class="btn btn-default btn-sm js-clip" data-url="pages/subPages2/lottery/lotteryIndex/lotteryIndex?id={$item['id']}" href="javascript:;">复制路径</a> |
|||
{/if} |
|||
<a class="btn btn-sm btn-success" target='_blank' href="{php echo web_url('luckydraw/luckydraw/recordIndex',['activityid'=>$item['id']]);}">活动记录</a> |
|||
<a class="btn btn-sm btn-warning" href="{php echo web_url('luckydraw/luckydraw/edit',['id'=>$item['id']]);}">编辑</a> |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('luckydraw/luckydraw/delete',['id'=>$item['id']]);}" data-confirm="抽奖活动是重要信息,请勿轻易删除,确认删除此抽奖活动?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"></div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,184 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
td.goods-info{position:relative;padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%;margin-top:-25px;background: url({IMAGE_LOADING} |
|||
) center center no-repeat;width:50px;height:50px;} |
|||
.goods-info span{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.status-text{cursor:pointer;} |
|||
.col-md-1{padding-right: 0px;} |
|||
.all-tips{margin-left: 65px;} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">活动列表</a></li> |
|||
</ul> |
|||
<!-- 直播间信息列表 --> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="luckydraw" /> |
|||
<input type="hidden" name="ac" value="luckydraw" /> |
|||
<input type="hidden" name="do" value="prizeIndex" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">中奖等级</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:');}" class="btn {if $status == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('status:5');}" class="btn {if $status == 5}btn-primary{else}btn-default{/if}">未开奖</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $status == 1}btn-primary{else}btn-default{/if}">未中奖</a> |
|||
<a href="{php echo wl_filter_url('status:2');}" class="btn {if $status == 2}btn-primary{else}btn-default{/if}">一等奖</a> |
|||
<a href="{php echo wl_filter_url('status:3');}" class="btn {if $status == 3}btn-primary{else}btn-default{/if}">二等奖</a> |
|||
<a href="{php echo wl_filter_url('status:4');}" class="btn {if $status == 4}btn-primary{else}btn-default{/if}">三等奖</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group form-inline"> |
|||
<label class="col-sm-2 control-label">筛选条件</label> |
|||
<div class="col-sm-9"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>用户昵称</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>用户电话</option> |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>抽奖码</option> |
|||
<option value="4" {if $_GPC['keywordtype']==4}selected="selected"{/if}>抽奖记录id</option> |
|||
|
|||
</select> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">时间筛选</label> |
|||
<div class="col-md-3"> |
|||
<select name="timetype" class="form-control"> |
|||
<option value="">请选择时间类型</option> |
|||
<option value="1" {if $_GPC['timetype']==1}selected="selected"{/if}>中奖时间</option> |
|||
<option value="2" {if $_GPC['timetype']==2}selected="selected"{/if}>领奖时间</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-2"> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d H:i',$starttime), 'endtime' => date('Y-m-d H:i', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="recordid" value="{$recordid}" /> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">活动主题</th> |
|||
<th class="text-center">中奖奖品</th> |
|||
<th class="">抽奖人</th> |
|||
<th class="text-center">抽奖码</th> |
|||
<th class="text-center">抽奖码来源</th> |
|||
<th class="text-center">获取/中奖时间</th> |
|||
<th class="text-center">领奖时间</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $de} |
|||
<tr> |
|||
<td class="text-center">{$de['drawtitle']}</td> |
|||
<td class="text-center"> |
|||
{if $de['draw_goods_id'] > 0} |
|||
<img src="{$de['goodslogo']}" style="width: 30px;height: 30px;"> |
|||
{$de['goodsname']} |
|||
{else} |
|||
- 无 - |
|||
{/if} |
|||
</td> |
|||
<td class="goods-info"> |
|||
<div class="img"><img src="{$de['avatar']}" height="50" width="50" ></div> |
|||
<div class="all-tips"> |
|||
<span class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;">{$de['nickname']}</span> |
|||
<span class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;">{$de['mobile']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center"> |
|||
{$de['codenum']}<br/><br/> |
|||
{if $de['status'] == 2} |
|||
<span class="label label-success">一等奖</span> |
|||
{else if $de['status'] == 3} |
|||
<span class="label label-danger">二等奖</span> |
|||
{else if $de['status'] == 4} |
|||
<span class="label label-warning">三等奖</span> |
|||
{else if $de['status'] == 0} |
|||
<span class="label label-info">未开奖</span> |
|||
{else if $de['status'] == 1} |
|||
<span class="label label-default">未中奖</span> |
|||
{/if} |
|||
{if $de['preset'] == 1} |
|||
<span class="label label-success">内定一等奖</span> |
|||
{else if $de['preset'] == 2} |
|||
<span class="label label-danger">内定二等奖</span> |
|||
{else if $de['preset'] == 3} |
|||
<span class="label label-warning">内定三等奖</span> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center">{$de['pluginname']}</td> |
|||
<td class="text-center"> |
|||
{$de['createtime']} |
|||
<br/> |
|||
{if $de['drawtime']} |
|||
{$de['drawtime']} |
|||
{else} |
|||
- 无 - |
|||
{/if} |
|||
</td> |
|||
<td class="text-center"> |
|||
{if $de['gettime']} |
|||
{$de['gettime']} |
|||
{else} |
|||
- 无 - |
|||
{/if} |
|||
</td> |
|||
<td class="text-center"> |
|||
{if !empty($de['url'])} |
|||
<p style="color: #428bca;display: inline-block;"> |
|||
<a href="{$de['url']}" target='_blank' >查看订单</a> |
|||
</p> |
|||
{/if} |
|||
{if $de['status'] == 0} |
|||
{if $de['preset'] > 0} |
|||
<a href="{php echo web_url('luckydraw/luckydraw/cancelPreset',array('id'=>$de['id']))}" data-toggle="ajaxRemove" data-confirm="确定取消此抽奖码的内定中奖?"> - 取消内定</a> |
|||
{else if empty(Customized::init('priest735')) } |
|||
<a href="{php echo web_url('luckydraw/luckydraw/setPreset',array('id'=>$de['id'],'reid' => $de['draw_reid'],'acid' => $de['draw_acid'],'preset' => 1))}" data-toggle="ajaxRemove" data-confirm="确定将此抽奖码内定为一等奖?"> - 内定一等奖</a> |
|||
{if $de['twoprizenum'] > 0} |
|||
<a href="{php echo web_url('luckydraw/luckydraw/setPreset',array('id'=>$de['id'],'reid' => $de['draw_reid'],'acid' => $de['draw_acid'],'preset' => 2))}" data-toggle="ajaxRemove" data-confirm="确定将此抽奖码内定为二等奖?"> - 内定二等奖</a> |
|||
{/if} |
|||
{if $de['threeprizenum'] > 0} |
|||
<a href="{php echo web_url('luckydraw/luckydraw/setPreset',array('id'=>$de['id'],'reid' => $de['draw_reid'],'acid' => $de['draw_acid'],'preset' => 3))}" data-toggle="ajaxRemove" data-confirm="确定将此抽奖码内定为三等奖?"> - 内定三等奖</a> |
|||
{/if} |
|||
{/if} |
|||
{/if} |
|||
{if empty($de['url']) && $de['status'] > 0} |
|||
- 无 - |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,102 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">活动列表</a></li> |
|||
</ul> |
|||
<!-- 直播间信息列表 --> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="luckydraw" /> |
|||
<input type="hidden" name="ac" value="luckydraw" /> |
|||
<input type="hidden" name="do" value="recordIndex" /> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">抽奖活动</label> |
|||
<div class="col-sm-9"> |
|||
{$draw['title']}(ID:{$drawid}) |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if $status == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('status:3');}" class="btn {if $status == 3}btn-primary{else}btn-default{/if}">未开奖</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $status == 1}btn-primary{else}btn-default{/if}">待开奖</a> |
|||
<a href="{php echo wl_filter_url('status:2');}" class="btn {if $status == 2}btn-primary{else}btn-default{/if}">已开奖</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">记录id</th> |
|||
<th class="text-center">开始时间</th> |
|||
<th class="text-center">开奖条件</th> |
|||
<th class="text-center">开奖时间</th> |
|||
<th class="text-center">记录状态</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $de} |
|||
<tr> |
|||
<td class="text-center">{$de['id']}</td> |
|||
<td class="text-center">{php echo date('Y-m-d H:i',$de['createtime'])}</td> |
|||
<td class="text-center"> |
|||
{if $de['drawstatus'] > 0} |
|||
抽奖码{$de['drawcodenum']}个,还差{$de['lacknum']}个 |
|||
{else} |
|||
时间:{php echo date('Y-m-d H:i',$de['endtime'])} |
|||
{/if} |
|||
</td> |
|||
<td class="text-center"> |
|||
{if $de['drawtime'] > 0} |
|||
{php echo date('Y-m-d H:i',$de['drawtime'])} |
|||
{else} |
|||
<span class="label label-default">未开奖</span> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center"> |
|||
{if $de['status'] == 0} |
|||
<span class="label label-default">未开奖</span> |
|||
{else if $de['status'] == 1} |
|||
<span class="label label-warning">待开奖</span> |
|||
{else if $de['status'] == 2} |
|||
<span class="label label-success">已开奖</span> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center"> |
|||
{if $de['status'] == 1} |
|||
<a href="{php echo web_url('luckydraw/luckydraw/drawing', array('id'=>$de['id']))}" data-toggle="ajaxRemove" data-confirm="确定开奖此条活动记录吗?">开奖 - </a> |
|||
{/if} |
|||
{if p('wxplatform')} |
|||
<a class="js-clip" data-url="{php echo h5_url('pages/subPages2/lottery/lotteryIndex/lotteryIndex',['id' => $de['drawid'],'recordid'=>$de['id']]);}" href="javascript:;">复制链接 -</a> |
|||
{/if} |
|||
{if p('wxapp')} |
|||
<a class="js-clip" data-url="pages/subPages2/coursegoods/coursegoods?id={$de['drawid']}&recordid={$de['id']}" href="javascript:;">复制路径 -</a> |
|||
{/if} |
|||
<a href="{php echo web_url('luckydraw/luckydraw/prizeIndex', array('keyword'=>$de['id'],'keywordtype'=>4))}">查看抽奖码</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"></div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,72 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">基础设置</a></li> |
|||
<!-- <li ><a href="#tab_share">分享设置</a></li>--> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">锦鲤抽奖设置</div> |
|||
<div class="panel-body"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">抽奖开关</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="set[status]" {if $settings['status']==1} checked {/if}>开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="set[status]" {if $settings['status']==0 || empty($settings) } checked {/if}>关闭 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">抽奖声明</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="set[statement]" placeholder="请输入抽奖声明声明" class="form-control" value="{$settings['statement']}" /> |
|||
<span class="help-block">默认内容为:100%开奖·绝对公平公正·快来加入吧。</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
function divhs(flag){ |
|||
if(flag == 1){ |
|||
$('.sljdiv').show(); |
|||
}else if(flag == 0){ |
|||
$('.sljdiv').hide(); |
|||
} |
|||
} |
|||
|
|||
function disdiv(flag){ |
|||
if(flag == 1){ |
|||
$('.disdiv').show(); |
|||
}else if(flag == 0){ |
|||
$('.disdiv').hide(); |
|||
} |
|||
} |
|||
|
|||
$(function() { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function(e) { |
|||
e.preventDefault(); //阻止a链接的跳转行为 |
|||
$(this).tab('show'); //显示当前选中的链接及关联的content |
|||
}) |
|||
}); |
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,187 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
red{color: #ed5565;} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('luckydraw/luckygoods/goodsIndex')}">奖品列表</a></li> |
|||
<li class="active"><a href="javascript:;">编辑奖品</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<div class="form-group-title">奖品类型</div> |
|||
<!-- 奖品类型 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="1" {if $info['type'] == 1}checked="checked"{/if}> 现金红包 |
|||
</label> |
|||
{if p('redpack') && j('redpack')} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="2" {if $info['type'] == 2}checked="checked"{/if}> 线上红包 |
|||
</label> |
|||
{/if} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="3" {if $info['type'] == 3}checked="checked"{/if}> 积分 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="4" {if $info['type'] == 4}checked="checked"{/if}> 激活码 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[type]" value="5" {if $info['type'] == 5}checked="checked"{/if}> 商品 |
|||
</label> |
|||
<div class="help-block"> |
|||
<span class="type-class type-red {if $info['type'] != 1}hide{/if}">中奖后将获得对应的<red>现金</red>奖励;请填写1-200之间的数据,否则红包会发送失败!</span> |
|||
<span class="type-class type-onlineRed {if $info['type'] != 2}hide{/if}">中奖后将获得一个对应的线上红包</span> |
|||
<span class="type-class type-integral {if $info['type'] != 3}hide{/if}">中奖后将获得对应的积分奖励</span> |
|||
<span class="type-class type-code {if $info['type'] != 4}hide{/if}">中奖后将获得对应序列的一个激活码</span> |
|||
<span class="type-class type-goods {if $info['type'] != 5}hide{/if}">中奖后将<red>免费</red>获得对应的商品,多规格商品不能作为奖品。</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为现金红包时 扩展内容 --> |
|||
<div class="type-class type-red {if $info['type'] != 1}hide{/if}"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">领取方式</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[get_type]" value="1" {if $info['get_type'] == 1}checked="checked"{/if}> 发送现金红包 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[get_type]" value="2" {if $info['get_type'] == 2}checked="checked"{/if}> 增加到余额 |
|||
</label> |
|||
<div class="help-block">注意:选择发送现金红包时;请保证微信商户中余额充足!</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">红包金额</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" id="redPackageMoney" name="data[prize_number]" value="{$info['prize_number']}"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为线上红包时 扩展内容 --> |
|||
<div class="type-class type-onlineRed {if $info['type'] != 2}hide{/if}"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">选择红包</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_select_redPack($info['red_pack_name'],$info['red_pack_id']);} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为积分时 扩展内容 --> |
|||
<div class="type-class type-integral {if $info['type'] != 3}hide{/if}"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖励积分</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="number" name="data[prize_number]" value="{$info['prize_number']}"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为激活码时 扩展内容 --> |
|||
<div class="type-class type-code {if $info['type'] != 4}hide{/if}"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">激活码(组)</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[code_keyword]" class="form-control"> |
|||
<option value="" selected>请选择一个激活码序列</option> |
|||
{loop $codeList $vo} |
|||
<option value="{$vo['remark']}" {if $info['code_keyword'] == $vo['remark']}selected{/if}>{$vo['remark']}({$vo['total']}份)</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 奖品类型为商品时 扩展内容 --> |
|||
<div class="type-class type-goods {if $info['type'] != 5}hide{/if}"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">选择商品</label> |
|||
<div class="col-sm-9 selectGoodsParams" params='{"is_optionstatus":1}'> |
|||
{php echo tpl_select_goods($info);} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 公共设置内容 --> |
|||
<div class="form-group-title">基本设置</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[status]" value="1" {if $info['status'] == 1}checked="checked"{/if}> 上架 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[status]" value="2" {if $info['status'] != 1}checked="checked"{/if}> 下架 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品名称</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" required name="data[title]" value="{$info['title']}" maxlength="25"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品logo</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[image]', $info['image']);} |
|||
</div> |
|||
</div> |
|||
<!-- 提交按钮 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="id" value="{$info['id']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 点击更换类型 |
|||
*/ |
|||
$("[name='data[type]']").on('click',function () { |
|||
//隐藏所有内容 |
|||
$(".type-class").addClass('hide'); |
|||
//清空所有已填写内容 |
|||
$("[name='data[get_type]']:eq(0)").click(); |
|||
$("[name='data[prize_number]']").val(0.00); |
|||
$("[name='data[red_pack_name]']").val(''); |
|||
$("[name='data[red_pack_id]']").val(''); |
|||
$("[name='data[code_keyword]']").val(''); |
|||
$("[name='data[goods_name]']").val(''); |
|||
$("[name='data[goods_id]']").val(''); |
|||
$("[name='data[goods_plugin]']").val(''); |
|||
$("[name='data[sid]']").val(''); |
|||
//根据type显示内容 |
|||
let type = parseInt($(this).val()); |
|||
switch (type) { |
|||
case 1:$(".type-red").removeClass('hide');break;//现金红包 |
|||
case 2:$(".type-onlineRed").removeClass('hide');break;//线上红包 |
|||
case 3:$(".type-integral").removeClass('hide');break;//积分奖励 |
|||
case 4:$(".type-code").removeClass('hide');break;//激活码 |
|||
case 5:$(".type-goods").removeClass('hide');break;//商品 |
|||
} |
|||
}); |
|||
/** |
|||
* 信息同步 |
|||
*/ |
|||
$("[name='data[prize_number]']").on('change',function () { |
|||
let val = $(this).val(); |
|||
$("[name='data[prize_number]']").val(val); |
|||
}); |
|||
/** |
|||
* 修改现金红包最小值 |
|||
*/ |
|||
$("[name='data[get_type]']").on('change',function () { |
|||
let val = $(this).val(); |
|||
if(val == 1) $("#redPackageMoney").attr('min',1); |
|||
else $("#redPackageMoney").attr('min',0.01); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,130 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="javascript:;">奖品列表</a></li> |
|||
</ul> |
|||
<!-- 直播间信息列表 --> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<!-- 顶部按钮 --> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('luckydraw/luckygoods/goodsEdit');}" class="btn btn-primary">添加奖品</a> |
|||
</div> |
|||
<!-- 搜索内容 --> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="luckydraw" /> |
|||
<input type="hidden" name="ac" value="luckygoods" /> |
|||
<input type="hidden" name="do" value="goodsIndex" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">奖品名称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="title" value="{$title}" placeholder="请输入奖品名称..."> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo web_url('luckydraw/luckygoods/goodsIndex',['type'=>0,'status'=>$status,'title'=>$title])}" class="btn {if $type == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo web_url('luckydraw/luckygoods/goodsIndex',['type'=>1,'status'=>$status,'title'=>$title])}" class="btn {if $type == 1}btn-primary{else}btn-default{/if}">现金红包</a> |
|||
{if p('redpack') && j('redpack')} |
|||
<a href="{php echo web_url('luckydraw/luckygoods/goodsIndex',['type'=>2,'status'=>$status,'title'=>$title])}" class="btn {if $type == 2}btn-primary{else}btn-default{/if}">线上红包</a> |
|||
{/if} |
|||
<a href="{php echo web_url('luckydraw/luckygoods/goodsIndex',['type'=>3,'status'=>$status,'title'=>$title])}" class="btn {if $type == 3}btn-primary{else}btn-default{/if}">积分</a> |
|||
<a href="{php echo web_url('luckydraw/luckygoods/goodsIndex',['type'=>4,'status'=>$status,'title'=>$title])}" class="btn {if $type == 4}btn-primary{else}btn-default{/if}">激活码</a> |
|||
<a href="{php echo web_url('luckydraw/luckygoods/goodsIndex',['type'=>5,'status'=>$status,'title'=>$title])}" class="btn {if $type == 5}btn-primary{else}btn-default{/if}">商品</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">奖品状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo web_url('luckydraw/luckygoods/goodsIndex',['type'=>$type,'status'=>0,'title'=>$title])}" class="btn {if $status == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo web_url('luckydraw/luckygoods/goodsIndex',['type'=>$type,'status'=>1,'title'=>$title])}" class="btn {if $status == 1}btn-primary{else}btn-default{/if}">上架</a> |
|||
<a href="{php echo web_url('luckydraw/luckygoods/goodsIndex',['type'=>$type,'status'=>2,'title'=>$title])}" class="btn {if $status == 2}btn-primary{else}btn-default{/if}">下架</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="hide" name="type" value="{$type}"> |
|||
<input type="text" class="hide" name="status" value="{$status}"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('luckydraw/luckygoods/goodsIndex',['type'=>0,'status'=>0,'title'=>''])}" class="btn btn-danger">清除</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!-- 表格内容 --> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center"> |
|||
<input type="checkbox" name="checkall" value="" id="checkall" class="checkboxall" onclick="var ck = this.checked; $(':checkbox').each(function(){this.checked = ck});"/> |
|||
</th> |
|||
<th class="text-center">奖品名称</th> |
|||
<th class="text-center">奖品类型</th> |
|||
<th class="text-center">奖品图片</th> |
|||
<th class="text-center">奖品状态</th> |
|||
<th class="text-center">添加时间</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $vo} |
|||
<tr class="text-center"> |
|||
<td><center><input type="checkbox" name="items[]" value="{$vo['id']}" class="checkbox" /></center></td> |
|||
<td>{$vo['title']}</td> |
|||
<td> |
|||
{if $vo['type'] == 1} |
|||
<label class="label label-primary">现金红包</label> |
|||
{elseif $vo['type'] == 2} |
|||
<label class="label label-info">线上红包</label> |
|||
{elseif $vo['type'] == 3} |
|||
<label class="label label-default">积分</label> |
|||
{elseif $vo['type'] == 4} |
|||
<label class="label label-danger">激活码</label> |
|||
{else} |
|||
<label class="label label-warning">商品</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<img class="scrollLoading" src="{php echo tomedia($vo['image']);}" data-url="{php echo tomedia($mem['avatar'])}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="50" width="50"/> |
|||
</td> |
|||
<td> |
|||
{if $vo['status'] == 1} |
|||
<label class="label label-primary">上架</label> |
|||
{else} |
|||
<label class="label label-danger">下架</label> |
|||
{/if} |
|||
</td> |
|||
<td>{php echo date("Y-m-d H:i:s",$vo['create_time']);}</td> |
|||
<td> |
|||
<a class="btn btn-sm btn-warning" href="{php echo web_url('luckydraw/luckygoods/goodsEdit',['id'=>$vo['id']]);}">编辑</a> |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('luckydraw/luckygoods/delete',['ids'=>$vo['id']]);}" data-confirm="确认删除此奖品?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default btn-sm" type="button" onclick="location.reload();"><i class="fa fa-refresh"></i></button> |
|||
<button class="btn btn-default" type="button" data-toggle='batch-remove' |
|||
data-confirm="确定删除当前选择的奖品?" |
|||
data-href="{php echo web_url('luckydraw/luckygoods/delete')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,429 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class News{ |
|||
//商品发货提醒 |
|||
static function sendremind($orderid, $plugin) { |
|||
global $_W; |
|||
if ($plugin == 'b') { |
|||
//抢购 |
|||
$order = pdo_get(PDO_NAME . 'rush_order', array('id' => $orderid)); |
|||
$type = 'rush'; |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'rush_activity',array('id'=>$order['activityid']),'name'); |
|||
} else { |
|||
//团购 拼团 砍价 积分兑换 |
|||
$order = pdo_get(PDO_NAME . 'order', array('id' => $orderid)); |
|||
$type = $order['plugin']; |
|||
if($type == 'groupon'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'groupon_activity',array('id'=>$order['fkid']),'name'); |
|||
}else if($type == 'wlfightgroup'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'fightgroup_goods',array('id'=>$order['fkid']),'name'); |
|||
}else if($type == 'bargain'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'bargain_activity',array('id'=>$order['fkid']),'name'); |
|||
}else if($type == 'consumption'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'consumption_goods',array('id'=>$order['fkid']),'title'); |
|||
} |
|||
} |
|||
$express = pdo_get('wlmerchant_express', array('id' => $order['expressid'])); |
|||
$url = h5_url('pages/subPages/orderList/orderDetails/orderDetails',['orderid'=>$orderid,'plugin'=>$type]); |
|||
$modelData = [ |
|||
'first' => '您的订单商品已发货,请注意查收!' , |
|||
'order_no' => $order['orderno'] ,//订单编号 |
|||
'express_name' => $express['expressname'],//物流公司 |
|||
'express_no' => $express['expresssn'],//物流单号 |
|||
'goods_name' => $goodsname,//商品信息 |
|||
'consignee' => $express['name'] ,//收货人 |
|||
'receiving_address' => $express['address'] ,//收货地址 |
|||
'remark' => '点击查看物流详细信息!' |
|||
]; |
|||
TempModel::sendInit('send',$order['mid'],$modelData,$_W['source'],$url); |
|||
} |
|||
|
|||
//组团成功提醒 |
|||
static function groupresult($groupid){ |
|||
global $_W; |
|||
$group = pdo_get('wlmerchant_fightgroup_group',array('id' => $groupid)); |
|||
$goodname = pdo_getcolumn(PDO_NAME.'fightgroup_goods',array('id'=>$group['goodsid']),'name'); |
|||
if($group['status'] == 2){ |
|||
$first = '恭喜您,您参加的拼团已组团成功'; |
|||
$result = '组团成功'; |
|||
$time = '成团时间:'.date('Y-m-d H:i:s',time()); |
|||
}else{ |
|||
$first = '很遗憾,您参加的拼团已组团失败'; |
|||
$result = '组团失败'; |
|||
$time = '失败时间:'.date('Y-m-d H:i:s',time()); |
|||
} |
|||
$data = array( |
|||
'first' => $first, |
|||
'result' => $result,//组团结果 |
|||
'goods_name' => $goodname,//商品名称 |
|||
'detail' => $time,//详细信息 |
|||
'user_number' => sprintf("%.0f",$group['neednum'] - $group['lacknum']),//组团人数 |
|||
'remark' => '点击查看组团详情' |
|||
); |
|||
$url = h5_url('pages/subPages/group/assemble/assemble',array('id'=>$group['goodsid'],'group_id'=>$group['id'])); |
|||
$orders = pdo_getall('wlmerchant_order' , ['status' => [1 , 8] , 'fightgroupid' => $groupid] , ['mid','price']); |
|||
//获取拼团成员昵称 |
|||
$mids = array_column($orders,'mid'); |
|||
$names = pdo_getall(PDO_NAME."member",['id'=>$mids],['nickname']); |
|||
$data['nickname_string'] = implode(array_column($names,'nickname'),','); |
|||
foreach ($orders as $order){ |
|||
$data['money'] = $order['price']; |
|||
TempModel::sendInit('fight',$order['mid'],$data,$_W['source'],$url); |
|||
} |
|||
} |
|||
//支付成功通知 |
|||
static function paySuccess($orderid,$plugin,$noticeagent = 0){ |
|||
global $_W; |
|||
if ($plugin == 'rush') { |
|||
//抢购 |
|||
$order = pdo_get(PDO_NAME . 'rush_order', array('id' => $orderid)); |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'rush_activity',array('id'=>$order['activityid']),'name'); |
|||
$pluginname = '抢购'; |
|||
$order['price'] = $order['actualprice']; |
|||
$remark = $order['remark'] ? : '';//买家备注 |
|||
}else if($plugin == 'mobilerecharge'){ |
|||
//话费充值 |
|||
$order = pdo_get(PDO_NAME . 'mrecharge_order', array('id' => $orderid)); |
|||
$goodsname = $order['money'].'元'; |
|||
$pluginname = '话费充值'; |
|||
$order['price'] = $order['price']; |
|||
} else { |
|||
//团购 拼团 砍价 积分兑换 |
|||
$order = pdo_get(PDO_NAME . 'order', array('id' => $orderid)); |
|||
if($plugin == 'groupon'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'groupon_activity',array('id'=>$order['fkid']),'name'); |
|||
$pluginname = '团购'; |
|||
}else if($plugin == 'wlfightgroup'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'fightgroup_goods',array('id'=>$order['fkid']),'name'); |
|||
$pluginname = '拼团'; |
|||
if($order['fightstatus'] == 1){ |
|||
$group = pdo_get(PDO_NAME . 'fightgroup_group', array('id' => $order['fightgroupid']),array('status')); |
|||
if($group['status'] == 1){ |
|||
$url = h5_url('pages/subPages/group/assemble/assemble',['group_id'=>$order['fightgroupid'],'id'=>$order['fkid']]); |
|||
} |
|||
} |
|||
}else if($plugin == 'bargain'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'bargain_activity',array('id'=>$order['fkid']),'name'); |
|||
$pluginname = '砍价'; |
|||
}else if($plugin == 'consumption'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'consumption_goods',array('id'=>$order['fkid']),'title'); |
|||
$pluginname = $_W['wlsetting']['trade']['credittext'].'兑换'; |
|||
}else if($plugin == 'citydelivery'){ |
|||
$pluginname = '同城配送'; |
|||
$smallorders = pdo_fetchall("SELECT gid,money,num,specid FROM ".tablename('wlmerchant_delivery_order')."WHERE tid = {$order['orderno']} ORDER BY price DESC"); |
|||
$cityremark = ''; |
|||
foreach ($smallorders as $ke => &$orr){ |
|||
$goods = pdo_get('wlmerchant_delivery_activity',array('id' => $orr['gid']),array('name','thumb')); |
|||
$orr['name'] = $goods['name']; |
|||
if($orr['specid']>0){ |
|||
$specname = pdo_getcolumn(PDO_NAME.'delivery_spec',array('id'=>$orr['specid']),'name'); |
|||
$orr['name'] .= '/'.$specname; |
|||
} |
|||
$cityremark .= '['.$orr['name'].'X'.$orr['num'].']'; |
|||
if($ke == 0){ |
|||
$goodsname = $orr['name']; |
|||
} |
|||
} |
|||
if(count($smallorders)>1){ |
|||
$goodsname .= ' 等商品'; |
|||
} |
|||
$url = h5_url('pages/subPages/orderList/orderTakeout/orderTakeout',['orderid'=>$orderid,'aid'=>$order['aid'],'plugin'=>$plugin]); |
|||
}else if($plugin == 'coupon'){ |
|||
$goodsname = pdo_getcolumn('wlmerchant_couponlist' , ['id' => $order['fkid']],'title'); |
|||
$pluginname = '卡券'; |
|||
$url = h5_url('pages/subPages/coupon/couponDetails/couponDetails',['id'=>$order['recordid'],'order_id'=>$order['id']]); |
|||
}else if($plugin == 'yellowpage'){ |
|||
if($order['fightstatus'] == 1){ |
|||
$goodsname = '114页面认领'; |
|||
}else if($order['fightstatus'] == 2){ |
|||
$goodsname = '114页面查看'; |
|||
}else if($order['fightstatus'] == 3){ |
|||
$goodsname = '114页面入驻'; |
|||
} |
|||
$pluginname = '黄页114'; |
|||
//$url = h5_url('pages/subPages/coupon/couponDetails/couponDetails',['id'=>$order['recordid'],'order_id'=>$order['id']]); |
|||
}else if($plugin == 'activity'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'activitylist',array('id'=>$order['fkid']),'title'); |
|||
if($order['specid']>0){ |
|||
$specname = pdo_getcolumn(PDO_NAME.'activity_spec',array('id'=>$order['specid']),'name'); |
|||
$goodsname .= '/'.$specname; |
|||
} |
|||
$pluginname = '活动报名'; |
|||
} |
|||
$remark = $order['buyremark'] ? : '';//买家备注 |
|||
} |
|||
//给用户发送模板信息 |
|||
$payinfo = array( |
|||
'first' => '您的'.$pluginname.'订单已经成功付款' , |
|||
'order_no' => $order['orderno'],//订单编号 |
|||
'time' => date('Y-m-d H:i:s', time()),//支付时间 |
|||
'money' => $order['price'],//支付金额 |
|||
'goods_name' => $goodsname,//商品名称 |
|||
'remark' => '点击可查看订单详情,如有疑问请联系客服' |
|||
); |
|||
if($order['paylogid']){ |
|||
$source = pdo_getcolumn(PDO_NAME.'paylogvfour',array('plid'=>$order['paylogid']),'source'); |
|||
}else{ |
|||
$source = pdo_getcolumn(PDO_NAME.'paylogvfour',array('tid'=>$order['orderno']),'source'); |
|||
} |
|||
$source = $source ? : $_W['source']; |
|||
if(empty($url)){ |
|||
$url = h5_url('pages/subPages/orderList/orderDetails/orderDetails',['orderid'=>$orderid,'aid'=>$order['aid'],'plugin'=>$plugin]); |
|||
} |
|||
$url = str_replace('payment/','',$url); |
|||
if($plugin == 'mobilerecharge'){ |
|||
$url = ''; |
|||
} |
|||
TempModel::sendInit('pay',$order['mid'],$payinfo,$source,$url); |
|||
//配置模板信息 |
|||
$userInfo = pdo_get(PDO_NAME . "member" , array( 'id' => $order['mid'] ) , array( 'nickname' , 'mobile' )); |
|||
//给商户发送用户购买商品的模板消息 |
|||
if($order['sid']){ |
|||
//获取当前店铺的超级管理员和管理员 |
|||
$list = pdo_fetchall("SELECT id,mid FROM ".tablename(PDO_NAME."merchantuser")." WHERE storeid = {$order['sid']} AND ismain IN (1,3) AND enabled = 1 "); |
|||
if(is_array($list) && count($list) > 0){ |
|||
//详细内容 判断是否存在买家备注 |
|||
if(!empty($remark)){ |
|||
$content = '订单金额:' . $order['price'] . '元,购买数量:' . $order['num'] . ',请商家注意备货' . "。买家备注:" . $remark; |
|||
}else{ |
|||
$content = '订单金额:' . $order['price'] . '元,购买数量:' . $order['num'] . ',请商家注意备货'; |
|||
} |
|||
|
|||
$modelData = [ |
|||
'first' => '您好,用户[' . $userInfo['nickname'] . ']购买的[' . $goodsname . ']已支付', |
|||
'type' => $pluginname . '商品订单支付',//业务类型 |
|||
'content' => $content,//业务内容 |
|||
'status' => '已付款' ,//处理结果 |
|||
'time' => date("Y-m-d H:i:s",$order['createtime']) ,//操作时间 |
|||
'remark' => $cityremark?$cityremark:'' |
|||
]; |
|||
$url = h5_url('pages/subPages/merchant/merchantOrderList/merchantOrderList',array('aid'=>$order['aid'],'storeid'=>$order['sid'])); |
|||
$url = str_replace('payment/','',$url); |
|||
foreach($list as $index => $item){ |
|||
TempModel::sendInit('service',$item['mid'],$modelData,$source,$url); |
|||
} |
|||
} |
|||
} |
|||
if(empty($noticeagent)){ |
|||
//给管理员发送消息 |
|||
if($order['sid'] > 0){ |
|||
$storename = pdo_getcolumn(PDO_NAME.'merchantdata',array('id'=>$order['sid']),'storename'); |
|||
$content = '订单所属商户:['.$storename.']'; |
|||
$remark = '请联系商户处理订单'; |
|||
}else{ |
|||
$content = '代理订单'; |
|||
$remark = '请及时处理订单'; |
|||
} |
|||
$first = '您好,用户['.$userInfo['nickname']. ']购买的['.$goodsname.']已支付'; |
|||
$type = $pluginname . '商品订单支付'; |
|||
$status = '已支付'; |
|||
News::noticeAgent('pay',$order['aid'],$first,$type,$content,$status,$remark,time()); |
|||
} |
|||
} |
|||
|
|||
//核销成功通知 |
|||
static function writeOffSuccess($mid,$goodname,$num = 1,$orderNo = ''){ |
|||
global $_W; |
|||
$info = array( |
|||
'first' => '您好,您的商品已经成功核销' , |
|||
'goods_name' => $goodname,//商品名称 |
|||
'goods_num' => $num,//商品数量 |
|||
'time' => date('Y-m-d H:i:s',time()),//核销时间 |
|||
'order_no' => $orderNo,//订单编号 |
|||
'remark' => '如有疑问请联系客服' |
|||
); |
|||
TempModel::sendInit('write_off',$mid,$info,$_W['source']); |
|||
} |
|||
|
|||
//订单退款通知 |
|||
static function refundNotice($orderid,$plugin,$money,$reason){ |
|||
global $_W; |
|||
if ($plugin == 'rush') { |
|||
//抢购 |
|||
$order = pdo_get(PDO_NAME . 'rush_order', array('id' => $orderid)); |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'rush_activity',array('id'=>$order['activityid']),'name'); |
|||
$pluginname = '抢购'; |
|||
$order['price'] = $order['actualprice']; |
|||
}else if($plugin == 'mobilerecharge'){ |
|||
//话费充值 |
|||
$order = pdo_get(PDO_NAME . 'mrecharge_order', array('id' => $orderid)); |
|||
$goodsname = '充值'.$order['money'].'元'; |
|||
$pluginname = '话费充值'; |
|||
$order['price'] = $order['price']; |
|||
} else { |
|||
//团购 拼团 砍价 积分兑换 |
|||
$order = pdo_get(PDO_NAME . 'order', array('id' => $orderid)); |
|||
if($plugin == 'groupon'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'groupon_activity',array('id'=>$order['fkid']),'name'); |
|||
$pluginname = '团购'; |
|||
}else if($plugin == 'wlfightgroup'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'fightgroup_goods',array('id'=>$order['fkid']),'name'); |
|||
$pluginname = '拼团'; |
|||
}else if($plugin == 'bargain'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'bargain_activity',array('id'=>$order['fkid']),'name'); |
|||
$pluginname = '砍价'; |
|||
}else if($plugin == 'wlcoupon'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'couponlist',array('id'=>$order['fkid']),'title'); |
|||
$pluginname = '卡券'; |
|||
}else if($plugin == 'consumption'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'consumption_goods',array('id'=>$order['fkid']),'title'); |
|||
$pluginname = $_W['wlsetting']['trade']['credittext'].'兑换'; |
|||
}else if($plugin == 'activity'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'activitylist',array('id'=>$order['fkid']),'title'); |
|||
$pluginname = '活动报名'; |
|||
}else if($plugin == 'housekeep'){ |
|||
$goodsname = pdo_getcolumn(PDO_NAME.'housekeep_service',array('id'=>$order['fkid']),'title'); |
|||
$pluginname = '家政服务'; |
|||
} |
|||
} |
|||
if($money < 0.01){$money = $order['price'];} |
|||
$refundinfo = array( |
|||
'first' => '您好,您的'.$pluginname.'订单已经退款' , |
|||
'money' => '¥' .$money,//退款金额 |
|||
'goods_name' => $goodsname ,//商品名称 |
|||
'order_no' => $order['orderno'],//订单编号 |
|||
'total_money' => '¥'.$money,//订单总金额 |
|||
'remark' => $reason.'如有疑问请联系客服' |
|||
); |
|||
TempModel::sendInit('refund',$order['mid'],$refundinfo,$_W['source']); |
|||
} |
|||
|
|||
//业务处理通知 |
|||
static function jobNotice($mid,$first,$type,$content,$status,$remark,$time,$url='',$sourceDefault = 1){ |
|||
global $_W; |
|||
$source = $_W['source'] ? $_W['source'] : $sourceDefault; |
|||
$modelData = [ |
|||
'first' => $first, |
|||
'type' => $type,//业务类型 |
|||
'content' => $content,//业务内容 |
|||
'status' => $status,//处理结果 |
|||
'time' => date("Y-m-d H:i:s",$time) ,//操作时间 |
|||
'remark' => $remark |
|||
]; |
|||
$res = TempModel::sendInit('service',$mid,$modelData,$source,$url); |
|||
file_put_contents(PATH_DATA . "new_error.log", var_export($res, true) . date("Y-m-d H:i:s") . PHP_EOL, FILE_APPEND); |
|||
} |
|||
|
|||
//添加系统通知 |
|||
static function addSysNotice($uniacid,$type,$sid=0,$mid=0,$objid,$status=0){ |
|||
$data = array( |
|||
'uniacid' => $uniacid, |
|||
'type' => $type, |
|||
'sid' => $sid, |
|||
'mid' => $mid, |
|||
'objid' => $objid, |
|||
'status' => $status, |
|||
'isread' => 0, |
|||
'createtime' => time() |
|||
); |
|||
pdo_insert(PDO_NAME .'systemnotice',$data); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 给代理商管理员发送模板消息 |
|||
* Date: 2019/11/29 10:30 |
|||
* @param string $authority storesettled=商户入驻审核;storegood=商品动态审核;storecomment=用户评论审核;refundorder=用户申请退款;pocketfabu=掌上信息审核;recruit_examine=招聘发布审核通知; |
|||
* @param int $aid 代理id |
|||
* @param string $first 消息头部 |
|||
* @param string $type 业务类型 |
|||
* @param string $content 业务内容 |
|||
* @param string $status 处理结果 |
|||
* @param string $remark 备注信息 |
|||
* @param int $time 操作时间(时间戳) |
|||
* @param string $url 跳转地址 |
|||
*/ |
|||
static function noticeAgent($authority,$aid,$first,$type,$content,$status,$remark,$time,$url=''){ |
|||
global $_W; |
|||
$aid = $aid ? : $_W['aid']; |
|||
if(empty($aid) || $aid == -1){ |
|||
$aid = 0; |
|||
} |
|||
//查询管理员 |
|||
$openids = pdo_getall('wlmerchant_agentadmin', array('uniacid' => $_W['uniacid'],'aid' => $aid, 'notice' => 1), array('mid','noticeauthority')); |
|||
if(!empty($openids)){ |
|||
foreach ($openids as $user){ |
|||
$noticeauthority = unserialize($user['noticeauthority']); |
|||
if(empty($noticeauthority)) $noticeauthority = []; |
|||
if(in_array($authority,$noticeauthority) || empty($noticeauthority)) self::jobNotice($user['mid'],$first,$type,$content,$status,$remark,$time,$url); |
|||
} |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 商品审核结果模板消息发送 |
|||
* Author: zzw |
|||
* Date: 2020/3/4 14:05 |
|||
* @param int $id 商品id |
|||
* @param string $type 商品类型(rush=抢购;groupon=团购;fight=拼团;bargain=砍价) |
|||
* @param string $result |
|||
* @return array |
|||
* @throws \GuzzleHttp\Exception\GuzzleException |
|||
*/ |
|||
public static function goodsToExamine($id,$type,$result = '通过',$remark = ''){ |
|||
global $_W; |
|||
#1、获取商品信息 |
|||
switch ($type) { |
|||
case 'rush': |
|||
$goods = pdo_get(PDO_NAME . "rush_activity" , ['id' => $id] , ['sid' , 'name']); |
|||
break;//抢购商品 |
|||
case 'groupon': |
|||
$goods = pdo_get(PDO_NAME . "groupon_activity" , ['id' => $id] , ['sid' , 'name']); |
|||
break;//团购商品 |
|||
case 'fight': |
|||
$goods = pdo_fetch("select merchantid as sid,name from " . tablename(PDO_NAME . "fightgroup_goods") . " where id = {$id}"); |
|||
break;//拼团商品 |
|||
case 'bargain': |
|||
$goods = pdo_get(PDO_NAME . "bargain_activity" , ['id' => $id] , ['sid' , 'name']); |
|||
break;//砍价商品 |
|||
case 'citydelivery': |
|||
$goods = pdo_get(PDO_NAME . "delivery_activity" , ['id' => $id] , ['sid' , 'name']); |
|||
break;//配送商品 |
|||
} |
|||
if(!$goods) return error(0,'商品不存在!'); |
|||
#2、获取店铺信息 |
|||
$storename = pdo_getcolumn(PDO_NAME."merchantdata",['id'=>$goods['sid']],'storename'); |
|||
#3、模板消息配置 |
|||
$modelData = [ |
|||
'first' => '商品审核通知', |
|||
'type' => '商品审核通知',//业务类型 |
|||
'content' => "[{$storename}]的商品[{$goods['name']}]已审核",//业务内容 |
|||
'status' => $result ,//处理结果 |
|||
'time' => date("Y-m-d H:i:s",time()) ,//操作时间 |
|||
'remark' => $remark |
|||
]; |
|||
#3、获取店铺的管理员列表 |
|||
$userList = pdo_getall(PDO_NAME."merchantuser",['storeid'=>$goods['sid']],['mid']); |
|||
foreach($userList as $item){ |
|||
TempModel::sendInit('service',$item['mid'],$modelData,$_W['source']); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 给商户管理员发送模板消息 |
|||
* Author: zzw |
|||
* Date: 2020/3/9 17:11 |
|||
* @param int $sid 商户id |
|||
* @param string $first 头部信息 |
|||
* @param string $type 类型 |
|||
* @param string $content 内容 |
|||
* @param string $status 结果 |
|||
* @param string $remark 备注信息 |
|||
* @param string $time 操作时间 |
|||
* @param string $url 跳转链接 |
|||
*/ |
|||
public static function noticeShopAdmin($sid,$first,$type,$content,$status,$remark,$time,$url=''){ |
|||
#1、获取当前店铺下面的管理员信息 |
|||
$list = pdo_fetchall("SELECT mid FROM ".tablename(PDO_NAME."merchantuser") |
|||
." WHERE storeid = {$sid} AND ismain IN (1,3) AND enabled = 1"); |
|||
if(is_array($list) && count($list) > 0){ |
|||
foreach($list as $key => $val){ |
|||
self::jobNotice($val['mid'],$first,$type,$content,$status,$remark,$time,$url); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[消息管理]]></name> |
|||
<identifie><![CDATA[news]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[help]]></type> |
|||
<description><![CDATA[模板消息、短信消息等相关的消息管理]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="false" /> |
|||
<system embed="true" /> |
|||
<task embed="false" /> |
|||
</setting> |
|||
<agentmenu> |
|||
|
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="模板消息" font="fa-inbox"> |
|||
<entry title="模板消息" ac="template" do="index" iscover="true"/> |
|||
</menu> |
|||
<menu title="短信设置" font="fa-inbox"> |
|||
<entry title="短信模板" ac="noticeset" do="smslist" /> |
|||
<entry title="短信设置" ac="noticeset" do="smsset" /> |
|||
<entry title="参数设置" ac="noticeset" do="smsparams" /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 3.0 KiB |
@ -0,0 +1,125 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Noticeset_WeliamController { |
|||
|
|||
public function smslist() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$listData = Util::getNumData('*', PDO_NAME . 'smstpl', array(), 'id desc', $pindex, $psize, 1); |
|||
$list = $listData[0]; |
|||
$pager = $listData[1]; |
|||
include wl_template('template/sms_list'); |
|||
} |
|||
|
|||
public function smsadd() { |
|||
global $_W, $_GPC; |
|||
if ($_W['isajax']) { |
|||
//处理数据值 |
|||
$data_temp = $_GPC['data_temp']; |
|||
$data_shop = $_GPC['data_shop']; |
|||
$len = count($data_temp); |
|||
$paramids = array(); |
|||
for ($k = 0; $k < $len; $k++) { |
|||
$paramids[$k]['data_temp'] = $data_temp[$k]; |
|||
$paramids[$k]['data_shop'] = $data_shop[$k]; |
|||
} |
|||
|
|||
$base = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'name' => trim($_GPC['name']), |
|||
'type' => trim($_GPC['type']), |
|||
'smstplid' => trim($_GPC['smstplid']), |
|||
'data' => serialize($paramids), |
|||
'createtime' => time(), |
|||
'status' => intval($_GPC['status']) |
|||
); |
|||
pdo_insert(PDO_NAME . 'smstpl', $base); |
|||
wl_message(array('errno' => 0, 'message' => '添加成功')); |
|||
} |
|||
include wl_template('template/sms_post'); |
|||
} |
|||
|
|||
public function smsedit() { |
|||
global $_W, $_GPC; |
|||
|
|||
$id = intval($_GPC['id']); |
|||
$item = pdo_get(PDO_NAME . 'smstpl', array('id' => $id)); |
|||
$item['data'] = unserialize($item['data']); |
|||
if ($_W['isajax']) { |
|||
//处理数据值 |
|||
$data_temp = $_GPC['data_temp']; |
|||
$data_shop = $_GPC['data_shop']; |
|||
$len = count($data_temp); |
|||
$paramids = array(); |
|||
for ($k = 0; $k < $len; $k++) { |
|||
$paramids[$k]['data_temp'] = $data_temp[$k]; |
|||
$paramids[$k]['data_shop'] = $data_shop[$k]; |
|||
} |
|||
$base = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'name' => trim($_GPC['name']), |
|||
'type' => trim($_GPC['type']), |
|||
'smstplid' => trim($_GPC['smstplid']), |
|||
'data' => serialize($paramids), |
|||
'createtime' => time(), |
|||
'status' => intval($_GPC['status']) |
|||
); |
|||
pdo_update(PDO_NAME . 'smstpl', $base, array('id' => $id)); |
|||
wl_message(array('errno' => 0, 'message' => '更新成功')); |
|||
} |
|||
include wl_template('template/sms_post'); |
|||
} |
|||
|
|||
public function smsset() { |
|||
global $_W, $_GPC; |
|||
$smses = pdo_getall(PDO_NAME . 'smstpl', array('uniacid' => $_W['uniacid']), array('id', 'name')); |
|||
$settings = Setting::wlsetting_read('smsset'); |
|||
if (checksubmit('submit')) { |
|||
$base = array( |
|||
'dy_sf' => intval($_GPC['dy_sf']), |
|||
'dy_sfhw' => intval($_GPC['dy_sfhw']), |
|||
'dy_hxm' => intval($_GPC['dy_hxm']) |
|||
); |
|||
Setting::wlsetting_save($base, 'smsset'); |
|||
wl_message('更新设置成功!', web_url('news/noticeset/smsset')); |
|||
} |
|||
include wl_template('template/sms_setting'); |
|||
} |
|||
|
|||
public function smsparams() { |
|||
global $_W, $_GPC; |
|||
$settings = Setting::wlsetting_read('sms'); |
|||
if ($_W['isajax']) { |
|||
if ($_GPC['note_haiwai'] == 'on' && empty($_GPC['note_quhao'])) { |
|||
wl_message('请添加国际区号'); |
|||
} |
|||
$base = array( |
|||
'note_appkey' => trim($_GPC['note_appkey']), |
|||
'note_secretKey' => trim($_GPC['note_secretKey']), |
|||
'note_sign' => trim($_GPC['note_sign']), |
|||
'note_haiwai' => $_GPC['note_haiwai'] == 'on' ? 1 : 0, |
|||
'note_quhao' => trim($_GPC['note_quhao']), |
|||
); |
|||
Setting::wlsetting_save($base, 'sms'); |
|||
wl_message('更新设置成功!', web_url('news/noticeset/smsparams'), 'success'); |
|||
} |
|||
include wl_template('template/sms_param'); |
|||
} |
|||
|
|||
public function tpl() { |
|||
global $_W, $_GPC; |
|||
$kw = $_GPC['kw']; |
|||
include wl_template('template/sms_tpl'); |
|||
} |
|||
|
|||
public function dele() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
if (pdo_delete(PDO_NAME . 'smstpl', array('id' => $id))) { |
|||
wl_message(array('errno' => 0, 'message' => '删除成功')); |
|||
} |
|||
wl_message(array('errno' => 1, 'message' => '删除失败')); |
|||
} |
|||
} |
|||
@ -0,0 +1,149 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Template_WeliamController { |
|||
#订单支付成功 = pay;订单发货提醒 = send;售后状态通知 = after_sale;退款成功通知 = refund;订单待付款提醒 = remind;业务处理结果通知 = service |
|||
#核销成功提醒 = write_off;拼团结果通知 = fight;商品下架提醒 = shop;签到成功通知 = sign |
|||
protected static $name = 'new_temp_set'; |
|||
/** |
|||
* Comment: 进入模板消息首页 |
|||
* Author: zzw |
|||
* Date: 2019/9/2 18:13 |
|||
*/ |
|||
public function index(){ |
|||
global $_W,$_GPC; |
|||
$set = Setting::wlsetting_read(self::$name); |
|||
$mid = Setting::wlsetting_read('adminmid'); |
|||
$useTemplateType = Setting::wlsetting_read('use_template_type'); |
|||
$weChatTempId = Setting::wlsetting_read('wechat_template_id') ? : ''; |
|||
$member = pdo_get(PDO_NAME.'member',['id' => $mid],['id','nickname']); |
|||
|
|||
include wl_template("template/template"); |
|||
} |
|||
/** |
|||
* Comment: 设置模板消息 |
|||
* Author: zzw |
|||
* Date: 2019/9/3 9:20 |
|||
*/ |
|||
public function setting(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$type = $_GPC['type'] OR wl_message('非法访问'); |
|||
#2、获取设置信息 |
|||
$set = Setting::wlsetting_read(self::$name); |
|||
$info = $set[$type]; |
|||
|
|||
include wl_template("template/set"); |
|||
} |
|||
/** |
|||
* Comment: 保存模板消息的设置 |
|||
* Author: zzw |
|||
* Date: 2019/9/3 9:21 |
|||
*/ |
|||
public function saveSet(){ |
|||
global $_W,$_GPC; |
|||
#1、参数接收 |
|||
$type = $_GPC['type'] OR wl_message('缺少参数,请刷新重试'); |
|||
$data = $_GPC['data'] OR wl_message('缺少参数,请刷新重试'); |
|||
#2、数据拼装 |
|||
$set = Setting::wlsetting_read(self::$name); |
|||
$set[$type] = $data; |
|||
#3、储存数据信息 |
|||
$res = Setting::wlsetting_save($set,self::$name); |
|||
if($res) wl_message('设置成功!', web_url('news/template/index'), 'success'); |
|||
else wl_message('设置失败!'); |
|||
} |
|||
/** |
|||
* Comment: 模板id获取 |
|||
* Author: zzw |
|||
* Date: 2019/9/4 9:42 |
|||
*/ |
|||
public function getTempId(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$source = $_GPC['source'] OR wl_json('获取失败,请刷新重试!');//端口类型:1=微信公众号;2=H5;3=微信小程序 |
|||
$type = $_GPC['type'] OR wl_json('获取失败,请刷新重试!'); |
|||
#2、id获取 |
|||
TempModel::init($source,$type); |
|||
} |
|||
/** |
|||
* Comment: 设置管理员mid |
|||
* Author: wlf |
|||
* Date: 2019/9/19 17:35 |
|||
*/ |
|||
public function addmid(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$mid = $_GPC['mid']; |
|||
$res = Setting::wlsetting_save($mid,'adminmid'); |
|||
return $mid; |
|||
} |
|||
/** |
|||
* Comment: 修改模板消息中某一项的内容 |
|||
* Author: zzw |
|||
* Date: 2019/12/10 14:17 |
|||
*/ |
|||
public function changeStatus(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$name = $_GPC['name'] OR Commons::sRenderError('参数错误,请刷新重试!'); |
|||
$source = $_GPC['source'] OR Commons::sRenderError('参数错误,请刷新重试!'); |
|||
$key = $_GPC['key'] OR Commons::sRenderError('参数错误,请刷新重试!'); |
|||
$status = $_GPC['status'] ? $_GPC['status'] : ''; |
|||
#2、获取设置信息 并且覆盖原有的值 变更为新的值 |
|||
$set = Setting::wlsetting_read(self::$name); |
|||
$set[$name][$source][$key] = $status; |
|||
Setting::wlsetting_save($set,self::$name); |
|||
|
|||
Commons::sRenderSuccess('修改成功'); |
|||
} |
|||
/** |
|||
* Comment: 修改模板消息中的设置信息 |
|||
* Author: zzw |
|||
* Date: 2021/1/27 17:41 |
|||
*/ |
|||
public function changeSetInfo(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$name = $_GPC['name'] OR Commons::sRenderError('参数错误,请刷新重试!'); |
|||
$source = $_GPC['source'] OR Commons::sRenderError('参数错误,请刷新重试!'); |
|||
$remark = $_GPC['remark'] ? : ''; |
|||
$link = $_GPC['link'] ? : ''; |
|||
//获取设置信息 并且覆盖原有的值 变更为新的值 |
|||
$set = Setting::wlsetting_read(self::$name); |
|||
$set[$name][$source]['remark'] = $remark; |
|||
$set[$name][$source]['link'] = $link; |
|||
Setting::wlsetting_save($set,self::$name); |
|||
|
|||
Commons::sRenderSuccess('修改成功'); |
|||
} |
|||
/** |
|||
* Comment: 修改公众号消息类型 |
|||
* Author: zzw |
|||
* Date: 2021/2/19 11:08 |
|||
*/ |
|||
public function changeTemplateType(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$type = $_GPC['type']; |
|||
Setting::wlsetting_save($type,'use_template_type'); |
|||
|
|||
Commons::sRenderSuccess('修改成功'); |
|||
} |
|||
/** |
|||
* Comment: 修改公众号模板id |
|||
* Author: zzw |
|||
* Date: 2021/2/20 13:44 |
|||
*/ |
|||
public function changeWeChatTempId(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$tempId = $_GPC['temp_id']; |
|||
Setting::wlsetting_save($tempId,'wechat_template_id'); |
|||
|
|||
Commons::sRenderSuccess('修改成功'); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,123 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.temp_id{ |
|||
width: 350px!important; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"> |
|||
<a href="javascript:;"> |
|||
{if $type == 'pay'} |
|||
订单支付成功设置 |
|||
{else if $type == 'refund'} |
|||
退款通知设置 |
|||
{else if $type == 'write_off'} |
|||
核销成功提醒设置 |
|||
{else if $type == 'card'} |
|||
开卡成功通知设置 |
|||
{else if $type == 'fight'} |
|||
拼团结果通知设置 |
|||
{else if $type == 'send'} |
|||
发货提醒设置 |
|||
{else if $type == 'remind'} |
|||
订单催付提醒设置 |
|||
{else if $type == 'phone'} |
|||
手机绑定通知设置 |
|||
{else if $type == 'shop_join'} |
|||
商户入驻通知设置 |
|||
{else if $type == 'examine'} |
|||
审核结果通知设置 |
|||
{else if $type == 'service'} |
|||
服务进度提醒设置 |
|||
{else if $type == 'sign'} |
|||
签到成功通知设置 |
|||
{/if} |
|||
</a> |
|||
</li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form action="{php echo web_url('news/template/saveSet')}" class="form-horizontal form" method="post"> |
|||
<div class="panel-body" id="formList"> |
|||
<!--<div class="form-group-title">基础设置</div>--> |
|||
<!--基础设置预览位--> |
|||
<div class="form-group-title">微信公众号消息</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否启用</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="showcutoff(0)"> |
|||
<input type="radio" value="0" name="data[wechat][status]" {if !$info['wechat']['status']}checked="checked"{/if}>关闭 |
|||
</label> |
|||
<label class="radio-inline" onclick="showcutoff(1)"> |
|||
<input type="radio" value="1" name="data[wechat][status]" {if $info['wechat']['status'] == 1}checked="checked"{/if}>开启 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">模板id</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="data[wechat][id]" value="{$info['wechat']['id']}"> |
|||
<span class="input-group-btn get_template_id" source="1"><button class="btn btn-default" type="button" >一键获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group-title">微信小程序消息</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否启用</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="showcutoff(0)"> |
|||
<input type="radio" value="0" name="data[weapp][status]" {if !$info['weapp']['status']}checked="checked"{/if}>关闭 |
|||
</label> |
|||
<label class="radio-inline" onclick="showcutoff(1)"> |
|||
<input type="radio" value="1" name="data[weapp][status]" {if $info['weapp']['status'] == 1}checked="checked"{/if}>开启 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">模板id</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="data[weapp][id]" value="{$info['weapp']['id']}"> |
|||
<span class="input-group-btn get_template_id" source="3"><button class="btn btn-default " type="button" >一键获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!--<div class="form-group-title">短信消息</div>--> |
|||
<!--短信消息设置预览位--> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must "></div> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="type" value="{$type}"/> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
<a href="{php echo web_url('news/template/index')}"> |
|||
<input type="button" value="取消" class="btn btn-warning col-sm-1 min-width" style="margin-left: 30px"/> |
|||
</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
let type = "{$type}";//模板信息类型 |
|||
$(function () { |
|||
$("#formList").on('click','.get_template_id',function () { |
|||
//端口设置:1=微信公众号;2=h5;3=微信小程序 |
|||
let source = $(this).attr('source'); |
|||
let res = common.ajaxPost('news/template/getTempId',{type:type,source:source},true,false); |
|||
if(res['errno'] == 0){ |
|||
$(this).prev().val(res['data']); |
|||
}else{ |
|||
tip.alert(res['message']); |
|||
} |
|||
}); |
|||
}) |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,74 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="{php echo web_url('news/noticeset/smslist')}">短信模板</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('news/noticeset/smsadd');}" class="btn btn-primary">添加模板</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">模板名称</th> |
|||
<th class="text-center">服务商</th> |
|||
<th class="text-center">状态</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr class="text-center"> |
|||
<td>{$item['name']}</td> |
|||
<td> |
|||
{if $item['type']=='aliyun'} |
|||
<span class="label label-primary">阿里云</span> |
|||
{elseif $item['type']=='dayu'} |
|||
<span class="label label-success">阿里大于</span> |
|||
{elseif $item['type']=='emay'} |
|||
<span class="label label-warning">亿美软通</span> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<span class="label {if !empty($item['status'])}label-success{else}label-default{/if}"> |
|||
{if !empty($item['status'])}开启{else}关闭{/if} |
|||
</span> |
|||
</td> |
|||
<td> |
|||
<a class='btn btn-default btn-sm' href="{php echo web_url('news/noticeset/smsedit', array('id' => $item['id']))}"><i class='fa fa-edit'></i> 编辑</a> |
|||
<a href="javascript:;" class='btn btn-default btn-sm js-dele' data-id="{$item['id']}" ><i class='fa fa-trash'></i> 删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$('.js-dele').click(function(){ |
|||
var id = $(this).attr("data-id"); |
|||
var url = "{php echo web_url('news/noticeset/dele')}" + "id="+id; |
|||
$.ajax({ |
|||
type: "POST", |
|||
url:url, |
|||
dataType:'json', |
|||
success: function(data) { |
|||
layer.msg(data.message); |
|||
location.href = "{php echo web_url('news/noticeset/smslist')}"; |
|||
} |
|||
}); |
|||
}) |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,71 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="{php echo web_url('news/noticeset/smsparams');}">短信参数编辑</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate" id="setting-form" id="form"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">参数设置</div> |
|||
<div class="panel-body"> |
|||
<div class="tab-content"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">短信配置说明</label> |
|||
<div class="col-sm-9"> |
|||
<div class="alert alert-warning">注: 仅支持阿里云或阿里大于,仅阿里云支持海外短信服务,阿里大于不支持。</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">appkey(AccessKeyId)</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="note_appkey" class="form-control" value="{$settings['note_appkey']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">secretKey(AccessKeySecret)</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="note_secretKey" class="form-control" value="{$settings['note_secretKey']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">短信签名</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="note_sign" class="form-control" value="{$settings['note_sign']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">海外短信服务</label> |
|||
<div class="col-sm-9"> |
|||
<input type="checkbox" class="js-switch" name="note_haiwai" {if $settings['note_haiwai'] == 1} checked="checked" {/if}> |
|||
</div> |
|||
</div> |
|||
<div class="form-group note_quhao" {if $settings['note_haiwai'] != 1}style="display: none;"{/if}> |
|||
<label class="col-sm-2 control-label">国际区号</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="note_quhao" class="form-control" value="{$settings['note_quhao']}" /> |
|||
<span class="help-block">请添加所有需要发送的国家的国际区号,例如我们需要添加中国和韩国则填入:86,82。</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$(".js-switch").change(function() { |
|||
if($('.js-switch').is(':checked')) { |
|||
$('.note_quhao').show(); |
|||
} else { |
|||
$('.note_quhao').hide(); |
|||
} |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,139 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="{php echo web_url('news/noticeset/smsadd')}">添加短信模板</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form" id="form"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">添加短信模板</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label must">模板名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="name" class="form-control" value="{$item['name']}" placeholder="模版名称"></div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label must">服务商</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" class="sms-type valid" data-template="1" name="type" value="aliyun" checked="checked">阿里云 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group sms-template-1"> |
|||
<label class="col-sm-2 control-label must">模板ID</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="smstplid" class="form-control" value="{$item['smstplid']}" placeholder="短信模板ID,例:SMS_13045962" > |
|||
<div class="help-block">短信模板ID</div></div> |
|||
</div> |
|||
<div id="datas" class="sms-template-1" style="display:block;"> |
|||
{if empty($item['data'])} |
|||
{php include wl_template('template/sms_tpl');} |
|||
{else} |
|||
{loop $item['data'] $data} |
|||
{php include wl_template('template/sms_tpl');} |
|||
{/loop} |
|||
{/if} |
|||
</div> |
|||
<div class="form-group sms-template-1" style="display:block;"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<a class="btn btn-default btn-add-type" href="javascript:;" onclick="addType();"> |
|||
<i class="fa fa-plus" title=""></i>增加一条数据值</a> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label must">状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="status" value="0" id="inlineRadio1" {if empty($item['status'])}checked{/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="status" value="1" id="inlineRadio2" {if !empty($item['status'])}checked{/if}>启用 |
|||
</label> |
|||
<div class="help-block">关闭后将不能调用</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="id" value="{$item['id']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script language="javascript"> |
|||
$(function () { |
|||
$(document).on('click', '.data-item-delete', function () { |
|||
var len = $(".data-item").length; |
|||
if(len==1){ |
|||
layer.msg('必须保留一条!'); |
|||
return; |
|||
} |
|||
$(this).closest('.data-item').remove(); |
|||
}); |
|||
}); |
|||
|
|||
var kw = 1; |
|||
function addType() { |
|||
$(".btn-add-type").button("loading"); |
|||
$.ajax({ |
|||
url: "{php echo web_url('news/noticeset/tpl')}&kw="+kw, |
|||
cache: false |
|||
}).done(function (html) { |
|||
$(".btn-add-type").button("reset"); |
|||
$("#datas").append(html); |
|||
}); |
|||
kw++; |
|||
} |
|||
|
|||
$('form').submit(function(){ |
|||
var smstype = $("input[name='type']:checked").val(); |
|||
if(!smstype){ |
|||
layer.msg('请选择短信服务商!'); |
|||
return false; |
|||
} |
|||
var type = $("input[name='type']:checked").data('template'); |
|||
if(type){ |
|||
if($('.data-item').length<=0){ |
|||
layer.msg('请添加一条键!'); |
|||
return false; |
|||
} |
|||
var checkkw = true; |
|||
$("#datas input").each(function(){ |
|||
if ( $.trim( $(this).val() ) ==''){ |
|||
checkkw = false; |
|||
layer.msg('变量不能为空!'); |
|||
$(this).focus(); |
|||
return false; |
|||
} |
|||
}); |
|||
if( !checkkw){ |
|||
return false; |
|||
} |
|||
} |
|||
$('form').removeAttr('stop'); |
|||
|
|||
var data = $(this).serialize(); |
|||
var url = "{php echo web_url('news/noticeset/smsadd')}"; |
|||
if($('input[name=id]').val()) url = "{php echo web_url('news/noticeset/smsedit')}"; |
|||
$.ajax({ |
|||
type: "POST", |
|||
url:url, |
|||
data:data, |
|||
dataType:'json', |
|||
success: function(data) { |
|||
layer.msg(data.message); |
|||
location.href = "{php echo web_url('news/noticeset/smslist')}"; |
|||
} |
|||
}); |
|||
return false; |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,66 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">短信设置</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate" id="setting-form"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">短信设置</div> |
|||
<div class="panel-body"> |
|||
<div class="tab-content"> |
|||
<div class="form-group"> |
|||
<label class="col-md-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<div class="alert alert-warning">注: 先添加短信模板,然后再选择对应的模板。海外短信模板和国内模板不同,需要单独设置。不需要海外使用,则无需配置。</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-md-2 control-label">身份验证</label> |
|||
<div class="col-sm-9"> |
|||
<select name="dy_sf" class="form-control"> |
|||
<option value="" {if empty($settings['dy_sf'])}selected="selected"{/if}>请选择短信模板</option> |
|||
{loop $smses $row} |
|||
<option value="{$row['id']}" {if $settings['dy_sf'] == $row['id']}selected="selected"{/if}>{$row['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-md-2 control-label">身份验证(海外)</label> |
|||
<div class="col-sm-9"> |
|||
<select name="dy_sfhw" class="form-control"> |
|||
<option value="" {if empty($settings['dy_sfhw'])}selected="selected"{/if}>请选择短信模板</option> |
|||
{loop $smses $row} |
|||
<option value="{$row['id']}" {if $settings['dy_sfhw'] == $row['id']}selected="selected"{/if}>{$row['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{if Customized::init('pft147') > 0} |
|||
<div class="form-group"> |
|||
<label class="col-md-2 control-label">核销码通知</label> |
|||
<div class="col-sm-9"> |
|||
<select name="dy_hxm" class="form-control"> |
|||
<option value="" {if empty($settings['dy_hxm'])}selected="selected"{/if}>请选择短信模板</option> |
|||
{loop $smses $row} |
|||
<option value="{$row['id']}" {if $settings['dy_hxm'] == $row['id']}selected="selected"{/if}>{$row['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-md-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,23 @@ |
|||
<div class="form-group sms-template-1 data-item"> |
|||
<label class="col-md-2 control-label">数据值</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group form-group" style="margin: 0;"> |
|||
<span class="input-group-addon">模版变量</span> |
|||
<input type="text" name="data_temp[]" class="form-control valid" value="{$data['data_temp']}"> |
|||
<span class="input-group-addon" style="border-left: 0; border-right: 0;">数据变量</span> |
|||
<select name="data_shop[]" class="form-control valid" style="min-width: 200px;"> |
|||
<option value="【验证码】" {if $data['data_shop'] == '【验证码】'}selected{/if}>手机验证码</option> |
|||
<option value="【系统名称】" {if $data['data_shop'] == '【系统名称】'}selected{/if}>系统名称</option> |
|||
<option value="【版权信息】" {if $data['data_shop'] == '【版权信息】'}selected{/if}>版权信息</option> |
|||
<option value="【核销码】" {if $data['data_shop'] == '【核销码】'}selected{/if}>订单核销码</option> |
|||
<option value="【昵称】" {if $data['data_shop'] == '【昵称】'}selected{/if}>用户昵称</option> |
|||
<option value="【商品名】" {if $data['data_shop'] == '【商品名】'}selected{/if}>商品名称</option> |
|||
<option value="【店铺名】" {if $data['data_shop'] == '【店铺名】'}selected{/if}>店铺名称</option> |
|||
<option value="【数量】" {if $data['data_shop'] == '【数量】'}selected{/if}>商品数量</option> |
|||
<option value="【过期时间】" {if $data['data_shop'] == '【过期时间】'}selected{/if}>过期时间</option> |
|||
</select> |
|||
<span class="input-group-addon btn btn-default data-item-delete"><i class="fa fa-remove"></i> 删除</span> |
|||
</div> |
|||
<span class="help-block">数据变量替换模板变量,例如:模版变量=${name},仅填英文变量name即可。</span> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,640 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
/*新版本模板消息补充样式*/ |
|||
.new_temp .temp_title{ |
|||
font-weight: 600; |
|||
font-size: 15px; |
|||
line-height: 27px; |
|||
border-bottom: 1px solid #C0C0C0; |
|||
padding: 10px 20px; |
|||
} |
|||
.new_temp .temp_block{ |
|||
width: 378px; |
|||
height: 137px; |
|||
background: #fff; |
|||
border-radius: 4px; |
|||
margin: 20px 0 20px 20px; |
|||
display: inline-block; |
|||
} |
|||
.new_temp .temp_block .header{ |
|||
background: #f3f4f7; |
|||
padding: 15px; |
|||
float: left; |
|||
width: 100%; |
|||
border-top: 1px solid #eee; |
|||
border-left: 1px solid #eee; |
|||
border-right: 1px solid #eee; |
|||
} |
|||
.new_temp .temp_block .header .title{ |
|||
color: #000; |
|||
font-size: 16px; |
|||
height: 35px; |
|||
line-height: 35px; |
|||
float: left; |
|||
} |
|||
.new_temp .temp_block .header .setting{ |
|||
color: #409eff; |
|||
background: #ecf5ff; |
|||
border: 1px solid #b3d8ff; |
|||
float: right; |
|||
height: 30px; |
|||
width: 60px; |
|||
margin-top: 3px; |
|||
} |
|||
.new_temp .temp_block .header .setting span{ |
|||
box-sizing: inherit; |
|||
margin: 5px; |
|||
} |
|||
.new_temp .temp_block .header .switchery{ |
|||
float: right; |
|||
} |
|||
.new_temp .temp_block .info{ |
|||
float: left; |
|||
width: 100%; |
|||
height: 70px; |
|||
text-align: center; |
|||
padding: 18px 10px; |
|||
border-bottom: 1px solid #eee; |
|||
border-left: 1px solid #eee; |
|||
border-right: 1px solid #eee; |
|||
} |
|||
.diyFormGroup .control-label{ |
|||
height: 35px; |
|||
line-height: 35px; |
|||
} |
|||
.diyFormGroup .input-group img{ |
|||
display: none!important; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">消息管理</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="alert alert-warning"> |
|||
注意:请将公众平台模板消息所在行业选择为: IT科技 互联网|电子商务,IT科技 IT软件与服务<br /> |
|||
注意:请将小程序订阅消息所在行业选择为: 商家自营-服饰内衣 |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div id="list" class="panel tab-pane panel-default"> |
|||
<div class="table-responsive"> |
|||
<!-- 管理员设置 --> |
|||
<div class="new_temp"> |
|||
<div class="form-group-title" style="margin: 0;">管理员设置</div> |
|||
<div class="temp_block" style="width: 720px;height: auto;border: none;"> |
|||
<div class="form-group diyFormGroup"> |
|||
<label class="col-sm-2 control-label">选择微信账号</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_select_user('mid', $member['id'],'选择微信账号');} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 更换公众号消息类型按钮 --> |
|||
{if p('wxplatform')} |
|||
<!-- todo 确定开启公众号订阅消息并且关闭公众号模板消息后可以删除该代码 同步修改addons/weliam_smartcity/core/model/TempModel.mod.php文件 使用公众号订阅消息 --> |
|||
<!--<div class="new_temp"> |
|||
<div class="form-group-title" style="margin: 0;">公众号消息类型</div> |
|||
<div class="temp_block" style="width: 720px;height: auto;border: none;"> |
|||
<div class="form-group diyFormGroup"> |
|||
<label class="col-sm-2 control-label">消息类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="use_template_type" {if $useTemplateType != 1}checked="checked"{/if}> 使用模板消息 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="use_template_type" {if $useTemplateType == 1}checked="checked"{/if}> 使用订阅消息 |
|||
</label> |
|||
<div class="help-block">服务号订阅通知功能开启灰度测试,模板消息即将弃用,请尽快改为使用订阅消息</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div>--> |
|||
{/if} |
|||
<!-- 模板信息-公众号 --> |
|||
<div class="new_temp {if $useTemplateType == 1}hide{/if}"> |
|||
<!--标题内容--> |
|||
<div class="form-group-title">公众号 - 模板消息</div> |
|||
<!--模板消息设置列表块--> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">订单支付成功</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=pay&source=wechat&key=status',$set['pay']['wechat']['status'])} |
|||
</div> |
|||
<div class="info {if $set['pay']['wechat']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=pay&source=wechat&key=id" value="{$set['pay']['wechat']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="pay" source="1" type="pay" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">订单发货提醒</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=send&source=wechat&key=status',$set['send']['wechat']['status'])} |
|||
</div> |
|||
<div class="info {if $set['send']['wechat']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=send&source=wechat&key=id" value="{$set['send']['wechat']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="send" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">售后状态通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=after_sale&source=wechat&key=status',$set['after_sale']['wechat']['status'])} |
|||
</div> |
|||
<div class="info {if $set['after_sale']['wechat']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=after_sale&source=wechat&key=id" value="{$set['after_sale']['wechat']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="after_sale" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">退款成功通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=refund&source=wechat&key=status',$set['refund']['wechat']['status'])} |
|||
</div> |
|||
<div class="info {if $set['refund']['wechat']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=refund&source=wechat&key=id" value="{$set['refund']['wechat']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="refund" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">业务处理结果通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=service&source=wechat&key=status',$set['service']['wechat']['status'])} |
|||
</div> |
|||
<div class="info {if $set['service']['wechat']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=service&source=wechat&key=id" value="{$set['service']['wechat']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="service" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">核销成功提醒</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=write_off&source=wechat&key=status',$set['write_off']['wechat']['status'])} |
|||
</div> |
|||
<div class="info {if $set['write_off']['wechat']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=write_off&source=wechat&key=id" value="{$set['write_off']['wechat']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="write_off" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">拼团结果通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=fight&source=wechat&key=status',$set['fight']['wechat']['status'])} |
|||
</div> |
|||
<div class="info {if $set['fight']['wechat']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=fight&source=wechat&key=id" value="{$set['fight']['wechat']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="fight" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">签到成功通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=sign&source=wechat&key=status',$set['sign']['wechat']['status'])} |
|||
</div> |
|||
<div class="info {if $set['sign']['wechat']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=sign&source=wechat&key=id" value="{$set['sign']['wechat']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="sign" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{if Customized::init('customized530')} |
|||
<!-- 定制消息推送 售后群:530 定制用户授权码:E42B66E240ED831B957640A4C7DB2B70 --> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">收益到账通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=profit&source=wechat&key=status',$set['profit']['wechat']['status'])} |
|||
</div> |
|||
<div class="info {if $set['profit']['wechat']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=profit&source=wechat&key=id" value="{$set['profit']['wechat']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="profit" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
<span class="input-group-btn set_template_info" type="profit" name="&name=profit&source=wechat"><button class="btn btn-default" type="button">设置</button></span> |
|||
</div> |
|||
</div> |
|||
<div class="modal fade" aria-hidden="false" id="profit"> |
|||
<div class="modal-dialog"> |
|||
<div class="modal-content"> |
|||
<div class="modal-body form-horizontal"> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">备注信息</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" name="profit_remark" placeholder="请输入备注信息" value="{$set['profit']['wechat']['remark']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">跳转链接</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group form-group" style="margin: 0;"> |
|||
<input type="text" value="{$set['profit']['wechat']['link']}" name="profit_link" readonly="readonly" class="form-control valid" id="profitLink"> |
|||
<span data-input="#profitLink" data-toggle="selectUrl" class="input-group-addon btn btn-default">选择链接</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<div class="btn btn-primary saveTemplateInfo">保存</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{else} |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">积分变更通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=change&source=wechat&key=status',$set['change']['wechat']['status'])} |
|||
</div> |
|||
<div class="info {if $set['change']['wechat']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=change&source=wechat&key=id" value="{$set['change']['wechat']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="change" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
<!-- 模板信息 - 公众号订阅消息 --> |
|||
{if p('wxplatform')} |
|||
<!-- todo 确定开启公众号订阅消息并且关闭公众号模板消息后可以取消注释 使用公众号订阅消息 并且可以删除上面的公众号模板消息 --> |
|||
<!--<div class="new_temp {if $useTemplateType != 1}hide{/if}"> |
|||
<!–标题内容–> |
|||
<div class="form-group-title">公众号 - 订阅消息</div> |
|||
<!– 公众号模板id填写 –> |
|||
<div class="temp_block" style="height: 55px; width: auto;display: block;border: none;"> |
|||
<div class="form-group diyFormGroup" style="max-width: 1000px;"> |
|||
<label class="col-sm-2 control-label">公众号模板id</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control" value="{$weChatTempId}" id="weChatTempId"> |
|||
<span class="btn input-group-addon" id="changeTempIdButton">提交修改</span> |
|||
</div> |
|||
<div class="help-block">移动端进行消息订阅时需要使用该id。id获取位置:公众号平台 - 接口权限 - 一次性订阅消息 - 查看模板id</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!–模板消息设置列表块–> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">订单支付成功</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=pay&source=wechatSubscription&key=status',$set['pay']['wechatSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['pay']['wechatSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=pay&source=wechatSubscription&key=id" value="{$set['pay']['wechatSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="pay" source="1" type="pay" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">订单发货提醒</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=send&source=wechatSubscription&key=status',$set['send']['wechatSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['send']['wechatSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=send&source=wechatSubscription&key=id" value="{$set['send']['wechatSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="send" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">售后状态通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=after_sale&source=wechatSubscription&key=status',$set['after_sale']['wechatSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['after_sale']['wechatSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=after_sale&source=wechatSubscription&key=id" value="{$set['after_sale']['wechatSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="after_sale" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">退款成功通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=refund&source=wechatSubscription&key=status',$set['refund']['wechatSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['refund']['wechatSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=refund&source=wechatSubscription&key=id" value="{$set['refund']['wechatSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="refund" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">业务处理结果通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=service&source=wechatSubscription&key=status',$set['service']['wechatSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['service']['wechatSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=service&source=wechatSubscription&key=id" value="{$set['service']['wechatSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="service" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">核销成功提醒</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=write_off&source=wechatSubscription&key=status',$set['write_off']['wechatSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['write_off']['wechatSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=write_off&source=wechatSubscription&key=id" value="{$set['write_off']['wechatSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="write_off" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">拼团结果通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=fight&source=wechatSubscription&key=status',$set['fight']['wechatSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['fight']['wechatSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=fight&source=wechatSubscription&key=id" value="{$set['fight']['wechatSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="fight" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">签到成功通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=sign&source=wechatSubscription&key=status',$set['sign']['wechatSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['sign']['wechatSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=sign&source=wechatSubscription&key=id" value="{$set['sign']['wechatSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="sign" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">积分变更通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=change&source=wechatSubscription&key=status',$set['change']['wechatSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['change']['wechatSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=change&source=wechatSubscription&key=id" value="{$set['change']['wechatSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="change" source="1"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div>--> |
|||
{/if} |
|||
<!-- 模板信息 - 小程序订阅消息 --> |
|||
{if p('wxapp')} |
|||
<div class="new_temp"> |
|||
<!--标题内容--> |
|||
<div class="form-group-title">小程序 - 订阅消息</div> |
|||
<!--模板消息设置列表块--> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">订单支付成功</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=pay&source=weappSubscription&key=status',$set['pay']['weappSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['pay']['weappSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=pay&source=weappSubscription&key=id" value="{$set['pay']['weappSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="pay" source="2"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">订单发货提醒</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=send&source=weappSubscription&key=status',$set['send']['weappSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['send']['weappSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=send&source=weappSubscription&key=id" value="{$set['send']['weappSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="send" source="2"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">售后状态通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=after_sale&source=weappSubscription&key=status',$set['after_sale']['weappSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['after_sale']['weappSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=after_sale&source=weappSubscription&key=id" value="{$set['after_sale']['weappSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="after_sale" source="2"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">退款成功通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=refund&source=weappSubscription&key=status',$set['refund']['weappSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['refund']['weappSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=refund&source=weappSubscription&key=id" value="{$set['refund']['weappSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="refund" source="2"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">业务处理结果通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=service&source=weappSubscription&key=status',$set['service']['weappSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['service']['weappSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=service&source=weappSubscription&key=id" value="{$set['service']['weappSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="service" source="2"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">核销成功提醒</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=write_off&source=weappSubscription&key=status',$set['write_off']['weappSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['write_off']['weappSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=write_off&source=weappSubscription&key=id" value="{$set['write_off']['weappSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="write_off" source="2"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">拼团结果通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=fight&source=weappSubscription&key=status',$set['fight']['weappSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['fight']['weappSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=fight&source=weappSubscription&key=id" value="{$set['fight']['weappSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="fight" source="2"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">签到成功通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=sign&source=weappSubscription&key=status',$set['sign']['weappSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['sign']['weappSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=sign&source=weappSubscription&key=id" value="{$set['sign']['weappSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="sign" source="2"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="temp_block"> |
|||
<div class="header"> |
|||
<div class="title">积分变更通知</div> |
|||
{php echo tpl_change_status('news/template/changeStatus&name=change&source=weappSubscription&key=status',$set['change']['weappSubscription']['status'])} |
|||
</div> |
|||
<div class="info {if $set['change']['weappSubscription']['status'] != 1}hide{/if}"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control temp_id" name="&name=change&source=weappSubscription&key=id" value="{$set['change']['weappSubscription']['id']}"> |
|||
<span class="input-group-btn get_template_id" type="change" source="2"><button class="btn btn-default" type="button">获取</button></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 开启、关闭的效果操作 |
|||
*/ |
|||
$(document).on('change', '.js-switch.tpl_change_status', function () { |
|||
//参数获取 |
|||
let _this = $(this), |
|||
checked = _this.attr("checked"), |
|||
position = _this.parents(".header").siblings('.info'); |
|||
//判断当前的操作 |
|||
if (checked) { |
|||
//关闭时的操作 |
|||
position.addClass("hide"); |
|||
//关闭模板消息 自动清空模板id |
|||
position.find(".temp_id").val('').change(); |
|||
} else { |
|||
//开启时的操作 |
|||
position.removeClass("hide"); |
|||
//开启模板消息 自动获取当前模板消息的模板id |
|||
position.find(".get_template_id").click(); |
|||
} |
|||
}); |
|||
/** |
|||
* 获取通讯模板id信息 |
|||
*/ |
|||
$(document).on('click','.get_template_id',function () { |
|||
let _this = $(this), |
|||
type = _this.attr("type"),//模板类型 |
|||
source = _this.attr("source");//端口设置:1=微信公众号;2=h5;3=微信小程序 |
|||
let res = common.ajaxPost('news/template/getTempId',{type:type,source:source},true,false); |
|||
if(res['errno'] == 0){ |
|||
$(this).prev().val(res['data']).change(); |
|||
}else{ |
|||
tip.alert(res['message'],function () { |
|||
history.go(0); |
|||
}); |
|||
} |
|||
}); |
|||
/** |
|||
* 提交模板id的修改信息 |
|||
*/ |
|||
$(document).on('change','.temp_id',function () { |
|||
//基本参数获取 |
|||
let _this = $(this), |
|||
name = _this.attr("name"), |
|||
val = _this.val(), |
|||
url = 'news/template/changeStatus' + name; |
|||
//提交修改 |
|||
let res = common.ajaxPost(url,{status:val},true,false); |
|||
|
|||
//console.log(res); |
|||
}); |
|||
/** |
|||
* 修改管理员 |
|||
*/ |
|||
$(document).on('change',"[name='mid']",function(){ |
|||
let mid = $(this).val(); |
|||
$.get("{php echo web_url('news/template/addmid')}", { |
|||
mid: mid |
|||
}, function(){ |
|||
util.tips('修改成功'); |
|||
}); |
|||
}); |
|||
/** |
|||
* 修改模板消息中的设置信息 |
|||
*/ |
|||
$(document).on('click','.set_template_info',function () { |
|||
let id = $(this).attr('type'), |
|||
modalId = '#'+id, |
|||
name = $(this).attr('name'); |
|||
//弹出设置栏 |
|||
$(modalId).modal(); |
|||
//点击提交设置信息 |
|||
$(modalId).on('click',".saveTemplateInfo",function () { |
|||
let remarkName = id + '_remark', |
|||
linkName = id + '_link', |
|||
remark = $("[name='"+remarkName+"']").val(), |
|||
link = $("[name='"+linkName+"']").val(); |
|||
|
|||
let res = common.ajaxPost('news/template/changeSetInfo'+name,{remark:remark,link:link},true,false); |
|||
if(res.errno == 0) tip.alert(res.message,function (){ |
|||
history.go(0); |
|||
}) |
|||
}); |
|||
}); |
|||
/** |
|||
* 修改公众号消息类型 |
|||
*/ |
|||
$(document).on('change',"[name='use_template_type']",function(){ |
|||
let type = $(this).val(); |
|||
$.post("{php echo web_url('news/template/changeTemplateType')}", { |
|||
type: type |
|||
}, function(){ |
|||
tip.alert('修改成功',function (){ |
|||
history.go(0); |
|||
}) |
|||
}); |
|||
}); |
|||
/** |
|||
* 修改公众号模板id |
|||
*/ |
|||
$(document).on('click','#changeTempIdButton',function () { |
|||
let temp_id = $("#weChatTempId").val(); |
|||
if(temp_id.length <= 1) { |
|||
tip.alert("请输入公众号模板id"); |
|||
}else{ |
|||
$.post("{php echo web_url('news/template/changeWeChatTempId')}", { |
|||
temp_id: temp_id |
|||
}, function(){ |
|||
tip.alert('修改成功',function (){ |
|||
history.go(0); |
|||
}) |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,11 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Openapi { |
|||
|
|||
static function apiurl($do) { |
|||
global $_W, $_GPC; |
|||
$settings = Setting::wlsetting_read('apiset'); |
|||
return $_W['siteroot'] . 'addons/'.MODULE_NAME.'/core/common/openapi.php?i=' . $_W['uniacid'] . "&do=" . $do . "&token=" . $settings['token']; |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[开放接口]]></name> |
|||
<identifie><![CDATA[openapi]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[expand]]></type> |
|||
<description><![CDATA[开放接口,可以对接其他模块]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="false" /> |
|||
<system embed="true" /> |
|||
<task embed="false" /> |
|||
</setting> |
|||
<agentmenu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="接口" font="fa-inbox"> |
|||
<entry title="接口列表" ac="apilist" do="apimanage" iscover="true" /> |
|||
<entry title="接口设置" ac="apilist" do="apiset" /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 3.9 KiB |
@ -0,0 +1,104 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Weliam_smartcityModuleOpenapi extends Openapi { |
|||
|
|||
//添加分销商 |
|||
public function doPageAdddisor() { |
|||
global $_W, $_GPC; |
|||
$openid = $_GPC['openid']; |
|||
$nickname = $_GPC['nickname']; |
|||
$avatar = $_GPC['avatar']; |
|||
if(empty($openid)){ |
|||
$this->result(1,'无有效openid'); |
|||
} |
|||
$mid = pdo_getcolumn('wlmerchant_member',array('openid' => $openid),'id'); |
|||
if(empty($mid)){ |
|||
$memberdata = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'openid' => $openid, |
|||
'nickname' => $nickname, |
|||
'avatar' => $avatar, |
|||
'createtime' => time() |
|||
); |
|||
pdo_insert(PDO_NAME.'member',$memberdata); |
|||
$mid = pdo_insertid(); |
|||
} |
|||
|
|||
$member = pdo_get('wlmerchant_member',array('id' => $mid),array('mobile','nickname','realname')); |
|||
$distributorid = pdo_getcolumn('wlmerchant_member',array('id'=>$mid),'distributorid'); |
|||
if($distributorid){ |
|||
$distributor = pdo_get('wlmerchant_distributor',array('id'=> $distributorid)); |
|||
if($distributor['disflag']){ |
|||
$this->result(1,'不能重复添加'); |
|||
}else { |
|||
$res = pdo_update('wlmerchant_distributor',array('disflag' => 1),array('id' => $distributorid)); |
|||
if($res){ |
|||
$this->result(0, '添加成功', array('id' => $distributorid)); |
|||
}else { |
|||
$this->result(1,'未知错误,请联系管理员'); |
|||
} |
|||
} |
|||
}else { |
|||
$data = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'mid' => $mid, |
|||
'createtime' => time(), |
|||
'disflag' => 1, |
|||
'nickname' => $member['nickname'], |
|||
'mobile' => $member['mobile'], |
|||
'realname' => $member['realname'] |
|||
); |
|||
pdo_insert('wlmerchant_distributor',$data); |
|||
$disid = pdo_insertid(); |
|||
$res = pdo_update('wlmerchant_member',array('distributorid' => $disid),array('id' => $mid)); |
|||
if($res){ |
|||
$this->result(0, '添加成功', array('id' => $disid)); |
|||
}else { |
|||
$this->result(1,'未知错误,请联系管理员'); |
|||
} |
|||
} |
|||
} |
|||
|
|||
//修改分销商余额 |
|||
public function doPageChangediscash() { |
|||
global $_W, $_GPC; |
|||
$openid = $_GPC['openid']; |
|||
$money = $_GPC['money']; //变更金额 |
|||
$reason = $_GPC['reason']; //修改原因 |
|||
$buymid = isset($_GPC['buymid'])?intval($_GPC['buymid']):-1; |
|||
if(empty($openid)){ |
|||
$this->result(1,'无有效openid'); |
|||
} |
|||
if(empty($money)){ |
|||
$this->result(1,'无有效变更金额'); |
|||
} |
|||
$disid = pdo_getcolumn(PDO_NAME.'member',array('openid'=>$openid),'distributorid'); |
|||
if(empty($disid)){ |
|||
$this->result(1,'该用户不是分销商'); |
|||
} |
|||
$distri = pdo_get('wlmerchant_distributor',array('id' => $disid),array('id','mid','dismoney','nowmoney')); |
|||
if($money > 0){ |
|||
$type = 1; |
|||
}else{ |
|||
$type = 2; |
|||
} |
|||
$money = abs($money); |
|||
$money = sprintf("%.2f",$money); |
|||
if(empty($reason)){ |
|||
$reason = '接口修改分销商金额'; |
|||
} |
|||
if($type == 1){ |
|||
$onedismoney = $distri['dismoney'] + $money; |
|||
$onenowmoney = $distri['nowmoney'] + $money; |
|||
}else { |
|||
$onedismoney = $distri['dismoney'] - $money; |
|||
$onenowmoney = $distri['nowmoney'] - $money; |
|||
} |
|||
$changeflag = pdo_update('wlmerchant_distributor',array('dismoney' => $onedismoney,'nowmoney' => $onenowmoney),array('id' => $distri['id'])); |
|||
if($changeflag){ |
|||
Distribution::adddisdetail(0,$distri['mid'],$buymid,$type,$money,'system',1,$reason); |
|||
$this->result(0,'修改成功'); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Apilist_WeliamController { |
|||
|
|||
public function apimanage(){ |
|||
global $_W, $_GPC; |
|||
|
|||
$disapis = array( |
|||
array( |
|||
'name' => '添加分销商', |
|||
'url' => Openapi::apiurl('adddisor'), |
|||
'request_data' => array('openid|String|是|公众号粉丝openid', 'nickname|String|是|公众号粉丝昵称', 'avatar|String|是|公众号粉丝头像'), |
|||
'response_data' => array('id|Number|否|分销商ID'), |
|||
'response' => array('errno' => 0, 'message' => '添加成功', 'data' => array('id' => 1)), |
|||
'error_response' => array('errno' => -1, 'message' => '无效Token,请检查后再试', 'data' => array()) |
|||
), |
|||
array( |
|||
'name' => '修改分销商余额', |
|||
'url' => Openapi::apiurl('changediscash'), |
|||
'request_data' => array('openid|String|是|公众号粉丝openid', 'money|Number|是|变更金额,负数为减少,正数为增加', 'reason|String|是|余额变更说明'), |
|||
'response_data' => array(), |
|||
'response' => array('errno' => 0, 'message' => '修改成功', 'data' => array()), |
|||
'error_response' => array('errno' => -1, 'message' => '无效Token,请检查后再试', 'data' => array()) |
|||
), |
|||
); |
|||
|
|||
include wl_template('apilist/apimanage'); |
|||
} |
|||
|
|||
public function apiset(){ |
|||
global $_W, $_GPC; |
|||
|
|||
$settings = Setting::wlsetting_read('apiset'); |
|||
if (checksubmit('submit')) { |
|||
Setting::wlsetting_save(array('token' => trim($_GPC['apitoken'])), 'apiset'); |
|||
wl_message('更新设置成功!', web_url('openapi/apilist/apiset')); |
|||
} |
|||
|
|||
include wl_template('apilist/apiset'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,190 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">分销接口</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="openapi-list clearfix"> |
|||
<div class="col-sm-2"> |
|||
<ul class="nav nav-pills nav-stacked"> |
|||
{loop $disapis $k $val} |
|||
<li {if $k == 0}class="active"{/if}><a href="#{$k}" data-toggle="tab">{$val['name']}</a></li> |
|||
{/loop} |
|||
</ul> |
|||
</div> |
|||
<div class="col-sm-9"> |
|||
<div class="tab-content"> |
|||
{loop $disapis $kk $value} |
|||
<div class="tab-pane {if $kk == 0}active{/if}" id="{$kk}"> |
|||
<div class="detail-item"> |
|||
<div class="detail-title">请求地址</div> |
|||
<div class="detail-content"> |
|||
<div class="request-url">{$value['url']}</div> |
|||
</div> |
|||
<div class="detail-title">请求参数</div> |
|||
<div class="detail-content"> |
|||
<div class="zent-table-container"> |
|||
<div class="zent-loading-container zent-loading-container-static " style="height: initial;"> |
|||
<div class="zent-table table-api-group"> |
|||
<div class="thead"> |
|||
<div class="stickrow tr"> |
|||
<div class="cell" style="width: 25%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container">名称</div> |
|||
</div> |
|||
<div class="cell" style="width: 25%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container">类型</div> |
|||
</div> |
|||
<div class="cell" style="width: 20%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container">是否必须</div> |
|||
</div> |
|||
<div class="cell" style="width: 30%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container">描述</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tbody"> |
|||
{if !empty($value['request_data'])} |
|||
{loop $value['request_data'] $rk $rval} |
|||
{php $relist = explode("|", $rval);} |
|||
<div class="row-{$rk} tr"> |
|||
<div class="cell" style="width: 25%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container">{$relist[0]}</div> |
|||
</div> |
|||
<div class="cell" style="width: 25%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container"> |
|||
<div>{$relist[1]}</div> |
|||
</div> |
|||
</div> |
|||
<div class="cell" style="width: 20%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container">{$relist[2]}</div> |
|||
</div> |
|||
<div class="cell" style="width: 30%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container">{$relist[3]}</div> |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
{else} |
|||
<div class="tr"><div class="cell empty-data">该接口无需请求参数</div></div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="detail-title">响应参数</div> |
|||
<div class="detail-content"> |
|||
<div class="zent-table-container"> |
|||
<div class="zent-loading-container zent-loading-container-static " style="height: initial;"> |
|||
<div class="zent-table table-api-group"> |
|||
<div class="thead"> |
|||
<div class="stickrow tr"> |
|||
<div class="cell" style="width: 25%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container">名称</div> |
|||
</div> |
|||
<div class="cell" style="width: 25%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container">类型</div> |
|||
</div> |
|||
<div class="cell" style="width: 20%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container">是否必须</div> |
|||
</div> |
|||
<div class="cell" style="width: 30%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container">描述</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tbody"> |
|||
{if !empty($value['response_data'])} |
|||
{loop $value['response_data'] $rdk $rdval} |
|||
{php $rdlist = explode("|", $rdval);} |
|||
<div class="row-{$rdk} tr"> |
|||
<div class="cell" style="width: 25%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container">{$rdlist[0]}</div> |
|||
</div> |
|||
<div class="cell" style="width: 25%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container"> |
|||
<div>{$rdlist[1]}</div> |
|||
</div> |
|||
</div> |
|||
<div class="cell" style="width: 20%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container">{$rdlist[2]}</div> |
|||
</div> |
|||
<div class="cell" style="width: 30%; flex: 0 1 auto;"> |
|||
<div class="cell__child-container">{$rdlist[3]}</div> |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
{else} |
|||
<div class="tr"><div class="cell empty-data">该接口无响应参数</div></div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="detail-title">响应示例</div> |
|||
<div class="detail-content"> |
|||
<pre class="responseDemo">{php echo json_encode($value['response'], JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT)}</pre> |
|||
</div> |
|||
<div class="detail-title">异常示例</div> |
|||
<div class="detail-content"> |
|||
<pre class="errorResponseDemo">{php echo json_encode($value['error_response'], JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT)}</pre> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<style> |
|||
.openapi-list{margin-top: 15px;} |
|||
.openapi-list .detail-item .detail-title{font-size:16px;font-weight:700;color:#333} |
|||
.openapi-list .detail-item .detail-content{font-size:14px;color:#333;margin-top:10px;width:100%;margin-bottom: 30px;} |
|||
.openapi-list .detail-item .detail-content hr{border-bottom:1px solid #e5e5e5;border-top:0;border-left:0;border-right:0;margin:1px 0 10px} |
|||
.openapi-list .detail-item .detail-content .link-faq{margin-left:20px} |
|||
.openapi-list .detail-item .detail-content .link-faq,.openapi-list .detail-item .detail-content .link-sdk-download{width:90px;height:32px;line-height:32px;font-size:14px;text-align:center;border-radius:2px;display:inline-block;background-color:#38f;color:#fff} |
|||
.zent-table-container{margin-bottom:20px} |
|||
.zent-table{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%} |
|||
.zent-table a{color:#38f;cursor:pointer} |
|||
.zent-table a:hover{cursor:pointer;text-decoration:none} |
|||
.zent-table .tr{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:-moz-box;display:flex;border-bottom:1px solid #e5e5e5} |
|||
.zent-table .expanded-item{width:70px;text-align:center;position:relative} |
|||
.zent-table .expanded-item i{height:100%} |
|||
.zent-table .expanded-item i:before{position:absolute;top:50%;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)} |
|||
.zent-table .thead .tr{border-top:none;border-bottom:1px solid #e5e5e5;background:#f2f2f2} |
|||
.zent-table .tbody .tr:hover{background:#f8f8f8} |
|||
.zent-table .tbody .tr:hover .empty-data{background:transparent} |
|||
.zent-table .tbody .tr--expanded{background-color:#f8f8f8} |
|||
.zent-table .tbody .tr .td{padding:16px 0 8px} |
|||
.zent-table .tbody .tr .td .expandable-btn{position:absolute;top:50%;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;width:17px;height:17px;text-align:center;background:#fff;line-height:10px;border:1px solid #e5e5e5} |
|||
.zent-table .tbody .tr .td .expandable-btn.expand-btn:after{content:"+";-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box} |
|||
.zent-table .tbody .tr .td .expandable-btn.collapse-btn:after{content:"-";-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box} |
|||
.zent-table .tbody .cell{min-height:30px} |
|||
.zent-table .tfoot{margin-top:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box} |
|||
.zent-table .tfoot__batchcomponents{float:left;padding:5px;padding-left:10px} |
|||
.zent-table .tfoot__batchcomponents--has-children{border:1px solid #e5e5e5;background:#fff} |
|||
.zent-table .tfoot__batchcomponents--fixed{position:fixed;bottom:0} |
|||
.zent-table .tfoot__page{float:right} |
|||
.zent-table .cell{position:relative;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:-moz-box;display:flex;-webkit-box-flex:1;-ms-flex:auto;-webkit-flex:auto;-moz-box-flex:1;flex:auto;-ms-flex-preferred-size:0;-webkit-flex-basis:0;flex-basis:0;padding:10px;padding-left:0;min-height:20px;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-box-align:center;align-items:center;text-align:left;font-size:14px} |
|||
.zent-table .cell__child-container{overflow:hidden;width:100%;text-overflow:ellipsis} |
|||
.zent-table .cell:first-child{padding-left:10px} |
|||
.zent-table .cell:last-child{-webkit-box-pack:end;-ms-flex-pack:end;-webkit-justify-content:flex-end;-moz-box-pack:end;justify-content:flex-end} |
|||
.zent-table .cell:last-child .cell__child-container{text-align:right} |
|||
.zent-table .cell.empty-data{line-height:20px;height:40px;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;-moz-box-pack:center;justify-content:center} |
|||
.zent-table .cell.cell--selection{padding-left:34px} |
|||
.zent-table .cell.cell--money,.zent-table .cell.cell--right{-webkit-box-pack:end;-ms-flex-pack:end;-webkit-justify-content:end;-moz-box-pack:end;justify-content:end} |
|||
.zent-table .cell.cell--money .cell__child-container,.zent-table .cell.cell--right .cell__child-container{text-align:right} |
|||
.zent-table .cell.cell--start{-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:start;-moz-box-pack:start;justify-content:start} |
|||
.zent-table .cell.cell--start .cell__child-container{text-align:left} |
|||
.zent-table .cell.cell--center{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;-moz-box-pack:center;justify-content:center} |
|||
.zent-table .cell.cell--center .cell__child-container{text-align:center} |
|||
.zent-table .cell .asc,.zent-table .cell .desc{margin-left:3px} |
|||
.zent-table .cell .desc:after{position:absolute;content:"\2193"} |
|||
.zent-table .cell .asc:after{position:absolute;content:"\2191"} |
|||
.zent-table .cell .select-check{position:absolute;left:10px;top:50%;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);margin-top:0} |
|||
.zent-table .card__thumb{float:left;margin-right:5px;height:50px} |
|||
.zent-table .card__title{display:block;height:32px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;font-size:14px;color:#38f} |
|||
.zent-table .card__title:hover{text-decoration:none} |
|||
.zent-table .card__info{font-size:14px;color:#f66} |
|||
.zent-table .clearfix:after{content:"";display:table;clear:both} |
|||
</style> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,47 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">接口设置</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">接口设置</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">接口Token</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="apitoken" class="form-control" id="num" value="{$settings['token']}"> |
|||
<a href="javascript:;" class="input-group-addon">生成新的Token</a> |
|||
</div> |
|||
<div class="help-block">请不要随意变更接口Token,否则将导致接口无法调用</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$(document).on('click', '.input-group-addon', function() { |
|||
tip.confirm('旧Token将失效,确认生成新的Token?', getNum); |
|||
function getNum(){ |
|||
var chars = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']; |
|||
var nums=""; |
|||
for(var i=0;i<32;i++){ |
|||
var id = parseInt(Math.random()*61); |
|||
nums+=chars[id]; |
|||
} |
|||
$('#num').val(nums); |
|||
} |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,254 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Paidpromotion{ |
|||
|
|||
static function getpaidpr($type,$id,$mid,$orderid,$paytype,$price,$num = 1){ |
|||
global $_W; |
|||
//判断是否已赠送 |
|||
$flag = pdo_getcolumn(PDO_NAME.'paidrecord',array('type'=>$type,'orderid'=>$orderid),'id'); |
|||
if($flag > 0){ |
|||
return 0; |
|||
} |
|||
//判断是否存在mid |
|||
if(!$mid){ |
|||
if ($type == 1) $mid = pdo_getcolumn(PDO_NAME.'rush_order',['id' => $orderid],'mid'); |
|||
else if ($type != 5) $mid = pdo_getcolumn(PDO_NAME.'order',['id' => $orderid],'mid'); |
|||
} |
|||
$activity = pdo_get('wlmerchant_payactive',array('id' => $id)); |
|||
if($activity['status']>0){ |
|||
$_W['mid'] = $mid; |
|||
//判断资格 |
|||
if($activity['userstatus']){ //判断会员资格 |
|||
$halfflag = Member::checkhalfmember(); |
|||
if(empty($halfflag)){ |
|||
return 0; |
|||
} |
|||
} |
|||
if($price < $activity['orderprice']){ //判断订单 订单价格 |
|||
return 0; |
|||
} |
|||
//判断支付方式 |
|||
if(!empty($activity['paytypearray'])){ |
|||
$paytypearray = unserialize($activity['paytypearray']); |
|||
if(!in_array($paytype,$paytypearray)){ |
|||
return 0; |
|||
} |
|||
} |
|||
//开始计算礼物 |
|||
$nointegral = 0; |
|||
if($_W['wlsetting']['creditset']['nointegral'] > 0){ |
|||
if($type == 1){ |
|||
$dkmoney = pdo_getcolumn(PDO_NAME.'rush_order',array('id'=>$orderid),'dkmoney'); |
|||
}else if($type != 5){ |
|||
$dkmoney = pdo_getcolumn(PDO_NAME.'order',array('id'=>$orderid),'cerditmoney'); |
|||
} |
|||
if($dkmoney > 0){ |
|||
$nointegral = 1; |
|||
} |
|||
} //不赠送积分 |
|||
if($activity['integralrate'] > 0 && empty($nointegral)){ //积分 |
|||
if($activity['integral'] < 0.01){ |
|||
$activity['integral'] = 1; |
|||
} |
|||
if($activity['ratestatus'] > 0){ |
|||
$integral = sprintf("%.2f",floor($price/$activity['integralrate'])*$activity['integral']); |
|||
}else{ |
|||
$integral = sprintf("%.2f",$price/$activity['integralrate']*$activity['integral']); |
|||
} |
|||
} |
|||
if($activity['balancerate'] > 0){ //余额 |
|||
if($activity['balance'] < 0.01){ |
|||
$activity['balance'] = 1; |
|||
} |
|||
if($activity['ratestatus'] > 0){ |
|||
$balance = sprintf("%.2f",floor($price/$activity['balancerate'])*$activity['balance']); |
|||
}else{ |
|||
$balance = sprintf("%.2f",$price/$activity['balancerate']*$activity['balance']); |
|||
} |
|||
} |
|||
|
|||
if($activity['giftstatus'] == 1){ //赠券 |
|||
$couponid = $activity['giftcouponid']; |
|||
}else if($activity['giftstatus'] == 2){ //赠码 |
|||
$codeid = pdo_getcolumn('wlmerchant_token',array('uniacid' => $_W['uniacid'],'remark' => $activity['codereamrk'],'status'=>0),'id'); |
|||
pdo_update('wlmerchant_token',array('status' => 2),array('id' => $codeid)); |
|||
}else if($activity['giftstatus'] == 3){ //赠送红包 |
|||
$redpackid = $activity['giftredpack']; |
|||
} |
|||
//创建记录 |
|||
$data = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'aid' => $_W['aid'], |
|||
'activeid' => $activity['id'], |
|||
'integral' => $integral, |
|||
'balance' => $balance, |
|||
'couponid' => $couponid, |
|||
'getcouflag' => 0, |
|||
'codeid' => $codeid, |
|||
'paytype' => $paytype, |
|||
'price' => $price, |
|||
'createtime' => time(), |
|||
'img' => $activity['img'], |
|||
'type' => $type, |
|||
'orderid' => $orderid, |
|||
'redpackid' => $redpackid |
|||
); |
|||
pdo_insert(PDO_NAME.'paidrecord',$data); |
|||
$paidprid = pdo_insertid(); |
|||
//赠送积分 |
|||
if($paidprid && $integral>0){ |
|||
$integralChangeRes = Member::credit_update_credit1($mid, $integral, '支付有礼赠送积分'); |
|||
if(is_array($integralChangeRes)){ |
|||
file_put_contents(PATH_DATA . "integralChangeError.log", var_export(['info'=>$integralChangeRes,'paidprid'=>$paidprid,'mid'=>$mid], true) . PHP_EOL, FILE_APPEND); |
|||
} |
|||
} |
|||
if($paidprid && $balance>0){ |
|||
if($_W['aid'] > 0){ |
|||
$agenttemark = '支付有利赠送余额'; |
|||
$ares = Order::deductAgencyAmount($_W['aid'],$balance,$agenttemark); |
|||
}else{ |
|||
$ares = 1; |
|||
} |
|||
if($ares){ |
|||
$balanceChangeRes = Member::credit_update_credit2($mid, $balance, '支付有礼赠送余额'); |
|||
if(is_array($balanceChangeRes)){ |
|||
file_put_contents(PATH_DATA . "integralChangeError.log", var_export(['info'=>$balanceChangeRes,'paidprid'=>$paidprid,'mid'=>$mid], true) . PHP_EOL, FILE_APPEND); |
|||
} |
|||
}else{ |
|||
pdo_update(PDO_NAME.'paidrecord',array('balance' => 0),array('id' => $paidprid)); |
|||
} |
|||
} |
|||
//自动发放卡券 |
|||
if($data['couponid'] && $activity['giftstatus'] == 1 && $activity['getstatus'] && $paidprid){ |
|||
$couponIdList = explode(',',$activity['giftcouponid']); |
|||
#3、通过循环判断信息 |
|||
if(is_array($couponIdList)){ |
|||
foreach ($couponIdList as $k => $v){ |
|||
$acresult = '';//优惠券领取状态 |
|||
$coupons = wlCoupon::getSingleCoupons($v, '*'); |
|||
$num = wlCoupon::getCouponNum($v, 1); |
|||
//判断卡券是否能够被领取 |
|||
if ($coupons['time_type'] == 1 && $coupons['endtime'] < time()) { |
|||
$acresult = '[失败]已停止发放'; |
|||
} |
|||
if ($coupons['status'] == 0) { |
|||
$acresult = '[失败]已被禁用'; |
|||
} |
|||
if ($coupons['status'] == 3) { |
|||
$acresult = '[失败]已失效'; |
|||
} |
|||
if ($coupons['surplus'] > ($coupons['quantity'] - 1)) { |
|||
$acresult = '[失败]已被领光'; |
|||
} |
|||
if ($num) { |
|||
if (($num > $coupons['get_limit'] || $num == $coupons['get_limit']) && $coupons['get_limit'] > 0) { |
|||
$acresult = '[失败]只能领取'.$coupons['get_limit'].'张'; |
|||
} |
|||
} |
|||
//领取状态为空 无异常 开始正常的领取操作 |
|||
if(empty($acresult)){ |
|||
//用户领取卡券的操作 |
|||
if ($coupons['time_type'] == 1) { |
|||
$starttime = $coupons['starttime']; |
|||
$endtime = $coupons['endtime']; |
|||
} else { |
|||
$starttime = time(); |
|||
$endtime = time() + ($coupons['deadline'] * 24 * 3600); |
|||
} |
|||
|
|||
if(empty($coupons['is_charge'])){ |
|||
$coupons['price'] = 0; |
|||
$settlementmoney = 0; |
|||
}else{ |
|||
//结算金额 |
|||
$settlementmoney = Store::getsettlementmoney(4,$coupons['id'],1,$coupons['merchantid'],0); |
|||
} |
|||
//生成领取订单 |
|||
$orderdata = array( |
|||
'uniacid' => $coupons['uniacid'], |
|||
'mid' => $_W['mid'], |
|||
'aid' => $coupons['aid'], |
|||
'fkid' => $coupons['id'], |
|||
'sid' => $coupons['merchantid'], |
|||
'status' => 1, |
|||
'paytype' => 6, |
|||
'createtime' => time(), |
|||
'orderno' => createUniontid(), |
|||
'price' => 0, |
|||
'num' => 1, |
|||
'plugin' => 'coupon', |
|||
'payfor' => 'couponsharge', |
|||
'vipbuyflag' => 0, |
|||
'goodsprice' => $coupons['price'], |
|||
'settlementmoney' => $settlementmoney, |
|||
'neworderflag' => 1, |
|||
'buyremark' => '支付有礼赠送卡券,支付有礼编号:'.$paidprid, |
|||
'paytime' => time() |
|||
); |
|||
$orderid = wlCoupon::saveCouponOrder($orderdata); |
|||
Order::createSmallorder($orderid,4); |
|||
//生成卡券 |
|||
$data = array( |
|||
'mid' => $_W['mid'], |
|||
'aid' => $coupons['aid'], |
|||
'parentid' => $coupons['id'], |
|||
'status' => 1, |
|||
'type' => $coupons['type'], |
|||
'title' => $coupons['title'], |
|||
'sub_title' => $coupons['sub_title'], |
|||
'content' => $coupons['goodsdetail'], |
|||
'description' => $coupons['description'], |
|||
'color' => $coupons['color'], |
|||
'starttime' => $starttime, |
|||
'endtime' => $endtime, |
|||
'createtime' => time(), |
|||
'usetimes' => $coupons['usetimes'], |
|||
'concode' => 0, |
|||
'uniacid' => $coupons['uniacid'], |
|||
'orderno' => $orderdata['orderno'] |
|||
); |
|||
$res = pdo_insert(PDO_NAME . 'member_coupons', $data); |
|||
$couponUserId = pdo_insertid(); |
|||
$newdata['recordid'] = $couponUserId; |
|||
$newdata['estimatetime'] = $data['endtime']; |
|||
pdo_update(PDO_NAME.'order',$newdata, array('id' => $orderid)); //更新订单状态 |
|||
if($res){ |
|||
//修改卡券的已售数量 |
|||
$newsurplus = $coupons['surplus'] + 1; |
|||
wlCoupon::updateCoupons(array('surplus' => $newsurplus), array('id' => $v)); |
|||
$url = h5_url('pages/subPages/coupon/couponDetails/couponDetails',['id'=>$couponUserId,'order_id'=>$orderid]); |
|||
$acresult = '[成功]领取成功'; |
|||
}else{ |
|||
$acresult = '[失败]领取失败'; |
|||
} |
|||
} |
|||
//发送当前卡券领取结果的通知 |
|||
$messagedata = array( |
|||
'first' => '“'.$coupons['title'].'”领取结果通知', |
|||
'type' => '支付有礼-卡券领取',//业务类型 |
|||
'content' => '领取人:'.$_W['wlmember']['nickname'],//业务内容 |
|||
'status' => $acresult ,//处理结果 |
|||
'time' => date('Y-m-d H:i:s',time()),//操作时间 |
|||
'remark' => '点击查看我的卡券' |
|||
); |
|||
TempModel::sendInit('service',$_W['mid'],$messagedata,$_W['source'],$url); |
|||
$acresult = '';//清除领取状态 |
|||
} |
|||
} |
|||
pdo_update(PDO_NAME.'paidrecord',array('getcouflag' => 1,'getcoutime'=>time()),array('id' => $paidprid)); |
|||
} |
|||
//发放红包 |
|||
if($data['redpackid'] && $activity['giftstatus'] == 3 && $paidprid){ |
|||
$redList = explode(',',$activity['giftredpack']); |
|||
foreach ($redList as $k => $v){ |
|||
Redpack::pack_send($mid,$v,'send'); |
|||
} |
|||
} |
|||
return $paidprid; |
|||
}else{ |
|||
return 0; |
|||
} |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[支付有礼]]></name> |
|||
<identifie><![CDATA[paidpromotion]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[interact]]></type> |
|||
<description><![CDATA[支付成功后的客户营销,支持发卡券、送激活码等等。]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="true" /> |
|||
<system embed="true" /> |
|||
<task embed="false" /> |
|||
</setting> |
|||
<agentmenu> |
|||
<menu title="活动" font="fa-inbox"> |
|||
<entry title="活动管理" ac="payactive" do="activelist" iscover="true" /> |
|||
<entry title="赠礼记录" ac="payactive" do="recodelist" /> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="活动" font="fa-inbox"> |
|||
<entry title="活动管理" ac="payactive" do="activelist" iscover="true" /> |
|||
<entry title="赠礼记录" ac="payactive" do="recodelist" /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 2.0 KiB |