@ -0,0 +1,768 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Pocket { |
|||
/** |
|||
* 从数据库获取幻灯片数据 |
|||
*/ |
|||
static function getslides($uniacid) { |
|||
global $_W, $_GPC; |
|||
$psize = 25; |
|||
$pindex = max(1, $_GPC['page']); |
|||
$data = Util::getNumData("*", PDO_NAME . 'pocket_slide', array('uniacid' => $uniacid,'aid' => $_W['aid']), 'sort desc', $pindex, $psize); |
|||
// if ($data) { |
|||
// foreach ($data[0] as $k => $v) { |
|||
// if ($v['aid']) { |
|||
// if ($v['aid'] != $_W['aid']) { |
|||
// unset($data[0][$k]); |
|||
// } |
|||
// } |
|||
// } |
|||
// return $data; |
|||
// } |
|||
return $data; |
|||
} |
|||
//创建订单 |
|||
static function saveFightOrder($data, $param = array()) { |
|||
global $_W; |
|||
if (!is_array($data)) |
|||
return FALSE; |
|||
if (empty($param)) { |
|||
pdo_insert(PDO_NAME . 'order', $data); |
|||
return pdo_insertid(); |
|||
} |
|||
return FALSE; |
|||
} |
|||
/** |
|||
* 获取分类 |
|||
*/ |
|||
static function gettypes($flag = 0) { |
|||
global $_W, $_GPC; |
|||
$uniacid = $_W['uniacid']; |
|||
if ($flag == 'all') { |
|||
$data = Util::getNumData("*", PDO_NAME . 'pocket_type', array('uniacid' => $uniacid,'aid'=>$_W['aid'] ,'type' => 0), 'sort desc', 0, 0); |
|||
} else { |
|||
$data = Util::getNumData("*", PDO_NAME . 'pocket_type', array('uniacid' => $uniacid,'aid'=>$_W['aid'] ,'type' => 0, 'isnav' => 0), 'sort desc', 0, 0); |
|||
} |
|||
if (!empty($data)) { |
|||
$data = $data[0]; |
|||
foreach ($data as $key => &$value) { |
|||
//$value['httitle'] = urlencode($value['title']); |
|||
$value['httitle'] = $value['title']; |
|||
if ($value['aid']) { |
|||
if ($value['aid'] != $_W['aid']) { |
|||
unset($data[$key]); |
|||
} else { |
|||
$temp = Util::getNumData("*", PDO_NAME . 'pocket_type', array('type' => $value['id']), 'sort desc'); |
|||
$temp = $temp[0]; |
|||
foreach($temp as &$te){ |
|||
//$te['httitle'] = urlencode($te['title']); |
|||
$te['httitle'] = $te['title']; |
|||
} |
|||
$data[$key]['children'] = $temp; |
|||
} |
|||
} else { |
|||
$temp = Util::getNumData("*", PDO_NAME . 'pocket_type', array('type' => $value['id']), 'sort desc'); |
|||
$data[$key]['children'] = $temp[0]; |
|||
} |
|||
} |
|||
return $data; |
|||
} |
|||
return null; |
|||
} |
|||
/** |
|||
* 根据id检查某一级分类是否含有二级分类 |
|||
*/ |
|||
static function checkFType($id) { |
|||
global $_W, $_GPC; |
|||
|
|||
$uniacid = $_W['uniacid']; |
|||
$data = null; |
|||
if ($id) { |
|||
$data = Util::getSingelData("*", PDO_NAME . 'pocket_type', array('uniacid' => $uniacid, 'type' => $id)); |
|||
if ($data) { |
|||
return true; |
|||
} |
|||
} |
|||
return false; |
|||
} |
|||
/** |
|||
* 获取发帖信息 |
|||
*/ |
|||
static function getInformations($id = 0) { |
|||
global $_W, $_GPC; |
|||
|
|||
$uniacid = $_W['uniacid']; |
|||
|
|||
if (!$id) { |
|||
$data = Util::getNumData("*", PDO_NAME . 'pocket_informations', array('uniacid' => $uniacid)); |
|||
} else { |
|||
$data = Util::getSingelData("*", PDO_NAME . 'pocket_informations', array('uniacid' => $uniacid, 'id' => $id)); |
|||
} |
|||
|
|||
if ($data) { |
|||
return $data; |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
/** |
|||
* 根据帖子id获取评论 |
|||
*/ |
|||
static function getcomments($id) { |
|||
global $_W, $_GPC; |
|||
|
|||
$uniacid = $_W['uniacid']; |
|||
|
|||
if ($id) { |
|||
$data = Util::getNumData("*", PDO_NAME . 'pocket_comment', array('uniacid' => $uniacid, 'tid' => $id)); |
|||
} |
|||
|
|||
if ($data) { |
|||
return $data; |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
/** |
|||
* 根据评论id获取回复 |
|||
*/ |
|||
static function getreplys($id) { |
|||
global $_W, $_GPC; |
|||
|
|||
$uniacid = $_W['uniacid']; |
|||
|
|||
if ($id) { |
|||
$data = Util::getNumData("*", PDO_NAME . 'pocket_reply', array('uniacid' => $uniacid, 'cid' => $id)); |
|||
} |
|||
|
|||
if ($data) { |
|||
return $data; |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
/** |
|||
* 根据类型获得帖子 |
|||
*/ |
|||
static function getInfoByType($id) { |
|||
global $_W, $_GPC; |
|||
|
|||
$uniacid = $_W['uniacid']; |
|||
$data = null; |
|||
if ($id) { |
|||
$data = Util::getNumData("*", PDO_NAME . 'pocket_informations', array('type' => $id)); |
|||
} |
|||
if ($data) { |
|||
return $data; |
|||
} |
|||
return null; |
|||
} |
|||
//异步支付结果回调 ,处理业务逻辑 |
|||
static function payPocketshargeNotify($params) { |
|||
global $_W; |
|||
Util::wl_log('payResult_notify', PATH_PLUGIN . "pocket/data/", $params); //写入异步日志记录 |
|||
$order = pdo_get('wlmerchant_order', array('orderno' => $params['tid']), array('id','fightstatus','mid', 'num', 'price', 'orderno', 'fkid', 'aid', 'status','uniacid')); |
|||
$_W['uniacid'] = $order['uniacid']; |
|||
if ($order['id']) { |
|||
$inform = self::getInformations($order['fkid']); |
|||
$type = pdo_get('wlmerchant_pocket_type',array('id' => $inform['type']),array('isdistri','onedismoney','twodismoney')); |
|||
//处理分销 |
|||
if (p('distribution')) { |
|||
$_W['aid'] = $order['aid']; |
|||
if ($inform['redpack'] > 0) { |
|||
$disprice = sprintf("%.2f", $order['price'] - $inform['redpack']); |
|||
} else { |
|||
$disprice = $order['price']; |
|||
} |
|||
if ($disprice > 0 && empty($type['isdistri'])) { |
|||
$disorderid = Distribution::disCore($order['mid'], $disprice, $type['onedismoney'], $type['twodismoney'], 0, $order['id'], 'pocket', 1); |
|||
} |
|||
} |
|||
if(empty($disorderid)){ |
|||
$disorderid = 0; |
|||
} |
|||
$data['disorderid'] = $disorderid; |
|||
$data['status'] = 3; |
|||
$data['paytime'] = time(); |
|||
//$paytype = array('credit' => 1, 'wechat' => 2, 'alipay' => 3, 'delivery' => 4, 'wxapp' => 5); |
|||
$data['paytype'] = $params['type']; |
|||
if ($params['tag']['transaction_id']) $data['transid'] = $params['tag']['transaction_id']; |
|||
if($order['fightstatus'] == 3){ |
|||
$data['issettlement'] = 1; |
|||
} |
|||
$res = pdo_update('wlmerchant_order', $data, array('id' => $order['id'])); |
|||
if ($res && $order['fightstatus'] != 3) { |
|||
Store::ordersettlement($order['id']); |
|||
} |
|||
if ($inform['endtime'] > time()) { |
|||
$endtime = $inform['endtime'] + $order['num'] * 24 * 3600; |
|||
} else { |
|||
$endtime = time() + $order['num'] * 24 * 3600; |
|||
} |
|||
$data = array( |
|||
'top' => 1, |
|||
'endtime' => $endtime |
|||
); |
|||
if ($inform['redpack'] > 0) { |
|||
$data['redpackstatus'] = 1; |
|||
} |
|||
pdo_update('wlmerchant_pocket_informations', $data, array('id' => $order['fkid'])); |
|||
|
|||
|
|||
} |
|||
|
|||
} |
|||
//异步支付结果回调 处理用户界面 |
|||
static function payPocketshargeReturn($params) { |
|||
$res = $params['result'] == 'success' ? 1 : 0; |
|||
$order = pdo_get('wlmerchant_order', array('orderno' => $params['tid']), array('fkid')); |
|||
$url = h5_url('pages/subPages/postDetails/postDetails',['id'=>$order['fkid']]); |
|||
if ($res) { |
|||
wl_message('支付成功', $url, 'success'); |
|||
} else { |
|||
wl_message('您已支付该订单', $url, 'error'); |
|||
} |
|||
|
|||
} |
|||
static function payPocketfabushargeNotify($params) { |
|||
global $_W; |
|||
Util::wl_log('payResult_notify', PATH_PLUGIN . "pocket/data/", $params); //写入异步日志记录 |
|||
$order = pdo_get('wlmerchant_order', array('orderno' => $params['tid']), array('id','uniacid','fightstatus','mid', 'num', 'price', 'orderno', 'fkid', 'aid', 'status')); |
|||
$_W['uniacid'] = $order['uniacid']; |
|||
$tiezi = pdo_get('wlmerchant_pocket_informations',array('id' => $order['fkid']),array('status','endtime','type','mid','aid')); |
|||
if ($order['id']) { |
|||
$inform = self::getInformations($order['fkid']); |
|||
if (empty($_W['aid'])) { |
|||
$_W['aid'] = $order['aid']; |
|||
} |
|||
$set = Setting::agentsetting_read('pocket'); |
|||
$inf = array(); |
|||
if($order['fightstatus'] == 1){ |
|||
if($inform['status'] == 5){ |
|||
if ($set['passstatus']) { |
|||
$inf['status'] = 0; |
|||
} else { |
|||
$inf['status'] = 1; |
|||
} |
|||
} |
|||
$type = pdo_get('wlmerchant_pocket_type',array('id' => $inform['type']),array('isdistri','onedismoney','twodismoney')); |
|||
$onedismoney = $type['onedismoney']; |
|||
$twodismoney = $type['twodismoney']; |
|||
if (p('distribution') && empty($type['isdistri'])) { |
|||
$disorderid = Distribution::disCore($order['mid'], $order['price'], $onedismoney, $twodismoney, 0, $order['id'], 'pocket', 1); |
|||
} |
|||
}else if($order['fightstatus'] == 2){ |
|||
$day = $order['num']; |
|||
$inf['top'] = 1; |
|||
if($tiezi['endtime']>time()){ |
|||
$inf['endtime'] = $tiezi['endtime'] + $day * 24 * 3600; |
|||
}else{ |
|||
$inf['endtime'] = time() + $day * 24 * 3600; |
|||
} |
|||
$inf['refreshtime'] = time(); |
|||
$onedismoney = 0; |
|||
$twodismoney = 0; |
|||
if (p('distribution')) { |
|||
$disorderid = Distribution::disCore($order['mid'], $order['price'],$onedismoney,$twodismoney,0,$order['id'],'pocket',1); |
|||
} |
|||
}else if($order['fightstatus'] == 3){ |
|||
$inf['redpackstatus'] = 1; |
|||
$inf['redpack'] = $inf['sredpack'] = $order['price']; |
|||
$inf['package'] = $order['num']; |
|||
}else if($order['fightstatus'] == 4){ |
|||
$inf['refreshtime'] = time(); |
|||
$onedismoney = 0; |
|||
$twodismoney = 0; |
|||
if (p('distribution')) { |
|||
$disorderid = Distribution::disCore($order['mid'], $order['price'],$onedismoney,$twodismoney,0,$order['id'],'pocket',1); |
|||
} |
|||
}else if($order['fightstatus'] == 5){ |
|||
$payinfo = [ |
|||
'pocketid' => $order['fkid'], |
|||
'mid' => $order['mid'], |
|||
'createtime' => time() |
|||
]; |
|||
pdo_insert(PDO_NAME . 'pocket_payvideo', $payinfo); |
|||
}else if($order['fightstatus'] == 6){ |
|||
$inf['fullchnnel'] = 1; |
|||
} |
|||
pdo_update('wlmerchant_pocket_informations', $inf, array('id' => $order['fkid'])); |
|||
if(empty($disorderid)){ |
|||
$disorderid = 0; |
|||
} |
|||
$data = array( |
|||
'status' => 3, |
|||
'disorderid' => $disorderid, |
|||
'paytime' => time() |
|||
); |
|||
//$paytype = array('credit' => 1, 'wechat' => 2, 'alipay' => 3, 'delivery' => 4, 'wxapp' => 5); |
|||
$data['paytype'] = $params['type']; |
|||
if ($params['tag']['transaction_id']) $data['transid'] = $params['tag']['transaction_id']; |
|||
if($order['fightstatus'] == 3){ |
|||
$data['issettlement'] = 1; |
|||
} |
|||
$res = pdo_update('wlmerchant_order', $data, array('id' => $order['id'])); |
|||
if ($res && $order['fightstatus'] != 3) { |
|||
Store::ordersettlement($order['id']); |
|||
} |
|||
if($order['fightstatus'] == 1){ |
|||
if ($inf['status']) { |
|||
self::examinenotice($order['fkid']); |
|||
} else { |
|||
self::examinenotice($order['fkid'], 1); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
static function payPocketfabushargeReturn($params) { |
|||
$res = $params['result'] == 'success' ? 1 : 0; |
|||
$order = pdo_get('wlmerchant_order', array('orderno' => $params['tid']), array('fkid')); |
|||
$url = h5_url('pages/subPages/postDetails/postDetails',['id'=>$order['fkid']]); |
|||
if ($res) { |
|||
wl_message('支付成功', $url, 'success'); |
|||
} else { |
|||
wl_message('您已支付该订单', $url, 'error'); |
|||
} |
|||
|
|||
} |
|||
static function payPocketredpackNotify($params) { |
|||
global $_W; |
|||
Util::wl_log('payResult_notify', PATH_PLUGIN . "pocket/data/", $params); //写入异步日志记录 |
|||
$order = pdo_get('wlmerchant_order', array('orderno' => $params['tid']), array('id', 'mid', 'num', 'price','fightstatus','orderno', 'fkid', 'aid', 'status', 'package','uniacid')); |
|||
$_W['uniacid'] = $order['uniacid']; |
|||
if ($order['status'] == 0) { |
|||
$inform = self::getInformations($order['fkid']); |
|||
if (empty($_W['aid'])) { |
|||
$_W['aid'] = $order['aid']; |
|||
} |
|||
pdo_update('wlmerchant_pocket_informations', array('redpackstatus' => 1), array('id' => $order['fkid'])); |
|||
$data = array('status' => 3, 'paytime' => time()); |
|||
//$paytype = array('credit' => 1, 'wechat' => 2, 'alipay' => 3, 'delivery' => 4, 'wxapp' => 5); |
|||
$data['paytype'] = $params['type']; |
|||
if ($params['tag']['transaction_id']) { |
|||
$data['transid'] = $params['tag']['transaction_id']; |
|||
} |
|||
if($order['fightstatus'] == 3){ |
|||
$data['issettlement'] = 1; |
|||
} |
|||
$res = pdo_update('wlmerchant_order', $data, array('id' => $order['id'])); |
|||
if ($res && $order['fightstatus'] != 3) { |
|||
Store::ordersettlement($order['id']); |
|||
} |
|||
} |
|||
} |
|||
static function payPocketredpackReturn($params) { |
|||
$res = $params['result'] == 'success' ? 1 : 0; |
|||
$order = pdo_get('wlmerchant_order', array('orderno' => $params['tid']), array('fkid')); |
|||
$url = h5_url('pages/subPages/postDetails/postDetails',['id'=>$order['fkid']]); |
|||
if ($res) { |
|||
wl_message('支付成功', $url, 'success'); |
|||
} else { |
|||
wl_message('您已支付该订单', $url, 'error'); |
|||
} |
|||
|
|||
|
|||
} |
|||
//获取所有帖子 |
|||
static function getNumTiezi($select, $where, $order, $pindex, $psize, $ifpage) { |
|||
$goodsInfo = Util::getNumData($select, PDO_NAME . 'pocket_informations', $where, $order, $pindex, $psize, $ifpage); |
|||
return $goodsInfo; |
|||
} |
|||
//获取所有订单 |
|||
static function getNumOrder($select, $where, $order, $pindex, $psize, $ifpage) { |
|||
$goodsInfo = Util::getNumData($select, PDO_NAME . 'order', $where, $order, $pindex, $psize, $ifpage); |
|||
return $goodsInfo; |
|||
} |
|||
static function commentnotice($commentid, $comment, $mid) { |
|||
global $_W; |
|||
$amid = pdo_getcolumn(PDO_NAME . 'pocket_informations', array('id' => $commentid), 'mid'); |
|||
$openid = pdo_getcolumn(PDO_NAME . 'member', array('id' => $amid), 'openid'); |
|||
$smnane = pdo_getcolumn(PDO_NAME . 'member', array('id' => $mid), 'nickname'); |
|||
$msg = $smnane . '对您的帖子评论道:' . "\n"; |
|||
$msg .= $comment . "\n"; |
|||
$msg .= '快去看看吧!' . "\n"; |
|||
|
|||
$time = pdo_getcolumn(PDO_NAME."pocket_comment",['id'=>$commentid],'createtime'); |
|||
$url = h5_url('pages/subPages/postDetails/postDetails',['id'=>$commentid]); |
|||
$modelData = [ |
|||
'first' => $smnane . '对您的帖子进行了评论', |
|||
'type' => '评论提醒' ,//业务类型 |
|||
'content' => $comment,//业务内容 |
|||
'status' => '等待回复' ,//处理结果 |
|||
'time' => date("Y-m-d H:i:s",$time) ,//操作时间 |
|||
'remark' => '快去看看吧!' |
|||
]; |
|||
TempModel::sendInit('service',$amid,$modelData,$_W['source'],$url); |
|||
} |
|||
static function replaynotice($amid, $comment, $mid, $cid) { |
|||
global $_W; |
|||
$smnane = pdo_getcolumn(PDO_NAME . 'member', array('id' => $mid), 'nickname'); |
|||
$tid = pdo_getcolumn(PDO_NAME . 'pocket_comment', array('id' => $cid), 'tid'); |
|||
$replyData = [ |
|||
'first' => '用户'.$smnane.'回复您的帖子', |
|||
'type' => '帖子回复' ,//业务类型 |
|||
'content' => $comment,//业务内容 |
|||
'status' => '已回复',//处理结果 |
|||
'time' => date('Y-m-d H:i:s', time()),//操作时间 |
|||
'remark' => '点击查看帖子' |
|||
]; |
|||
$url = h5_url('pages/subPages/postDetails/postDetails',array('id'=>$tid)); |
|||
TempModel::sendInit('service',$amid,$replyData,$_W['source'],$url); |
|||
} |
|||
static function examinenotice($commentid, $flag = 0) { |
|||
global $_W; |
|||
$comment = pdo_get(PDO_NAME . 'pocket_informations', array('id' => $commentid), array('nickname', 'type', 'createtime')); |
|||
$typename = pdo_getcolumn(PDO_NAME . 'pocket_type', array('id' => $comment['type']), 'title'); |
|||
//给代理商管理员发送模板消息通知 |
|||
$url = h5_url('pages/subPages/postDetails/postDetails',array('id'=>$commentid,'examine' => 1)); |
|||
if(empty($_W['areaname'])){ |
|||
$areaid = pdo_getcolumn(PDO_NAME.'oparea',array('aid'=>$_W['aid']),'areaid'); |
|||
$_W['areaname'] = pdo_getcolumn(PDO_NAME.'area',array('id'=>$areaid),'name'); |
|||
} |
|||
$first = '您好,用户['.$comment['nickname'].']在[' .$_W['areaname'].']发布了一个同城信息';//消息头部 |
|||
$type = "帖子发布";//业务类型 |
|||
$content = '帖子分类:'.$typename;//业务内容 |
|||
$status = $flag ? '已发布' : '待审核';//处理结果 |
|||
$remark = "请尽快处理!";//备注信息 |
|||
$time = $comment['createtime'];//操作时间 |
|||
News::noticeAgent('pocketfabu',$_W['aid'],$first,$type,$content,$status,$remark,$time,$url); |
|||
} |
|||
|
|||
static function passnotice($informationsid) { |
|||
global $_W; |
|||
$informations = pdo_get('wlmerchant_pocket_informations', array('id' => $informationsid), array('mid', 'type', 'nickname', 'status', 'reason', 'createtime')); |
|||
$typename = pdo_getcolumn(PDO_NAME . 'pocket_type', array('id' => $informations['type']), 'title'); |
|||
if ($informations['status']) { |
|||
$result = '已驳回'; |
|||
$remark = '您发布的信息已被驳回,驳回原因是:' . $informations['reason'] . ',请您重新发布'; |
|||
$url = h5_url('pages/subPages/myPost/myPost', array('status' => 2)); |
|||
} else { |
|||
$result = '已通过'; |
|||
$remark = '您发布的信息已通过审核,点击查看帖子'; |
|||
$url = h5_url('pages/subPages/postDetails/postDetails',array('id'=>$informationsid)); |
|||
} |
|||
$replyData = [ |
|||
'first' => '您好,您发布的帖子已审核', |
|||
'type' => '帖子审核' ,//业务类型 |
|||
'content' => '帖子分类:'.$typename,//业务内容 |
|||
'status' => $result,//处理结果 |
|||
'time' => date('Y-m-d H:i:s', time()),//操作时间 |
|||
'remark' => $remark |
|||
]; |
|||
TempModel::sendInit('service',$informations['mid'],$replyData,$_W['source'],$url); |
|||
} |
|||
//计划任务 |
|||
static function doTask() { |
|||
global $_W; |
|||
//置顶时间过期,自动下线 |
|||
$tops = pdo_getall('wlmerchant_pocket_informations', array('top' => 1)); |
|||
foreach ($tops as $key => $v) { |
|||
if ($v['endtime'] < time()) { |
|||
pdo_update('wlmerchant_pocket_informations', array('top' => 0), array('id' => $v['id'])); |
|||
} |
|||
} |
|||
//添加回复时间 |
|||
$noreplytime = pdo_fetchall("SELECT createtime,id FROM ".tablename('wlmerchant_pocket_informations')."WHERE replytime = 0 LIMIT 20 "); |
|||
if(!empty($noreplytime)){ |
|||
foreach($noreplytime as $time){ |
|||
$colltime = pdo_getcolumn(PDO_NAME.'pocket_comment',array('tid'=>$time['id'],'status' => 1),'createtime'); |
|||
$retime = pdo_getcolumn(PDO_NAME.'pocket_reply',array('tid'=>$time['id'],'status' => 1),'createtime'); |
|||
$createtime = $time['createtime']; |
|||
$newtime = max($colltime,$retime,$createtime); |
|||
pdo_update('wlmerchant_pocket_informations',array('replytime' => $newtime),array('id' => $time['id'])); |
|||
} |
|||
} |
|||
//删除未支付订单 |
|||
// $config = Setting::agentsetting_read('pocket'); |
|||
// if ($config['delete'] > 0) { |
|||
// $deletetime = time() - $config['delete'] * 3600; |
|||
// $tiezis = pdo_fetchall("SELECT id FROM " . tablename('wlmerchant_pocket_informations') . "WHERE uniacid = {$_W['uniacid']} AND status = 5 AND createtime < {$deletetime}"); |
|||
// if ($tiezis) { |
|||
// foreach ($tiezis as $key => &$tie) { |
|||
// $res = pdo_delete('wlmerchant_order', array('fkid' => $tie['id'], 'plugin' => 'pocket')); |
|||
// if ($res) { |
|||
// pdo_delete('wlmerchant_pocket_informations', array('id' => $tie['id'])); |
|||
// } |
|||
// } |
|||
// } |
|||
// } |
|||
|
|||
//重新统计回复帖子id |
|||
$replys = pdo_fetchall("SELECT cid,id FROM " . tablename('wlmerchant_pocket_reply') . "WHERE tid = 0 ORDER BY id DESC LIMIT 20"); |
|||
if ($replys) { |
|||
foreach ($replys as $key => $va) { |
|||
$tid = pdo_getcolumn(PDO_NAME . 'pocket_comment', array('id' => $va['cid']), 'tid'); |
|||
pdo_update('wlmerchant_pocket_reply', array('tid' => $tid), array('id' => $va['id'])); |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 判断是否为黑名单用户 |
|||
* Author: zzw |
|||
* Date: 2019/8/22 10:30 |
|||
* @param $id int 帖子id |
|||
* @return bool |
|||
*/ |
|||
public static function is_black($id){ |
|||
global $_W; |
|||
$is_black = pdo_get(PDO_NAME."pocket_blacklist" ,['mid'=>$_W['mid'],'inid'=>$id]); |
|||
if($is_black) return true;//是黑名单用户 |
|||
else return false;//不是黑名单用户 |
|||
} |
|||
/** |
|||
* Comment: 获取掌上信息评论信息 |
|||
* Author: zzw |
|||
* Date: 2019/8/29 14:38 |
|||
* @param $page |
|||
* @param $pageIndex |
|||
* @param $id |
|||
* @return array|bool |
|||
*/ |
|||
public static function getComment($page,$pageIndex,$id){ |
|||
global $_W; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
#2、获取评论信息列表 |
|||
$total_sql = "SELECT count(*) FROM " |
|||
.tablename(PDO_NAME."pocket_comment") ." as a JOIN ".tablename(PDO_NAME."member") |
|||
." as b ON a.mid = b.id WHERE a.tid = {$id} "; |
|||
$total_sql .= $_W['mid'] ? " AND (a.status = 1 or (a.status = 0 and a.mid = {$_W['mid']}))" : " AND a.status = 1"; |
|||
$total = pdo_fetchcolumn($total_sql); |
|||
|
|||
$list_sql = "SELECT a.id,a.content,a.mid,a.createtime,a.likenum,b.nickname,b.avatar,b.encodename FROM " |
|||
.tablename(PDO_NAME."pocket_comment") ." as a JOIN ".tablename(PDO_NAME."member") |
|||
." as b ON a.mid = b.id WHERE a.tid = {$id} "; |
|||
$list_sql .= $_W['mid'] ? " AND (a.status = 1 or (a.status = 0 and a.mid = {$_W['mid']}))" : " AND a.status = 1"; |
|||
$list_sql .= " ORDER BY a.createtime DESC LIMIT {$pageStart},{$pageIndex}"; |
|||
$list = pdo_fetchall($list_sql); |
|||
|
|||
#3、获取回复信息 |
|||
if(is_array($list) && count($list) > 0){ |
|||
foreach($list as $key => &$val){ |
|||
if (is_base64($val['content'])) $val['content'] = base64_decode($val['content']); |
|||
$val['createtime'] = date("Y-m-d H:i",$val['createtime']); |
|||
$likeids = unserialize($val['likeids']); |
|||
$val['is_fabulous'] = in_array($_W['mid'],$likeids) ?:false; |
|||
$val['nickname'] = base64_decode($val['encodename']); |
|||
|
|||
$sql = "SELECT a.id,a.smid,a.createtime,b.nickname as reply_name,b.encodename as b_encodename,m.nickname as name,m.encodename as m_encodename,a.content FROM ".tablename(PDO_NAME."pocket_reply") |
|||
." as a JOIN ".tablename(PDO_NAME."member") |
|||
." as b ON a.smid = b.id JOIN ".tablename(PDO_NAME."member") |
|||
." as m ON a.amid = m.id WHERE a.tid = {$id} AND a.cid = {$val['id']} "; |
|||
$sql .= $_W['mid'] ? " AND (a.status = 1 or (a.status = 0 and a.smid = {$_W['mid']}))" : " AND a.status = 1"; |
|||
$sql .= " ORDER BY a.createtime ASC "; |
|||
$val['list'] = pdo_fetchall($sql); |
|||
|
|||
foreach ($val['list'] as $k => $v) { |
|||
if (is_base64($val['list'][$k]['content'])) $val['list'][$k]['content'] = base64_decode($val['list'][$k]['content']); |
|||
$val['list'][$k]['createtime'] = date("Y-m-d H:i",$v['createtime']); |
|||
$val['list'][$k]['name'] = base64_decode($v['m_encodename']); |
|||
$val['list'][$k]['reply_name'] = base64_decode($v['b_encodename']); |
|||
unset($val['list'][$k]['m_encodename'],$val['list'][$k]['b_encodename']); |
|||
} |
|||
unset($val['encodename']); |
|||
} |
|||
} |
|||
|
|||
|
|||
return ['total'=>$total,'list'=>$list]; |
|||
} |
|||
/** |
|||
* Comment: 红包算法 |
|||
* Author: zzw |
|||
* Date: 2019/8/29 17:03 |
|||
* @param $balance float 红包余额 |
|||
* @param $surplus float 剩余的包 |
|||
* @return string float 返回一个红包中拥有的金额 |
|||
*/ |
|||
public static function redEnvelopeAlgorithm($balance, $surplus) { |
|||
if ($surplus > 1) { |
|||
//根据红包算法获取当前用户应该领取的红包 |
|||
$total = 0;//循环获取的随机数的总和 |
|||
$frequency = 5;//循环的次数 |
|||
$maxMoney = 0;//随机数的最大值 |
|||
//通过循环获取平均值 让红包的金额不会太大也不会太小 |
|||
$meanValue = $balance / $surplus * 2;//在每个包的平均值浮动两倍中取随机值 保证每个红包的金额差距不大 |
|||
for ($i = 0; $i < $frequency; $i++) { |
|||
$rand = mt_rand() / mt_getrandmax(); |
|||
$value = sprintf("%0.2f", $rand * $meanValue); |
|||
$total += $value; |
|||
if ($value > $maxMoney) { |
|||
$maxMoney = $value; |
|||
} |
|||
} |
|||
//去掉最大值 让数字比较平均 出现领取红包的金额数量依次递减的情况减少 |
|||
$total = sprintf("%0.2f", $total - $maxMoney); |
|||
//通过平均数 获取红包的具体金额 |
|||
$money = sprintf("%0.2f", $total / 4); |
|||
//判断:当红包金额等于小于0或者等于大于余额时 从新获取红包金额 |
|||
$currentBalance = $balance - $money; |
|||
$minBalance = 0.01 * ($surplus - 1); |
|||
if($money <= 0){ |
|||
$money = 0.01; |
|||
} |
|||
if ($money > $balance || $currentBalance < $minBalance) { |
|||
self::redEnvelopeAlgorithm($balance, $surplus); |
|||
} |
|||
} else { |
|||
//只剩下一个包 则当前用户获得剩下的所有金额 |
|||
$money = $balance; |
|||
} |
|||
return $money; |
|||
} |
|||
/** |
|||
* Comment: 红包领取列表 |
|||
* Author: zzw |
|||
* Date: 2019/8/29 18:32 |
|||
* @param $id |
|||
* @param int $page |
|||
* @param int $pageIndex |
|||
* @return mixed |
|||
*/ |
|||
public static function getGetList($id,$page = 1,$pageIndex = 10){ |
|||
global $_W,$_GPC; |
|||
$data['total'] = 0; |
|||
$data['list'] = []; |
|||
#1、获取开始查询的位置 |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
#2、条件生成 |
|||
$where = " WHERE a.uniacid = {$_W['uniacid']} AND a.pid = {$id} ORDER BY a.gettime DESC "; |
|||
#3、获取手气最佳领取的金额 |
|||
$max = pdo_fetchcolumn( "SELECT MAX(money) FROM ".tablename(PDO_NAME."red_envelope")." as a ".$where); |
|||
if($max > 0){ |
|||
#4、获取总数量 |
|||
$total = pdo_fetchcolumn("SELECT COUNT(*) FROM ".tablename(PDO_NAME."red_envelope") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."member") |
|||
." as b ON a.mid = b.id ".$where); |
|||
$data['total'] = ceil($total / $pageIndex);//总页数 |
|||
#5、获取红包基本信息 |
|||
$info = pdo_get(PDO_NAME."pocket_informations",['id'=>$id],['package']); |
|||
$info['surplus'] = ($info['package'] - $total) > 0 ? ($info['package'] - $total) : 0; |
|||
$data['info'] = $info;//基本信息 |
|||
#6、获取领取列表 |
|||
$sql = "SELECT a.money,b.nickname,b.avatar,FROM_UNIXTIME(a.gettime,'%Y-%m-%d %H:%i:%S') as gettime, |
|||
CASE WHEN a.money = {$max} THEN 1 |
|||
ELSE 0 |
|||
END as is_optimum FROM ".tablename(PDO_NAME."red_envelope") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."member") |
|||
." as b ON a.mid = b.id ".$where." LIMIT {$pageStart},{$pageIndex}"; |
|||
$data['list'] = pdo_fetchall($sql);//信息列表 |
|||
} |
|||
|
|||
return $data; |
|||
} |
|||
/** |
|||
* Comment: 将数转为带单位的字符串 |
|||
* Author: zzw |
|||
* Date: 2019/10/29 14:35 |
|||
* @param int $num 要转换的数 |
|||
* @param int $limit 转换限制,当数大于该限制时才会进行转换 |
|||
* @param int $hierarchy 返回的层级(例如转换111111,限制10000。返回层级1时返回10万,2时返回10万1千,3时返回10万1千1百) |
|||
* @return string |
|||
*/ |
|||
public static function rounding($num,$limit,$hierarchy = 1){ |
|||
//定义基本信息 |
|||
$content = []; |
|||
$lv_1 = 100000000;//亿 |
|||
$lv_2 = 10000000;//千万 |
|||
$lv_3 = 10000;//万 |
|||
$lv_4 = 1000;//千 |
|||
$lv_5 = 100;//百 |
|||
$lv_6 = 10;//十 |
|||
if($num > $limit){ |
|||
# 亿 |
|||
if($num > $lv_1 && $hierarchy > count($content)){ |
|||
$content[] = floor($num / $lv_1).'亿'; |
|||
$num = intval($num % $lv_1); |
|||
} |
|||
# 千万 |
|||
if($num > $lv_2 && $hierarchy > count($content)){ |
|||
$content[] = floor($num / $lv_2).'千万'; |
|||
$num = intval($num % $lv_2); |
|||
} |
|||
# 万 |
|||
if($num > $lv_3 && $hierarchy > count($content)){ |
|||
$content[] = floor($num / $lv_3).'万'; |
|||
$num = intval($num % $lv_3); |
|||
} |
|||
# 千 |
|||
if($num > $lv_4 && $hierarchy > count($content)){ |
|||
$content[] = floor($num / $lv_4).'千'; |
|||
$num = intval($num % $lv_4); |
|||
} |
|||
# 百 |
|||
if($num > $lv_5 && $hierarchy > count($content)){ |
|||
$content[] = floor($num / $lv_5).'百'; |
|||
$num = intval($num % $lv_5); |
|||
} |
|||
# 十 |
|||
if($num > $lv_6 && $hierarchy > count($content)){ |
|||
$content[] = floor($num / $lv_6).'十'; |
|||
$num = intval($num % $lv_6); |
|||
} |
|||
# 个 |
|||
if($num > 0 && $hierarchy > count($content)){ |
|||
$content[] = $num; |
|||
} |
|||
} |
|||
|
|||
return implode($content); |
|||
} |
|||
/** |
|||
* Comment: 发送评论信息模板消息通知 |
|||
* Author: zzw |
|||
* Date: 2020/3/16 14:09 |
|||
* @param int $id 帖子id |
|||
* @param int $cid 评论id |
|||
* @param int $source 渠道信息 |
|||
* @throws \GuzzleHttp\Exception\GuzzleException |
|||
*/ |
|||
public static function setModelInfo($id,$cid,$source = 1){ |
|||
#1、基本信息获取 |
|||
$sendMid = pdo_getcolumn(PDO_NAME."pocket_informations",['id'=>$id],'mid');//获取发帖人id |
|||
$comment = pdo_get(PDO_NAME."pocket_comment",['id'=>$cid],['mid','createtime']);//获取评论人id |
|||
$nickname = pdo_getcolumn(PDO_NAME."member",['id'=>$comment['mid']],'nickname');//获取评论人昵称 |
|||
#2、发送模板消息通知用户 |
|||
$modelData = [ |
|||
'first' => '' , |
|||
'type' => '评论提醒' ,//业务类型 |
|||
'content' => '用户['.$nickname.']对您的帖子进行了评论!' ,//业务内容 |
|||
'status' => '待回复' ,//处理结果 |
|||
'time' => date("Y-m-d H:i:s",$comment['createtime']) ,//操作时间 |
|||
'remark' => '' |
|||
]; |
|||
$link = h5_url('pagesA/pictureTextDetails/pictureTextDetails',['id'=>$id]); |
|||
TempModel::sendInit('service',$sendMid,$modelData,$source,$link); |
|||
} |
|||
/** |
|||
* Comment: 发送回复信息模板消息通知 |
|||
* Author: zzw |
|||
* Date: 2020/3/16 14:41 |
|||
* @param int $tid 帖子id |
|||
* @param int $rid 回复信息id |
|||
* @param int $smid 回复人id(发布回复信息的用户的id) |
|||
* @param int $amid 被回复人id(接收回复信息的用户的id) |
|||
* @param int $source 渠道信息 |
|||
* @throws \GuzzleHttp\Exception\GuzzleException |
|||
*/ |
|||
public static function setReplyModelInfo($tid,$rid,$smid,$amid,$source = 1){ |
|||
#1、基本信息获取 |
|||
$nickname = pdo_getcolumn(PDO_NAME."member",['id'=>$smid],'nickname');//获取回复人昵称 |
|||
$time = pdo_getcolumn(PDO_NAME."pocket_reply",['id'=>$rid],'createtime');//回复时间 |
|||
#2、发送模板消息通知用户 |
|||
$modelData = [ |
|||
'first' => '您的评论被回复了' , |
|||
'type' => '评论回复提醒' ,//业务类型 |
|||
'content' => '用户['.$nickname.']对您的评论进行了回复!' ,//业务内容 |
|||
'status' => '待回复' ,//处理结果 |
|||
'time' => date("Y-m-d H:i:s",$time) ,//操作时间 |
|||
'remark' => '' |
|||
]; |
|||
$link = h5_url('pages/subPages/postDetails/postDetails',['id'=>$tid]); |
|||
TempModel::sendInit('service',$amid,$modelData,$source,$link); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,53 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[掌上信息]]></name> |
|||
<identifie><![CDATA[pocket]]></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="Tiezi" do="lists" iscover="true"></entry> |
|||
<entry title="订单列表" ac="Tiezi" do="orders"></entry> |
|||
<entry title="黑名单用户" ac="Tiezi" do="blacklist"></entry> |
|||
</menu> |
|||
<menu title="内容" font="fa-inbox"> |
|||
<entry title="幻灯片" ac="Slide" do="lists"></entry> |
|||
<entry title="分类列表" ac="Type" do="lists"></entry> |
|||
</menu> |
|||
<menu title="内容审核" font="fa-inbox"> |
|||
<entry title="评论审核" ac="ToExamine" do="comment"></entry> |
|||
<entry title="回复审核" ac="ToExamine" do="reply"></entry> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox" > |
|||
<entry title="基础设置" ac="BasicSetting" do="basicsetting"></entry> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="帖子" font="fa-inbox" > |
|||
<entry title="帖子列表" ac="Tiezi" do="lists" iscover="true"></entry> |
|||
<entry title="订单列表" ac="Tiezi" do="orders"></entry> |
|||
<entry title="黑名单用户" ac="Tiezi" do="blacklist"></entry> |
|||
</menu> |
|||
<menu title="内容" font="fa-inbox"> |
|||
<entry title="幻灯片" ac="Slide" do="lists"></entry> |
|||
<entry title="分类列表" ac="Type" do="lists"></entry> |
|||
</menu> |
|||
<menu title="内容审核" font="fa-inbox"> |
|||
<entry title="评论审核" ac="ToExamine" do="comment"></entry> |
|||
<entry title="回复审核" ac="ToExamine" do="reply"></entry> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox" > |
|||
<entry title="基础设置" ac="BasicSetting" do="basicsetting"></entry> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 2.4 KiB |
@ -0,0 +1,86 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class BasicSetting_WeliamController { |
|||
|
|||
public function basicsetting() { |
|||
global $_W, $_GPC; |
|||
$data = Setting::agentsetting_read('pocket'); |
|||
$vip_level = unserialize($data['vip_level']); |
|||
$distri = Setting::wlsetting_read('distribution'); |
|||
if ($data['noticeopenid']) { |
|||
$noticename = pdo_getcolumn(PDO_NAME . 'member', array('openid' => $data['noticeopenid']), 'nickname'); |
|||
} |
|||
//一卡通等级 |
|||
$levels = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_halflevel') . "WHERE uniacid = {$_W['uniacid']} AND status = 1 ORDER BY sort DESC"); |
|||
|
|||
if (checksubmit('submit')) { |
|||
$data = $_GPC['data']; |
|||
$status = $_GPC['status']; |
|||
$search = $_GPC['search']; |
|||
$pass = $_GPC['passstatus']; |
|||
$free = $_GPC['freestatus']; |
|||
$auto = $_GPC['automobile']; |
|||
$listorder = $_GPC['listorder']; |
|||
$data['search_float'] = $_GPC['search_float']; |
|||
$data['search_bgColor'] = $_GPC['search_bgColor']; |
|||
$data['search'] = $search; |
|||
$data['status'] = $status; |
|||
$data['passstatus'] = $pass; |
|||
$data['freestatus'] = $free; |
|||
$data['locastatus'] = $_GPC['locastatus']; |
|||
$data['automobile'] = $auto; |
|||
$data['listorder'] = $listorder; |
|||
$data['is_openRed'] = $_GPC['is_openRed']; |
|||
$data['comment_reply'] = $_GPC['comment_reply'] ? : 0; |
|||
$data['vip_show'] = $_GPC['vip_show'] ? : 0; |
|||
$data['storesettle'] = $_GPC['storesettle'] ? : 0; |
|||
$data['videoupload'] = $_GPC['videoupload'] ? : 0; |
|||
$data['imgupload'] = $_GPC['imgupload'] ? : 0; |
|||
$data['audioupload'] = $_GPC['audioupload'] ? : 0; |
|||
$day = $_GPC['day']; |
|||
$price = $_GPC['price']; |
|||
$vipprice = $_GPC['vipprice']; |
|||
$paramids = array(); |
|||
$len = count($day); |
|||
for ($k = 0; $k < $len; $k++) { |
|||
if($day[$k]>0){ |
|||
$paramids[$k]['day'] = sprintf("%.0f",$day[$k]); |
|||
$paramids[$k]['price'] = sprintf("%.2f",$price[$k]); |
|||
$paramids[$k]['vipprice'] = sprintf("%.2f",$vipprice[$k]); |
|||
if($paramids[$k]['price'] < 0.01 || $paramids[$k]['vipprice'] < 0.01){ |
|||
wl_message('置顶价格金额不能为0'); |
|||
} |
|||
} |
|||
} |
|||
$data['price'] = $paramids; |
|||
|
|||
$num = $_GPC['num']; |
|||
$red_price = $_GPC['red_price']; |
|||
$redIds = array(); |
|||
$len = count($num); |
|||
for ($k = 0; $k < $len; $k++) { |
|||
$redIds[$k]['num'] = sprintf("%.0f",$num[$k]); |
|||
$redIds[$k]['red_price'] = sprintf("%.2f",$red_price[$k]); |
|||
} |
|||
$data['red_envelopes'] = $redIds; |
|||
$vip_level = $_GPC['vip_level']; |
|||
$data['vip_level'] = serialize($vip_level); |
|||
|
|||
$data['fullprice'] = sprintf("%.2f",$data['fullprice']); |
|||
$data['fullvip'] = sprintf("%.2f",$data['fullvip']); |
|||
|
|||
Setting::agentsetting_save($data, 'pocket'); |
|||
wl_message('设置成功', web_url('pocket/BasicSetting/basicsetting')); |
|||
} |
|||
include wl_template('pocket/basicsetting'); |
|||
} |
|||
|
|||
public function dayandprice() { |
|||
include wl_template('pocket/dayandprice'); |
|||
} |
|||
|
|||
public function redEnvelopes() { |
|||
include wl_template('pocket/redEnvelopes'); |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Information_WeliamController{ |
|||
|
|||
|
|||
|
|||
} |
|||
?> |
|||
@ -0,0 +1,62 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Slide_WeliamController { |
|||
|
|||
function lists() { |
|||
global $_W, $_GPC; |
|||
|
|||
$uniacid = $_W['uniacid']; |
|||
$list1 = Pocket::getslides($uniacid); |
|||
|
|||
$list = $list1[0]; |
|||
$pager = $list1[1]; |
|||
include wl_template('pocket/slidelist'); |
|||
|
|||
} |
|||
|
|||
function operating() { |
|||
global $_W, $_GPC; |
|||
$did = $_GPC['did']; |
|||
$eid = $_GPC['id']; |
|||
$temp = $_GPC['data']; |
|||
|
|||
if (!empty($did)) { |
|||
pdo_delete(PDO_NAME . 'pocket_slide', array('id' => $did)); |
|||
wl_message('删除数据成功!', web_url('pocket/Slide/lists'), 'success'); |
|||
} |
|||
if (!empty($eid)) { |
|||
$data = Util::getSingelData("*", PDO_NAME . 'pocket_slide', array('id' => $eid)); |
|||
} |
|||
|
|||
if($temp){ |
|||
$temp['uniacid'] = $_W['uniacid']; |
|||
$temp['aid'] = $_W['aid']; |
|||
if($temp['id']){ |
|||
pdo_update(PDO_NAME.'pocket_slide',$temp,array('id'=>$temp['id'])); |
|||
}else{ |
|||
pdo_insert(PDO_NAME.'pocket_slide',$temp); |
|||
} |
|||
wl_message('操作成功!',web_url('pocket/Slide/lists'),'success'); |
|||
} |
|||
include wl_template('pocket/slideadd'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 修改状态 |
|||
* Author: zzw |
|||
* Date: 2019/9/18 17:07 |
|||
*/ |
|||
public function changeStatus (){ |
|||
global $_W , $_GPC; |
|||
#1、获取参数信息 |
|||
$id = $_GPC['id'] OR Commons::sRenderError('缺少参数:id'); |
|||
$status = $_GPC['status'] ? : 0; |
|||
#1、修改操作 |
|||
$res = pdo_update(PDO_NAME."pocket_slide",['status'=>$status],['id'=>$id]); |
|||
if($res) Commons::sRenderSuccess('修改成功'); |
|||
else Commons::sRenderError('修改失败,请刷新重试!'); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,725 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Tiezi_WeliamController { |
|||
/** |
|||
* Comment: 进入帖子列表 |
|||
*/ |
|||
function lists() { |
|||
global $_W, $_GPC; |
|||
$set = Setting::agentsetting_read('pocket'); |
|||
|
|||
$status0 = pdo_fetchcolumn('SELECT count(id) FROM ' . tablename('wlmerchant_pocket_informations') . " where uniacid = {$_W['uniacid']} AND aid = {$_W['aid']}"); |
|||
$status1 = pdo_fetchcolumn('SELECT count(id) FROM ' . tablename('wlmerchant_pocket_informations') . " where uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND status = 1"); |
|||
$status3 = pdo_fetchcolumn('SELECT count(id) FROM ' . tablename('wlmerchant_pocket_informations') . " where uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND status = 0"); |
|||
$status4 = pdo_fetchcolumn('SELECT count(id) FROM ' . tablename('wlmerchant_pocket_informations') . " where uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND status = 0 AND top > 0"); |
|||
$status2 = pdo_fetchcolumn('SELECT count(id) FROM ' . tablename('wlmerchant_pocket_informations') . " where uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND status = 2"); |
|||
$status5 = pdo_fetchcolumn('SELECT count(id) FROM ' . tablename('wlmerchant_pocket_informations') . " where uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND status = 3"); |
|||
|
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$where = array(); |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['aid'] = $_W['aid']; |
|||
$status = $_GPC['status']; |
|||
if (empty($status)) { |
|||
$where['status'] = 0; |
|||
} else if ($status == 1) { |
|||
$where['status'] = 1; |
|||
} else if ($status == 2) { |
|||
$where['status'] = 2; |
|||
} else if ($status == 4) { |
|||
$where['status'] = 0; |
|||
$where['top>'] = 1; |
|||
} else if ($status == 3) { |
|||
$where['status'] = 3; |
|||
} |
|||
if (!empty($_GPC['keyword'])) { |
|||
if (!empty($_GPC['keywordtype'])) { |
|||
switch ($_GPC['keywordtype']) { |
|||
case 1: |
|||
$where['@content@'] = $_GPC['keyword']; |
|||
break; |
|||
case 3: |
|||
$where['@nickname@'] = $_GPC['keyword']; |
|||
break; |
|||
case 4: |
|||
$where['@phone@'] = $_GPC['keyword']; |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
if ($_GPC['keywordtype'] == 2) { |
|||
$keyword = $_GPC['keyword']; |
|||
$params[':title'] = "%{$keyword}%"; |
|||
$goods = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_pocket_type') . "WHERE uniacid = {$_W['uniacid']} AND title LIKE :title", $params); |
|||
if ($goods) { |
|||
$goodids = "("; |
|||
foreach ($goods as $key => $v) { |
|||
if ($key == 0) { |
|||
$goodids .= $v['id']; |
|||
} else { |
|||
$goodids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$goodids .= ")"; |
|||
$where['type#'] = $goodids; |
|||
} else { |
|||
$where['type#'] = "(0)"; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
if ($_GPC['time_limit']) { |
|||
$time_limit = $_GPC['time_limit']; |
|||
$starttime = strtotime($_GPC['time_limit']['start']); |
|||
$endtime = strtotime($_GPC['time_limit']['end']); |
|||
$where['createtime>'] = $starttime; |
|||
$where['createtime<'] = $endtime + 24 * 3600; |
|||
} |
|||
|
|||
//导出 |
|||
if($_GPC['export']){ |
|||
$this -> exportTieziList($where); |
|||
} |
|||
|
|||
if (empty($starttime) || empty($endtime)) { |
|||
$starttime = strtotime('-1 month'); |
|||
$endtime = time(); |
|||
} |
|||
|
|||
$orderlist = Pocket::getNumTiezi('*', $where, 'ID DESC', $pindex, $psize, 1); |
|||
$pager = $orderlist[1]; |
|||
$list = $orderlist[0]; |
|||
foreach ($list as $key => &$v) { |
|||
$v['content'] = nl2br($v['content']); |
|||
if (!empty($v['content_json'])) { |
|||
$v['content'] = str_replace("\n", "<br>", json_decode($v['content_json'])); |
|||
} |
|||
if ($v['type']) { |
|||
$v['logo'] = pdo_getcolumn(PDO_NAME . 'pocket_type', array('uniacid' => $_W['uniacid'], 'id' => $v['type']), 'img'); |
|||
$v['type'] = pdo_getcolumn(PDO_NAME . 'pocket_type', array('uniacid' => $_W['uniacid'], 'id' => $v['type']), 'title'); |
|||
} else { |
|||
$v['logo'] = $set['kefu_avatar']; |
|||
$v['type'] = '全局置顶'; |
|||
} |
|||
Member::getMemberInfo($v,$v['mid']); |
|||
if (empty($v['avatar'])) { |
|||
if ($v['mid']) { |
|||
$v['avatar'] = pdo_getcolumn(PDO_NAME . 'member', array('uniacid' => $_W['uniacid'], 'id' => $v['mid']), 'avatar'); |
|||
} else { |
|||
$v['avatar'] = $set['kefu_avatar']; |
|||
} |
|||
} |
|||
} |
|||
|
|||
include wl_template('pocket/infolist'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 掌上信息导出 |
|||
*/ |
|||
public function exportTieziList($where){ |
|||
global $_W, $_GPC; |
|||
|
|||
$orderlist = Pocket::getNumTiezi('*', $where, 'ID DESC', 0, 0, 1); |
|||
$list = $orderlist[0]; |
|||
foreach ($list as $key => &$v) { |
|||
$v['content'] = nl2br($v['content']); |
|||
if (!empty($v['content_json'])) $v['content'] = json_decode($v['content_json']); |
|||
if ($v['type']) { |
|||
$v['type'] = pdo_getcolumn(PDO_NAME . 'pocket_type', array('uniacid' => $_W['uniacid'], 'id' => $v['type']), 'title'); |
|||
} else { |
|||
$v['type'] = '全局置顶'; |
|||
} |
|||
$v['createtime'] = date("Y-m-d H:i:s",$v['createtime']); |
|||
//状态 |
|||
if($v['status'] == 0){ |
|||
$v['status'] = '显示中'; |
|||
}else if($v['status'] == 1){ |
|||
$v['status'] = '审核中'; |
|||
}else if($v['status'] == 2){ |
|||
$v['status'] = '未通过'; |
|||
}else if($v['status'] == 3){ |
|||
$v['status'] = '已删除'; |
|||
}else if($v['status'] == 3){ |
|||
$v['status'] = '未付款'; |
|||
} |
|||
//置顶 |
|||
if($v['top'] == 1){ |
|||
$v['top'] = '置顶中'; |
|||
}else if($v['top'] == 2){ |
|||
$v['top'] = '分类置顶'; |
|||
}else if($v['top'] == 3){ |
|||
$v['top'] = '全局置顶'; |
|||
} |
|||
//红包 |
|||
if($v['redpackstatus'] > 0){ |
|||
$v['redtext'] = '红包剩余'.$v['sredpack'].'元'; |
|||
}else{ |
|||
$v['redtext'] = '无红包'; |
|||
} |
|||
} |
|||
|
|||
$filter = array( |
|||
'id' => '帖子id',//U |
|||
'nickname' => '发帖人',//A |
|||
'phone' => '联系电话',//B |
|||
'type' => '信息分类',//C |
|||
'status' => '帖子状态',//D |
|||
'top' => '置顶状态',//E |
|||
'redtext' => '红包状态',//F |
|||
'look' => '浏览量',//G |
|||
'likenum' => '点赞量',//H |
|||
'share' => '分享量',//I |
|||
'address' => '发帖地址',//J |
|||
'createtime' => '发帖时间',//K |
|||
'content' => '帖子内容',//L |
|||
); |
|||
|
|||
$data = array(); |
|||
for ($i=0; $i < count($list) ; $i++) { |
|||
foreach ($filter as $key => $title) { |
|||
$data[$i][$key] = $list[$i][$key]; |
|||
} |
|||
} |
|||
util_csv::export_csv_2($data, $filter, '掌上信息帖子表.csv'); |
|||
exit(); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* Comment: 进入帖子详情 |
|||
*/ |
|||
function details() { |
|||
global $_W, $_GPC; |
|||
$set = Setting::agentsetting_read('pocket'); |
|||
$id = $_GPC['id']; |
|||
if (checksubmit('submit')) { |
|||
$data = $_GPC['data']; |
|||
$data['createtime'] = strtotime($data['createtime']); |
|||
$data['content'] = htmlspecialchars_decode($data['content']); |
|||
$data['content_json'] = json_encode($data['content']); |
|||
if ($_GPC['keyword']) { |
|||
$data['keyword'] = serialize($_GPC['keyword']); |
|||
} else { |
|||
$data['keyword'] = ''; |
|||
} |
|||
$endtime = $_GPC['endtime']; |
|||
$category = $_GPC['category']; |
|||
$data['onetype'] = $category['parentid']; |
|||
$data['type'] = $category['childid']; |
|||
if (empty($data['type'])) { |
|||
$data['type'] = $data['onetype']; |
|||
} |
|||
if ($data['top']) { |
|||
$data['endtime'] = strtotime($endtime); |
|||
} else { |
|||
$data['endtime'] = 0; |
|||
} |
|||
$data['img'] = serialize($data['img']); |
|||
//关联商户 |
|||
$storeids = $_GPC['storeids']; |
|||
if(!empty($storeids)){ |
|||
$data['storeid'] = serialize($storeids); |
|||
} |
|||
$res = pdo_update('wlmerchant_pocket_informations', $data, array('id' => $id)); |
|||
if ($res) { |
|||
wl_message('保存成功!', web_url('pocket/Tiezi/lists'), 'success'); |
|||
} else { |
|||
wl_message('保存失败!', web_url('pocket/Tiezi/details', array('id' => $id)), 'error'); |
|||
} |
|||
} |
|||
if ($id) { |
|||
$tiezi = Pocket::getInformations($id); |
|||
//过期时间 |
|||
if (empty($tiezi['endtime'])) { |
|||
$tiezi['endtime'] = time() + 259200; |
|||
} |
|||
if ($tiezi['mid']) { |
|||
$bmin = pdo_getcolumn('wlmerchant_pocket_blacklist', array('mid' => $tiezi['mid'], 'aid' => $_W['aid'], 'uniacid' => $_W['uniacid']), 'id'); |
|||
if ($bmin) { |
|||
$bflag = 2; |
|||
} else { |
|||
$bflag = 1; |
|||
} |
|||
} |
|||
$inmid = $tiezi['mid']; |
|||
if (empty($tiezi['avatar'])) { |
|||
if ($tiezi['mid']) { |
|||
$member['avatar'] = pdo_getcolumn(PDO_NAME . 'member', array('uniacid' => $_W['uniacid'], 'id' => $tiezi['mid']), 'avatar'); |
|||
} else { |
|||
$member['avatar'] = $set['kefu_avatar']; |
|||
} |
|||
} else { |
|||
$member['avatar'] = $tiezi['avatar']; |
|||
} |
|||
$member['nickname'] = $tiezi['nickname']; |
|||
$tiezi['mid'] = $member; |
|||
$tiezi['storeid'] = unserialize($tiezi['storeid']); |
|||
//分类 |
|||
$categoryes = pdo_getall(PDO_NAME . 'pocket_type', array('uniacid' => $_W['uniacid'], 'aid' => $_W['aid'], 'isnav' => 0)); //商家分类 |
|||
if (!empty($categoryes)) { |
|||
$parent = $children = array(); |
|||
foreach ($categoryes as $cid => $cate) { |
|||
$cate['name'] = $cate['title']; |
|||
if (!empty($cate['type'])) { |
|||
$children[$cate['type']][] = $cate; |
|||
} else { |
|||
$parent[$cate['id']] = $cate; |
|||
} |
|||
} |
|||
} |
|||
// wl_debug($children); |
|||
$tiezi['img'] = unserialize($tiezi['img']); |
|||
if(!empty($tiezi['img'])){ |
|||
foreach($tiezi['img'] as $key => &$img){ |
|||
if(empty($img)){ |
|||
unset($tiezi['img'][$key]); |
|||
} |
|||
} |
|||
} |
|||
|
|||
$tiezi['video_link'] = tomedia($tiezi['video_link']); |
|||
$comments = Pocket::getcomments($id); |
|||
$comments = $comments[0]; |
|||
foreach ($comments as $key => &$value) { |
|||
if (is_base64($value['content'])) $value['content'] = base64_decode($value['content']); |
|||
$mid = $value['mid']; |
|||
$member = Util::getSingelData("*", 'wlmerchant_member', array('id' => $mid)); |
|||
$value['mid'] = $member; |
|||
$bmin = pdo_getcolumn('wlmerchant_pocket_blacklist', array('mid' => $mid, 'aid' => $_W['aid'], 'uniacid' => $_W['uniacid']), 'id'); |
|||
if ($bmin) { |
|||
$value['mid']['bflag'] = 1; |
|||
} |
|||
$replys = Pocket::getreplys($value['id']); |
|||
$replys = $replys[0]; |
|||
if ($replys) { |
|||
foreach ($replys as &$reply) { |
|||
$mid = $reply['smid']; |
|||
$member = Util::getSingelData("*", 'wlmerchant_member', array('id' => $mid)); |
|||
$reply['smid'] = $member; |
|||
$bmin = pdo_getcolumn('wlmerchant_pocket_blacklist', array('mid' => $mid, 'aid' => $_W['aid'], 'uniacid' => $_W['uniacid']), 'id'); |
|||
if ($bmin) { |
|||
$reply['smid']['bflag'] = 1; |
|||
} |
|||
$mid = $reply['amid']; |
|||
$member = Util::getSingelData("*", 'wlmerchant_member', array('id' => $mid)); |
|||
$reply['amid'] = $member; |
|||
} |
|||
$comments[$key]['replys'] = $replys; |
|||
} |
|||
} |
|||
$info = pdo_getcolumn(PDO_NAME . "pocket_type", array('id' => $tiezi['type']), 'keyword'); |
|||
$keyword = explode(',', trim($info, ',')); |
|||
$tiezi['keyword'] = unserialize($tiezi['keyword']); |
|||
if (!empty($tiezi['content_json'])) $tiezi['content'] = json_decode($tiezi['content_json']); |
|||
} |
|||
|
|||
//定制查询商户 |
|||
if(Customized::init('pocket1500') > 0){ |
|||
$storelist = pdo_getall('wlmerchant_merchantdata',array('uniacid' => $_W['uniacid'],'aid' => $_W['aid'],'status' => 2,'enabled' => 1),array('id','storename')); |
|||
} |
|||
|
|||
include wl_template('pocket/infodetails'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 帖子删除 |
|||
*/ |
|||
function delete() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$ids = $_GPC['ids']; |
|||
$flag = $_GPC['flag']; |
|||
if ($ids) { |
|||
foreach ($ids as $key => $id) { |
|||
if ($flag == 1) { |
|||
pdo_update('wlmerchant_pocket_informations', array('status' => 3), array('id' => $id)); |
|||
} else if ($flag == 2) { |
|||
pdo_delete('wlmerchant_pocket_informations', array('id' => $id)); |
|||
} |
|||
} |
|||
die(json_encode(array('errno' => 0, 'message' => '', 'id' => ''))); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 帖子通过 |
|||
*/ |
|||
function pass() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$ids = $_GPC['ids']; |
|||
if ($id) { |
|||
$status = pdo_getcolumn(PDO_NAME . 'pocket_informations', array('uniacid' => $_W['uniacid'], 'id' => $id), 'status'); |
|||
if ($status == 3) { |
|||
die(json_encode(array('errno' => 2, 'message' => '已删除帖子不能通过', 'id' => $id))); |
|||
} else { |
|||
$res = pdo_update('wlmerchant_pocket_informations', array('status' => 0), array('id' => $id)); |
|||
if ($res) { |
|||
Pocket::passnotice($id); |
|||
die(json_encode(array('errno' => 0, 'message' => $res, 'id' => $id))); |
|||
} else { |
|||
die(json_encode(array('errno' => 2, 'message' => '通过失败,请重试', 'id' => $id))); |
|||
} |
|||
} |
|||
} |
|||
if ($ids) { |
|||
foreach ($ids as $key => $id) { |
|||
$status = pdo_getcolumn(PDO_NAME . 'pocket_informations', array('uniacid' => $_W['uniacid'], 'id' => $id), 'status'); |
|||
if ($status != 3) { |
|||
pdo_update('wlmerchant_pocket_informations', array('status' => 0), array('id' => $id)); |
|||
Pocket::passnotice($id); |
|||
} |
|||
} |
|||
die(json_encode(array('errno' => 0, 'message' => '', 'id' => ''))); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 帖子关闭 |
|||
*/ |
|||
function nopass() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$ids = $_GPC['ids']; |
|||
if ($id) { |
|||
$status = pdo_getcolumn(PDO_NAME . 'pocket_informations', array('uniacid' => $_W['uniacid'], 'id' => $id), 'status'); |
|||
if ($status == 3) { |
|||
die(json_encode(array('errno' => 2, 'message' => '已删除帖子不能操作', 'id' => $id))); |
|||
} else { |
|||
$res = pdo_update('wlmerchant_pocket_informations', array('status' => 2), array('id' => $id)); |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0, 'message' => $res, 'id' => $id))); |
|||
} else { |
|||
die(json_encode(array('errno' => 2, 'message' => '通过失败,请重试', 'id' => $id))); |
|||
} |
|||
} |
|||
|
|||
} |
|||
if ($ids) { |
|||
foreach ($ids as $key => $id) { |
|||
$status = pdo_getcolumn(PDO_NAME . 'pocket_informations', array('uniacid' => $_W['uniacid'], 'id' => $id), 'status'); |
|||
if ($status != 3) { |
|||
pdo_update('wlmerchant_pocket_informations', array('status' => 2), array('id' => $id)); |
|||
} |
|||
} |
|||
die(json_encode(array('errno' => 0, 'message' => '', 'id' => ''))); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 帖子订单列表 |
|||
*/ |
|||
function orders() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$where = array(); |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['aid'] = $_W['aid']; |
|||
$where['plugin'] = 'pocket'; |
|||
$where['status'] = 3; |
|||
$fightstatus = $_GPC['fightstatus']; |
|||
if($fightstatus > 0 ){ |
|||
$where['fightstatus'] = $fightstatus; |
|||
} |
|||
|
|||
if (!empty($_GPC['keyword'])) { |
|||
if (!empty($_GPC['keywordtype'])) { |
|||
switch ($_GPC['keywordtype']) { |
|||
case 1: |
|||
$where['@id@'] = $_GPC['keyword']; |
|||
break; |
|||
case 2: |
|||
$where['@orderno@'] = $_GPC['keyword']; |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
if ($_GPC['keywordtype'] == 3) { |
|||
$keyword = $_GPC['keyword']; |
|||
$params[':content'] = "%{$keyword}%"; |
|||
$goods = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_pocket_informations') . "WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND content LIKE :content", $params); |
|||
if ($goods) { |
|||
$goodids = "("; |
|||
foreach ($goods as $key => $v) { |
|||
if ($key == 0) { |
|||
$goodids .= $v['id']; |
|||
} else { |
|||
$goodids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$goodids .= ")"; |
|||
$where['fkid#'] = $goodids; |
|||
} else { |
|||
$where['fkid#'] = "(0)"; |
|||
} |
|||
} |
|||
if ($_GPC['keywordtype'] == 5) { |
|||
$keyword = $_GPC['keyword']; |
|||
$params[':nickname'] = "%{$keyword}%"; |
|||
$goods = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_pocket_informations') . "WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND nickname LIKE :nickname", $params); |
|||
if ($goods) { |
|||
$goodids = "("; |
|||
foreach ($goods as $key => $v) { |
|||
if ($key == 0) { |
|||
$goodids .= $v['id']; |
|||
} else { |
|||
$goodids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$goodids .= ")"; |
|||
$where['fkid#'] = $goodids; |
|||
} else { |
|||
$where['fkid#'] = "(0)"; |
|||
} |
|||
} |
|||
if ($_GPC['keywordtype'] == 6) { |
|||
$keyword = $_GPC['keyword']; |
|||
$params[':phone'] = "%{$keyword}%"; |
|||
$goods = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_pocket_informations') . "WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND :phone LIKE :phone", $params); |
|||
if ($goods) { |
|||
$goodids = "("; |
|||
foreach ($goods as $key => $v) { |
|||
if ($key == 0) { |
|||
$goodids .= $v['id']; |
|||
} else { |
|||
$goodids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$goodids .= ")"; |
|||
$where['fkid#'] = $goodids; |
|||
} else { |
|||
$where['fkid#'] = "(0)"; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
if ($_GPC['time_limit']) { |
|||
$time_limit = $_GPC['time_limit']; |
|||
$starttime = strtotime($_GPC['time_limit']['start']); |
|||
$endtime = strtotime($_GPC['time_limit']['end']); |
|||
$where['createtime>'] = $starttime; |
|||
$where['createtime<'] = $endtime + 24 * 3600; |
|||
} |
|||
|
|||
if (empty($starttime) || empty($endtime)) { |
|||
$starttime = strtotime('-1 month'); |
|||
$endtime = time(); |
|||
} |
|||
|
|||
$orderlist = Pocket::getNumOrder('*', $where, 'ID DESC', $pindex, $psize, 1); |
|||
$pager = $orderlist[1]; |
|||
$list = $orderlist[0]; |
|||
foreach ($list as $key => &$v) { |
|||
$tiezi = Pocket::getInformations($v['fkid']); |
|||
$v['content'] = $tiezi['content']; |
|||
if (!empty($tiezi['content_json'])) $v['content'] = json_decode($tiezi['content_json']); |
|||
$v['logo'] = pdo_getcolumn(PDO_NAME . 'pocket_type', array('uniacid' => $_W['uniacid'], 'id' => $tiezi['type']), 'img'); |
|||
$v['type'] = pdo_getcolumn(PDO_NAME . 'pocket_type', array('uniacid' => $_W['uniacid'], 'id' => $tiezi['type']), 'title'); |
|||
$member = pdo_get(PDO_NAME . 'member', array('uniacid' => $_W['uniacid'], 'id' => $tiezi['mid']), ['avatar','encodename']); |
|||
$v['avatar'] = $member['avatar']; |
|||
$v['nickname'] = base64_decode($member['encodename']); |
|||
$v['phone'] = $tiezi['phone']; |
|||
$v['endtime'] = $tiezi['endtime']; |
|||
} |
|||
|
|||
include wl_template('pocket/orderlist'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 发布帖子 |
|||
*/ |
|||
function createtop() { |
|||
global $_W, $_GPC; |
|||
$type = $_GPC['type']; |
|||
$types = pdo_getall('wlmerchant_pocket_type', array('isnav' => 0, 'aid' => $_W['aid'], 'type' => 0,'uniacid'=>$_W['uniacid'])); |
|||
$set = Setting::agentsetting_read('pocket'); |
|||
if ($_W['ispost']) { |
|||
$data = $_GPC['data']; |
|||
$data['keyword'] = serialize($_GPC['keyword']); |
|||
$data['img'] = serialize($data['img']); |
|||
$data['mid'] = 0; |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$data['status'] = 0; |
|||
|
|||
if (empty($type)) { |
|||
$data['nickname'] = $set['kefu_name']; |
|||
$data['phone'] = $set['kefu_phone']; |
|||
$data['avatar'] = $set['kefu_avatar']; |
|||
if ($data['onetype']) { |
|||
$data['top'] = 2; |
|||
} else { |
|||
$data['top'] = 3; |
|||
} |
|||
} |
|||
if ($data['top'] == 1) { |
|||
$data['endtime'] = time() + 3 * 24 * 3600; |
|||
} |
|||
$data['createtime'] = time(); |
|||
$data['likenum'] = 0; |
|||
$data['look'] = 0; |
|||
$data['share'] = 0; |
|||
if (empty($data['type'])) { |
|||
$data['type'] = $data['onetype']; |
|||
} |
|||
|
|||
$storeids = $_GPC['storeids']; |
|||
if(!empty($storeids)){ |
|||
$data['storeid'] = serialize($storeids); |
|||
} |
|||
if (!empty($data['content'])) $data['content_json'] = json_encode($data['content']); |
|||
|
|||
$res = pdo_insert('wlmerchant_pocket_informations', $data); |
|||
if ($res) { |
|||
wl_message('保存成功!', web_url('pocket/Tiezi/lists'), 'success'); |
|||
} else { |
|||
wl_message('保存失败!', web_url('pocket/Tiezi/createtop'), 'error'); |
|||
} |
|||
} |
|||
//定制查询商户 |
|||
if(Customized::init('pocket1500') > 0){ |
|||
$storelist = pdo_getall('wlmerchant_merchantdata',array('uniacid' => $_W['uniacid'],'aid' => $_W['aid'],'status' => 2,'enabled' => 1),array('id','storename')); |
|||
} |
|||
include wl_template('pocket/createtop'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 获取帖子分类 |
|||
*/ |
|||
function seconds() { |
|||
global $_W, $_GPC; |
|||
$onetype = $_GPC['onetype']; |
|||
$seconds = pdo_getall('wlmerchant_pocket_type', array('aid' => $_W['aid'], 'uniacid' => $_W['uniacid'], 'type' => $onetype)); |
|||
if ($seconds) { |
|||
die(json_encode(array('errno' => 0, 'twotype' => $seconds))); |
|||
} else { |
|||
die(json_encode(array('errno' => 1))); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 删除帖子详情 |
|||
* Author: zzw |
|||
*/ |
|||
function deletecomment() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$res = pdo_delete('wlmerchant_pocket_comment', array('id' => $id)); |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0))); |
|||
} else { |
|||
die(json_encode(array('errno' => 1))); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 删除帖子的回复信息 |
|||
* Author: zzw |
|||
*/ |
|||
function deletereply() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$res = pdo_delete('wlmerchant_pocket_reply', array('id' => $id)); |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0))); |
|||
} else { |
|||
die(json_encode(array('errno' => 1))); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 添加掌上信息黑名单 |
|||
* Author: zzw |
|||
*/ |
|||
function addblack() { |
|||
global $_W, $_GPC; |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$data['mid'] = $_GPC['mid']; |
|||
$data['inid'] = $_GPC['inid']; |
|||
$data['createtime'] = time(); |
|||
if ($data['inid'] && $data['mid']) { |
|||
$res = pdo_insert(PDO_NAME . 'pocket_blacklist', $data); |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0))); |
|||
} else { |
|||
die(json_encode(array('errno' => 1))); |
|||
} |
|||
} else { |
|||
die(json_encode(array('errno' => 1, 'msg' => '添加失败,参数错误'))); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 取消掌上信息黑名单 |
|||
* Author: zzw |
|||
*/ |
|||
function deteblack() { |
|||
global $_W, $_GPC; |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$data['mid'] = $_GPC['mid']; |
|||
if ($data['mid']) { |
|||
$res = pdo_delete('wlmerchant_pocket_blacklist', $data); |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0))); |
|||
} else { |
|||
die(json_encode(array('errno' => 1))); |
|||
} |
|||
} else { |
|||
die(json_encode(array('errno' => 1, 'msg' => '取消失败,参数错误'))); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 获取某个分类的所有标签 |
|||
* Author: zzw |
|||
*/ |
|||
public function getKeyword() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$info = pdo_getcolumn(PDO_NAME . "pocket_type", array('id' => $id), 'keyword'); |
|||
if ($info) { |
|||
$keyword = explode(',', trim($info, ',')); |
|||
wl_json(1, '标签内容', $keyword); |
|||
} else { |
|||
wl_json(0, '没有标签'); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 驳回帖子 |
|||
* Author: zzw |
|||
*/ |
|||
public function reject() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$text = $_GPC['text']; |
|||
if (empty($text)) { |
|||
$reason = '时间:' . date('Y-m-d H:i:s', time()) . '在后台驳回'; |
|||
$res = pdo_update(PDO_NAME . 'pocket_informations', array('status' => 2, 'reason' => $reason), array('id' => $id)); |
|||
} else { |
|||
$res = pdo_update(PDO_NAME . 'pocket_informations', array('status' => 2, 'reason' => $text), array('id' => $id)); |
|||
} |
|||
if ($res) { |
|||
Pocket::passnotice($id); |
|||
wl_json(1); |
|||
} else { |
|||
wl_json(0); |
|||
} |
|||
} |
|||
|
|||
public function blacklist() { |
|||
global $_W, $_GPC; |
|||
$blacklist = pdo_getall('wlmerchant_pocket_blacklist', array('uniacid' => $_W['uniacid'], 'aid' => $_W['aid'])); |
|||
foreach ($blacklist as $key => &$black) { |
|||
$black['avatar'] = pdo_getcolumn(PDO_NAME . 'member', array('id' => $black['mid']), 'avatar'); |
|||
$black['nickname'] = base64_decode(pdo_getcolumn(PDO_NAME . 'member', array('id' => $black['mid']), 'encodename')); |
|||
} |
|||
include wl_template('pocket/blacklist'); |
|||
} |
|||
} |
|||
@ -0,0 +1,167 @@ |
|||
<?php |
|||
/** |
|||
* Comment: 掌上信息 评论/回复审核操作 |
|||
* Author: zzw |
|||
*/ |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class ToExamine_WeliamController{ |
|||
/** |
|||
* Comment: 获取评论列表 |
|||
* Author: zzw |
|||
* Date: 2020/3/13 15:51 |
|||
*/ |
|||
public function comment(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$page = $_GPC['page'] ? :1; |
|||
$pageIndex = $_GPC['page_index'] ? :10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$status = $_GPC['status'] ? : 0; |
|||
#2、条件生成 |
|||
$where = " WHERE a.uniacid = {$_W['uniacid']} AND a.aid = {$_W['aid']} "; |
|||
if($status > 0) $where .= $status == 3 ? " AND a.status = 0 " : " AND a.status = {$status} "; |
|||
$order = " ORDER BY a.createtime DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$field = "a.id,a.content,FROM_UNIXTIME(a.createtime,'%Y-%m-%d %H:%i:%S') as createtime,a.tid,u.nickname,a.status"; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."pocket_comment") |
|||
." as a RIGHT JOIN ".tablename(PDO_NAME."pocket_informations") |
|||
." as b ON a.tid = b.id RIGHT JOIN ".tablename(PDO_NAME."member") |
|||
." as u ON a.mid = u.id {$where}"; |
|||
#3、列表信息获取 |
|||
$list = pdo_fetchall($sql.$order.$limit); |
|||
#3、总数获取 |
|||
$totalSql = str_replace($field , 'count(*)' , $sql); |
|||
$total = pdo_fetchcolumn($totalSql); |
|||
$pager = wl_pagination($total , $page , $pageIndex); |
|||
|
|||
include wl_template('examine/comment'); |
|||
} |
|||
/** |
|||
* Comment: 评论审核操作 |
|||
* Author: zzw |
|||
* Date: 2020/3/13 16:05 |
|||
*/ |
|||
public function commentToExamine(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$status = $_GPC['status'] ? : 1; |
|||
$ids = $_GPC['ids']; |
|||
#2、条件生成 |
|||
$where['status'] = 0; |
|||
if(is_array($ids)) $where['id IN '] = $ids; |
|||
else $where['id'] = $ids; |
|||
#3、操作判断 |
|||
if (pdo_update(PDO_NAME . "pocket_comment" , ['status' => $status] , $where)){ |
|||
//发送模板消息通知 |
|||
if($status == 1){ |
|||
unset($where['status']); |
|||
$list = pdo_getall(PDO_NAME."pocket_comment",$where,['id','tid']); |
|||
foreach($list as $key => $val){ |
|||
pdo_update('wlmerchant_pocket_informations',array('replytime' => time()),array('id' => $val['tid'])); |
|||
Pocket::setModelInfo($val['tid'],$val['id']); |
|||
} |
|||
} |
|||
|
|||
show_json(1 , '审核成功'); |
|||
}else { |
|||
show_json(0 , '审核失败,请刷新重试!'); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 删除评论信息 |
|||
* Author: zzw |
|||
* Date: 2020/3/13 16:12 |
|||
*/ |
|||
public function delComment(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids']; |
|||
#1、条件生成 |
|||
if(is_array($ids)) $where['id IN '] = $ids; |
|||
else $where['id'] = $ids; |
|||
#3、操作判断 |
|||
if (pdo_delete(PDO_NAME."pocket_comment",$where)) show_json(1 , '删除成功'); |
|||
else show_json(0 , '删除失败,请刷新重试!'); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* Comment: 获取回复列表 |
|||
* Author: zzw |
|||
* Date: 2020/3/13 17:07 |
|||
*/ |
|||
public function reply(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$page = $_GPC['page'] ? :1; |
|||
$pageIndex = $_GPC['page_index'] ? :10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$status = $_GPC['status'] ? : 0; |
|||
#2、条件生成 |
|||
$where = " WHERE a.uniacid = {$_W['uniacid']} AND a.aid = {$_W['aid']} "; |
|||
if($status > 0) $where .= $status == 3 ? " AND a.status = 0 " : " AND a.status = {$status} "; |
|||
$order = " ORDER BY a.createtime DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
$field = "a.id,a.content,FROM_UNIXTIME(a.createtime,'%Y-%m-%d %H:%i:%S') as createtime,a.tid,u.nickname,a.status"; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."pocket_reply") |
|||
." as a RIGHT JOIN ".tablename(PDO_NAME."pocket_informations") |
|||
." as b ON a.tid = b.id RIGHT JOIN ".tablename(PDO_NAME."member") |
|||
." as u ON a.smid = u.id {$where}"; |
|||
#3、列表信息获取 |
|||
$list = pdo_fetchall($sql.$order.$limit); |
|||
#3、总数获取 |
|||
$totalSql = str_replace($field , 'count(*)' , $sql); |
|||
$total = pdo_fetchcolumn($totalSql); |
|||
$pager = wl_pagination($total , $page , $pageIndex); |
|||
|
|||
include wl_template('examine/reply'); |
|||
} |
|||
/** |
|||
* Comment: 评论审核操作 |
|||
* Author: zzw |
|||
* Date: 2020/3/13 16:05 |
|||
*/ |
|||
public function replyToExamine(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$status = $_GPC['status'] ? : 1; |
|||
$ids = $_GPC['ids']; |
|||
#2、条件生成 |
|||
$where['status'] = 0; |
|||
if(is_array($ids)) $where['id IN '] = $ids; |
|||
else $where['id'] = $ids; |
|||
#3、操作判断 |
|||
if (pdo_update(PDO_NAME . "pocket_reply" , ['status' => $status] , $where)) { |
|||
//发送模板消息通知 |
|||
if($status == 1){ |
|||
unset($where['status']); |
|||
$list = pdo_getall(PDO_NAME."pocket_reply",$where,['id','tid','smid','amid']); |
|||
foreach($list as $key => $val){ |
|||
pdo_update('wlmerchant_pocket_informations',array('replytime' => time()),array('id' => $val['tid'])); |
|||
Pocket::setReplyModelInfo($val['tid'],$val['id'],$val['smid'],$val['amid']); |
|||
} |
|||
} |
|||
|
|||
show_json(1 , '审核成功'); |
|||
}else { |
|||
show_json(0 , '审核失败,请刷新重试!'); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 删除评论信息 |
|||
* Author: zzw |
|||
* Date: 2020/3/13 16:12 |
|||
*/ |
|||
public function delReply(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids']; |
|||
#1、条件生成 |
|||
if(is_array($ids)) $where['id IN '] = $ids; |
|||
else $where['id'] = $ids; |
|||
#3、操作判断 |
|||
if (pdo_delete(PDO_NAME."pocket_reply",$where)) show_json(1 , '删除成功'); |
|||
else show_json(0 , '删除失败,请刷新重试!'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,125 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Type_WeliamController { |
|||
/** |
|||
* Comment: 进入帖子分类列表 |
|||
*/ |
|||
function lists() { |
|||
global $_W, $_GPC; |
|||
$list = Pocket::gettypes(); |
|||
include wl_template('pocket/typelist'); |
|||
} |
|||
/** |
|||
* Comment: 进入编辑分类 |
|||
*/ |
|||
function operating() { |
|||
global $_W, $_GPC; |
|||
//参数信息获取 |
|||
$parentId = trim($_GPC['parentid']); |
|||
|
|||
if ($_GPC['id']) { |
|||
$data = Util::getSingelData("*", PDO_NAME . 'pocket_type', array('id' => $_GPC['id'])); |
|||
if($data['type'] > 0) $parentId = $data['type']; |
|||
$data['adv'] = unserialize($data['adv']); |
|||
} |
|||
if ($_GPC['did']) { |
|||
pdo_delete(PDO_NAME . 'pocket_type', array('id' => $_GPC['did'])); |
|||
wl_message('删除数据成功', web_url('pocket/Type/lists'), 'success'); |
|||
} |
|||
if ($_GPC['data']) { |
|||
$temp = $_GPC['data']; |
|||
$temp['uniacid'] = $_W['uniacid']; |
|||
$temp['aid'] = $_W['aid']; |
|||
$temp['adv'] = serialize($temp['adv']); |
|||
|
|||
if ($temp['id'] > 0) { |
|||
$status = Util::getSingelData("status", PDO_NAME . 'pocket_type', array('id' => $temp['type'])); |
|||
|
|||
if ($status['status'] === 0) { |
|||
$temp['status'] = 0; |
|||
} |
|||
pdo_update(PDO_NAME . 'pocket_type', $temp, array('id' => $temp['id'])); |
|||
$temp = Util::getSingelData("*", PDO_NAME.'pocket_type', array('id'=>$temp['id'])); |
|||
|
|||
if (!$temp['type']) { |
|||
echo $temp['status']; |
|||
if (!$temp['status']) { |
|||
$temp1 = Util::getNumData("*", PDO_NAME . 'pocket_type', array('type' => $temp['id'])); |
|||
$temp1 = $temp1[0]; |
|||
foreach ($temp1 as $value) { |
|||
$value['status'] = 0; |
|||
pdo_update(PDO_NAME . 'pocket_type', $value, array('id' => $value['id'])); |
|||
} |
|||
} |
|||
if ($temp['status'] == 1) { |
|||
$temp1 = Util::getNumData("*", PDO_NAME . 'pocket_type', array('type' => $temp['id'])); |
|||
$temp1 = $temp1[0]; |
|||
foreach ($temp1 as $value) { |
|||
$value['status'] = 1; |
|||
pdo_update(PDO_NAME . 'pocket_type', $value, array('id' => $value['id'])); |
|||
} |
|||
} |
|||
} |
|||
|
|||
wl_message('修改成功', web_url('pocket/Type/lists'), 'success'); |
|||
}else if ($parentId > 0) { |
|||
$temp['type'] = $parentId; |
|||
|
|||
$status = Util::getSingelData("status", PDO_NAME . 'pocket_type', array('id' => $temp['type'])); |
|||
if ($status['status'] === 0) { |
|||
$temp['status'] = 0; |
|||
} |
|||
pdo_insert(PDO_NAME . 'pocket_type', $temp); |
|||
wl_message('插入子类型成功', web_url('pocket/Type/lists'), 'success'); |
|||
} else { |
|||
pdo_insert(PDO_NAME . 'pocket_type', $temp); |
|||
wl_message('添加类型成功', web_url('pocket/Type/lists'), 'success'); |
|||
} |
|||
} |
|||
//进入添加子分类页面 获取上级分类信息 |
|||
if($parentId > 0){ |
|||
$parentTitle = pdo_getcolumn(PDO_NAME . 'pocket_type',['id'=>$parentId],'title'); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
include wl_template('pocket/typeadd'); |
|||
} |
|||
/** |
|||
* Comment: 设置/修改 帖子发帖需要支付的费用 |
|||
* Author: zzw |
|||
*/ |
|||
function setPrice(){ |
|||
global $_W,$_GPC; |
|||
$id = $_GPC['id']; |
|||
$price = trim($_GPC['value']); |
|||
$res = pdo_update(PDO_NAME."pocket_type",array('price'=>$price),array('id'=>$id)); |
|||
if($res){ |
|||
show_json(1, "修改成功"); |
|||
}else{ |
|||
show_json(0, "修改失败"); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 修改状态 |
|||
* Author: zzw |
|||
* Date: 2019/9/18 17:37 |
|||
*/ |
|||
public function changeStatus (){ |
|||
global $_W , $_GPC; |
|||
#1、获取参数信息 |
|||
$id = $_GPC['id'] OR Commons::sRenderError('缺少参数:导航id'); |
|||
$status = $_GPC['status'] ? : 0; |
|||
#1、修改操作 |
|||
$res = pdo_update(PDO_NAME."pocket_type",['status'=>$status],['id'=>$id]); |
|||
if($res) Commons::sRenderSuccess('修改成功'); |
|||
else Commons::sRenderError('修改失败,请刷新重试!'); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,77 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="javascript:;">评论审核</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('pocket/ToExamine/comment')}" class="btn {if $status > 0}btn-default{else}btn-primary{/if}">全部回复</a> |
|||
<a href="{php echo web_url('pocket/ToExamine/comment',['status'=>3])}" class="btn {if $status == 3}btn-primary{else}btn-default{/if}">待审核</a> |
|||
<a href="{php echo web_url('pocket/ToExamine/comment',['status'=>1])}" class="btn {if $status == 1}btn-primary{else}btn-default{/if}">已通过</a> |
|||
<a href="{php echo web_url('pocket/ToExamine/comment',['status'=>2])}" class="btn {if $status == 2}btn-primary{else}btn-default{/if}">未通过</a> |
|||
</div> |
|||
<div class="filter-list"></div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center"><input type="checkbox" /></th> |
|||
<th class="text-left">评论内容</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> |
|||
<input type="checkbox" value="{$item['id']}" /> |
|||
</td> |
|||
<td class="text-left"> |
|||
{if is_base64($item['content'])} |
|||
{php echo base64_decode($item['content']);} |
|||
{else} |
|||
{$item['content']} |
|||
{/if} |
|||
</td> |
|||
<td>{$item['createtime']}</td> |
|||
<td>{$item['nickname']}</td> |
|||
<td> |
|||
{if $item['status'] == 1} |
|||
<label class="label label-success">通过</label> |
|||
{elseif $item['status'] == 2} |
|||
<label class="label label-danger">未通过</label> |
|||
{else} |
|||
<label class="label label-default">待审核</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['status'] != 1 && $item['status'] != 2} |
|||
<a href="{php echo web_url('pocket/ToExamine/commentToExamine',['ids'=>$item['id'],'status'=>1])}" data-toggle="ajaxPost" class="btn btn-sm btn-primary">通过</a> |
|||
<a href="{php echo web_url('pocket/ToExamine/commentToExamine',['ids'=>$item['id'],'status'=>2])}" data-toggle="ajaxPost" class="btn btn-sm btn-warning">驳回</a> |
|||
{/if} |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('pocket/ToExamine/delComment',['ids'=>$item['id']])}" data-confirm="确定删除当前评论?">删除</a> |
|||
<a href="{php echo web_url('pocket/Tiezi/details',['id'=>$item['tid']])}" class="btn btn-sm btn-info" >查看帖子</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div id="de1" class="pull-left"> |
|||
<button class="btn btn-default" type="button" data-toggle='batch-remove' data-confirm="确定删除当前选择的评论?" data-href="{php echo web_url('pocket/ToExamine/delComment')}">批量删除</button> |
|||
<button class="btn btn-default" type="button" data-toggle='batch' data-href="{php echo web_url('pocket/ToExamine/commentToExamine',['status'=>1])}">批量通过</button> |
|||
<button class="btn btn-default" type="button" data-toggle='batch' data-href="{php echo web_url('pocket/ToExamine/commentToExamine',['status'=>2])}">批量驳回</button> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,77 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="javascript:;">回复审核</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('pocket/ToExamine/reply')}" class="btn {if $status > 0}btn-default{else}btn-primary{/if}">全部回复</a> |
|||
<a href="{php echo web_url('pocket/ToExamine/reply',['status'=>3])}" class="btn {if $status == 3}btn-primary{else}btn-default{/if}">待审核</a> |
|||
<a href="{php echo web_url('pocket/ToExamine/reply',['status'=>1])}" class="btn {if $status == 1}btn-primary{else}btn-default{/if}">已通过</a> |
|||
<a href="{php echo web_url('pocket/ToExamine/reply',['status'=>2])}" class="btn {if $status == 2}btn-primary{else}btn-default{/if}">未通过</a> |
|||
</div> |
|||
<div class="filter-list"></div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center"><input type="checkbox" /></th> |
|||
<th class="text-left">回复内容</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> |
|||
<input type="checkbox" value="{$item['id']}" /> |
|||
</td> |
|||
<td class="text-left"> |
|||
{if is_base64($item['content'])} |
|||
{php echo base64_decode($item['content']);} |
|||
{else} |
|||
{$item['content']} |
|||
{/if} |
|||
</td> |
|||
<td>{$item['createtime']}</td> |
|||
<td>{$item['nickname']}</td> |
|||
<td> |
|||
{if $item['status'] == 1} |
|||
<label class="label label-success">通过</label> |
|||
{elseif $item['status'] == 2} |
|||
<label class="label label-danger">未通过</label> |
|||
{else} |
|||
<label class="label label-default">待审核</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $item['status'] != 1 && $item['status'] != 2} |
|||
<a href="{php echo web_url('pocket/ToExamine/replyToExamine',['ids'=>$item['id'],'status'=>1])}" data-toggle="ajaxPost" class="btn btn-sm btn-primary">通过</a> |
|||
<a href="{php echo web_url('pocket/ToExamine/replyToExamine',['ids'=>$item['id'],'status'=>2])}" data-toggle="ajaxPost" class="btn btn-sm btn-warning">驳回</a> |
|||
{/if} |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('pocket/ToExamine/delReply',['ids'=>$item['id']])}" data-confirm="确定删除当前回复?">删除</a> |
|||
<a href="{php echo web_url('pocket/Tiezi/details',['id'=>$item['tid']])}" class="btn btn-sm btn-info" >查看帖子</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div id="de1" class="pull-left"> |
|||
<button class="btn btn-default" type="button" data-toggle='batch-remove' data-confirm="确定删除当前选择的回复信息?" data-href="{php echo web_url('pocket/ToExamine/delReply')}">批量删除</button> |
|||
<button class="btn btn-default" type="button" data-toggle='batch' data-href="{php echo web_url('pocket/ToExamine/replyToExamine',['status'=>1])}">批量通过</button> |
|||
<button class="btn btn-default" type="button" data-toggle='batch' data-href="{php echo web_url('pocket/ToExamine/replyToExamine',['status'=>2])}">批量驳回</button> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,563 @@ |
|||
{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_top">置顶设置</a></li> |
|||
<li><a href="#tab_redpaper">红包设置</a></li> |
|||
<li><a href="#tab_share">列表分享</a></li> |
|||
<li><a href="#tab_kefu">管理员设置</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="status" {if $data['status']==1} checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="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="passstatus" {if $data['passstatus']==1} checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="passstatus" {if $data['passstatus']==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="comment_reply" {if $data['comment_reply']==1} checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="comment_reply" {if $data['comment_reply']!=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="$('#vip_level').show()"> |
|||
<input type="radio" value="1" name="vip_show" {if $data['vip_show']==1} checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#vip_level').hide()"> |
|||
<input type="radio" value="0" name="vip_show" {if $data['vip_show']!=1} checked {/if}>禁用 |
|||
</label> |
|||
<span class="help-block">开启后只有设置了权限的会员等级才能查看发帖人联系方式。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="vip_level" {if $data['vip_show'] != 1} style="display:none;" {/if} > |
|||
<label class="col-sm-2 control-label">查阅特权等级</label> |
|||
<div class="col-sm-9"> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="0" name="vip_level[]" {if in_array(0,$vip_level)} checked="checked" {/if} /> {$_W['wlsetting']['halflevel']['name']} |
|||
</label> |
|||
{loop $levels $level} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{$level['id']}" name="vip_level[]" {if in_array($level['id'],$vip_level)} checked="checked" {/if} /> {$level['name']} |
|||
</label> |
|||
{/loop} |
|||
<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="2" name="locastatus" {if $data['locastatus']==2} checked {/if}>强制开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="locastatus" {if $data['locastatus']==1} checked {/if}>默认开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="locastatus" {if $data['locastatus']==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="0" name="listorder" {if $data['listorder']==0} checked {/if}>按发帖时间 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="listorder" {if $data['listorder']==1} checked {/if}>按浏览数量 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="2" name="listorder" {if $data['listorder']==2} checked {/if}>按分享数量 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="3" name="listorder" {if $data['listorder']==3} checked {/if}>按点赞数量 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="4" name="listorder" {if $data['listorder']==4} checked {/if}>按回复时间 |
|||
</label> |
|||
</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="text" name="data[alllimit]" class="form-control" value="{$data['alllimit']}" /> |
|||
<span class="input-group-addon">个,个人每日发帖数</span> |
|||
<input type="text" name="data[daylimit]" class="form-control" value="{$data['daylimit']}" /> |
|||
<span class="input-group-addon">个</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"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">会员发帖总数</span> |
|||
<input type="text" name="data[vipalllimit]" class="form-control" value="{$data['vipalllimit']}" /> |
|||
<span class="input-group-addon">个,会员每日发帖数</span> |
|||
<input type="text" name="data[vipdaylimit]" class="form-control" value="{$data['vipdaylimit']}" /> |
|||
<span class="input-group-addon">个</span> |
|||
</div> |
|||
<span class="help-block">会员用户发帖的数量限制,不填则无限制。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group form-inline"> |
|||
<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="text" name="data[look]" class="form-control" value="{$data['look']}" /> |
|||
<span class="input-group-addon">发布</span> |
|||
<input type="text" name="data[fabu]" class="form-control" value="{$data['fabu']}" /> |
|||
<span class="input-group-addon">分享</span> |
|||
<input type="text" name="data[share]" class="form-control" value="{$data['share']}" /> |
|||
</div> |
|||
</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="text" name="data[maxup]" placeholder="5" class="form-control" value="{$data['maxup']}" /> |
|||
<span class="input-group-addon">最小</span> |
|||
<input type="text" name="data[minup]" placeholder="1" class="form-control" value="{$data['minup']}" /> |
|||
</div> |
|||
<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[remark]" class="form-control" value="{$data['remark']}" /> |
|||
</div> |
|||
<div class="col-sm-2"> |
|||
<input type="color" name="data[remarkcolor]" class="form-control" value="{$data['remarkcolor']}" /> |
|||
</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="storesettle" {if $data['storesettle']==1} checked {/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="storesettle" {if $data['storesettle']!=1} checked {/if}>启用 |
|||
</label> |
|||
<span class="help-block">是否在发帖选择分类页面显示商户入驻提示。</span> |
|||
</div> |
|||
</div> |
|||
{if empty(Customized::init('pocket140'))} |
|||
<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="imgupload" {if $data['imgupload']==1} checked {/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="imgupload" {if $data['imgupload']!=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"> |
|||
<input type="radio" value="1" name="videoupload" {if $data['videoupload']==1} checked {/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="videoupload" {if $data['videoupload']!=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"> |
|||
<input type="radio" value="1" name="audioupload" {if $data['audioupload']==1} checked {/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="audioupload" {if $data['audioupload']!=1} checked {/if}>启用 |
|||
</label> |
|||
<span class="help-block">用户在发帖时是否可以转译语音。</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="data[statement]" placeholder="请输入平台免责声明" class="form-control" value="{$data['statement']}" /> |
|||
<span class="help-block">默认内容为:本平台发布的所有信息展示,内容本身与平台本身无关,平台不负任何责任。</span> |
|||
</div> |
|||
</div> |
|||
{if p('wxapp')} |
|||
<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[wxapptip]" {if $data['wxapptip']==1} checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="data[wxapptip]" {if $data['wxapptip']!=1} checked {/if}>禁用 |
|||
</label> |
|||
<span class="help-block">小程序端发布时是否提示订阅。</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
<div class="tab-pane" id="tab_top"> |
|||
<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[number]" class="form-control" value="{$data['number']}" /> |
|||
<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">--> |
|||
<!-- <label class="radio-inline">--> |
|||
<!-- <input type="radio" value="1" name="freestatus" {if $data['freestatus']==1} checked {/if}>启用--> |
|||
<!-- </label>--> |
|||
<!-- <label class="radio-inline">--> |
|||
<!-- <input type="radio" value="0" name="freestatus" {if $data['freestatus']==0} checked {/if}>禁用--> |
|||
<!-- </label>--> |
|||
<!-- </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['price'])} |
|||
{php include wl_template('pocket/dayandprice');} |
|||
{else} |
|||
{loop $data['price'] $ba} |
|||
{php include wl_template('pocket/dayandprice');} |
|||
{/loop} |
|||
{/if} |
|||
</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"> |
|||
<a class="btn btn-info btn-add-type" href="javascript:;" onclick="addType();"> |
|||
<i class="fa fa-plus" title=""></i>增加一种置顶规则 |
|||
</a> |
|||
</div> |
|||
</div> |
|||
{if Customized::init('pocket140') > 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" value="1" onclick="$('#fulldiv').show();" name="data[fullchannel]" {if $data['fullchannel']==1} checked {/if}>开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" onclick="$('#fulldiv').hide();" name="data[fullchannel]" {if $data['fullchannel']!=1} checked {/if}>关闭 |
|||
</label> |
|||
<span class="help-block">全频推广时,用户帖子会显示在所有代理中,全频推广的帖子不能置顶,置顶帖也不能全频推广。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="fulldiv" {if $data['fullchannel'] != 1} style="display:none;" {/if} > |
|||
<label class="col-sm-2 control-label">推广金额</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" min="0" name="data[fullprice]" class="form-control" value="{$data['fullprice']}" /> |
|||
<span class="input-group-addon">元,会员价</span> |
|||
<input type="number" min="0" name="data[fullvip]" class="form-control" value="{$data['fullvip']}" /> |
|||
<span class="input-group-addon">元</span> |
|||
</div> |
|||
<span class="help-block">金额保留两位小数,不填或者填0即为免费。</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
<div class="tab-pane" id="tab_redpaper"> |
|||
<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="is_openRed" {if $data['is_openRed']==1} checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="is_openRed" {if $data['is_openRed']==0} checked {/if}>禁用 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<span class="{if $data['is_openRed']!=1}hide{/if}" id="redSetList"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">红包设置</label> |
|||
<div class="col-sm-9"> |
|||
<div id="redEnvelopes"> |
|||
{if empty($data['red_envelopes'])} |
|||
{php include wl_template('pocket/redEnvelopes');} |
|||
{else} |
|||
{loop $data['red_envelopes'] $itmes} |
|||
{php include wl_template('pocket/redEnvelopes');} |
|||
{/loop} |
|||
{/if} |
|||
</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"> |
|||
<a class="btn btn-info btn-add-type" href="javascript:;" onclick="addReds();"> |
|||
<i class="fa fa-plus" title=""></i>增加一种红包设置 |
|||
</a> |
|||
</div> |
|||
</div> |
|||
</span> |
|||
</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"> |
|||
<input type="text" name="data[share_title]" class="form-control" value="{$data['share_title']}" /> |
|||
</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_image]', $data['share_image']);} |
|||
</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']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_kefu"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">管理员名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[kefu_name]" class="form-control" value="{$data['kefu_name']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">管理员头像</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[kefu_avatar]', $data['kefu_avatar']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">管理员电话</label> |
|||
<div class="col-sm-9"> |
|||
<input type="tel" name="data[kefu_phone]" class="form-control" value="{$data['kefu_phone']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_distri"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">一级佣金比例</label> |
|||
<div class="col-xs-12 col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="data[onecommission]" class="form-control" value="{$data['onecommission']}" /> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
<span class="help-block">买家上级所获佣金</span> |
|||
</div> |
|||
</div> |
|||
{if $distri['ranknum']>1} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">二级佣金比例</label> |
|||
<div class="col-xs-12 col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="data[twocommission]" class="form-control" value="{$data['twocommission']}" /> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
<span class="help-block">买家上级的上级所获佣金</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if $distri['ranknum']>2} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">三级佣金比例</label> |
|||
<div class="col-xs-12 col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="data[threecommission]" class="form-control" value="{$data['threecommission']}" /> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
<span class="help-block">买家最高上级所获佣金</span> |
|||
</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']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$('.dede').delegate('.deteblack','click',function(e){ |
|||
e.stopPropagation(); |
|||
var mid = $(this).attr('inmid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('pocket/Tiezi/deteblack')}", { mid : mid }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("取消成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.msg); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认把该用户取消黑名单?'}); |
|||
}); |
|||
$(function() { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function(e) { |
|||
e.preventDefault(); //阻止a链接的跳转行为 |
|||
$(this).tab('show'); //显示当前选中的链接及关联的content |
|||
}) |
|||
}); |
|||
var kw = 1; |
|||
function addType() { |
|||
$(".btn-add-type").button("loading"); |
|||
$.ajax({ |
|||
url: "{php echo web_url('pocket/BasicSetting/dayandprice')}&kw="+kw, |
|||
cache: false |
|||
}).done(function (html) { |
|||
$(".btn-add-type").button("reset"); |
|||
$("#datas").append(html); |
|||
}); |
|||
kw++; |
|||
} |
|||
var nums = 1; |
|||
function addReds() { |
|||
$(".btn-add-type").button("loading"); |
|||
$.ajax({ |
|||
url: "{php echo web_url('pocket/BasicSetting/redEnvelopes')}&kw="+nums, |
|||
cache: false |
|||
}).done(function (html) { |
|||
$(".btn-add-type").button("reset"); |
|||
$("#redEnvelopes").append(html); |
|||
}); |
|||
nums++; |
|||
} |
|||
function removes(asd){ |
|||
$(asd).closest('.data-item').remove(); |
|||
} |
|||
function search_members() { |
|||
if( $.trim($('#search-kwd').val())==''){ |
|||
Tip.focus('#search-kwd','请输入关键词'); |
|||
return; |
|||
} |
|||
|
|||
$("#module-menus").html("正在搜索....") |
|||
$.get('{php echo web_url('store/register/add',array('op'=>'selectnickname'))}', { |
|||
keyword: $.trim($('#search-kwd').val()) |
|||
}, function(dat){ |
|||
$('#module-menus').html(dat); |
|||
}); |
|||
} |
|||
function select_member(o) { |
|||
$("#openid").val(o.openid); |
|||
$("#saler").val(o.nickname); |
|||
$('#search-kwd').val(o.nickname) |
|||
$('#module-menus').html(''); |
|||
$("#modal-module-menus").modal("hide"); |
|||
} |
|||
//监听搜索框是否启用 |
|||
$("[name='search']").change(function () { |
|||
var val = $(this).val(); |
|||
if(val == 1){ |
|||
$(".form-group.search_float").hide(); |
|||
$(".form-group.search_bgColor").hide(); |
|||
}else{ |
|||
$(".form-group.search_float").show(); |
|||
if($("[name='search_float']:checked").val() == 1){ |
|||
$(".form-group.search_bgColor").show(); |
|||
}else{ |
|||
$(".form-group.search_bgColor").hide(); |
|||
} |
|||
} |
|||
}); |
|||
//监听搜索框是否浮动 |
|||
$("[name='search_float']").change(function () { |
|||
var val = $(this).val(); |
|||
if(val == 1){ |
|||
$(".form-group.search_bgColor").show(); |
|||
}else{ |
|||
$(".form-group.search_bgColor").hide(); |
|||
} |
|||
}); |
|||
//监听红包是否开启 |
|||
$("[name='is_openRed']").change(function () { |
|||
var val = $(this).val(); |
|||
if(val == 1){ |
|||
$("#redSetList").removeClass("hide"); |
|||
$("#redSetList").show(); |
|||
}else{ |
|||
$("#redSetList").hide(); |
|||
} |
|||
}); |
|||
//判断 浏览增量 最小值是否小于最大值 |
|||
$('[name="data[maxup]"],[name="data[minup]"]').on('change',function () { |
|||
let minup = $('[name="data[minup]"]').val(); |
|||
let maxup = $('[name="data[maxup]"]').val(); |
|||
console.log(minup,maxup); |
|||
if(parseInt(minup) > parseInt(maxup)){ |
|||
tip.alert('最小值不能大于最大值',function () { |
|||
$('[name="data[minup]"]').val(0); |
|||
}); |
|||
} |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,74 @@ |
|||
{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-table-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-hover table-bordered" id="de2"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th style="width:50px;text-align:center;">用户头像</th> |
|||
<th style="width:90px;text-align: center;">用户昵称</th> |
|||
<th style="width:70px;text-align: center;">违规帖子</th> |
|||
<th style="width:100px;text-align:center;">拉黑时间</th> |
|||
<th style="width:80px;text-align:center;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody > |
|||
{loop $blacklist $item} |
|||
<tr> |
|||
<!--用户昵称--> |
|||
<td class="goods-info line-feed" style="width:150px;padding-left: 10px;height: 60px;text-align: center;"> |
|||
<div class="img"><img src="{IMAGE_PIXEL}" class="scrollLoading" data-url="{php echo tomedia($item['avatar'])}" height="50" width="50" ></div> |
|||
</td> |
|||
<!--用户电话--> |
|||
<td class="text-center" style="width:150px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
<div class="all-tips"> |
|||
<p class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;">{$item['nickname']}</p> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" style="width:150px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
<a href="{php echo web_url('pocket/Tiezi/details',array('id'=>$item['inid']))}">查看帖子详情</a> |
|||
</td> |
|||
<!--开通时间--> |
|||
<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{php echo date('Y-m-d H:i:s',$item['createtime'])} |
|||
</td> |
|||
<td class="text-center dede" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
<a href="javascript:;" class="deteblack" inmid = "{$item['mid']}">取消黑名单</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> |
|||
$('#de2').delegate('.deteblack','click',function(e){ |
|||
e.stopPropagation(); |
|||
var mid = $(this).attr('inmid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('pocket/Tiezi/deteblack')}", { mid : mid }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("取消成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.msg); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认把该用户取消黑名单?'}); |
|||
}); |
|||
</script> |
|||
|
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,242 @@ |
|||
{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"> |
|||
<div class="tab-content"> |
|||
<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">分类</label> |
|||
<div class="col-md-3"> |
|||
<select class="form-control selecttype" name="data[onetype]" onchange="second(this)"> |
|||
<option value="">全局置顶</option> |
|||
{loop $types $type} |
|||
<option value="{$type['id']}">{$type['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
<div id="seconds" style="display: none;"> |
|||
<label class="col-sm-2 control-label">子分类</label> |
|||
<div class="col-md-3"> |
|||
<select class="form-control selecttype" id='twotype' name="data[type]"> |
|||
|
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="keyword" style="display: none"> |
|||
<label class="col-sm-2 control-label">标签</label> |
|||
<div class="col-sm-9" id="keywordList"></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="type" onclick="show(1)" /> 虚拟帖子 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="type" onclick="show(0)" checked /> 官方公告 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div id="member" style="display: none;"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户昵称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[nickname]" class="form-control" placeholder="请输出虚拟发帖人昵称" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户电话</label> |
|||
<div class="col-sm-9"> |
|||
<input type="tel" name="data[phone]" class="form-control" placeholder="请输出虚拟发帖人电话" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户头像</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[avatar]','');} |
|||
</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[top]" /> 置顶 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="data[top]" checked /> 不置顶 |
|||
</label> |
|||
</div> |
|||
</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]" value="{$tiezi['share_title']}" class="form-control" placeholder="请输出帖子分享标题" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">内容</label> |
|||
<div class="col-sm-9"> |
|||
<textarea style="height: 250px;" name="data[content]" class="form-control">{$tiezi['content']}</textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_multi('data[img]',$tiezi['img']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="video-info"> |
|||
<label class="col-sm-2 control-label">视频</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_form_field_video('data[video_link]',$tiezi['video_link'],array('extras' => array('text'=>'readonly')));} |
|||
<div class="{if $tiezi['video_link']}show{else}hide{/if}" style="width: 300px;height: 300px;"> |
|||
<video style="max-height: 300px;" src="{$tiezi['video_link']}" controls="controls"> |
|||
您的浏览器不支持该视频播放,请更新浏览器或更换浏览器。 |
|||
</video> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{if Customized::init('pocket1500') > 0} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关联商户</label> |
|||
<div class="col-sm-9"> |
|||
<select name ='storeids[]' class="form-control select2" multiple="multiple"> |
|||
{loop $storelist $pp} |
|||
<option value="{$pp['id']}" {if in_array($pp['id'],$storelist)} selected {/if} >{$pp['storename']}</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"> |
|||
<input type="number" name="data[videoprice]" class="form-control" value="" placeholder="不填或填0即可以免费查看视频,最多保留两位小数" /> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</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> |
|||
{if $comments} |
|||
<div style="margin-top: 6rem;" class="panel panel-default"> |
|||
<div class="panel-body"> |
|||
<h3 style="margin-top: 0;">帖子回复:</h3> |
|||
<div class="panel-body"> |
|||
{loop $comments $index $item} |
|||
<div class="form-group"> |
|||
<div class="col-md-8 col-xs-12"> |
|||
<img src="{php echo tomedia($item['mid']['avatar'])}" class="scrollLoading" height="30px" width="30px" /> {$item['mid']['nickname']} {php echo date('Y-m-d H:i:s',$item['createtime'])} 说: {$item['content']} |
|||
{loop $comments[$index]['replys'] $re} |
|||
<div class="form-group" style="margin-top: 10px;"> |
|||
<div class="col-md-12 col-xs-12"> |
|||
<img src="{php echo tomedia($re['smid']['avatar'])}" class="scrollLoading" height="30px" width="30px" /> {$re['smid']['nickname']} {php echo date('Y-m-d H:i:s',$re['createtime'])} 回复 |
|||
<img src="{php echo tomedia($re['amid']['avatar'])}" class="scrollLoading" height="30px" width="30px" /> {$re['amid']['nickname']} 说:{$re['content']} |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<script> |
|||
function show(asd){ |
|||
if(asd){ |
|||
$('#member').show(); |
|||
}else{ |
|||
$('#member').hide(); |
|||
} |
|||
} |
|||
function second(asd){ |
|||
$("#keyword").hide(); |
|||
$("#keywordList").html(''); |
|||
var onetype = $(asd).val(); |
|||
if(!onetype){ |
|||
$('#seconds').hide(); |
|||
}else{ |
|||
$.post("{php echo web_url('pocket/Tiezi/seconds')}",{onetype:onetype},function(d){ |
|||
if(!d.errno){ |
|||
$('#twotype').html(''); |
|||
var html = '<option value="">请选择</option>'; |
|||
for(var i=0;i<d.twotype.length;i++){ |
|||
html += '<option value='+d.twotype[i].id+'>'+d.twotype[i].title+'</option>'; |
|||
} |
|||
$('#twotype').append(html); |
|||
$('#seconds').show(); |
|||
}else{ |
|||
$('#seconds').hide(); |
|||
} |
|||
},"json"); |
|||
} |
|||
} |
|||
/** |
|||
* 分类下面标签的显示/隐藏/更换/选择 |
|||
*/ |
|||
$(".selecttype").change(function () { |
|||
var id = $(this).val(); |
|||
var pos = $("#keyword"); |
|||
$("#keywordList").html(''); |
|||
if(id > 0){ |
|||
$.post("{php echo web_url('pocket/Tiezi/getKeyword')}",{id:id},function(res){ |
|||
if(res.data) { |
|||
var html = ''; |
|||
$.each(res.data, function (k, v) { |
|||
html += '<label class="checkbox-inline">\n' + |
|||
'<input type="checkbox" name="keyword[]" value="'+v+'">'+v+'\n' + |
|||
'</label>'; |
|||
}); |
|||
$("#keywordList").append(html); |
|||
pos.show(); |
|||
}else{ |
|||
pos.hide(); |
|||
} |
|||
},"json"); |
|||
}else{ |
|||
pos.hide(); |
|||
} |
|||
}); |
|||
|
|||
// myrequire(['select2'], function() { |
|||
// $('.chosen-select').select2({ |
|||
// ajax: { |
|||
// url: "{php echo web_url('store/merchant/getstorelist')}", |
|||
// dataType: 'json', |
|||
// data: function (params) { |
|||
// var query = { //请求的参数, 关键字和搜索条件之类的 |
|||
// search: params.term //select搜索框里面的value |
|||
// } |
|||
// // Query paramters will be ?search=[term]&page=[page] |
|||
// return query; |
|||
// }, |
|||
// processResults: function (data) { |
|||
// return { |
|||
// results: data //必须赋值给results并且必须返回一个obj |
|||
// }; |
|||
// } |
|||
// } |
|||
// }); |
|||
// }); |
|||
</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="price[]" class="form-control" value="{$ba['price']}"> |
|||
<span class="input-group-addon">会员¥</span> |
|||
<input type="number" name="vipprice[]" class="form-control" value="{$ba['vipprice']}"> |
|||
<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,357 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.hhf{ |
|||
display: inline-block; |
|||
padding: 2px 5px 2px 5px; |
|||
border: 1px orangered solid; |
|||
border-radius: 5px; |
|||
cursor:pointer; |
|||
} |
|||
</style> |
|||
<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"> |
|||
<div class="form-group-title">帖子详情</div> |
|||
<div class="form-group" id="de2"> |
|||
<label class="col-sm-2 control-label">用户</label> |
|||
<div class="col-md-3 col-xs-3"> |
|||
<img src="{php echo tomedia($tiezi['mid']['avatar'])}" class="scrollLoading" height="30px" width="30px" />{$tiezi['mid']['nickname']} |
|||
</div> |
|||
{if $bflag == 1} |
|||
<div class="col-md-2 col-xs-2"> |
|||
<a href="javascript:;" class="addblack" inmid = "{$inmid}" style="display: inline-block;padding:5px 10px;background-color: orangered;color: white;border-radius: 8px;">加入黑名单</a> |
|||
</div> |
|||
{/if} |
|||
{if $bflag == 2} |
|||
<div class="col-md-2 col-xs-2"> |
|||
<a href="javascript:;" class="deteblack" inmid = "{$inmid}" style="display: inline-block;padding:5px 10px;background-color: lawngreen;color: white;border-radius: 8px;">取消黑名单</a> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">Phone</label> |
|||
<div class="col-sm-9"> |
|||
<input type="tel" name="data[phone]" value="{$tiezi['phone']}" class="form-control" placeholder="请输联系人电话" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">发布时间</label> |
|||
<div class="col-sm-9"> |
|||
<div class="form-control-static"> |
|||
{php echo tpl_form_field_date('data[createtime]', date('Y-m-d H:i:s', $tiezi['createtime']),true);} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">类型</label> |
|||
<div class="col-sm-9" id="typeClass"> |
|||
{php echo tpl_form_field_category_2level('category', $parent, $children, $tiezi['onetype'], $tiezi['type'])} |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="keyword" {if !$keyword}style="display:none;"{/if}> |
|||
<label class="col-sm-2 control-label">标签</label> |
|||
<div class="col-sm-9" id="keywordList"> |
|||
{loop $keyword $item} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" name="keyword[]" value="{$item}" {if in_array($item,$tiezi['keyword'])}checked="checked"{/if}>{$item} |
|||
</label> |
|||
{/loop} |
|||
</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]" value="{$tiezi['share_title']}" class="form-control" placeholder="请输出帖子分享标题" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">内容</label> |
|||
<div class="col-sm-9"> |
|||
<textarea id="cont" style="height: 250px;" name="data[content]" class="form-control">{$tiezi['content']}</textarea> |
|||
<!-- <span class="hhf">换行</span>--> |
|||
<!-- <span class="head-info">点击换行按钮会在内容里面添加一个换行符,在前端显示时会直接换行,不再需要回车键换行。</span>--> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_multi('data[img]',$tiezi['img']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="video-info"> |
|||
<label class="col-sm-2 control-label">视频</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_form_field_video('data[video_link]',$tiezi['video_link'],array('extras' => array('text'=>'readonly')));} |
|||
<div class="{if $tiezi['video_link']}show{else}hide{/if}" style="width: 300px;height: 300px;"> |
|||
<video style="max-height: 300px;" src="{$tiezi['video_link']}" controls="controls"> |
|||
您的浏览器不支持该视频播放,请更新浏览器或更换浏览器。 |
|||
</video> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">视频封面图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[video_img_link]',$tiezi['video_img_link']);} |
|||
</div> |
|||
</div> |
|||
|
|||
{if Customized::init('pocket1500') > 0 && empty($bflag)} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关联商户</label> |
|||
<div class="col-sm-9"> |
|||
<select name ='storeids[]' class="form-control select2" multiple="multiple"> |
|||
{loop $storelist $pp} |
|||
<option value="{$pp['id']}" {if in_array($pp['id'],$tiezi['storeid'])} selected {/if} >{$pp['storename']}</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"> |
|||
<input type="number" name="data[videoprice]" class="form-control" value="{$tiezi['videoprice']}" /> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
|
|||
<div class="form-group form-inline"> |
|||
<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" min="0" name="data[look]" class="form-control" value="{$tiezi['look']}" /> |
|||
<span class="input-group-addon">次</span> |
|||
<!-- <span class="input-group-addon">点赞数</span> |
|||
<input type="number" min="0" name="data[likenum]" class="form-control" value="{$tiezi['likenum']}" /> |
|||
<span class="input-group-addon">个</span>--> |
|||
<span class="input-group-addon">分享数</span> |
|||
<input type="number" min="0" name="data[share]" class="form-control" value="{$tiezi['share']}" /> |
|||
<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"> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input onclick="show(1)" type="radio" id="top1" name="data[top]" value="1" {if intval($tiezi[ 'top'])==1 }checked="checked" {/if}> |
|||
<label onclick="show(1)" for="top1"> 是 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input onclick="show(0)" type="radio" id="top2" name="data[top]" value="0" {if intval($tiezi[ 'top'])==0 }checked="checked" {/if}> |
|||
<label onclick="show(0)" for="top2"> 否 </label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div id="endtime" {if empty($tiezi[ 'top'])} style="display: none;" {/if} class="form-group"> |
|||
<label class="col-sm-2 control-label">置顶结束时间</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_form_field_date('endtime', date('Y-m-d H:i:s', $tiezi['endtime']),true);} |
|||
</div> |
|||
</div> |
|||
<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="0" {if intval($tiezi[ 'status'])==0 }checked="checked" {/if}> |
|||
<label for="status1"> 显示 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="status2" name="data[status]" value="2" {if intval($tiezi[ 'status'])==2 }checked="checked" {/if}> |
|||
<label for="status2"> 不通过 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="status3" name="data[status]" value="1" {if intval($tiezi[ 'status'])==1 }checked="checked" {/if}> |
|||
<label for="status3"> 审核中 </label> |
|||
</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> |
|||
{if $comments} |
|||
<div id="de1" style="margin-top: 6rem;" class="panel panel-default"> |
|||
<div class="panel-body"> |
|||
<h3 style="margin-top: 0;">帖子回复:</h3> |
|||
<div class="panel-body"> |
|||
{loop $comments $index $item} |
|||
<div class="form-group"> |
|||
<div class="col-md-10 col-xs-12"> |
|||
<div><img src="{php echo tomedia($item['mid']['avatar'])}" class="scrollLoading" height="30px" width="30px" /> {$item['mid']['nickname']} {php echo date('Y-m-d H:i:s',$item['createtime'])} 说: {$item['content']}{if empty($item['mid']['bflag'])}<a href="javascript:;" class="blackmid" mid = "{$item['mid']['id']}" cid="{$item['id']}" style="float: right;">拉黑用户</a>{/if}<a href="javascript:;" class="shanchu" cid="{$item['id']}" style="float: right;margin-right:1rem;">删除评论</a></div> |
|||
{loop $comments[$index]['replys'] $re} |
|||
<div class="form-group" style="margin-top: 10px;"> |
|||
<div class="col-md-12 col-xs-12"> |
|||
<img src="{php echo tomedia($re['smid']['avatar'])}" class="scrollLoading" height="30px" width="30px" /> {$re['smid']['nickname']} {php echo date('Y-m-d H:i:s',$re['createtime'])} 回复 |
|||
<img src="{php echo tomedia($re['amid']['avatar'])}" class="scrollLoading" height="30px" width="30px" /> {$re['amid']['nickname']} 说:{$re['content']} |
|||
</div> |
|||
{if empty($re['smid']['bflag'])} |
|||
<a href="javascript:;" class="blackmid" mid="{$re['smid']['id']}" style="float: right;position: relative;left: -30px;">拉黑用户</a> - |
|||
{/if} |
|||
<a href="javascript:;" class="shanchureply" rid="{$re['id']}" style="float: right;position: relative;left: -30px;margin-right:1rem;">删除回复</a> |
|||
</div> |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<script> |
|||
function show(asd){ |
|||
if(asd){ |
|||
$('#endtime').show(); |
|||
}else{ |
|||
$('#endtime').hide(); |
|||
} |
|||
} |
|||
$('#de2').delegate('.addblack','click',function(e){ |
|||
e.stopPropagation(); |
|||
var mid = $(this).attr('inmid'); |
|||
var inid = "{$id}"; |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('pocket/Tiezi/addblack')}", { mid : mid ,inid : inid }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("添加成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.msg); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认把该用户加入黑名单?'}); |
|||
}); |
|||
$('#de1').delegate('.blackmid','click',function(e){ |
|||
e.stopPropagation(); |
|||
var mid = $(this).attr('mid'); |
|||
var inid = "{$id}"; |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('pocket/Tiezi/addblack')}", { mid : mid ,inid : inid }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("添加成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.msg); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认把该用户加入黑名单?'}); |
|||
}); |
|||
$('#de2').delegate('.deteblack','click',function(e){ |
|||
e.stopPropagation(); |
|||
var mid = $(this).attr('inmid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('pocket/Tiezi/deteblack')}", { mid : mid }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("取消成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.msg); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认把该用户取消黑名单?'}); |
|||
}); |
|||
$('#de1').delegate('.shanchu','click',function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('cid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('pocket/Tiezi/deletecomment')}", { id : id }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '删除评论会删除评论下所有回复并无法恢复,确定?'}); |
|||
}); |
|||
$('#de1').delegate('.shanchureply','click',function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('rid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('pocket/Tiezi/deletereply')}", { id : id }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确定删除回复?'}); |
|||
}); |
|||
|
|||
$('.hhf').click(function () { |
|||
var text = $('#cont').val(); |
|||
text = text+"<br/>"; |
|||
$('#cont').val(text); |
|||
}); |
|||
|
|||
/** |
|||
* 更换一级分类的操作 |
|||
*/ |
|||
$("#typeClass").on('change','[name="category[parentid]"]',function () { |
|||
$("#keyword").hide(); |
|||
$("#keywordList").html(''); |
|||
|
|||
var id = $(this).val(); |
|||
var pos = $("#keyword"); |
|||
if(id > 0){ |
|||
$.post("{php echo web_url('pocket/Tiezi/getKeyword')}",{id:id},function(res){ |
|||
if(res.data) { |
|||
var html = ''; |
|||
$.each(res.data, function (k, v) { |
|||
html += '<label class="checkbox-inline">\n' + |
|||
'<input type="checkbox" name="keyword[]" value="'+v+'">'+v+'\n' + |
|||
'</label>'; |
|||
}); |
|||
$("#keywordList").append(html); |
|||
pos.show(); |
|||
}else{ |
|||
pos.hide(); |
|||
} |
|||
},"json"); |
|||
}else{ |
|||
pos.hide(); |
|||
} |
|||
}); |
|||
/** |
|||
* 更换二级分类的操作 |
|||
*/ |
|||
$("#typeClass").on('change','[name="category[childid]"]',function () { |
|||
var id = $(this).val(); |
|||
var pos = $("#keyword"); |
|||
$("#keywordList").html(''); |
|||
if(id > 0){ |
|||
$.post("{php echo web_url('pocket/Tiezi/getKeyword')}",{id:id},function(res){ |
|||
if(res.data) { |
|||
var html = ''; |
|||
$.each(res.data, function (k, v) { |
|||
html += '<label class="checkbox-inline">\n' + |
|||
'<input type="checkbox" name="keyword[]" value="'+v+'">'+v+'\n' + |
|||
'</label>'; |
|||
}); |
|||
$("#keywordList").append(html); |
|||
pos.show(); |
|||
}else{ |
|||
pos.hide(); |
|||
} |
|||
},"json"); |
|||
}else{ |
|||
pos.hide(); |
|||
} |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,312 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.trbody td {text-align: center; vertical-align:top;border-left:1px solid #ccc; border-bottom: 1px solid #ddd;} |
|||
.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: inherit;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.status-text{cursor:pointer;} |
|||
.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {border-top: 1px solid rgba(221, 221, 221, 0);} |
|||
.col-md-1{padding-right: 0px;} |
|||
.asd{cursor: pointer;} |
|||
.label-status{margin: 5px;display: inline-block;} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li {if $_GPC['status']==5}class="active"{/if}><a href="{php echo web_url('pocket/Tiezi/lists',array('status'=>5));}">所有帖子<span class="label label-warning pull-right" style="margin-left: 10px;">{$status0}</span></a></li> |
|||
<li {if $_GPC['status']==1}class="active"{/if}><a href="{php echo web_url('pocket/Tiezi/lists',array('status'=>1));}">待审核<span class="label label-warning pull-right" style="margin-left: 10px;">{$status1}</span></a></li> |
|||
<li {if $_GPC['status']==0}class="active"{/if}><a href="{php echo web_url('pocket/Tiezi/lists',array('status'=>0));}">显示中<span class="label label-warning pull-right" style="margin-left: 10px;">{$status3}</span></a></li> |
|||
<li {if $_GPC['status']==4}class="active"{/if}><a href="{php echo web_url('pocket/Tiezi/lists',array('status'=>4));}">置顶中<span class="label label-warning pull-right" style="margin-left: 10px;">{$status4}</span></a></li> |
|||
<li {if $_GPC['status']==2}class="active"{/if}><a href="{php echo web_url('pocket/Tiezi/lists',array('status'=>2));}">未通过<span class="label label-warning pull-right" style="margin-left: 10px;">{$status2}</span></a></li> |
|||
<li {if $_GPC['status']==3}class="active"{/if}><a href="{php echo web_url('pocket/Tiezi/lists',array('status'=>3));}">已删除<span class="label label-warning pull-right" style="margin-left: 10px;">{$status5}</span></a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('pocket/Tiezi/createtop')}" 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="pocket" /> |
|||
<input type="hidden" name="ac" value="Tiezi" /> |
|||
<input type="hidden" name="do" value="lists" /> |
|||
<input type="hidden" name="status" value="{$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> |
|||
</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> |
|||
<button class="btn btn-default" name="export" type="submit" value="export"><i class="fa fa-download"></i> 导出</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-bordered"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th width="5%" class="text-center"><input type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});" /></th> |
|||
<th width="15%" class="text-left">帖子内容</th> |
|||
{if $_GPC['status'] == 2} |
|||
<th width="15%" class="text-left">驳回理由</th> |
|||
{/if} |
|||
<th width="10%" class="text-center">帖子分类</th> |
|||
<th width="10%" class="text-center">帖子信息</th> |
|||
<th width="10%" class="text-center">发帖时间</th> |
|||
<th width="10%" class="text-center">发帖人</th> |
|||
<th width="10%" class="text-center">帖子状态</th> |
|||
<th width="20%" class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody > |
|||
{loop $list $item} |
|||
<tr> |
|||
<td ><center><input type="checkbox" name="checkbox[]" class="checkbox" value="{$item['id']}" /></center></td> |
|||
<td class="goods-info line-feed"> |
|||
<div class="title" style="max-height:120px!important;overflow-y: auto;"> |
|||
<span>{$item['content']}</span> |
|||
</div> |
|||
</td> |
|||
{if $_GPC['status'] == 2} |
|||
<td> |
|||
<div style="max-height:120px!important;overflow-y: auto;">{$item['reason']}</div> |
|||
</td> |
|||
{/if} |
|||
<td class="text-center" > |
|||
<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"> |
|||
<span>{$item['type']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" > |
|||
<p>分享:{$item['share']}</p> |
|||
<p>点赞:{$item['likenum']}</p> |
|||
<p>浏览:{$item['look']}</p> |
|||
</td> |
|||
<td class="text-center" > |
|||
<span>{php echo date("y-m-d",$item['createtime'])}</span><br> |
|||
<span>{php echo date("H:i:s",$item['createtime'])}</span> |
|||
</td> |
|||
<td class="goods-info line-feed" > |
|||
<div style="position: relative;top: 38px;left: 5px;" class="img"><img style="height: 100%;width: 100%;" class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['avatar'])}"></div> |
|||
<div class="title" style="padding-left: 60px;position: relative;top: -15px;"> |
|||
<span>{$item['nickname']}</span> |
|||
<span>{$item['phone']}</span> |
|||
<span>MID:{$item['mid']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" > |
|||
{if $item['status']==2}<span class="label label-danger label-status">未通过</span>{/if} |
|||
{if $item['status']==1}<span class="label label-warning label-status">待审核</span>{/if} |
|||
{if $item['status']==0}<span class="label label-success label-status">显示中</span>{/if} |
|||
{if $item['status']==3}<span class="label label-danger label-status">已删除</span>{/if} |
|||
{if $item['status']==5}<span class="label label-danger label-status">未付款</span>{/if} |
|||
{if $item['top']==1}<br><span class="label label-danger label-status">置顶中</span>{/if} |
|||
{if $item['top']==2}<br><span class="label label-danger label-status">分类置顶</span>{/if} |
|||
{if $item['top']==3}<br><span class="label label-danger label-status">全局置顶</span>{/if} |
|||
{if $item['redpackstatus']==1 && $item['sredpack'] > 0} |
|||
<br><span class="label label-danger label-status">剩余红包:{$item['sredpack']}</span> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center" > |
|||
{if $item['status'] !=0 && $item['status'] != 3}<a tieziid = "{$item['id']}" href="javascript:;" class="btn btn-sm btn-primary asd asdp">通过</a>{/if} |
|||
{if $item['status'] == 0} |
|||
<a tieziid = "{$item['id']}" href="javascript:;" class="btn btn-sm btn-danger asd asdn">关闭</a> |
|||
<a href="javascript:;" class="btn btn-sm btn-info js-clip" data-url="{php echo h5_url('pages/subPages/postDetails/postDetails',['id'=>$item['id']])}">复制链接</a> |
|||
<a href="javascript:;" class="btn btn-sm btn-warning js-clip" data-url="pages/subPages/postDetails/postDetails?id={$item['id']}">复制路径</a> |
|||
{/if} |
|||
{if $item['status'] == 1}<a tieziid = "{$item['id']}" href="javascript:;" class="btn btn-sm btn-danger asd reject">驳回</a>{/if} |
|||
<a class="btn btn-sm btn-success" href="{php echo web_url('pocket/Tiezi/details',array('id'=>$item['id']))}">编辑</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div id="de1" class="pull-left"> |
|||
{if $status == 3} |
|||
<a href="javascript:;" class="btn btn-default min-width js-batch js-delete thorough">彻底删除选中帖子</a> |
|||
{else} |
|||
<a href="javascript:;" class="btn btn-default min-width js-batch js-delete pass">通过选中帖子</a><a style="margin-left: 1rem;" href="javascript:;" class="btn btn-default min-width js-batch js-delete nopass">关闭选中帖子</a><a style="margin-left: 1rem;" href="javascript:;" class="btn btn-default min-width js-batch js-delete delete">删除选中帖子</a> |
|||
{/if} |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
</script> |
|||
<script> |
|||
//批量软删除帖子 |
|||
$('#de1').delegate('.delete','click',function(e){ |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
//alert(ids); |
|||
|
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('pocket/Tiezi/delete')}", { ids : ids,flag:1 }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.message); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认删除?'}); |
|||
}); |
|||
//批量彻底删除帖子 |
|||
$('#de1').delegate('.thorough','click',function(e){ |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
//alert(ids); |
|||
|
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('pocket/Tiezi/delete')}", { ids : ids,flag:2}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("彻底删除成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.message); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '彻底删除?'}); |
|||
}); |
|||
//批量通过帖子 |
|||
$('#de1').delegate('.pass','click',function(e){ |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
//alert(ids); |
|||
|
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('pocket/Tiezi/pass')}", { ids : ids }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("通过审核成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.message); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认通过审核?'}); |
|||
}); |
|||
//批量禁用帖子 |
|||
$('#de1').delegate('.nopass','click',function(e){ |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
//alert(ids); |
|||
|
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('pocket/Tiezi/nopass')}", { ids : ids }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("禁用成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.message); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认禁用?'}); |
|||
}); |
|||
//单个帖子通过 |
|||
$('.asdp').click(function(){ |
|||
var id = $(this).attr('tieziid'); |
|||
$.post("{php echo web_url('pocket/Tiezi/pass')}", { id : id }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("通过审核成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.message); |
|||
}; |
|||
}, 'json'); |
|||
}); |
|||
//单个帖子禁用 |
|||
$('.asdn').click(function(){ |
|||
var id = $(this).attr('tieziid'); |
|||
$.post("{php echo web_url('pocket/Tiezi/nopass')}", { id : id }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("禁用成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.message); |
|||
}; |
|||
}, 'json'); |
|||
}); |
|||
//驳回帖子 |
|||
$('.reject').click(function(){ |
|||
var id = $(this).attr('tieziid'); |
|||
tip.prompt('请输入驳回理由!',function (text) { |
|||
console.log(text); |
|||
$.post("{php echo web_url('pocket/Tiezi/reject')}", { id : id ,text:text}, function(res){ |
|||
console.log(res); |
|||
if(res.errno == 1){ |
|||
util.tips("驳回成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
tip.alert("驳回失败,请与页面刷新后再试!",function () { |
|||
location.reload(); |
|||
}); |
|||
} |
|||
}, 'json'); |
|||
}); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,219 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.trbody td {text-align: center; vertical-align:top;border-left:1px solid #ccc; border-bottom: 1px solid #ddd;} |
|||
.order-rank img{width:16px; height:16px;} |
|||
.js-admin-remark{word-break:break-all; overflow:hidden; background: #FDEEEE;color: #ED5050;padding: 5px 10px;} |
|||
.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: inherit;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {border-top: 1px solid rgba(221, 221, 221, 0);} |
|||
</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-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="pocket" /> |
|||
<input type="hidden" name="ac" value="Tiezi" /> |
|||
<input type="hidden" name="do" value="orders" /> |
|||
<input type="hidden" name="fightstatus" value="{$fightstatus}" /> |
|||
<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 $fightstatus == 0 || empty($fightstatus) }btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('fightstatus:1');}" class="btn {if $fightstatus == 1}btn-primary{else}btn-default{/if}">发帖</a> |
|||
<a href="{php echo wl_filter_url('fightstatus:2');}" class="btn {if $fightstatus == 2}btn-primary{else}btn-default{/if}">置顶</a> |
|||
<a href="{php echo wl_filter_url('fightstatus:3');}" class="btn {if $fightstatus == 3}btn-primary{else}btn-default{/if}">红包</a> |
|||
<a href="{php echo wl_filter_url('fightstatus:4');}" class="btn {if $fightstatus == 4}btn-primary{else}btn-default{/if}">刷新</a> |
|||
{if Customized::init('pocket1500') > 0} |
|||
<a href="{php echo wl_filter_url('fightstatus:5');}" class="btn {if $fightstatus == 5}btn-primary{else}btn-default{/if}">视频</a> |
|||
{/if} |
|||
{if Customized::init('pocket140') > 0} |
|||
<a href="{php echo wl_filter_url('fightstatus:6');}" class="btn {if $fightstatus == 6}btn-primary{else}btn-default{/if}">推广</a> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">搜索</label> |
|||
<div class="col-sm-2"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="">关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>订单ID</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="5" {if $_GPC['keywordtype']==5}selected="selected"{/if}>用户昵称</option> |
|||
<option value="6" {if $_GPC['keywordtype']==6}selected="selected"{/if}>用户电话</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-sm-4"> |
|||
<div class="input-group"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</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 min-width" type="submit">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="order-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-bordered"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th style="width:50px;text-align:center;">序号</th> |
|||
<th style="width:180px;text-align:center;">帖子内容</th> |
|||
<th style="width:120px; text-align:center;">帖子分类</th> |
|||
<th style="width:160px; text-align:center;">置顶时间(开始/结束)</th> |
|||
<th style="width:180px; text-align:center;">发帖人</th> |
|||
<th style="width:80px; text-align:center;">支付信息</th> |
|||
<th style="width:130px; text-align:center;">时长/金额</th> |
|||
</tr> |
|||
</thead> |
|||
</table> |
|||
</div> |
|||
{loop $list $y $item} |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading clearfix" style="border: 1px solid #e5e5e5;"> |
|||
<div class="pull-left"> |
|||
<span>订单号:{$item['orderno']}</span> |
|||
<!--<span>|| 下单时间: {php echo date('Y-m-d', $item['createtime'])} {php echo date('H:i:s', $item['createtime'])} </span>--> |
|||
<span>|| 支付时间: {php echo date('Y-m-d', $item['paytime'])} {php echo date('H:i:s', $item['paytime'])} </span> |
|||
</div> |
|||
<div class="pull-right"> |
|||
<span class="text-muted"></span> |
|||
<a href="{php echo web_url('pocket/Tiezi/details',array('id'=>$item['fkid']))}" >查看帖子</a> |
|||
</div> |
|||
</div> |
|||
<div class="panel-body table-responsive" style="padding: 0px;"> |
|||
<table class="table table-bordered"> |
|||
<tbody > |
|||
<tr> |
|||
<td style="width: 50px;" ><center>{php echo $y+1}</center></td> |
|||
<td class="goods-info line-feed" style="width:180px;"> |
|||
<div class="title"> |
|||
<span>{$item['content']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" style="width:120px;"> |
|||
<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"> |
|||
<span>{$item['type']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" style="width:160px;"> |
|||
{if $item['endtime']} |
|||
<p>{php echo date('Y-m-d H:i:s',$item['paytime'])}</p> |
|||
<p>{php echo date('Y-m-d H:i:s',$item['endtime'])}</p> |
|||
{else} |
|||
<span class="label label-warning">未置顶</span> |
|||
{/if} |
|||
</td> |
|||
<td class="goods-info line-feed" style="width:180px;padding-left: 10px;"> |
|||
<div style="position: relative;top: 30px;left: 5px;" class="img"><img style="height: 100%;width: 100%;" class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['avatar'])}"></div> |
|||
<div class="title" style="padding-left: 60px;position: relative;top: -15px;"> |
|||
<span>{$item['nickname']}</span> |
|||
<span>{$item['phone']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" style="width:80px;"> |
|||
{if $item['fightstatus']=='1'}<span class="label label-success">发帖</span><br><br>{/if} |
|||
{if $item['fightstatus']=='2'}<span class="label label-info">置顶</span><br><br>{/if} |
|||
{if $item['fightstatus']=='3'}<span class="label label-danger">红包</span><br><br>{/if} |
|||
{if $item['fightstatus']=='4'}<span class="label label-default">刷新</span><br><br>{/if} |
|||
{if $item['fightstatus']=='5'}<span class="label label-primary">视频</span><br><br>{/if} |
|||
{if $item['fightstatus']=='6'}<span class="label label-primary">推广</span><br><br>{/if} |
|||
{if $item['paytype']==1}<span class="label label-info">余额支付</span>{/if} |
|||
{if $item['paytype']==2}<span class="label label-success">微信支付</span>{/if} |
|||
{if $item['paytype']==3}<span class="label label-warning">支付宝</span>{/if} |
|||
{if $item['paytype']==4}<span class="label label-danger">货到付款</span>{/if} |
|||
</td> |
|||
<td class="text-center" style="width:130px;"> |
|||
{if $item['fightstatus'] == 2} |
|||
置顶时长:{$item['num']}天<br /> |
|||
{/if} |
|||
实付:¥{if empty($item['price'])}0.00{else}{$item['price']}{/if}<br> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="panel-footer js-admin-remark{$item['id']} js-admin-remark" order-id="{$item['id']}" {if empty($item['remark'])}style="display: none;"{/if} style="background-color:lightgoldenrodyellow"> |
|||
卖家备注:<span id="js-admin-remark{$item['id']}" style="">{$item['remark']}</span> |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div id="modal-module-gift" class="modal fade" tabindex="-1"> |
|||
<div class="modal-dialog"> |
|||
<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"> |
|||
<div class="modal-body"> |
|||
<textarea id="remark" name="admin_remark" class="form-control" rows="5" placeholder="请输入备注内容"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<a class="btn btn-default js-cancel" aria-hidden="true" data-dismiss="modal">取消</a> |
|||
<a class="btn btn-primary js-order-remark-post" order-id="" data-dismiss="modal" aria-hidden="true">确定</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
// 修改备注 |
|||
$('.js-order-edit-remark').click(function(){ |
|||
var order_id = $(this).attr('order-id'); |
|||
var remarkvalue = $('#js-admin-remark'+order_id).text(); |
|||
$('.js-order-remark-post').attr("order-id",order_id); |
|||
$('#remark').val(remarkvalue); |
|||
popwin = $('#modal-module-gift').modal(); |
|||
}); |
|||
$('.js-cancel,.close').click(function() { |
|||
$('#order-remark-container').hide(); |
|||
$('.main').css("opacity","1");$('.nav').css("opacity","1");$('.big-menu').css("opacity","1"); |
|||
}); |
|||
$('.js-order-remark-post').click(function() { |
|||
var order_id = $(this).attr('order-id'); |
|||
var remark = $('#remark').val(); |
|||
$.post("{php echo web_url('wlfightgroup/fightorder/remark')}",{id:order_id,remark:remark},function(d){ |
|||
if(!d.errno){ |
|||
$('#js-admin-remark'+order_id).html(remark); |
|||
$('.js-admin-remark'+order_id).show(); |
|||
} |
|||
},"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,7 @@ |
|||
<div class="input-group data-item" style="margin-top: 10px;"> |
|||
<span class="input-group-addon">红包数量</span> |
|||
<input type="text" name="num[]" class="form-control" value="{$itmes['num']}"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="red_price[]" class="form-control" value="{$itmes['red_price']}"> |
|||
<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,64 @@ |
|||
{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"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" 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-9"> |
|||
<input type="text" name="data[title]" id="title" class="form-control" value="{$data['title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<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">图片建议为750 X 300,请将所有幻灯片图片尺寸保持一致</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="{$data['url']}" class="form-control valid" name="data[url]" readonly="readonly" id="advlink"> |
|||
<span data-input="#advlink" data-toggle="selectUrl" class="input-group-addon btn btn-default">选择链接</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<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="inlineRadio1"> 是 </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="inlineRadio2"> 否 </label> |
|||
</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="data[id]" value="{$data['id']}" /> |
|||
</div> |
|||
</div> |
|||
</from> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,63 @@ |
|||
{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-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('pocket/Slide/operating')}" class="btn btn-primary">添加幻灯片</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" style="width:60px;">图片</th> |
|||
<th class="text-center" style="width:60px;">排序</th> |
|||
<th class="text-center" style="width:100px;">标题</th> |
|||
<th class="text-center" style="width:200px;">链接</th> |
|||
<th class="text-center" style="width:50px;">状态</th> |
|||
<th class="text-center" style="width:100px;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr class="text-center"> |
|||
<td> |
|||
<img src="{php echo tomedia($item['img'])}" data-url="{php echo tomedia($item['img'])}" onerror="this.src='{php echo tomedia($item['img'])}'" class="scrollLoading" height="50px" width="100px" /> |
|||
</td> |
|||
<td> |
|||
{$item['sort']} |
|||
</td> |
|||
<td> |
|||
{$item['title']} |
|||
</td> |
|||
<td style="overflow: hidden;"> |
|||
{$item['url']} |
|||
</td> |
|||
<td>{php echo tpl_change_status('pocket/Slide/changeStatus&id='.$item['id'],$item['status'])}</td> |
|||
<td class="text-center"> |
|||
<a href="{php echo web_url('pocket/Slide/operating',array('id'=>$item['id']))}">编辑 </a> |
|||
- |
|||
<a href="{php echo web_url('pocket/Slide/operating',array('did'=>$item['id']))}">删除 </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,299 @@ |
|||
{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" 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="text" 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"> |
|||
<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[isnav]" value="0" {if intval($data[ 'isnav'])==0 }checked="checked" {/if}> |
|||
<label onclick="show(0)" for="inlineRadio3"> 普通分类 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input onclick="show(1)" type="radio" id="inlineRadio2" name="data[isnav]" value="1" {if intval($data[ 'isnav'])==1 }checked="checked" {/if}> |
|||
<label onclick="show(1)" for="inlineRadio2"> 导航标签 </label> |
|||
</div> |
|||
<span class="help-block">提示:导航标签不会被视作分类,只在首页做导航使用,子分类只能作为普通分类。</span> |
|||
</div> |
|||
</div> |
|||
<!-- 普通分类 START --> |
|||
<div id="tag" class="{if intval($data[ 'isnav'])==1 }hide{/if}"> |
|||
<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[price]" onkeyup="showdis(this)" class="form-control" value="{$data['price']}" /> |
|||
<span class="input-group-addon">元/帖</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"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[vipstatus]" value="0" onclick="$('.vipprice').hide()" {if empty($data['vipstatus'])}checked{/if}>无 |
|||
</label> |
|||
<label class="radio-inline is_free" {if !empty($data['is_free'])}style="display: none;"{/if} > |
|||
<input type="radio" name="data[vipstatus]" value="1" onclick="$('.vipprice').show()" {if $data['vipstatus'] == 1}checked{/if}>会员特价 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[vipstatus]" value="2" onclick="$('.vipprice').hide()" {if $data['vipstatus'] == 2}checked{/if}>会员特供 |
|||
</label> |
|||
<div class="help-block">一卡通会员特权设置,会员特供即只有会员可以发布此类型帖子.</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group vipprice" {if $data['vipstatus'] != 1}style="display: none;"{/if} > |
|||
<label class="col-sm-2 control-label">会员特价</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" step="0.01" class="form-control" name="data[vipprice]" value="{$data['vipprice']}" placeholder="请输入会员优惠发帖金额"> |
|||
<span class="input-group-addon">元</span> |
|||
</div> |
|||
<div class="help-block">如果设置为0或不填,即会员免费发帖,最多保留两位小数.</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[refreshprcie]" class="form-control" value="{$data['refreshprcie']}" /> |
|||
<span class="input-group-addon">元/次,会员</span> |
|||
<input type="text" name="data[refreshvip]" class="form-control" value="{$data['refreshvip']}" /> |
|||
<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"> |
|||
<input type="text" name="data[refreshday]" class="form-control" value="{$data['refreshday']}" /> |
|||
<span class="input-group-addon">天</span> |
|||
</div> |
|||
<span class="help-block">最多保留两位小数,不填或填0即为不限制间隔时间。</span> |
|||
</div> |
|||
</div> |
|||
|
|||
<div id="disdiv" class="{if $data['price']<0.01 }hide{/if}"> |
|||
{if p('distribution') && $_W['wlsetting']['distribution']['switch']} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否参与分销</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="distri(1)"> |
|||
<input type="radio" value="0" name="data[isdistri]" {if $data['isdistri']==0 || empty($data['isdistri'])} checked {/if}>参与 |
|||
</label> |
|||
<label class="radio-inline" onclick="distri(2)"> |
|||
<input type="radio" value="1" name="data[isdistri]" {if $data['isdistri']==1 } checked {/if}>不参与 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div id="distridiv" class="{if $data['isdistri']}hide{/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="text" name="data[onedismoney]" class="form-control" value="{$data['onedismoney']}" /> |
|||
{if $_W['wlsetting']['distribution']['ranknum']>1} |
|||
<span class="input-group-addon">二级</span> |
|||
<input type="text" name="data[twodismoney]" class="form-control" value="{$data['twodismoney']}" /> |
|||
{/if} |
|||
</div> |
|||
<span class="help-block">最多保留两位小数,不填会根据分销商等级佣金比例计算。</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</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;">{$data['keyword']}</span> |
|||
<input type="hidden" name="data[keyword]" class="form-control valid" value="{$data['keyword']}"> |
|||
</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 {if $parentId > 0}hide{/if}"> |
|||
<label class="col-sm-2 control-label">幻灯片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select_multi('data[adv]',$data['adv']);} |
|||
<span class="help-block">分类页面顶部的幻灯片,建议大小750X380</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 普通分类 END --> |
|||
<!-- 导航标签 START --> |
|||
<div id="urll" class="form-group {if intval($data[ 'isnav'])==0 }hide{/if}"> |
|||
<label class="col-sm-2 control-label">导航链接</label> |
|||
<div class="col-sm-9"> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group" style="margin: 0;"> |
|||
<input type="text" name="data[url]" class="form-control" value="{$data['url']}" readonly="readonly" name="link" placeholder="" id="advlink"> |
|||
<span data-input="#advlink" data-toggle="selectUrl" class="input-group-addon btn btn-default">选择链接</span> |
|||
<span class="input-group-addon btn btn-default clearinput">X</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 导航标签 END --> |
|||
{if Customized::init('pocket140') > 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" value="1" name="data[imgupload]" {if $data['imgupload']==1} checked {/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="data[imgupload]" {if $data['imgupload']!=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"> |
|||
<input type="radio" value="1" name="data[videoupload]" {if $data['videoupload']==1} checked {/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="data[videoupload]" {if $data['videoupload']!=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"> |
|||
<input type="radio" value="1" name="data[audioupload]" {if $data['audioupload']==1} checked {/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="data[audioupload]" {if $data['audioupload']!=1} checked {/if}>启用 |
|||
</label> |
|||
<span class="help-block">用户在发帖时是否可以转译语音。</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
|
|||
<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"> 是 </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"> 否 </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[type]" value="{$data['type']}" /> |
|||
<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,169 @@ |
|||
{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;} |
|||
.scrollLoading{border-radius: 50px;} |
|||
</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('pocket/Type/operating')}" class="btn btn-primary">添加一级分类</a> |
|||
<a href="javascript:;" class="btn btn-default js-category-all js-collapse">折叠分类</a> |
|||
</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="10%">分类图片</th> |
|||
<th width="20%">分类名称</th> |
|||
<th width="10%" class="text-center">标签种类</th> |
|||
<th width="10%" class="text-center">付费发帖</th> |
|||
<th width="10%" class="text-center">分类ID</th> |
|||
<th width="10%" class="text-center">开启状态</th> |
|||
<th width="10%" class="text-center">显示顺序</th> |
|||
<th width="30%" class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody > |
|||
{loop $list $item} |
|||
<tr class="text-center"> |
|||
<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']};">{$item['title']}</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('pocket/Type/operating',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> |
|||
<a href="javascript:;" data-toggle="ajaxEdit" data-href="{php echo web_url('pocket/Type/setPrice',array('id'=>$item['id']))}" style="color: #000;">{$item['price']}</a> |
|||
</td> |
|||
<td> |
|||
<label class='label label-warning'>{$item['id']}</label> |
|||
</td> |
|||
<td>{php echo tpl_change_status('pocket/Type/changeStatus&id='.$item['id'],$item['status'])}</td> |
|||
<td class="text-center">{$item['sort']}</td> |
|||
<td class="text-center" style="position: relative"> |
|||
{if $item['isnav'] != 1} |
|||
<!-- 'title'=>$item['title']--> |
|||
<a href="javascript:;" data-id="{$category['id']}" data-url="{php echo h5_url('pages/mainPages/econdaryClassification/econdaryClassification',['id'=>$item['id']])}&title={$item['title']}" class="js-clip" > |
|||
复制链接 |
|||
</a> |
|||
- |
|||
<a href="javascript:;" data-id="{$category['id']}" data-url="pages/mainPages/econdaryClassification/econdaryClassification?id={$item['id']}&title={$item['httitle']}" class="js-clip" > |
|||
复制路径 |
|||
</a> |
|||
- |
|||
{/if} |
|||
<a href="{php echo web_url('pocket/Type/operating',array('id'=>$item['id']))}">编辑 </a> |
|||
- |
|||
<a href="{php echo web_url('pocket/Type/operating',array('did'=>$item['id']))}">删除 </a> |
|||
</td> |
|||
</tr> |
|||
|
|||
{loop $item['children'] $iitem} |
|||
<tr class="js-collpase js-child-category text-center" pid="{$item['id']}" > |
|||
<td><img class="scrollLoading" src="{php echo tomedia($iitem['img'])}" width='45' height="45" style='float:right;'/></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']};"> |
|||
{$iitem['title']} |
|||
</div> |
|||
</td> |
|||
<td> |
|||
{if $iitem['isnav'] ==1} |
|||
<label class='label label-primary'>导航标签</label> |
|||
{else} |
|||
<label class='label label-danger'>普通分类</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<a href="javascript:;" data-toggle="ajaxEdit" data-href="{php echo web_url('pocket/Type/setPrice',array('id'=>$iitem['id']))}" style="color: #000;">{$iitem['price']}</a> |
|||
</td> |
|||
<td> |
|||
<label class='label label-default'>{$iitem['id']}</label> |
|||
</td> |
|||
<td>{php echo tpl_change_status('pocket/Type/changeStatus&id='.$iitem['id'],$iitem['status'])}</td> |
|||
<td class="text-center">{$iitem['sort']}</td> |
|||
<td class="text-center" style="position: relative"> |
|||
{if $iitem['isnav'] != 1} |
|||
<a href="javascript:;" data-id="{$category['id']}" data-url="{php echo h5_url('pages/mainPages/econdaryClassification/econdaryClassification',['id'=>$item['id'],'two_id'=>$iitem['id']])}&title={$iitem['title']}" class="js-clip" > |
|||
复制链接 |
|||
</a> |
|||
- |
|||
<a href="javascript:;" data-id="{$category['id']}" data-url="pages/mainPages/econdaryClassification/econdaryClassification?id={$item['id']}&two_id={$iitem['id']}&title={$iitem['httitle']}" class="js-clip" > |
|||
复制路径 |
|||
</a> |
|||
- |
|||
{/if} |
|||
<a href="{php echo web_url('pocket/Type/operating',array('id'=>$iitem['id']))}">编辑 </a> |
|||
- |
|||
<a href="{php echo web_url('pocket/Type/operating',array('did'=>$iitem['id']))}">删除 </a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</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(); |
|||
}); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,4 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Ranklist {} |
|||
@ -0,0 +1,24 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[排行榜]]></name> |
|||
<identifie><![CDATA[ranklist]]></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="false" /> |
|||
<system embed="true" /> |
|||
<task embed="false" /> |
|||
</setting> |
|||
<agentmenu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="排行榜" font="fa-inbox"> |
|||
<entry title="排行榜" ac="rank" do="rank_list" actions='["do",["rank_list","rank_edit"]]' iscover="true" /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 2.9 KiB |
@ -0,0 +1,53 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Rank_WeliamController { |
|||
|
|||
public function rank_list() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 15; |
|||
$lists = pdo_getslice(PDO_NAME . 'rank', array('uniacid' => $_W['uniacid']), array($pindex, $psize), $total, array(), '', "id DESC"); |
|||
$pager = wl_pagination($total, $pindex, $psize); |
|||
|
|||
include wl_template('ranklist/rank_list'); |
|||
} |
|||
|
|||
public function rank_edit() { |
|||
global $_W, $_GPC; |
|||
if (checksubmit()) { |
|||
if (empty($_GPC['name'])) { |
|||
wl_message('请填写排行榜名称'); |
|||
} |
|||
$data = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'name' => $_GPC['name'], |
|||
'type' => $_GPC['type'], |
|||
'orderby' => $_GPC['orderby'], |
|||
'status' => $_GPC['status'] == 'on' ? 1 : 0, |
|||
'number' => $_GPC['number']?$_GPC['number']:10, |
|||
'createtime' => time() |
|||
); |
|||
|
|||
if (empty($_GPC['id'])) { |
|||
pdo_insert(PDO_NAME . 'rank', $data); |
|||
} else { |
|||
pdo_update(PDO_NAME . 'rank', $data, array('id' => $_GPC['id'])); |
|||
} |
|||
wl_message('编辑排行榜成功', web_url('ranklist/rank/rank_list'), 'success'); |
|||
} |
|||
$rank = pdo_get(PDO_NAME . 'rank', array('uniacid' => $_W['uniacid'], 'id' => $_GPC['id'])); |
|||
include wl_template('ranklist/rank_edit'); |
|||
} |
|||
|
|||
public function rank_del() { |
|||
global $_W, $_GPC; |
|||
if ($_GPC['id']) { |
|||
pdo_delete(PDO_NAME . 'rank', array('uniacid' => $_W['uniacid'], 'id' => $_GPC['id'])); |
|||
show_json(1); |
|||
}else{ |
|||
show_json(0,'删除失败'); |
|||
} |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('ranklist/rank/rank_list');}">排行榜</a></li> |
|||
<li class="active"><a href="{php echo web_url('ranklist/rank/rank_edit');}">编辑排行榜</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form class="form-horizontal form form-validate" action="" method="post" id="form1"> |
|||
<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">排行榜名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" placeholder="请输入排行榜名称" name="name" value="{$rank['name']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">数据类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('.usersort').show();$('.storesort').hide();"><input type="radio" name="type" value="0" {if $rank['type'] != 1} checked {/if}>用户</label> |
|||
<label class="radio-inline" onclick="$('.usersort').hide();$('.storesort').show();"><input type="radio" name="type" value="1" {if $rank['type'] == 1} checked {/if}>商户</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序方式</label> |
|||
<div class="col-sm-9"> |
|||
<div class="usersort" {if $rank['type'] == 1}style="display: none;"{/if}> |
|||
<label class="radio-inline"><input type="radio" name="orderby" value="0" {if $rank['orderby'] == 0} checked {/if}>用户积分</label> |
|||
<label class="radio-inline"><input type="radio" name="orderby" value="1" {if $rank['orderby'] == 1} checked {/if}>用户余额</label> |
|||
<label class="radio-inline"><input type="radio" name="orderby" value="2" {if $rank['orderby'] == 2} checked {/if}>用户消费金额</label> |
|||
</div> |
|||
<div class="storesort" {if $rank['type'] != 1}style="display: none;"{/if}> |
|||
<label class="radio-inline"><input type="radio" name="orderby" value="11" {if $rank['orderby'] == 11} checked {/if}>商户人气</label> |
|||
<label class="radio-inline"><input type="radio" name="orderby" value="12" {if $rank['orderby'] == 12} checked {/if}>商户订单数</label> |
|||
<label class="radio-inline"><input type="radio" name="orderby" value="13" {if $rank['orderby'] == 13} checked {/if}>商户营业额</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!--<div class="form-group"> |
|||
<label class="col-sm-2 control-label">背景图</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_form_field_image('bgimg', $rank['bgimg'])} |
|||
<span class="help-block">建议图片大小900*500</span> |
|||
</div> |
|||
</div>--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">显示数量</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" placeholder="请输入排行榜显示数量 默认10" name="number" value="{$rank['number']}" /> |
|||
</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="status" {if $rank['status'] == 1} checked="checked" {/if}> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button type="submit" class="btn btn-primary min-width" name="submit" value="提交">提交</button> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,70 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<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('ranklist/rank/rank_edit')}" class="btn btn-primary">添加排行榜</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th style="width:100px;text-align:center;">ID</th> |
|||
<th style="width:100px;text-align:center;">名称</th> |
|||
<th style="width:100px;text-align:center;">类型</th> |
|||
<th style="width:100px; text-align:center;">排序</th> |
|||
<th style="width:200px; text-align:center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $lists $list} |
|||
<tr> |
|||
<td class="text-center">{$list['id']}</td> |
|||
<td class="text-center">{$list['name']}</td> |
|||
<td class="text-center"> |
|||
{if $list['type'] == 1} |
|||
<label class='label label-success'>商户</label> |
|||
{else} |
|||
<label class='label label-primary'>用户</label> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center"> |
|||
{if $list['orderby'] == 0} |
|||
用户积分 |
|||
{elseif $list['orderby'] == 1} |
|||
用户余额 |
|||
{elseif $list['orderby'] == 2} |
|||
用户消费金额 |
|||
{elseif $list['orderby'] == 11} |
|||
商户人气 |
|||
{elseif $list['orderby'] == 12} |
|||
商户订单数 |
|||
{elseif $list['orderby'] == 13} |
|||
商户营业额 |
|||
{/if} |
|||
</td> |
|||
<td class="text-center" style="text-align: center;position: relative;"> |
|||
<a class="btn btn-info btn-sm js-clip" data-url="{$_W['siteroot']}addons/{MODULE_NAME}/v3/index.html?i={$_W['uniacid']}&do=getorder&p=ranklist&id={$list['id']}" href="javascript:;">复制链接</a> |
|||
<a class="btn btn-primary btn-sm" href="{php echo web_url('ranklist/rank/rank_edit', array('id' => $list['id']));}">编辑</a> |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('ranklist/rank/rank_del', array('id' => $list['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,120 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class RanklistModuleUniapp extends Uniapp { |
|||
public function index() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
//是否存在该排行榜 |
|||
$rank = pdo_get(PDO_NAME . 'rank', array('uniacid' => $_W['uniacid'], 'id' => $id)); |
|||
if (empty($rank)) { |
|||
$this->result(1, '排行榜不存在或已被删除'); |
|||
} |
|||
//定义基本内容 |
|||
$getNum = $rank['number'];//排行榜数量 |
|||
$orderType = $rank['type'].'_'.$rank['orderby'];//排行榜样式 组合方式:数据类型_排序方式 |
|||
$data = ''; |
|||
//获取对应的排行榜的数据信息 0=用户排行榜 1=商户排行榜 |
|||
switch ($orderType) { |
|||
case '0_0': |
|||
$table = 'mc_members'; |
|||
$orderby = 'credit2 DESC'; |
|||
$text = '积分'; |
|||
$where = "uniacid = {$_W['uniacid']} AND credit2 > 0.01"; |
|||
$field = " uid,nickname as name,avatar as images,credit2 as info"; |
|||
break; |
|||
case '0_1': |
|||
$table = 'mc_members'; |
|||
$orderby = 'credit1 DESC'; |
|||
$text = '余额'; |
|||
$where = "uniacid = {$_W['uniacid']} AND credit1 > 0.01"; |
|||
$field = " uid,nickname as name,avatar as images,credit1 as info"; |
|||
break; |
|||
case '0_2': |
|||
$table = PDO_NAME.'member'; |
|||
$orderby = 'dealmoney DESC'; |
|||
$text = '消费金额'; |
|||
$where = "uniacid = {$_W['uniacid']} AND dealmoney > 0.01"; |
|||
$field = " id,uid,nickname as name,avatar as images,dealmoney as info"; |
|||
break; |
|||
case '1_11': |
|||
$table = PDO_NAME.'merchantdata'; |
|||
$orderby = 'pv DESC'; |
|||
$text = '人气'; |
|||
$where = " status = 2 AND enabled = 1 AND pv > 0.01"; |
|||
$field = " id,storename as name,logo as images,pv as info"; |
|||
break; |
|||
case '1_12': |
|||
$sql = "SELECT id as fid,logo images,storename as name,(SELECT COUNT(*) FROM " |
|||
.tablename(PDO_NAME.'order') |
|||
." WHERE sid = fid AND status IN (1,2,3,4,9)) + (SELECT COUNT(*) FROM " |
|||
.tablename(PDO_NAME.'rush_order') |
|||
." WHERE sid = fid AND status IN (1,2,3,4,9)) as info FROM " |
|||
.tablename(PDO_NAME."merchantdata") |
|||
." WHERE status = 2 AND enabled = 1 ORDER BY info DESC"; |
|||
$data = pdo_fetchall($sql); |
|||
$text = '订单数'; |
|||
break; |
|||
case '1_13': |
|||
$table = PDO_NAME.'merchantdata'; |
|||
$orderby = 'allmoney DESC'; |
|||
$text = '营业额'; |
|||
$where = " status = 2 AND enabled = 1 AND allmoney > 0.01"; |
|||
$field = " id,storename as name,logo as images,allmoney as info"; |
|||
break; |
|||
default: |
|||
$this->result(1, '排行榜设置错误,请联系管理员'); |
|||
break; |
|||
} |
|||
if(!$data){ |
|||
$data = pdo_fetchall("SELECT {$field} FROM ".tablename($table)." WHERE {$where} ORDER BY {$orderby} LIMIT {$getNum}"); |
|||
} |
|||
if($rank['type'] == 1){ |
|||
foreach ($data as $k => &$v){ |
|||
$v['images'] = tomedia($v['images']); |
|||
if($orderType == '1_12' && $v['info'] < 0.01){ |
|||
unset($data[$k]); |
|||
} |
|||
} |
|||
} |
|||
|
|||
$this->result(0, '', array('name'=>$rank['name'],'text' => $text, 'data' => $data)); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
@ -0,0 +1,51 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[求职招聘]]></name> |
|||
<identifie><![CDATA[recruit]]></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="industryPosition" do="industryList" actions='["do",["industryList","industryEdit"]]' iscover="true" /> |
|||
<entry title="职位管理" ac="industryPosition" do="positionList" actions='["do",["positionList","positionEdit"]]'/> |
|||
</menu> |
|||
<menu title="求职招聘" font="fa-inbox"> |
|||
<entry title="标签管理" ac="recruitment" do="labelList" actions='["do",["labelList","labelEdit"]]'/> |
|||
<entry title="招聘管理" ac="recruitment" do="recruitList" actions='["do",["recruitList","recruitEdit"]]'/> |
|||
<entry title="简历管理" ac="recruitment" do="resumeList" actions='["do",["resumeList","resumeSee"]]'/> |
|||
</menu> |
|||
<menu title="订单" font="fa-inbox"> |
|||
<entry title="订单管理" ac="recruitOrder" do="index" actions='["do",["index"]]'/> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="基本设置" ac="recruitment" do="setEdit" actions='["do",["setEdit"]]'/> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="行业职位" font="fa-inbox"> |
|||
<entry title="行业管理" ac="industryPosition" do="industryList" actions='["do",["industryList","industryEdit"]]' iscover="true" /> |
|||
<entry title="职位管理" ac="industryPosition" do="positionList" actions='["do",["positionList","positionEdit"]]'/> |
|||
</menu> |
|||
<menu title="求职招聘" font="fa-inbox"> |
|||
<entry title="标签管理" ac="recruitment" do="labelList" actions='["do",["labelList","labelEdit"]]'/> |
|||
<entry title="招聘管理" ac="recruitment" do="recruitList" actions='["do",["recruitList","recruitEdit"]]'/> |
|||
<entry title="简历管理" ac="recruitment" do="resumeList" actions='["do",["resumeList","resumeSee"]]'/> |
|||
</menu> |
|||
<menu title="订单" font="fa-inbox"> |
|||
<entry title="订单管理" ac="recruitOrder" do="index" actions='["do",["index"]]'/> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="基本设置" ac="recruitment" do="setEdit" actions='["do",["setEdit"]]'/> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,401 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
/** |
|||
* Comment: 行业职位 |
|||
* Author: zzw |
|||
* Class industryPosition_WeliamController |
|||
*/ |
|||
class IndustryPosition_WeliamController{ |
|||
/** |
|||
* Comment: 行业列表 |
|||
* Author: zzw |
|||
* Date: 2020/11/25 17:53 |
|||
*/ |
|||
public function industryList(){ |
|||
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 pid FROM " |
|||
.tablename(PDO_NAME."recruit_industry") |
|||
.$where." AND title LIKE '%{$title}%' AND pid > 0"); |
|||
$ids = array_column($ids,'pid'); |
|||
$ids = $ids ? implode($ids) : []; |
|||
$where .= " AND (title LIKE '%{$title}%' OR id IN ({$ids})) "; |
|||
} |
|||
//sql语句生成 |
|||
$field = "id,title,sort,create_time"; |
|||
$sql = "SELECT {$field} FROM " .tablename(PDO_NAME."recruit_industry"); |
|||
$order = " ORDER BY sort DESC,id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
//列表获取 |
|||
$list = pdo_fetchall($sql.$where." AND pid = 0".$order.$limit); |
|||
foreach($list as $key => &$val){ |
|||
$val['list'] = pdo_fetchall($sql.$where." AND pid = {$val['id']}".$order); |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where." AND pid = 0"); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('industry/index'); |
|||
} |
|||
/** |
|||
* Comment: 添加/编辑 行业 |
|||
* Author: zzw |
|||
* Date: 2020/11/26 10:24 |
|||
*/ |
|||
public function industryEdit(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] ? : ''; |
|||
//接收信息 并且进行对应的处理 |
|||
if($_W['ispost']){ |
|||
$data = $_GPC['data']; |
|||
//判断当前行业是否已经存在 |
|||
$isWhere = ['uniacid'=>$_W['uniacid'],'aid'=>$_W['aid'],'title'=>$data['title']]; |
|||
if($id > 0) $isWhere['id <>'] = $id; |
|||
$isHave = pdo_get(PDO_NAME."recruit_industry" ,$isWhere); |
|||
if($isHave) wl_message('该行业已存在!',referer(),'error'); |
|||
//根据是否存在id 判断是添加操作还是修改操作 |
|||
if($id){ |
|||
//判断当前行业是否可以修改子行业信息 |
|||
if($data['pid']){ |
|||
$pid = pdo_getcolumn(PDO_NAME."recruit_industry",['id'=>$id],'pid'); |
|||
$sub = pdo_count(PDO_NAME."recruit_industry",['pid'=>$id]); |
|||
if($pid != $data['pid'] && $sub > 0) wl_message('当前行业存在子行业信息,禁止修改上级行业信息。',referer(),'error'); |
|||
} |
|||
//修改当前行业信息 |
|||
pdo_update(PDO_NAME."recruit_industry",$data,['id'=>$id]); |
|||
|
|||
wl_message('修改成功',web_url('recruit/industryPosition/industryList'),'success'); |
|||
}else{ |
|||
//不存在 保存添加的行业信息 |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$data['create_time'] = time(); |
|||
pdo_insert(PDO_NAME."recruit_industry",$data); |
|||
|
|||
wl_message('添加成功',web_url('recruit/industryPosition/industryList'),'success'); |
|||
} |
|||
} |
|||
//准备信息 |
|||
$pList = pdo_getall(PDO_NAME."recruit_industry",['uniacid'=>$_W['uniacid'],'aid'=>$_W['aid'],'pid'=>0,'id <>'=>$id],['id','title']); |
|||
if($id){ |
|||
//修改信息准备 |
|||
$info = pdo_get(PDO_NAME."recruit_industry",['id'=>$id],['title','pid','sort']); |
|||
$info['sub'] = pdo_count(PDO_NAME."recruit_industry",['pid'=>$id]); |
|||
}else{ |
|||
//添加信息准备 |
|||
$sort = pdo_fetchcolumn("SELECT MAX(id) FROM ".tablename(PDO_NAME."recruit_industry")); |
|||
$info['sort'] = $sort ? : 0; |
|||
} |
|||
|
|||
include wl_template('industry/edit'); |
|||
} |
|||
/** |
|||
* Comment: 生成默认行业信息 |
|||
* Author: zzw |
|||
* Date: 2020/11/26 10:47 |
|||
*/ |
|||
public function industryDefaultInfo(){ |
|||
global $_W,$_GPC; |
|||
//获取默认行业类别 |
|||
$list = Recruit::defaultIndustryList(); |
|||
$tableName = PDO_NAME."recruit_industry"; |
|||
$publicWhere = ['uniacid'=>$_W['uniacid'],'aid'=>$_W['aid']]; |
|||
//修改所有默认信息的排序信息 |
|||
pdo_fetchall("update ".tablename($tableName)." set `sort` = `id` WHERE `sort` is null "); |
|||
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'] , |
|||
'pid' => 0 , |
|||
'create_time' => time() , |
|||
]; |
|||
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 , |
|||
'pid' => $pid , |
|||
'create_time' => time() , |
|||
]; |
|||
pdo_insert($tableName,$subData); |
|||
} |
|||
} |
|||
} |
|||
//修改所有默认信息的排序信息 |
|||
pdo_fetchall("update ".tablename($tableName)." set `sort` = `id` WHERE `sort` is null "); |
|||
|
|||
wl_json(1,'生成成功'); |
|||
} |
|||
/** |
|||
* Comment: 删除行业信息 |
|||
* Author: zzw |
|||
* Date: 2020/11/26 11:15 |
|||
*/ |
|||
public function industryDel(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids'] ? :[] ; |
|||
pdo_delete(PDO_NAME."recruit_industry",['id IN'=>$ids]); |
|||
pdo_delete(PDO_NAME."recruit_industry",['pid IN'=>$ids]); |
|||
pdo_delete(PDO_NAME."recruit_position",['industry_pid IN'=>$ids]); |
|||
|
|||
show_json(1, "删除成功"); |
|||
} |
|||
/** |
|||
* Comment: 获取某个上级行业下所有子行业信息 |
|||
* Author: zzw |
|||
* Date: 2020/11/26 17:56 |
|||
*/ |
|||
public function industrySubList(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = $_GPC['id'] OR wl_json(0,'参数错误,请刷新重试!'); |
|||
//子行业列表信息获取 |
|||
$list = pdo_getall(PDO_NAME."recruit_industry",['uniacid'=>$_W['uniacid'],'aid'=>$_W['aid'],'pid'=>$id],['id','title'],'','sort DESC,create_time DESC'); |
|||
|
|||
wl_json(1,'子行业信息列表',$list); |
|||
} |
|||
/** |
|||
* Comment: 导出行业信息 |
|||
* Author: zzw |
|||
* Date: 2021/2/22 16:19 |
|||
*/ |
|||
public function industryExport(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$title = $_GPC['title'] ? : '';//活动名称 |
|||
//条件生成 |
|||
$where = " WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "; |
|||
if($title) $where .= " AND (title LIKE '%{$title}%' ) "; |
|||
//sql语句生成 |
|||
$field = "a.title, |
|||
CASE WHEN pid = 0 THEN '' |
|||
ELSE (SELECT title FROM ".tablename(PDO_NAME."recruit_industry")." as b where b.id = a.pid) |
|||
END as pid,a.sort,FROM_UNIXTIME(a.create_time) as create_time"; |
|||
$sql = "SELECT {$field} FROM " .tablename(PDO_NAME."recruit_industry")." as a "; |
|||
$order = " ORDER BY sort DESC,id DESC "; |
|||
//列表获取 |
|||
$list = pdo_fetchall($sql.$where.$order); |
|||
//标题列表数组 |
|||
$title = [ |
|||
'title' => '行业标题', |
|||
'pid' => '上级行业', |
|||
'sort' => '排序', |
|||
'create_time' => '创建时间', |
|||
]; |
|||
//导出信息 |
|||
util_csv::export_csv_2($list, $title, '行业信息.csv');die; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 职位列表 |
|||
* Author: zzw |
|||
* Date: 2020/11/26 15:40 |
|||
*/ |
|||
public function positionList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$title = $_GPC['title'] ? : '';//活动名称 |
|||
$industryPid = $_GPC['industry_pid'] ? : '';//上级行业id |
|||
$industryId = $_GPC['industry_id'] ? : '';//子行业id |
|||
//条件生成 |
|||
$where = " WHERE a.uniacid = {$_W['uniacid']} AND a.aid = {$_W['aid']} "; |
|||
if($title) $where .= " AND a.title LIKE '%{$title}%' "; |
|||
if($industryPid > 0) $where .= " AND a.industry_pid = {$industryPid} "; |
|||
if($industryId > 0) $where .= " AND a.industry_id = {$industryId} "; |
|||
//sql语句生成 |
|||
$field = "a.id,a.title,a.sort,a.create_time,b.title as industry_one_title,c.title as industry_two_title"; |
|||
$sql = "SELECT {$field} FROM " .tablename(PDO_NAME."recruit_position") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."recruit_industry") |
|||
." as b ON a.industry_pid = b.id LEFT JOIN ".tablename(PDO_NAME."recruit_industry") |
|||
." as `c` ON a.industry_id = c.id "; |
|||
$order = " ORDER BY a.sort DESC,a.id DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
//列表获取 |
|||
if($_GPC['export'] == 1) $this->positionExport(pdo_fetchall($sql.$where.$order)); |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
//获取上级行业信息 |
|||
$industryList = pdo_getall(PDO_NAME."recruit_industry",['uniacid'=>$_W['uniacid'],'aid'=>$_W['aid'],'pid'=>0],['id','title'],'','sort DESC,create_time DESC'); |
|||
if($industryPid > 0) $subList = pdo_getall(PDO_NAME."recruit_industry",['uniacid'=>$_W['uniacid'],'aid'=>$_W['aid'],'pid'=>$industryPid],['id','title'],'','sort DESC,create_time DESC'); |
|||
|
|||
include wl_template('position/index'); |
|||
} |
|||
/** |
|||
* Comment: 职位添加/编辑 |
|||
* Author: zzw |
|||
* Date: 2020/11/26 15:41 |
|||
*/ |
|||
public function positionEdit(){ |
|||
global $_W,$_GPC; |
|||
$id = $_GPC['id'] ? : ''; |
|||
//接收信息 并且进行对应的处理 |
|||
if($_W['ispost']){ |
|||
$data = $_GPC['data']; |
|||
//获取上级行业id |
|||
$data['industry_pid'] = pdo_getcolumn(PDO_NAME."recruit_industry",['id'=>$data['industry_id']],'pid'); |
|||
//判断职位是否已经存在 |
|||
$haveWhere = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $_W['aid'] , |
|||
'title' => $data['title'] , |
|||
'industry_pid' => $data['industry_pid'] , |
|||
'industry_id' => $data['industry_id'] |
|||
]; |
|||
if($id) $haveWhere['id <>'] = $id; |
|||
$isHave = pdo_get(PDO_NAME."recruit_position",$haveWhere); |
|||
if($isHave) wl_message('当前职位已经存在,请勿重复添加!',referer(),'error'); |
|||
//根据是否存在id 判断是添加操作还是修改操作 |
|||
if($id){ |
|||
pdo_update(PDO_NAME."recruit_position",$data,['id'=>$id]); |
|||
|
|||
wl_message('修改成功',web_url('recruit/industryPosition/positionList'),'success'); |
|||
}else{ |
|||
//判断职位是否已经存在 |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$data['create_time'] = time(); |
|||
pdo_insert(PDO_NAME."recruit_position",$data); |
|||
|
|||
wl_message('添加成功',web_url('recruit/industryPosition/positionList'),'success'); |
|||
} |
|||
} |
|||
//获取所有的行业列表信息 |
|||
$industryList = pdo_getall(PDO_NAME."recruit_industry",['uniacid'=>$_W['uniacid'],'aid'=>$_W['aid'],'pid'=>0],['id','title'],'','sort DESC,create_time DESC'); |
|||
foreach($industryList as &$industryItem){ |
|||
$industryItem['list'] = pdo_getall(PDO_NAME."recruit_industry",['uniacid'=>$_W['uniacid'],'aid'=>$_W['aid'],'pid'=>$industryItem['id']],['id','title'],'','sort DESC,create_time DESC'); |
|||
} |
|||
//准备信息 |
|||
if($id){ |
|||
//修改信息准备 |
|||
$info = pdo_get(PDO_NAME."recruit_position",['id'=>$id],['title','industry_id','sort']); |
|||
}else{ |
|||
//添加信息准备 |
|||
$sort = pdo_fetchcolumn("SELECT MAX(id) FROM ".tablename(PDO_NAME."recruit_position")); |
|||
$info['sort'] = $sort ? : 0; |
|||
} |
|||
|
|||
include wl_template('position/edit'); |
|||
} |
|||
/** |
|||
* Comment: 生成默认职位信息 |
|||
* Author: zzw |
|||
* Date: 2020/11/26 16:47 |
|||
*/ |
|||
public function positionDefaultInfo(){ |
|||
global $_W,$_GPC; |
|||
//获取职位列表信息 |
|||
$list = Cache::getCache('recruit','position'); |
|||
if($list){ |
|||
$list = json_decode($list,true); |
|||
}else{ |
|||
$list = Recruit::defaultPositionList(); |
|||
Cache::setCache('recruit','position',json_encode($list)); |
|||
} |
|||
//当前需要处理的行业的key值获取 职位列表信息获取 |
|||
$industry = array_keys($list)[0]; |
|||
$position = $list[$industry]; |
|||
//获取职位信息 |
|||
$info = pdo_get(PDO_NAME."recruit_industry",['uniacid'=>$_W['uniacid'],'aid'=>$_W['aid'],'title'=>$industry],['id','pid']); |
|||
if($info){ |
|||
//循环删除对应的职位信息 |
|||
foreach($position as $title){ |
|||
//判断是否存在职位信息 |
|||
$data = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $_W['aid'] , |
|||
'title' => trim($title) , |
|||
'industry_pid' => $info['pid'] , |
|||
'industry_id' => $info['id'] |
|||
]; |
|||
$isHave = pdo_get(PDO_NAME."recruit_position",$data); |
|||
if(!$isHave){ |
|||
//不存在 添加职位信息 |
|||
$data['create_time'] = time(); |
|||
pdo_insert(PDO_NAME."recruit_position",$data); |
|||
} |
|||
} |
|||
} |
|||
//修改所有默认信息的排序信息 |
|||
pdo_fetchall("update ".tablename(PDO_NAME."recruit_position")." set `sort` = `id` WHERE `sort` is null "); |
|||
//删除当前行业信息 修改缓存信息 |
|||
unset($list[$industry]); |
|||
$total = count($list); |
|||
if($total > 0) Cache::setCache('recruit','position',json_encode($list)); |
|||
else Cache::deleteCache('recruit','position'); |
|||
//计算已生成的占比率 |
|||
$rate = sprintf("%.2f",(count(Recruit::defaultPositionList()) - $total) / count(Recruit::defaultPositionList()) * 100); |
|||
|
|||
wl_json(1,'生成成功',['total'=>$total,'rate'=>$rate]); |
|||
} |
|||
/** |
|||
* Comment: 删除指定的职位信息 |
|||
* Author: zzw |
|||
* Date: 2020/11/26 16:57 |
|||
*/ |
|||
public function positionDel(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids'] ? :[] ; |
|||
if(is_array($ids)) pdo_delete(PDO_NAME."recruit_position",['id IN'=>$ids]); |
|||
else pdo_delete(PDO_NAME."recruit_position",['id'=>$ids]); |
|||
|
|||
show_json(1, "删除成功"); |
|||
} |
|||
/** |
|||
* Comment: 导出职位信息 |
|||
* Author: zzw |
|||
* Date: 2021/2/22 16:33 |
|||
* @param $list |
|||
*/ |
|||
public function positionExport($list){ |
|||
//处理职位信息 |
|||
foreach($list as &$val){ |
|||
//处理时间信息 |
|||
$val['create_time'] = date("Y-m-d H:i:s",$val['create_time']); |
|||
//行业拼接 |
|||
$val['industry'] = $val['industry_one_title'].' - '.$val['industry_two_title']; |
|||
//删除不需要的数据 |
|||
unset($val['id'],$val['industry_one_title'],$val['industry_two_title']); |
|||
} |
|||
//标题列表数组 |
|||
$title = [ |
|||
'title' => '职位名称', |
|||
'sort' => '排序', |
|||
'create_time' => '创建时间', |
|||
'industry' => '所属行业', |
|||
]; |
|||
//导出信息 |
|||
util_csv::export_csv_2($list, $title, '职位信息.csv');die; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
|
|||
/** |
|||
* Comment: 求职招聘订单管理 |
|||
* Author: zzw |
|||
* Date: 2021/1/13 10:02 |
|||
* Class RecruitOrder_WeliamController |
|||
*/ |
|||
class RecruitOrder_WeliamController{ |
|||
/** |
|||
* Comment: 求职订单列表 |
|||
* Author: zzw |
|||
* Date: 2021/1/13 11:19 |
|||
*/ |
|||
public function index(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = $_GPC['page_index'] ? : 10; |
|||
$startPage = $page * $pageIndex - $pageIndex; |
|||
$title = $_GPC['title'] ? : '';//名称 |
|||
$industryPid = $_GPC['industry_pid'] ? : 0;//上级行业id |
|||
$industryId = $_GPC['industry_id'] ? : 0;//子行业id |
|||
$positionId = $_GPC['position_id'] ? : 0;//职位id |
|||
$recruitmentType = $_GPC['recruitment_type'] ? : 0;//招聘类型:1=个人招聘,2=企业招聘 |
|||
//条件删除 |
|||
$where = " WHERE a.uniacid = {$_W['uniacid']} AND a.aid = {$_W['aid']} AND a.plugin = 'recruit' "; |
|||
if($title) $where .= " AND b.title LIKE '%{$title}%' "; |
|||
if($industryPid > 0) $where .= " AND b.industry_pid = {$industryPid} "; |
|||
if($industryId > 0) $where .= " AND b.industry_id = {$industryId} "; |
|||
if($positionId > 0) $where .= " AND b.position_id = {$positionId} "; |
|||
if($recruitmentType > 0) $where .= " AND b.recruitment_type = {$recruitmentType} "; |
|||
//sql语句生成 |
|||
$field = "a.id,a.orderno,a.status,a.paytype,a.paytime,a.price,a.fightstatus,b.title,b.recruitment_type,b.release_mid,b.release_sid"; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."order") |
|||
." as a RIGHT JOIN ".tablename(PDO_NAME."recruit_recruit") |
|||
." as b ON a.fkid = b.id "; |
|||
$order = " ORDER BY a.createtime DESC,a.id DESC "; |
|||
$limit = " LIMIT {$startPage},{$pageIndex} "; |
|||
//获取并且处理信息 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach($list as $index => &$item){ |
|||
//判断发布方 招聘类型:1=个人招聘,2=企业招聘 |
|||
if($item['recruitment_type'] == 1){ |
|||
$release = pdo_get(PDO_NAME."member",['id'=>$item['release_mid']],['nickname','avatar']); |
|||
$item['release_name'] = $release['nickname']; |
|||
$item['release_logo'] = tomedia($release['avatar']); |
|||
}else{ |
|||
$release = pdo_get(PDO_NAME."merchantdata",['id'=>$item['release_sid']],['storename','logo']); |
|||
$item['release_name'] = $release['storename']; |
|||
$item['release_logo'] = tomedia($release['logo']); |
|||
} |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
//获取行业职位信息 |
|||
$industry = Recruit::getIndustryList(['pid'=>0],['id','title']);//上级行业列表 |
|||
if ($industryPid) $subIndustry = Recruit::getIndustryList(['pid'=>$industryPid],['id','title']);//子行业列表 |
|||
if ($industryId) $position = Recruit::getPositionList(['industry_id'=>$industryId],['id','title']);//子行业列表 |
|||
|
|||
|
|||
|
|||
include wl_template('order/index'); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,616 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
/** |
|||
* Comment: 求职招聘 |
|||
* Author: zzw |
|||
* Class Recruitment_WeliamController |
|||
*/ |
|||
class Recruitment_WeliamController{ |
|||
/** |
|||
* Comment: 标签列表 |
|||
* Author: zzw |
|||
* Date: 2020/12/1 10:49 |
|||
*/ |
|||
public function labelList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$title = $_GPC['title'] ? : '';//名称 |
|||
$type = $_GPC['type'] ? : 0;//类型 |
|||
//条件生成 |
|||
$where = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $_W['aid'] |
|||
]; |
|||
if($title) $where['title LIKE'] = "%{$title}%"; |
|||
if($type > 0) $where['type'] = $type; |
|||
//列表获取 |
|||
$field = ['id','title','type','create_time','sort']; |
|||
$order = 'sort DESC,id DESC'; |
|||
$list = pdo_getall(PDO_NAME."recruit_label",$where,$field,'',$order,[$page,$pageIndex]); |
|||
//分页操作 |
|||
$total = pdo_count(PDO_NAME."recruit_label",$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('label/labelindex'); |
|||
} |
|||
/** |
|||
* Comment: 标签添加/编辑 |
|||
* Author: zzw |
|||
* Date: 2020/12/1 11:04 |
|||
*/ |
|||
public function labelEdit(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] ? : ''; |
|||
//接收信息 并且进行对应的处理 |
|||
if($_W['ispost']){ |
|||
$data = $_GPC['data']; |
|||
//判断是否已经存在当前标签 |
|||
$where = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $_W['aid'] , |
|||
'title' => $data['title'] , |
|||
'type' => $data['type'] |
|||
]; |
|||
if($id > 0) $where['id <>'] = $id; |
|||
$isHave = pdo_get(PDO_NAME."recruit_label",$where); |
|||
if($isHave) wl_message('标签已经存在',referer(),'error'); |
|||
//根据是否存在id 判断是添加操作还是修改操作 |
|||
if($id){ |
|||
pdo_update(PDO_NAME."recruit_label",$data,['id'=>$id]); |
|||
|
|||
wl_message('修改成功',web_url('recruit/recruitment/labelList'),'success'); |
|||
}else{ |
|||
//信息补充 并且进行添加操作 |
|||
$data['uniacid'] = $where['uniacid']; |
|||
$data['aid'] = $where['aid']; |
|||
$data['create_time'] = time(); |
|||
pdo_insert(PDO_NAME."recruit_label",$data); |
|||
|
|||
wl_message('添加成功',web_url('recruit/recruitment/labelList'),'success'); |
|||
} |
|||
} |
|||
//准备信息 |
|||
if($id){ |
|||
//修改信息准备 |
|||
$info = pdo_get(PDO_NAME."recruit_label",['id'=>$id],['title','type','sort']); |
|||
}else{ |
|||
//添加信息准备 |
|||
$sort = pdo_fetchcolumn("SELECT MAX(id) FROM ".tablename(PDO_NAME."recruit_label")); |
|||
$info['sort'] = $sort ? : 0; |
|||
} |
|||
|
|||
include wl_template('label/edit'); |
|||
} |
|||
/** |
|||
* Comment: 生成默认的标签信息 |
|||
* Author: zzw |
|||
* Date: 2020/12/1 10:33 |
|||
*/ |
|||
public function labelDefaultInfo(){ |
|||
global $_W,$_GPC; |
|||
//获取默认行业类别 |
|||
$list = Recruit::defaultLabelList(); |
|||
foreach($list as $val){ |
|||
//判断是否已经存在当前标签 |
|||
$val['uniacid'] = $_W['uniacid']; |
|||
$val['aid'] = $_W['aid']; |
|||
$isHave = pdo_get(PDO_NAME."recruit_label",$val); |
|||
if(!$isHave){ |
|||
//不存在 添加标签信息 |
|||
$val['create_time'] = time(); |
|||
pdo_insert(PDO_NAME."recruit_label",$val); |
|||
} |
|||
} |
|||
//修改所有默认信息的排序信息 |
|||
pdo_fetchall("update ".tablename(PDO_NAME."recruit_label")." set `sort` = `id` WHERE `sort` is null "); |
|||
|
|||
wl_json(1,'生成成功'); |
|||
} |
|||
/** |
|||
* Comment: 删除标签信息 |
|||
* Author: zzw |
|||
* Date: 2020/12/1 11:07 |
|||
*/ |
|||
public function labelDel(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids'] ? :[] ; |
|||
pdo_delete(PDO_NAME."recruit_label",['id IN'=>$ids]); |
|||
|
|||
show_json(1, "删除成功"); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* Comment: 招聘列表 |
|||
* Author: zzw |
|||
* Date: 2020/12/3 10:27 |
|||
*/ |
|||
public function recruitList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$title = $_GPC['title'] ? : '';//名称 |
|||
$industryPid = $_GPC['industry_pid'] ? : 0;//上级行业id |
|||
$industryId = $_GPC['industry_id'] ? : 0;//子行业id |
|||
$positionId = $_GPC['position_id'] ? : 0;//职位id |
|||
$recruitmentType = $_GPC['recruitment_type'] ? : 0;//招聘类型:1=个人招聘,2=企业招聘 |
|||
$status = $_GPC['status'] ? : 0;//招聘状态:1=待付款,2=审核中,3=未通过,4=招聘中,5=已结束 |
|||
$isTop = $_GPC['is_top'] ? : 0;//0=全部,1=置顶中,2=未置顶 |
|||
|
|||
//条件生成 |
|||
$where = " WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "; |
|||
if ($title) $where .= " AND title LIKE '%{$title}%' "; |
|||
if ($industryPid > 0) $where .= " AND industry_pid = {$industryPid} "; |
|||
if ($industryId > 0) $where .= " AND industry_id = {$industryId} "; |
|||
if ($positionId > 0) $where .= " AND position_id = {$positionId} "; |
|||
if ($recruitmentType > 0) $where .= " AND recruitment_type = {$recruitmentType} "; |
|||
if ($status > 0) $where .= " AND status = {$status} "; |
|||
if ($isTop == 1) $where .= " AND is_top = 1 "; |
|||
else if($isTop == 2) $where .= " AND is_top = 0 "; |
|||
//sql信息生成 |
|||
$field = "id,title,position_id,recruitment_type,release_mid,release_sid,work_address,contacts,contact_phone,status,create_time,sort,job_type, |
|||
CASE WHEN job_type in (1,3) THEN |
|||
CASE WHEN full_type = 1 THEN '面议' |
|||
ELSE concat(full_salary_min,'元 ~ ',full_salary_max,'元') |
|||
END |
|||
ELSE CASE WHEN part_type = 1 THEN concat(part_salary,'元/时','(', |
|||
CASE WHEN part_settlement = 1 THEN '日结' |
|||
WHEN part_settlement = 2 THEN '周结' |
|||
WHEN part_settlement = 3 THEN '月结' |
|||
WHEN part_settlement = 4 THEN '完工结算' |
|||
END,')') |
|||
WHEN part_type = 2 THEN concat(part_salary,'元/天','(', |
|||
CASE WHEN part_settlement = 1 THEN '日结' |
|||
WHEN part_settlement = 2 THEN '周结' |
|||
WHEN part_settlement = 3 THEN '月结' |
|||
WHEN part_settlement = 4 THEN '完工结算' |
|||
END,')') |
|||
WHEN part_type = 3 THEN concat(part_salary,'元/月','(', |
|||
CASE WHEN part_settlement = 1 THEN '日结' |
|||
WHEN part_settlement = 2 THEN '周结' |
|||
WHEN part_settlement = 3 THEN '月结' |
|||
WHEN part_settlement = 4 THEN '完工结算' |
|||
END,')') |
|||
END |
|||
END as salary,is_top,top_end_time"; |
|||
$sql = " SELECT {$field} FROM ".tablename(PDO_NAME."recruit_recruit"); |
|||
$order = ' ORDER BY sort DESC,id DESC '; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
//列表获取并且处理 |
|||
if ($_GPC['export'] == 1) $this->recruitExport(pdo_fetchall($sql.$where.$order)); |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach ($list as $index => &$item) { |
|||
//职位信息获取 |
|||
$item['position'] = pdo_getcolumn(PDO_NAME . "recruit_position" , ['id' => $item['position_id']] , 'title'); |
|||
//发布方信息 招聘类型:1=个人招聘,2=企业招聘 |
|||
if ($item['recruitment_type'] == 1) $item['release'] = pdo_getcolumn(PDO_NAME . "member" , ['id' => $item['release_mid']] , 'nickname'); |
|||
else $item['release'] = pdo_getcolumn(PDO_NAME . "merchantdata" , ['id' => $item['release_sid']] , 'storename'); |
|||
//删除多余的信息 |
|||
unset($item['position_id'] , $item['release_mid'] , $item['release_sid']); |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
//获取行业职位信息 |
|||
$industry = Recruit::getIndustryList(['pid'=>0],['id','title']);//上级行业列表 |
|||
if ($industryPid) $subIndustry = Recruit::getIndustryList(['pid'=>$industryPid],['id','title']);//子行业列表 |
|||
if ($industryId) $position = Recruit::getPositionList(['industry_id'=>$industryId],['id','title']);//子行业列表 |
|||
|
|||
include wl_template('recruit/index'); |
|||
} |
|||
/** |
|||
* Comment: 招聘信息添加/编辑 |
|||
* Author: zzw |
|||
* Date: 2020/12/3 15:19 |
|||
*/ |
|||
public function recruitEdit(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] ? : ''; |
|||
//接收信息 并且进行对应的处理 |
|||
if($_W['ispost']){ |
|||
$data = $_GPC['data']; |
|||
//判断内容是否完善 |
|||
if(!$data['title']) wl_json(0,'请输入职位名称'); |
|||
if($data['recruitment_type'] == 1 && !$data['release_mid']) wl_json(0,'请选择发布人'); |
|||
if($data['recruitment_type'] == 2 && !$data['release_sid']) wl_json(0,'请选择发布企业'); |
|||
if(($data['job_type'] == 1 || $data['job_type'] == 3) && $data['full_type'] == 2 && !$data['full_salary_min']) wl_json(0,'请输入最低薪资'); |
|||
if(($data['job_type'] == 1 || $data['job_type'] == 3) && $data['full_type'] == 2 && !$data['full_salary_max']) wl_json(0,'请输入最高薪资'); |
|||
if($data['job_type'] == 2 && !$data['part_salary']) wl_json(0,'请输入薪资金额'); |
|||
if(!$data['work_address'] || !$data['work_lng'] || !$data['work_lat']) wl_json(0,'请选择工作地址'); |
|||
if(!$data['contacts']) wl_json(0,'请输入联系人'); |
|||
if(!$data['contact_phone']) wl_json(0,'请输入联系方式'); |
|||
if(!$data['age_min'] || !$data['age_max']) wl_json(0,'请输入年龄要求'); |
|||
//信息处理 |
|||
if(is_array($data['welfare'])) $data['welfare'] = implode(',',$data['welfare']); |
|||
//时间处理 |
|||
$data['top_end_time'] = strtotime($data['top_end_time']); |
|||
// 图集|视频|视频封面判断 |
|||
if ($data['job_type'] == 2) { |
|||
#if (empty($data['recruit_img'])) wl_json(0,'兼职岗位封面图必填'); |
|||
} else { |
|||
// if(empty($data['video_link'])) wl_json(0,'请上传视频'); |
|||
// if(empty($data['video_img_link'])) wl_json(0,'请上传视频封面图'); |
|||
// if (!empty($data['img'])) $data['img'] = serialize($data['img']); |
|||
// else wl_json(0,'请上传图集'); |
|||
} |
|||
$data['img'] = empty($data['img']) ? "" : serialize($data['img']); |
|||
unset($data['img_url'],$data['video_img_link_url'],$data['video_link_url'],$data['recruit_img_url']); |
|||
//根据是否存在id 判断是添加操作还是修改操作 |
|||
if($id){ |
|||
pdo_update(PDO_NAME."recruit_recruit",$data,['id'=>$id]); |
|||
|
|||
wl_json(1,'编辑成功'); |
|||
}else{ |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$data['create_time'] = time(); |
|||
pdo_insert(PDO_NAME."recruit_recruit",$data); |
|||
|
|||
wl_json(1,'发布成功'); |
|||
} |
|||
} |
|||
//准备信息 |
|||
$oneIndustry = Recruit::getIndustryList(['pid'=>0],['id','title']);//上级行业列表 |
|||
$provinceList = pdo_getall(PDO_NAME."area",['level'=>1,'visible'=>2],['id','name']);//省级列表 |
|||
$welfareLabel = Recruit::getLabelList(2); |
|||
$educationLabel = Recruit::getLabelList(1); |
|||
$experienceLabel = Recruit::getLabelList(3); |
|||
if($id){ |
|||
//修改信息准备 |
|||
$info = pdo_get(PDO_NAME."recruit_recruit",['id'=>$id]); |
|||
//行业职位信息 |
|||
$subIndustryList = Recruit::getIndustryList(['pid'=>$info['industry_pid']],['id','title']);//子行业列表 |
|||
$positionList = Recruit::getPositionList(['industry_id'=>$info['industry_id']],['id','title']);//子行业列表 |
|||
//区域信息获取 |
|||
if($info['work_city']) $cityList = pdo_getall(PDO_NAME."area",['pid'=>$info['work_province']],['id','name']); |
|||
if($info['work_area']) $areaList = pdo_getall(PDO_NAME."area",['pid'=>$info['work_city']],['id','name']); |
|||
//获取发布方信息 |
|||
if($info['recruitment_type'] == 1) $user = pdo_get(PDO_NAME."member",['id'=>$info['release_mid']],['nickname','avatar']); |
|||
else $shop = pdo_get(PDO_NAME."merchantdata",['id'=>$info['release_sid']],['storename','logo']); |
|||
//处理福利标签信息 |
|||
$info['welfare'] = $info['welfare'] ? explode(',',$info['welfare']) : []; |
|||
//处理富文本信息 |
|||
$jobDescription = $info['job_description']; |
|||
//时间信息处理 |
|||
$info['top_end_time'] = $info['top_end_time'] > 0 ? date('Y-m-d H:i',$info['top_end_time']) : date('Y-m-d H:i',strtotime('-1 month')); |
|||
$info['img'] = unserialize($info['img']); |
|||
$info['img_url'] = []; |
|||
foreach ($info['img'] as $imgVal) $info['img_url'][] = tomedia($imgVal); |
|||
if ($info['video_img_link']) $info['video_img_link_url'] = tomedia($info['video_img_link']); |
|||
if ($info['video_link']) $info['video_link_url'] = tomedia($info['video_link']); |
|||
if ($info['recruit_img']) $info['recruit_img_url'] = tomedia($info['recruit_img']); |
|||
unset($info['id'],$info['uniacid'],$info['aid'],$info['job_description']); |
|||
$cultivateClassList = $this->cultivateClassList($info['job_type']); |
|||
}else{ |
|||
//添加信息准备 |
|||
$sort = pdo_fetchcolumn("SELECT MAX(id) FROM ".tablename(PDO_NAME."recruit_recruit")); |
|||
} |
|||
|
|||
include wl_template('recruit/edit'); |
|||
} |
|||
|
|||
public function cultivateClassList($job_type = 0) { |
|||
global $_GPC; |
|||
if ($job_type) { |
|||
return Category::getCategoryRecruit($job_type); |
|||
} |
|||
if ($_GPC['job_type']) { |
|||
$list = Category::getCategoryRecruit($_GPC['job_type']); |
|||
show_json(1,['list' => $list]); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 删除招聘信息 |
|||
* Author: zzw |
|||
* Date: 2020/12/3 15:20 |
|||
*/ |
|||
public function recruitDel(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids'] ? : []; |
|||
pdo_delete(PDO_NAME."recruit_recruit",['id IN'=>$ids]); |
|||
|
|||
show_json(1, "删除成功"); |
|||
} |
|||
/** |
|||
* Comment: 查看招聘信息 |
|||
* Author: zzw |
|||
* Date: 2021/1/11 14:54 |
|||
*/ |
|||
public function recruitSee(){ |
|||
global $_W,$_GPC; |
|||
//基本参数信息获取 |
|||
$id = $_GPC['id'] ? : ''; |
|||
//获取招聘信息 |
|||
$info = pdo_get(PDO_NAME."recruit_recruit",['id'=>$id]); |
|||
//获取行业职位信息 |
|||
$info['industry_pid_text'] = pdo_getcolumn(PDO_NAME."recruit_industry",['id'=>$info['industry_pid']],'title'); |
|||
$info['industry_id_text'] = pdo_getcolumn(PDO_NAME."recruit_industry",['id'=>$info['industry_id']],'title'); |
|||
$info['position_id_text'] = pdo_getcolumn(PDO_NAME."recruit_position",['id'=>$info['position_id']],'title'); |
|||
//获取发布方信息 招聘类型:1=个人招聘,2=企业招聘 |
|||
if($info['recruitment_type'] == 1) $info['release_name'] = pdo_getcolumn(PDO_NAME."member",['id'=>$info['release_mid']],'nickname'); |
|||
else $info['release_name'] = pdo_getcolumn(PDO_NAME."merchantdata",['id'=>$info['release_sid']],'storename'); |
|||
//职位福利信息获取 |
|||
if($info['job_type'] == 1) { |
|||
//处理福利标签信息 |
|||
$welfare = $info['welfare'] ? explode(',',$info['welfare']) : []; |
|||
$info['welfare'] = pdo_getall(PDO_NAME."recruit_label",['id IN'=>$welfare],['title']); |
|||
} |
|||
//获取工作区域信息 |
|||
$info['work_province_text'] = pdo_getcolumn(PDO_NAME."area",['id'=>$info['work_province']],'name'); |
|||
$info['work_city_text'] = pdo_getcolumn(PDO_NAME."area",['id'=>$info['work_city']],'name'); |
|||
$info['work_area_text'] = pdo_getcolumn(PDO_NAME."area",['id'=>$info['work_area']],'name'); |
|||
//获取学历要求 |
|||
if($info['education_label_id'] > 0) $info['education'] = pdo_getcolumn(PDO_NAME."recruit_label",['id'=>$info['education_label_id']],'title'); |
|||
else $info['education'] = '学历不限'; |
|||
//获取经验要求 |
|||
if($info['experience_label_id'] > 0) $info['experience'] = pdo_getcolumn(PDO_NAME."recruit_label",['id'=>$info['experience_label_id']],'title'); |
|||
else $info['experience'] = '经验不限'; |
|||
//职位描述信息处理 |
|||
$info['job_description'] = htmlspecialchars_decode($info['job_description']); |
|||
// 类型分类 |
|||
$info['cc_str'] = pdo_getcolumn(PDO_NAME . 'cultivate_class',['id' => $info['cc_id']],'name'); |
|||
|
|||
|
|||
include wl_template('recruit/see'); |
|||
} |
|||
/** |
|||
* Comment: 修改招聘信息状态 |
|||
* Author: zzw |
|||
* Date: 2021/1/11 11:39 |
|||
*/ |
|||
public function changeRecruitStatus(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$ids = $_GPC['ids'] or show_json(0,"参数错误,请刷新重试!"); |
|||
$status = $_GPC['status'] or show_json(0,"参数错误,请刷新重试!"); |
|||
$reson = $_GPC['reason']; |
|||
//修改状态 |
|||
if(is_array($ids)) pdo_update(PDO_NAME."recruit_recruit",['status'=>$status],['id IN'=>$ids]); |
|||
else pdo_update(PDO_NAME."recruit_recruit",['status'=>$status,'reason' =>$reson ],['id'=>$ids]); |
|||
|
|||
|
|||
show_json(1, "操作成功"); |
|||
} |
|||
/** |
|||
* Comment: 导出招聘信息 |
|||
* Author: zzw |
|||
* Date: 2021/2/22 16:52 |
|||
* @param $list |
|||
*/ |
|||
public function recruitExport($list){ |
|||
//循环处理信息 |
|||
foreach($list as &$val){ |
|||
$val['create_time'] = date("Y-m-d H:i",$val['create_time']); |
|||
//职位信息获取 |
|||
$val['position'] = pdo_getcolumn(PDO_NAME . "recruit_position" , ['id' => $val['position_id']] , 'title'); |
|||
//发布方信息 招聘类型:1=个人招聘,2=企业招聘 |
|||
if ($val['recruitment_type'] == 1) { |
|||
$val['release_type'] = '个人招聘'; |
|||
$val['release'] = pdo_getcolumn(PDO_NAME . "member" , ['id' => $val['release_mid']] , 'nickname'); |
|||
} else { |
|||
$val['release_type'] = '企业招聘'; |
|||
$val['release'] = pdo_getcolumn(PDO_NAME . "merchantdata" , ['id' => $val['release_sid']] , 'storename'); |
|||
} |
|||
//招聘状态 |
|||
switch ($val['status']){ |
|||
case 1:$val['status'] = '待付款';break; |
|||
case 2:$val['status'] = '审核中';break; |
|||
case 3:$val['status'] = '未通过';break; |
|||
case 4:$val['status'] = '招聘中';break; |
|||
case 5:$val['status'] = '已结束';break; |
|||
} |
|||
//是否置顶 |
|||
if($val['is_top'] == 1){ |
|||
$val['is_top'] = '置顶中'; |
|||
$val['top_end_time'] = date("Y-m-d H:i",$val['top_end_time']); |
|||
}else{ |
|||
$val['is_top'] = '未置顶'; |
|||
$val['top_end_time'] = ''; |
|||
} |
|||
//删除多余的信息 |
|||
unset($val['id'] , $val['position_id'] , $val['recruitment_type'] , $val['release_mid'] , $val['release_sid']); |
|||
} |
|||
//标题列表数组 |
|||
$title = [ |
|||
'title' => '职位名称', |
|||
'work_address' => '工作详细地址', |
|||
'contacts' => '联系人', |
|||
'contact_phone' => '联系方式', |
|||
'status' => '状态', |
|||
'create_time' => '发布时间', |
|||
'sort' => '排序', |
|||
'salary' => '薪资待遇', |
|||
'is_top' => '是否置顶', |
|||
'top_end_time' => '置顶结束时间', |
|||
'position' => '所属职位', |
|||
'release_type' => '招聘类型', |
|||
'release' => '发布方', |
|||
]; |
|||
//导出信息 |
|||
util_csv::export_csv_2($list, $title, '招聘信息.csv');die; |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* Comment: 简历列表 |
|||
* Author: zzw |
|||
* Date: 2020/12/4 14:02 |
|||
*/ |
|||
public function resumeList(){ |
|||
global $_W,$_GPC; |
|||
//参数获取 |
|||
$page = max(1 , intval($_GPC['page'])); |
|||
$pageIndex = 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$search = $_GPC['search'] ? : '';//真实姓名|手机号 |
|||
$jobType = $_GPC['job_type'] ? : 0;//工作类型:1=全职,2=兼职 |
|||
$isExport = $_GPC['export'] ? : '';//是否为导出操作 |
|||
//条件生成 |
|||
$where = " WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "; |
|||
if($search) $where .= " AND (name LIKE '%{$search}%' OR phone LIKE '%{$search}%') "; |
|||
if($jobType > 0) $where .= " AND job_type = {$jobType} "; |
|||
//条件生成 |
|||
$areaName = tablename(PDO_NAME.'area'); |
|||
$field = "id,name,phone,avatar,gender,work_status,job_type, |
|||
CASE WHEN experience_label_id > 0 THEN (SELECT title FROM ".tablename(PDO_NAME.'recruit_label')." WHERE id = experience_label_id ) |
|||
ELSE '无经验' |
|||
END as experience, |
|||
(SELECT title FROM ".tablename(PDO_NAME.'recruit_label')." WHERE id = education_label_id ) as education, |
|||
concat(expect_salary_min, |
|||
CASE WHEN job_type = 1 THEN '元/月' |
|||
ELSE '元/天' |
|||
END,' ~ ',expect_salary_max, |
|||
CASE WHEN job_type = 1 THEN '元/月' |
|||
ELSE '元/天' |
|||
END) as expect_salary,create_time, |
|||
concat( |
|||
(SELECT name FROM ".$areaName." WHERE id = expect_work_province ), |
|||
CASE WHEN expect_work_city > 0 THEN concat('.',(SELECT name FROM ".$areaName." WHERE id = expect_work_city )) |
|||
ELSE '' |
|||
END, |
|||
CASE WHEN expect_work_city > 0 AND expect_work_area > 0 THEN concat('.',(SELECT name FROM ".$areaName." WHERE id = expect_work_area )) |
|||
ELSE '' |
|||
END) as expect_work_address"; |
|||
$sql = " SELECT {$field} FROM ".tablename(PDO_NAME."recruit_resume"); |
|||
$order = ' ORDER BY create_time DESC,id DESC'; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex} "; |
|||
//列表获取并且处理 |
|||
if($isExport == 'export'){ |
|||
//导出操作 |
|||
$list = pdo_fetchall($sql.$where.$order); |
|||
if(is_array($list) && count($list) > 0) Recruit::exportResumeList($list); |
|||
else wl_message('暂无可导出信息'); |
|||
}else{ |
|||
//查看操作 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
} |
|||
//分页操作 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
include wl_template('resume/index'); |
|||
} |
|||
/** |
|||
* Comment: 简历查看 |
|||
* Author: zzw |
|||
* Date: 2020/12/4 17:08 |
|||
*/ |
|||
public function resumeSee(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = $_GPC['id'] ? : ''; |
|||
$isExport = $_GPC['export'] ? : '';//是否为导出操作 |
|||
//信息获取并且处理 |
|||
$info = pdo_get(PDO_NAME."recruit_resume",['id'=>$id]); |
|||
//判断是否为导出信息 |
|||
if($isExport == 'export') Recruit::exportResumeInfo($info); |
|||
//上岗状态 |
|||
switch ($info['work_status']){ |
|||
case 1:$info['work_status'] = '随时上岗';break; |
|||
case 2:$info['work_status'] = '一周之内';break; |
|||
case 3:$info['work_status'] = '一月之内';break; |
|||
case 4:$info['work_status'] = '考虑中';break; |
|||
case 5:$info['work_status'] = '无换岗意向';break; |
|||
} |
|||
//获取工作经验信息 |
|||
if($info['experience_label_id'] > 0) $info['experience'] = pdo_getcolumn(PDO_NAME."recruit_label",['id'=>$info['experience_label_id']],'title'); |
|||
else $info['experience'] = '无工作经验'; |
|||
//最高学历 |
|||
$info['education'] = pdo_getcolumn(PDO_NAME."recruit_label",['id'=>$info['education_label_id']],'title'); |
|||
//通过出生日期获取年龄信息 |
|||
$info['age'] = Recruit::getAge(date("Y-m-d",$info['birth_time'])); |
|||
//求职意向 |
|||
$expectPositionIds = explode(',',$info['expect_position']); |
|||
$expectPosition = pdo_getall(PDO_NAME."recruit_position",['id IN'=>$expectPositionIds],['title']); |
|||
$info['expect_position'] = array_column($expectPosition,'title'); |
|||
//期望工作区域 |
|||
$info['expect_work_province'] = pdo_getcolumn(PDO_NAME."area",['id'=>$info['expect_work_province']],'name'); |
|||
$info['expect_work_city'] = pdo_getcolumn(PDO_NAME."area",['id'=>$info['expect_work_city']],'name'); |
|||
$info['expect_work_area'] = pdo_getcolumn(PDO_NAME."area",['id'=>$info['expect_work_area']],'name'); |
|||
//工作经历 |
|||
$info['work_experience'] = unserialize($info['work_experience']); |
|||
//教育经历 |
|||
$info['educational_experience'] = unserialize($info['educational_experience']); |
|||
//在校职务 |
|||
$info['school_office'] = unserialize($info['school_office']); |
|||
//删除多余的信息 |
|||
unset($info['id'],$info['uniacid'],$info['aid'],$info['experience_label_id'],$info['education_label_id'],$info['birth_time']); |
|||
|
|||
include wl_template('resume/see'); |
|||
} |
|||
/** |
|||
* Comment: 删除简历信息 |
|||
* Author: zzw |
|||
* Date: 2021/1/6 11:41 |
|||
*/ |
|||
public function resumeDel(){ |
|||
global $_W,$_GPC; |
|||
$ids = $_GPC['ids'] ? : []; |
|||
pdo_delete(PDO_NAME."recruit_resume",['id IN'=>$ids]); |
|||
|
|||
show_json(1, "删除成功"); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 行业职位三级联动 —— 改变上级行业时获取子行业信息 |
|||
* Author: zzw |
|||
* Date: 2020/12/1 15:41 |
|||
*/ |
|||
public function getSubIndustry(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = $_GPC['id'] OR wl_json(0,'参数错误,请刷新重试'); |
|||
//列表信息获取 |
|||
$list = $twoOne = Recruit::getIndustryList(['pid'=>$id],['id','title']);//子行业信息列表 |
|||
|
|||
wl_json(1,'子行业列表信息',$list); |
|||
} |
|||
/** |
|||
* Comment: 行业职位三级联动 —— 改变子行业时获取职位信息 |
|||
* Author: zzw |
|||
* Date: 2020/12/1 15:54 |
|||
*/ |
|||
public function getPosition(){ |
|||
global $_W,$_GPC; |
|||
//参数信息获取 |
|||
$id = $_GPC['id'] OR wl_json(0,'参数错误,请刷新重试'); |
|||
//列表信息获取 |
|||
$list = $twoOne = Recruit::getPositionList(['industry_id'=>$id],['id','title']);//子行业信息列表 |
|||
|
|||
wl_json(1,'子行业列表信息',$list); |
|||
} |
|||
/** |
|||
* Comment: 求职招聘基本设置信息 |
|||
* Author: zzw |
|||
* Date: 2020/12/3 17:15 |
|||
*/ |
|||
public function setEdit(){ |
|||
global $_W,$_GPC; |
|||
$name = 'recruit_set'; |
|||
if($_W['ispost']){ |
|||
$data = $_GPC['data']; |
|||
|
|||
Setting::agentsetting_save($data,$name); |
|||
wl_message('设置成功!' , web_url('recruit/recruitment/setEdit') , 'success'); |
|||
} |
|||
//获取已存在的设置信息 |
|||
$info = Setting::agentsetting_read($name); |
|||
|
|||
include wl_template('set'); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('recruit/industryPosition/industryList')}">行业列表</a></li> |
|||
<li class="active"><a href="javascript:;">{if $id}编辑{else}添加{/if}行业</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"> |
|||
<label class="col-sm-2 control-label">上级行业</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[pid]" class="form-control select2" {if $info['sub'] > 0}disabled="disabled"{/if}> |
|||
<option value="0">请选择一个行业</option> |
|||
{loop $pList $pItem} |
|||
<option value="{$pItem['id']}" {if $info['pid'] == $pItem['id']}selected="selected"{/if}>{$pItem['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
<div class="help-block"> |
|||
{if $info['sub'] > 0}<span style="color: #ed5565;">当前行业存在子行业信息,禁止修改上级行业信息。</span>{/if}不选择上级行业则代表当前行业为一级行业 |
|||
</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="text" required name="data[title]" value="{$info['title']}" maxlength="45"/> |
|||
</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" digits="true" name="data[sort]" value="{$info['sort']}" /> |
|||
</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="{$id}" /> |
|||
<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,169 @@ |
|||
{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('recruit/industryPosition/industryEdit')}" class="btn btn-primary">添加行业</a> |
|||
<a href="javascript:;" class="btn btn-success" id="wholeButton" data-status="1">全部展开</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="recruit" /> |
|||
<input type="hidden" name="ac" value="industryPosition" /> |
|||
<input type="hidden" name="do" value="industryList" /> |
|||
<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/industryList')}" class="btn btn-danger">清除</a> |
|||
<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="table-responsive order-list"> |
|||
<table class="table table-hover"> |
|||
<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> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $item} |
|||
<tr class="text-center"> |
|||
<td> |
|||
<input type="checkbox" value="{$item['id']}" /> |
|||
</td> |
|||
<td class="text-left"> |
|||
<div> |
|||
<span>{$item['title']}</span> |
|||
<span class="category-caret"> |
|||
<i class="fa fa-caret-down hide hideButton" data-pid="{$item['id']}"></i> |
|||
<i class="fa fa-caret-up showButton" data-pid="{$item['id']}"></i> |
|||
</span> |
|||
</div> |
|||
</td> |
|||
<td>{$item['sort']}</td> |
|||
<td>{php echo date("Y-m-d H:i:s",$item['create_time']);}</td> |
|||
<td> |
|||
<a href="{php echo web_url('recruit/industryPosition/industryEdit',['id'=>$item['id']])}" class="btn btn-warning btn-sm">编辑</a> |
|||
<a href="{php echo web_url('recruit/industryPosition/industryDel',['ids'=>$item['id']])}"class="btn btn-danger btn-sm" data-toggle="ajaxRemove" data-confirm="删除上级行业将删除此行业下所有子行业和职位信息,确定删除当前行业?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{loop $item['list'] $vo} |
|||
<tr class="text-center two-industry industry_{$item['id']} hide"> |
|||
<td> |
|||
<input type="checkbox" value="{$vo['id']}" /> |
|||
</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;"> |
|||
{$vo['title']} |
|||
</div> |
|||
</td> |
|||
<td>{$vo['sort']}</td> |
|||
<td>{php echo date("Y-m-d H:i:s",$vo['create_time']);}</td> |
|||
<td class="text-center"> |
|||
<a href="{php echo web_url('recruit/industryPosition/industryEdit',['id'=>$vo['id']])}" class="btn btn-warning btn-sm">编辑</a> |
|||
<a href="{php echo web_url('recruit/industryPosition/industryDel',['ids'=>$item['id']])}"class="btn btn-danger btn-sm" data-toggle="ajaxRemove" data-confirm="确定删除当前行业?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
{/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('recruit/industryPosition/industryDel')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 点击显示子行业信息 |
|||
*/ |
|||
$(".showButton").on('click',function () { |
|||
let pid = $(this).data("pid"); |
|||
//显示对应的子行业列表信息 |
|||
$(".industry_"+pid).removeClass('hide'); |
|||
//隐藏显示按钮 显示隐藏按钮 |
|||
$(this).addClass('hide'); |
|||
$(this).siblings('.hideButton').removeClass('hide'); |
|||
}); |
|||
/** |
|||
* 点击隐藏子行业信息 |
|||
*/ |
|||
$(".hideButton").on('click',function () { |
|||
let pid = $(this).data("pid"); |
|||
//显示对应的子行业列表信息 |
|||
$(".industry_"+pid).addClass('hide'); |
|||
//隐藏显示按钮 显示隐藏按钮 |
|||
$(this).addClass('hide'); |
|||
$(this).siblings('.showButton').removeClass('hide'); |
|||
}); |
|||
/** |
|||
* 全部展开/全部折叠 |
|||
*/ |
|||
$("#wholeButton").on('click',function () { |
|||
let status = $(this).data("status"); |
|||
if(status == 1){ |
|||
//全部展开 |
|||
$(".showButton").addClass('hide'); |
|||
$(".hideButton").removeClass('hide'); |
|||
$(".two-industry").removeClass('hide'); |
|||
$(this).data('status',0); |
|||
$(this).html('全部折叠'); |
|||
}else{ |
|||
//全部隐藏 |
|||
$(".showButton").removeClass('hide'); |
|||
$(".hideButton").addClass('hide'); |
|||
$(".two-industry").addClass('hide'); |
|||
$(this).data('status',1); |
|||
$(this).html('全部展开'); |
|||
} |
|||
}); |
|||
/** |
|||
* 默认行业信息生成 |
|||
*/ |
|||
$("#createButton").on('click',function () { |
|||
tip.confirm('是否生成默认的行业信息?',function () { |
|||
//显示加载动画 |
|||
$("#page-loading").show(); |
|||
//请求生成 |
|||
let link = "{php echo web_url('recruit/industryPosition/industryDefaultInfo');}"; |
|||
$.post(link,function (res) { |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
},'json'); |
|||
}); |
|||
}); |
|||
|
|||
|
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,46 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('recruit/recruitment/labelList')}">标签列表</a></li> |
|||
<li class="active"><a href="javascript:;">{if $id}编辑{else}添加{/if}标签</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"> |
|||
<label class="col-sm-2 control-label">标签类型</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[type]" class="form-control "> |
|||
<option value="1" {if $info['type'] == 1}selected="selected"{/if}>学历要求</option> |
|||
<option value="2" {if $info['type'] == 2}selected="selected"{/if}>职位福利</option> |
|||
<option value="3" {if $info['type'] == 3}selected="selected"{/if}>经验标签</option> |
|||
<option value="4" {if $info['type'] == 4}selected="selected"{/if}>企业规模</option> |
|||
<option value="5" {if $info['type'] == 5}selected="selected"{/if}>企业性质</option> |
|||
</select> |
|||
</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="45"/> |
|||
</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" digits="true" name="data[sort]" value="{$info['sort']}" /> |
|||
</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="{$id}" /> |
|||
<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,120 @@ |
|||
{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('recruit/recruitment/labelEdit')}" class="btn btn-primary">添加标签</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="recruit" /> |
|||
<input type="hidden" name="ac" value="recruitment" /> |
|||
<input type="hidden" name="do" value="labelList" /> |
|||
<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">全部</option> |
|||
<option value="1" {if $type == 1}selected="selected"{/if}>学历要求</option> |
|||
<option value="2" {if $type == 2}selected="selected"{/if}>职位福利</option> |
|||
<option value="3" {if $type == 3}selected="selected"{/if}>经验标签</option> |
|||
<option value="4" {if $type == 4}selected="selected"{/if}>企业规模</option> |
|||
<option value="5" {if $type == 5}selected="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('recruit/recruitment/labelList')}" 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" /></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 $key $item} |
|||
<tr class="text-center"> |
|||
<td><input type="checkbox" value="{$item['id']}" /></td> |
|||
<td>{$item['title']}</td> |
|||
<td> |
|||
{if $item['type'] == '1'} |
|||
<label class="label label-primary">学历要求</label> |
|||
{elseif $item['type'] == '2'} |
|||
<label class="label label-danger">职位福利</label> |
|||
{elseif $item['type'] == '3'} |
|||
<label class="label label-success">经验标签</label> |
|||
{elseif $item['type'] == '4'} |
|||
<label class="label label-inverse">企业规模</label> |
|||
{elseif $item['type'] == '5'} |
|||
<label class="label label-default">企业性质</label> |
|||
{/if} |
|||
</td> |
|||
<td>{$item['sort']}</td> |
|||
<td>{php echo date("Y-m-d H:i:s",$item['create_time']);}</td> |
|||
<td> |
|||
<a href="{php echo web_url('recruit/recruitment/labelEdit',['id'=>$item['id']])}" class="btn btn-warning btn-sm">编辑</a> |
|||
<a href="{php echo web_url('recruit/recruitment/labelDel',['ids'=>$item['id']])}" class="btn btn-danger btn-sm" data-toggle="ajaxRemove" 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('recruit/recruitment/labelDel')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 默认职位信息生成 |
|||
*/ |
|||
$("#createButton").on('click',function () { |
|||
tip.confirm('是否确认生成默认的标签信息?',function () { |
|||
//显示加载动画 |
|||
$("#page-loading").show(); |
|||
//请求生成 |
|||
let link = "{php echo web_url('recruit/recruitment/labelDefaultInfo');}"; |
|||
$.post(link,function (res) { |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
},'json'); |
|||
}); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,192 @@ |
|||
{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="recruit" /> |
|||
<input type="hidden" name="ac" value="recruitOrder" /> |
|||
<input type="hidden" name="do" value="index" /> |
|||
<input type="hidden" name="recruitment_type" value="{$recruitmentType}" /> |
|||
<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="row row-fix js-address-selector"> |
|||
<div class="col-md-4"> |
|||
<select name="industry_pid" class="form-control"> |
|||
<option value="0">全部</option> |
|||
{loop $industry $oneItem} |
|||
<option value="{$oneItem['id']}" {if $oneItem['id'] == $industryPid}selected="selected"{/if}>{$oneItem['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<select name="industry_id" class="form-control"> |
|||
<option value="0">全部</option> |
|||
{loop $subIndustry $subItem} |
|||
<option value="{$subItem['id']}" {if $subItem['id'] == $industryId}selected="selected"{/if}>{$subItem['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<select name="position_id" class="form-control"> |
|||
<option value="0">全部</option> |
|||
{loop $position $positionItem} |
|||
<option value="{$positionItem['id']}" {if $positionItem['id'] == $positionId}selected="selected"{/if}>{$positionItem['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</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('recruitment_type:0');}" class="btn {if $recruitmentType == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('recruitment_type:1');}" class="btn {if $recruitmentType == 1}btn-primary{else}btn-default{/if}">个人招聘</a> |
|||
<a href="{php echo wl_filter_url('recruitment_type:2');}" class="btn {if $recruitmentType == 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"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('recruit/recruitOrder/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">发布方(<span class="text-primary">用户</span>/<span class="text-danger">企业</span>)</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 $key $val} |
|||
<tr class="text-center"> |
|||
<td>{$val['orderno']}</td> |
|||
<td> |
|||
<div style="height: 50px;float: left"> |
|||
<div style="width: 50px;height: 50px;float: left;"> |
|||
<img src="{$val['release_logo']}" style="width: 100%;height: 100%"/> |
|||
</div> |
|||
<div class="{if $val['recruitment_type'] == 1}text-primary{else}text-danger{/if}" style="float:left;height: 50px;line-height: 25px;margin-left: 5px"> |
|||
{$val['release_name']} |
|||
</divcl> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
{if $val['recruitment_type'] == 1} |
|||
<label class="label label-success">个人招聘</label> |
|||
{else} |
|||
<label class="label label-danger">企业招聘</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $val['fightstatus'] == 2} |
|||
<label class="label label-primary">置顶</label> |
|||
{else} |
|||
<label class="label label-inverse">发布</label> |
|||
{/if} |
|||
</td> |
|||
<td>{$val['title']}</td> |
|||
<td>{$val['price']}</td> |
|||
<td> |
|||
{if $val['status'] > 0 && $val['status'] != 5} |
|||
{if $val['paytype']==1} |
|||
<span> <i class="icow icow-yue text-warning" style="font-size: 17px;"></i><span>余额支付</span></span> |
|||
{elseif $val['paytype']==2} |
|||
<span> <i class="icow icow-weixinzhifu text-success" style="font-size: 17px"></i>微信支付</span> |
|||
{elseif $val['paytype']==3} |
|||
<span><i class="icow icow-zhifubaozhifu text-primary" style="font-size: 17px"></i>支付宝支付</span> |
|||
{else} |
|||
<label class='label label-danger'>未知方式</label> |
|||
{/if} |
|||
{else} |
|||
<label class='label label-default'>未支付</label> |
|||
{/if} |
|||
</td> |
|||
<td>{if $val['paytime'] > 0}{php echo date("Y-m-d H:i:s",$val['paytime']);}{/if}</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!--操作按钮 分页信息--> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
//行业职位三级联动 —— 改变上级行业时重新生成子行业信息 |
|||
$("[name='industry_pid']").on('change',function () { |
|||
let id = $(this).val(); |
|||
let html = '<option value="0">全部</option>'; |
|||
if(id > 0){ |
|||
//选择了行业信息 |
|||
$.post("{php echo web_url('recruit/recruitment/getSubIndustry');}",{id:id},function (res) { |
|||
if(res.errno == 1){ |
|||
$.each(res.data,function (k,v) { |
|||
html += '<option value="'+v['id']+'">'+v['title']+'</option>'; |
|||
}); |
|||
$("[name='industry_id']").html(html).change(); |
|||
}else{ |
|||
tip.alert(res.message) |
|||
} |
|||
},'json'); |
|||
}else{ |
|||
//选择了全部 |
|||
$("[name='industry_id']").html(html).change(); |
|||
} |
|||
}); |
|||
//行业职位三级联动 —— 改变子行业时重新生成职位信息 |
|||
$("[name='industry_id']").on('change',function () { |
|||
let id = $(this).val(); |
|||
let html = '<option value="0">全部</option>'; |
|||
if(id > 0){ |
|||
//选择了行业信息 |
|||
$.post("{php echo web_url('recruit/recruitment/getPosition');}",{id:id},function (res) { |
|||
if(res.errno == 1){ |
|||
$.each(res.data,function (k,v) { |
|||
html += '<option value="'+v['id']+'">'+v['title']+'</option>'; |
|||
}); |
|||
$("[name='position_id']").html(html); |
|||
}else{ |
|||
tip.alert(res.message) |
|||
} |
|||
},'json'); |
|||
}else{ |
|||
//选择了全部 |
|||
$("[name='position_id']").html(html); |
|||
} |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,48 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('recruit/industryPosition/positionList')}">职位列表</a></li> |
|||
<li class="active"><a href="javascript:;">{if $id}编辑{else}添加{/if}职位</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"> |
|||
<label class="col-sm-2 control-label">所属行业<span class="must-fill">*</span></label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[industry_id]" class="form-control select2"> |
|||
{loop $industryList $val} |
|||
<optgroup label="{$val['title']}"> |
|||
{loop $val['list'] $vo} |
|||
<option value="{$vo['id']}" {if $info['industry_id'] == $vo['id']}selected="selected"{/if}>{$vo['title']}</option> |
|||
{/loop} |
|||
</optgroup> |
|||
{/loop} |
|||
</select> |
|||
</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="45"/> |
|||
</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" digits="true" name="data[sort]" value="{$info['sort']}" /> |
|||
</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="{$id}" /> |
|||
<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,168 @@ |
|||
{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('recruit/industryPosition/positionEdit')}" class="btn btn-primary">添加职位</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="recruit" /> |
|||
<input type="hidden" name="ac" value="industryPosition" /> |
|||
<input type="hidden" name="do" value="positionList" /> |
|||
<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="industry_pid" class="form-control select2"> |
|||
<option value="0">全部</option> |
|||
{loop $industryList $industryVo} |
|||
<option value="{$industryVo['id']}" {if $industryPid == $industryVo['id']}selected="selected"{/if}>{$industryVo['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">子行业</label> |
|||
<div class="col-sm-9"> |
|||
<select name="industry_id" class="form-control select2"> |
|||
<option value="0">全部</option> |
|||
{loop $subList $subVo} |
|||
<option value="{$subVo['id']}" {if $industryId == $subVo['id']}selected="selected"{/if}>{$subVo['title']}</option> |
|||
{/loop} |
|||
</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('recruit/industryPosition/positionList')}" class="btn btn-danger">清除</a> |
|||
<button class="btn btn-warning" type="submit" name="export" value="1">导出</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"><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> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $item} |
|||
<tr class="text-center"> |
|||
<td><input type="checkbox" value="{$item['id']}" /></td> |
|||
<td>{$item['industry_one_title']} - {$item['industry_two_title']}</td> |
|||
<td>{$item['title']}</td> |
|||
<td>{$item['sort']}</td> |
|||
<td>{php echo date("Y-m-d H:i:s",$item['create_time']);}</td> |
|||
<td> |
|||
<a href="{php echo web_url('recruit/industryPosition/positionEdit',['id'=>$item['id']])}" class="btn btn-warning btn-sm">编辑</a> |
|||
<a href="{php echo web_url('recruit/industryPosition/positionDel',['ids'=>$item['id']])}"class="btn btn-danger btn-sm" data-toggle="ajaxRemove" 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('recruit/industryPosition/positionDel')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!--进度框--> |
|||
<div class="upgrade-modal-page"> |
|||
<div class="upgrade-modal-mask"> |
|||
<div class="upgrade-modal"> |
|||
<div> |
|||
<img src="../addons/{MODULE_NAME}/web/resource/images/upgrade.png"/> |
|||
</div> |
|||
<div class="progress"> |
|||
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div> |
|||
</div> |
|||
<div class="upgrade-modal-tip"> |
|||
系统正在为您生成默认的职位信息,请耐心等待~~~ |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
/** |
|||
* 默认职位信息生成 |
|||
*/ |
|||
$("#createButton").on('click',function () { |
|||
tip.confirm('生成职位信息需要先生成默认行业信息,否则生成空的职位信息。是否生成默认的职位信息?',function () { |
|||
//显示加载动画 |
|||
$(".upgrade-modal-page").modal(); |
|||
//请求生成 |
|||
let link = "{php echo web_url('recruit/industryPosition/positionDefaultInfo');}"; |
|||
let eachList = function(){ |
|||
$.post(link,function (res) { |
|||
if(res.errno == 1 && res.data['total'] > 0){ |
|||
let rate = res.data['rate']+'%'; |
|||
$(".progress-bar").css({"width":rate}); |
|||
$(".progress-bar").html(rate); |
|||
eachList(); |
|||
}else{ |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
} |
|||
},'json'); |
|||
} |
|||
eachList(); |
|||
}); |
|||
}); |
|||
/** |
|||
* 上级行业和子行业联动操作 |
|||
*/ |
|||
$("[name='industry_pid']").on('change',function () { |
|||
let id = $(this).val(), |
|||
link = "{php echo web_url('recruit/industryPosition/industrySubList');}"; |
|||
//请求获取子行业信息 |
|||
$.post(link,{id:id},function (res) { |
|||
if(res.errno == 1){ |
|||
let data = res.data, |
|||
html = '<option value="0">全部</option>'; |
|||
//循环生成子行业信息 |
|||
$.each(data,function (k,v) { |
|||
html += '<option value="'+v['id']+'">'+v['title']+'</option>'; |
|||
}); |
|||
//替换信息 |
|||
$("[name='industry_id']").html(html); |
|||
}else{ |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
} |
|||
},'json'); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,621 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('recruit/recruitment/recruitList')}">招聘列表</a></li> |
|||
<li class="active"><a href="javascript:;">{if $id}编辑{else}发布{/if}招聘信息</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default" id="recruitContent"> |
|||
<form class="form-horizontal form-validate" method="post"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">职位名称</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" required v-model="info.title" maxlength="45"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">行业职位</label> |
|||
<div class="col-sm-9"> |
|||
<div class="row row-fix js-address-selector"> |
|||
<div class="col-md-4"> |
|||
<select v-model="info.industry_pid" class="form-control"> |
|||
<option v-for="(item,index) in industryList" :value="item.id">{{ item.title }}</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<select v-model="info.industry_id" class="form-control"> |
|||
<option v-for="(item,index) in subIndustryList" :value="item.id">{{ item.title }}</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<select v-model="info.position_id" class="form-control"> |
|||
<option v-for="(item,index) in positionList" :value="item.id">{{ item.title }}</option> |
|||
</select> |
|||
</div> |
|||
</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" v-model="info.recruitment_type" @click="tempHandle" value="1">个人招聘 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="info.recruitment_type" @click="tempHandle" value="2">企业招聘 |
|||
</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" v-model="info.is_top" value="0"> 不置顶 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="info.is_top" value="1"> 置顶 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div :class="{'form-group':true,'hide':(info.is_top != 1)}"> |
|||
<label class="col-sm-2 control-label">置顶结束时间</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="top_end_time" value="{$info['top_end_time']}" |
|||
placeholder="请选择日期时间" |
|||
readonly="readonly" |
|||
class="datetimepicker form-control valid" |
|||
style="padding-left: 12px;" aria-invalid="false"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" v-if="info.recruitment_type == 1"> |
|||
<label class="col-sm-2 control-label">发布人</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" value="{$user['nickname']}" class="form-control user_nickname"> |
|||
<input type="hidden" class="user_mid"> |
|||
<span class="btn input-group-addon" data-toggle="selectUser">选择用户</span> |
|||
</div> |
|||
<div class="input-group" style="margin-top:.5em;"> |
|||
<img src="{$user['avatar']}" onerror="this.src='./resource/images/nopic.jpg'" class="img-responsive img-thumbnail" width="132" data-times="1"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" v-if="info.recruitment_type == 2"> |
|||
<label class="col-sm-2 control-label">发布企业</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" value="{$shop['storename']}" class="form-control shop_name"> |
|||
<input type="hidden" class="shop_id"> |
|||
<span class="btn input-group-addon" data-toggle="selectShop">选择商家</span> |
|||
</div> |
|||
<div class="input-group" style="margin-top:.5em;"> |
|||
<img src="{php echo tomedia($shop['logo'])}" onerror="this.src='./resource/images/nopic.jpg'" class="img-responsive img-thumbnail" width="132" data-times="1"> |
|||
</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" v-model="info.job_type" value="1" @click="changeClass(1)">全职 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="info.job_type" value="2" @click="changeClass(2)">兼职 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="info.job_type" value="3" @click="changeClass(3)">实习 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">类型分类</label> |
|||
<div class="col-sm-9"> |
|||
<select v-model="info.cc_id" class="form-control"> |
|||
<option v-for="(item,index) in cultivateClassList" :value="item.id">{{ item.name }}</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<!--全职 —— 输入信息--> |
|||
<div class="form-group" v-if="info.job_type == 1 || info.job_type == 3"> |
|||
<label class="col-sm-2 control-label">薪资待遇</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="info.full_type" value="1">面议 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="info.full_type" value="2">指定 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" v-if="(info.job_type == 1 || info.job_type == 3) && info.full_type == 2"> |
|||
<label class="col-sm-2 control-label">每月薪资</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" digits="true" v-model="info.full_salary_min" class="form-control"> |
|||
<span class="btn input-group-addon">元 ~ </span> |
|||
<input type="number" digits="true" v-model="info.full_salary_max" class="form-control"> |
|||
<span class="btn input-group-addon">元</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" v-if="info.job_type == 1 || info.job_type == 3"> |
|||
<label class="col-sm-2 control-label">职位福利</label> |
|||
<div class="col-sm-9"> |
|||
<label class="checkbox checkbox-inline" v-for="(item,index) in welfareLabel" style="margin-left: 0;margin-right: 20px;"> |
|||
<input type="checkbox" v-model="info.welfare" :value="item.id"> {{item.title}} |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<!--兼职 —— 输入信息--> |
|||
<div class="form-group" v-if="info.job_type == 2"> |
|||
<label class="col-sm-2 control-label">薪资待遇</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" digits="true" v-model="info.part_salary" class="form-control"> |
|||
<span class="btn input-group-addon" style="padding: 0!important;"> |
|||
<select v-model="info.part_type" style="height: 32px!important;border: none;padding-right: 45px;"> |
|||
<option value="1">元/时 </option> |
|||
<option value="2">元/天 </option> |
|||
<option value="3">元/月 </option> |
|||
</select> |
|||
</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" v-if="info.job_type == 2"> |
|||
<label class="col-sm-2 control-label">结算方式</label> |
|||
<div class="col-sm-9"> |
|||
<select v-model="info.part_settlement" class="form-control"> |
|||
<option value="1">日结</option> |
|||
<option value="2">周结</option> |
|||
<option value="3">月结</option> |
|||
<option value="4">完工结算</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">工作区域</label> |
|||
<div class="col-sm-9"> |
|||
<div class="row row-fix js-address-selector"> |
|||
<div class="col-md-4"> |
|||
<select v-model="info.work_province" class="form-control"> |
|||
<option v-for="(item,index) in provinceList" :value="item.id">{{ item.name }}</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<select v-model="info.work_city" class="form-control"> |
|||
<option v-for="(item,index) in cityList" :value="item.id">{{ item.name }}</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<select v-model="info.work_area" class="form-control"> |
|||
<option v-for="(item,index) in areaList" :value="item.id">{{ item.name }}</option> |
|||
</select> |
|||
</div> |
|||
</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 class="form-control" value="{$info['work_address']}" id="c-address" type="text" required="required"> |
|||
<input class="form-control hide" value="{$info['work_lng']}" id="c-lng" type="text"> |
|||
<input class="form-control hide" value="{$info['work_lat']}" id="c-lat" type="text"> |
|||
<span class="btn input-group-addon" data-toggle="addresspicker" data-address-id="c-address" data-lng-id="c-lng" data-lat-id="c-lat">地图定位</span> |
|||
</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="text" required v-model="info.contacts"/> |
|||
</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 v-model="info.contact_phone"/> |
|||
</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" v-model="info.gender" value="1">不限 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="info.gender" value="2">男 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="info.gender" value="3">女 |
|||
</label> |
|||
</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="number" digits="true" v-model="info.age_min" class="form-control"> |
|||
<span class="btn input-group-addon">岁 ~ </span> |
|||
<input type="number" digits="true" v-model="info.age_max" class="form-control"> |
|||
<span class="btn input-group-addon">岁</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="number" digits="true" v-model="info.people_number" class="form-control"> |
|||
<span class="btn input-group-addon">人</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">学历要求</label> |
|||
<div class="col-sm-9"> |
|||
<select v-model="info.education_label_id" class="form-control"> |
|||
<option value="0">学历不限</option> |
|||
<option v-for="(item,index) in educationLabel" :value="item.id">{{ item.title }}</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">经验要求</label> |
|||
<div class="col-sm-9"> |
|||
<select v-model="info.experience_label_id" class="form-control"> |
|||
<option value="0">经验不限</option> |
|||
<option v-for="(item,index) in experienceLabel" :value="item.id">{{ item.title }}</option> |
|||
</select> |
|||
</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" v-model="info.status" value="2"> 审核中 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="info.status" value="3"> 未通过 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="info.status" value="4"> 招聘中 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="info.status" value="5"> 已结束 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">职位描述</label> |
|||
<div class="col-sm-9"> |
|||
<textarea placeholder="请输入职位描述..." class="form-control" rows="10" style="resize: none;font-size: 15px;" id="job_description">{$jobDescription}</textarea> |
|||
</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" class="form-control valid" value="批量上传图片" readonly="readonly" autocomplete="off" data-name="data[img]" id="cimg-data_img_"> |
|||
<span class="input-group-btn"> |
|||
<button class="btn btn-default" type="button" data-toggle="selectAttachment" data-input="#cimg-data_img_" data-img="#pimg-data_img_" data-multi="multi">选择图片</button> |
|||
</span> |
|||
</div> |
|||
<div class="input-group multi-img-details ui-sortable" id="pimg-data_img_"> |
|||
<div class="multi-item" v-for="(imgSrc) in info.img_url"> |
|||
<img v-bind:src="imgSrc" class="img-responsive img-thumbnail"> |
|||
<input type="hidden" name="data[img][]" :value="imgSrc"> |
|||
<em class="close" title="删除这张图片" onclick="$(this).closest('.multi-item').remove();">×</em> |
|||
</div> |
|||
</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[recruit_img]" :value="info.recruit_img" autocomplete="off" readonly="readonly" id="cimg-data_recruit_img_0" class="form-control"> |
|||
<span class="input-group-btn"> |
|||
<button type="button" data-toggle="selectAttachment" data-input="#cimg-data_recruit_img_0" data-img="#pimg-data_recruit_img_0" class="btn btn-default">选择图片</button> |
|||
</span> |
|||
</div> |
|||
<div class="input-group " style="margin-top: 0.5em;"> |
|||
<img v-bind:src="info.recruit_img_url" id="pimg-data_recruit_img_0" width="150" onerror="this.src='https://qingyuan.xingtongworld.com/addons/weliam_smartcity/web/resource/images/nopic-small.jpg'" class="img-responsive img-thumbnail" data-times="1"> |
|||
<em @click="recruitImgChange" class="close" style="position: absolute; top: 0px; right: -14px;">×</em> |
|||
</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[video_img_link]" :value="info.video_img_link" autocomplete="off" readonly="readonly" id="cimg-data_video_img_link_0" class="form-control"> |
|||
<span class="input-group-btn"> |
|||
<button type="button" data-toggle="selectAttachment" data-input="#cimg-data_video_img_link_0" data-img="#pimg-data_video_img_link_0" class="btn btn-default">选择图片</button> |
|||
</span> |
|||
</div> |
|||
<div class="input-group " style="margin-top: 0.5em;"> |
|||
<img v-bind:src="info.video_img_link_url" id="pimg-data_video_img_link_0" width="150" onerror="this.src='https://qingyuan.xingtongworld.com/addons/weliam_smartcity/web/resource/images/nopic-small.jpg'" class="img-responsive img-thumbnail" data-times="1"> |
|||
<em @click="videoImgLinkChange" class="close" style="position: absolute; top: 0px; right: -14px;">×</em> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="video-info"> |
|||
<label class="col-sm-2 control-label">视频</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" :value="info.video_link" name="data[video_link]" autocomplete="off" readonly="readonly" class="form-control"> |
|||
<span class="input-group-btn"> |
|||
<button type="button" @click="showVideoDialog(this)" class="btn btn-default">选择媒体文件</button> |
|||
</span> |
|||
</div> |
|||
<div v-if="info.video_link_url != ''" style="width: 300px;height: 300px;position: inherit;"> |
|||
<video style="max-height: 300px;" v-bind:src="info.video_link_url" controls="controls"> |
|||
您的浏览器不支持该视频播放,请更新浏览器或更换浏览器。 |
|||
</video> |
|||
<em class="close" title="删除视频" @click="delVideo" style="position: absolute; top: 0px; right: -15px;">×</em> |
|||
</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" v-model="info.sort"/> |
|||
</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" v-model="info.fictitious_pv"/> |
|||
</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="{$id}" />--> |
|||
<!-- <input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" />--> |
|||
<input type="button" value="提交" class="btn btn-primary col-sm-1 min-width" @click="submitInfo()" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
let recruit = new Vue({ |
|||
el:'#recruitContent', |
|||
data:{ |
|||
id:"{$id}", |
|||
industryList:JSON.parse('{php echo json_encode($oneIndustry)}'),//上级行业列表 |
|||
subIndustryList:JSON.parse('{php echo json_encode($subIndustryList)}'),//子行业列表 |
|||
positionList:JSON.parse('{php echo json_encode($positionList)}'),//职位信息列表 |
|||
provinceList:JSON.parse('{php echo json_encode($provinceList)}'),//省列表 |
|||
cityList:JSON.parse('{php echo json_encode($cityList)}'),//市列表 |
|||
areaList:JSON.parse('{php echo json_encode($areaList)}'),//区列表 |
|||
welfareLabel:JSON.parse('{php echo json_encode($welfareLabel)}'),//标签 - 职位福利 |
|||
educationLabel:JSON.parse('{php echo json_encode($educationLabel)}'),//标签 - 学历要求 |
|||
experienceLabel:JSON.parse('{php echo json_encode($experienceLabel)}'),//标签 - 经验要求 |
|||
cultivateClassList:JSON.parse('{php echo json_encode($cultivateClassList)}'),//分类 |
|||
//招聘信息 |
|||
info: JSON.parse('{php echo json_encode($info)}') ? JSON.parse('{php echo json_encode($info)}') : { |
|||
title: '',//职位名称 |
|||
industry_pid: '',//上级行业id |
|||
industry_id: '',//子行业id |
|||
position_id: '',//职位id |
|||
recruitment_type: 1,//招聘类型:1=个人招聘,2=企业招聘 |
|||
is_top: 0,//是否置顶:0=未置顶,1=置顶中 |
|||
top_end_time: 0,//置顶结束时间 |
|||
release_mid: '',//发布用户id |
|||
release_sid: '',//发布企业id |
|||
job_type: 1,//工作类型:1=全职,2=兼职 |
|||
full_type: 1,//全职 - 薪资待遇:1=面议,2=指定 |
|||
full_salary_min: '',//全职 - 薪资待遇:最低薪资 |
|||
full_salary_max: '',//全职 - 薪资待遇:最高薪资 |
|||
welfare:[],//全职 - 职位福利 |
|||
part_type: 1,//兼职 - 薪资类型:1=元/时,2=元/天,2=元/月 |
|||
part_salary: '',//兼职 - 薪资待遇:薪资金额 |
|||
part_settlement: 1,//兼职 - 结算方式:1=日结,2=周结,3=月结,4=完工结算 |
|||
work_province: '',//工作区域 - 省 |
|||
work_city: '',//工作区域 - 市 |
|||
work_area: '',//工作区域 - 区 |
|||
work_address: '',//工作详细地址 |
|||
work_lng:'',//经度 |
|||
work_lat:'',//纬度 |
|||
contacts:'',//联系人 |
|||
contact_phone:'',//联系方式 |
|||
gender: 1,//性别要求:1=不限,2=男,3=女 |
|||
age_min:'',//最小年龄要求 |
|||
age_max:'',//最大年龄要求 |
|||
people_number: 1,//招聘人数 |
|||
education_label_id: 0,//学历要求 |
|||
experience_label_id: 0,//经验要求 |
|||
status: 4,//招聘状态:1=待付款,2=审核中,3=未通过,4=招聘中,5=已结束 |
|||
job_description:'',//职位描述 |
|||
sort:"{php echo $sort ? : 0;}",//排序信息 |
|||
fictitious_pv: 0,//虚拟浏览量 |
|||
video_link: '',//招聘宣传视频 |
|||
video_img_link: '',//招聘宣传视频封面图 |
|||
img: [],//招聘宣传图集 |
|||
video_link_url: '',//招聘宣传视频(展示) |
|||
video_img_link_url: 'https://qingyuan.xingtongworld.com/addons/weliam_smartcity/web/resource/images/nopic-small.jpg',//招聘宣传视频封面图(展示) |
|||
img_url: [],//招聘宣传图集(展示) |
|||
recruit_img: '',//招聘封面图 |
|||
recruit_img_url: 'https://qingyuan.xingtongworld.com/addons/weliam_smartcity/web/resource/images/nopic-small.jpg',//招聘封面图(展示) |
|||
cc_id: '', // |
|||
}, |
|||
}, |
|||
watch: { |
|||
//行业职位三级联动 —— 改变上级行业时重新生成子行业信息 |
|||
'info.industry_pid'(){ |
|||
let _this = this; |
|||
$.post("{php echo web_url('recruit/recruitment/getSubIndustry');}",{id:this.info.industry_pid},function (res) { |
|||
if(res.errno == 1){ |
|||
_this.subIndustryList = res.data; |
|||
_this.info.industry_id = res.data[0].id; |
|||
}else{ |
|||
tip.alert(res.message) |
|||
} |
|||
},'json'); |
|||
}, |
|||
//行业职位三级联动 —— 改变子行业时重新生成职位信息 |
|||
'info.industry_id'(){ |
|||
let _this = this; |
|||
$.post("{php echo web_url('recruit/recruitment/getPosition');}",{id:this.info.industry_id},function (res) { |
|||
if(res.errno == 1){ |
|||
_this.positionList = res.data; |
|||
_this.info.position_id = res.data[0].id; |
|||
}else{ |
|||
tip.alert(res.message) |
|||
} |
|||
},'json'); |
|||
}, |
|||
//区域三级联动 —— 改变省时同步改变市级信息 |
|||
'info.work_province'(){ |
|||
let _this = this; |
|||
$.post("{php echo web_url('area/areaagent/getAreaInfo');}",{id:_this.info.work_province,lv:2},function (res) { |
|||
if(res.errno == 1){ |
|||
_this.cityList = res.data; |
|||
_this.info.work_city = res.data[0].id; |
|||
}else{ |
|||
tip.alert(res.message) |
|||
} |
|||
},'json'); |
|||
}, |
|||
//区域三级联动 —— 改变市时同步改变区级信息 |
|||
'info.work_city'(){ |
|||
let _this = this; |
|||
$.post("{php echo web_url('area/areaagent/getAreaInfo');}",{id:_this.info.work_city,lv:3},function (res) { |
|||
if(res.errno == 1){ |
|||
_this.areaList = res.data; |
|||
_this.info.work_area = res.data[0].id; |
|||
}else{ |
|||
tip.alert(res.message) |
|||
} |
|||
},'json'); |
|||
}, |
|||
}, |
|||
methods: { |
|||
//提交信息 |
|||
submitInfo(){ |
|||
let _this = this, |
|||
_info = _this.info; |
|||
//补充信息 —— 获取发布方信息 |
|||
_info.release_mid = $(".user_mid").val() ? $(".user_mid").val() : _info.release_mid ; |
|||
_info.release_sid = $(".shop_id").val() ? $(".shop_id").val() : _info.release_sid ; |
|||
//补充信息 —— 获取工作详细地址、经纬度 |
|||
_info.work_address = $("#c-address").val() ? $("#c-address").val() : _info.work_address ; |
|||
_info.work_lng = $("#c-lng").val() ? $("#c-lng").val() : _info.work_lng ; |
|||
_info.work_lat = $("#c-lat").val() ? $("#c-lat").val() : _info.work_lat ; |
|||
//获取文本信息 |
|||
_info.job_description = $("#job_description").val() ? $("#job_description").val() : _info.job_description ; |
|||
_info.img = $('input[name="data[img][]"]').map(function() { |
|||
return $(this).val(); |
|||
}).get(); |
|||
_info.video_img_link = $('input[name="data[video_img_link]"]').val(); |
|||
_info.video_link = $('input[name="data[video_link]"]').val(); |
|||
_info.recruit_img = $('input[name="data[recruit_img]"]').val(); |
|||
//提交信息 |
|||
let link = "{php echo web_url('recruit/recruitment/recruitEdit');}"; |
|||
$.post(link,{data:_info,id:_this.id},function (res) { |
|||
if(res.errno == 1){ |
|||
tip.alert(res.message,function () { |
|||
let href = "{php echo web_url('recruit/recruitment/recruitList');}"; |
|||
window.location.href = href; |
|||
}); |
|||
}else{ |
|||
tip.msgbox.err(res.message); |
|||
} |
|||
},'json'); |
|||
}, |
|||
videoImgLinkChange(){ |
|||
$('#cimg-data_video_img_link_0').val(''); |
|||
$('#pimg-data_video_img_link_0').attr('src',''); |
|||
}, |
|||
recruitImgChange(){ |
|||
$('#cimg-data_recruit_img_0').val(''); |
|||
$('#pimg-data_recruit_img_0').attr('src',''); |
|||
}, |
|||
showVideoDialog(elm){ |
|||
var options = { |
|||
'extras':{'text':'readonly'}, |
|||
'direct':true, |
|||
'multi':false, |
|||
'type':'video', |
|||
'fileSizeLimit':5120000 |
|||
}; |
|||
let _this = this; |
|||
require(["util"], function(util){ |
|||
var btn = $(elm); |
|||
var ipt = $('input[name="data[video_link]"]'); |
|||
var val = ipt.val(); |
|||
util.audio(val, function(url){ |
|||
if(url && url.attachment && url.url){ |
|||
btn.prev().show(); |
|||
_this.info.video_link = url.attachment; |
|||
ipt.attr("filename",url.filename); |
|||
ipt.attr("url",url.url); |
|||
_this.info.video_link_url = url.url; |
|||
} |
|||
if(url && url.media_id){ |
|||
ipt.val(url.media_id); |
|||
} |
|||
}, options); |
|||
}); |
|||
}, |
|||
delVideo(){ |
|||
this.info.video_link = ''; |
|||
this.info.video_link_url = ''; |
|||
}, |
|||
tempHandle(){ |
|||
var video_img_link = $('input[name="data[video_img_link]"]').val(); |
|||
if (video_img_link !== '' || video_img_link !== null && video_img_link !== undefined) { |
|||
this.info.video_img_link = video_img_link; |
|||
} |
|||
var recruit_img = $('input[name="data[recruit_img]"]').val(); |
|||
if (recruit_img !== '' || recruit_img !== null && recruit_img !== undefined) { |
|||
this.info.recruit_img = recruit_img; |
|||
} |
|||
}, |
|||
changeClass(job_type){ |
|||
var _this = this; |
|||
var link = "{php echo web_url('recruit/recruitment/cultivateClassList');}"; |
|||
$.get(link,{job_type:job_type},function (res) { |
|||
if (res.status == 1) { |
|||
_this.cultivateClassList = res.result.list; |
|||
} |
|||
},'json'); |
|||
} |
|||
}, |
|||
mounted(){ |
|||
//基础参数信息获取 |
|||
if(!this.info.industry_pid) this.info.industry_pid = this.industryList[0].id; |
|||
if(!this.info.work_province) this.info.work_province = this.provinceList[0].id; |
|||
if(!this.info.recruit_img_url) $('#pimg-data_recruit_img_0').attr('src','https://qingyuan.xingtongworld.com/addons/weliam_smartcity/web/resource/images/nopic-small.jpg'); |
|||
if(!this.info.video_img_link_url) $('#pimg-data_video_img_link_0').attr('src','https://qingyuan.xingtongworld.com/addons/weliam_smartcity/web/resource/images/nopic-small.jpg'); |
|||
this.changeClass(1); |
|||
} |
|||
}); |
|||
</script> |
|||
<script type="text/javascript"> |
|||
//初始化时间选择器 |
|||
require(["datetimepicker"], function(){ |
|||
var option = { |
|||
lang : "zh", |
|||
step : 5, |
|||
timepicker : true, |
|||
closeOnDateSelect : true, |
|||
format : "Y-m-d H:i" |
|||
}; |
|||
$(".datetimepicker[name = 'top_end_time']").datetimepicker(option); |
|||
}); |
|||
//置顶结束时间被修改 |
|||
$(document).on('change',"[name='top_end_time']",function (){ |
|||
recruit.info.top_end_time = $(this).val(); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,299 @@ |
|||
{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('recruit/recruitment/recruitEdit')}" 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="recruit" /> |
|||
<input type="hidden" name="ac" value="recruitment" /> |
|||
<input type="hidden" name="do" value="recruitList" /> |
|||
<input type="hidden" name="recruitment_type" value="{$recruitmentType}" /> |
|||
<input type="hidden" name="status" value="{$status}" /> |
|||
<input type="hidden" name="is_top" value="{$isTop}" /> |
|||
<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="row row-fix js-address-selector"> |
|||
<div class="col-md-4"> |
|||
<select name="industry_pid" class="form-control"> |
|||
<option value="0">全部</option> |
|||
{loop $industry $oneItem} |
|||
<option value="{$oneItem['id']}" {if $oneItem['id'] == $industryPid}selected="selected"{/if}>{$oneItem['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<select name="industry_id" class="form-control"> |
|||
<option value="0">全部</option> |
|||
{loop $subIndustry $subItem} |
|||
<option value="{$subItem['id']}" {if $subItem['id'] == $industryId}selected="selected"{/if}>{$subItem['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<select name="position_id" class="form-control"> |
|||
<option value="0">全部</option> |
|||
{loop $position $positionItem} |
|||
<option value="{$positionItem['id']}" {if $positionItem['id'] == $positionId}selected="selected"{/if}>{$positionItem['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</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('recruitment_type:0');}" class="btn {if $recruitmentType == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('recruitment_type:1');}" class="btn {if $recruitmentType == 1}btn-primary{else}btn-default{/if}">个人招聘</a> |
|||
<a href="{php echo wl_filter_url('recruitment_type:2');}" class="btn {if $recruitmentType == 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('status:0');}" class="btn {if $status == 0}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> |
|||
<a href="{php echo wl_filter_url('status:5');}" class="btn {if $status == 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('is_top:0');}" class="btn {if $isTop == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('is_top:1');}" class="btn {if $isTop == 1}btn-primary{else}btn-default{/if}">置顶中</a> |
|||
<a href="{php echo wl_filter_url('is_top:2');}" class="btn {if $isTop == 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"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('recruit/recruitment/recruitList')}" class="btn btn-danger">清除</a> |
|||
<button class="btn btn-warning" type="submit" name="export" value="1">导出</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 width="3%" class="text-center"><input type="checkbox" /></th> |
|||
<th width="10%" class="text-center">职位名称</th> |
|||
<th width="5%" class="text-center">所属职位</th> |
|||
<th width="5%" class="text-center">招聘类型</th> |
|||
<th width="5%" class="text-center">工作类型</th> |
|||
<th width="10%" class="text-center">发布方</th> |
|||
<th width="8%" class="text-center">联系人</th> |
|||
<th width="5%" class="text-center">招聘状态</th> |
|||
<th width="15%" class="text-center">工作地址</th> |
|||
<th width="8%" class="text-center">发布时间</th> |
|||
<th width="4%" class="text-center">排序</th> |
|||
<th width="5%" class="text-center">薪资</th> |
|||
<th width="5%" class="text-center">是否置顶</th> |
|||
<th width="12%" class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $val} |
|||
<tr class="text-center"> |
|||
<td><input type="checkbox" value="{$val['id']}" /></td> |
|||
<td>{$val['title']}</td> |
|||
<td>{$val['position']}</td> |
|||
<td> |
|||
{if $val['recruitment_type'] == 1} |
|||
<label class="label label-success">个人招聘</label> |
|||
{else} |
|||
<label class="label label-danger">企业招聘</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $val['job_type'] == 1} |
|||
<label class="label label-primary">全职</label> |
|||
{elseif $val['job_type'] == 2} |
|||
<label class="label label-info">兼职</label> |
|||
{elseif $val['job_type'] == 3} |
|||
<label class="label label-warning">实习</label> |
|||
{/if} |
|||
</td> |
|||
<td>{$val['release']}</td> |
|||
<td> |
|||
{$val['contacts']}<br /> |
|||
{$val['contact_phone']} |
|||
</td> |
|||
<td> |
|||
{if $val['status'] == 1} |
|||
<label class="label label-primary">待付款</label> |
|||
{elseif $val['status'] == 2} |
|||
<label class="label label-inverse">审核中</label> |
|||
{elseif $val['status'] == 3} |
|||
<label class="label label-danger">未通过</label> |
|||
{elseif $val['status'] == 4} |
|||
<label class="label label-success">招聘中</label> |
|||
{else} |
|||
<label class="label label-default">已结束</label> |
|||
{/if} |
|||
</td> |
|||
<td>{$val['work_address']}</td> |
|||
<td>{php echo date("Y-m-d H:i",$val['create_time']);}</td> |
|||
<td>{$val['sort']}</td> |
|||
<td>{$val['salary']}</td> |
|||
<td> |
|||
{if $val['is_top'] == 1} |
|||
<label class="label label-success">置顶中</label><br /> |
|||
<label class="label label-success" style="display: inline-block;margin-top: 5px;">结束时间:{php echo date("Y-m-d H:i",$val['top_end_time'])}</label> |
|||
{else} |
|||
<label class="label label-default">未置顶</label> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<!--招聘状态:1=待付款,2=审核中,3=未通过,4=招聘中,5=已结束--> |
|||
{if $val['status'] == 1} |
|||
|
|||
|
|||
{elseif $val['status'] == 2} |
|||
<a href="javascript:;" class="btn btn-sm btn-info rejectdis" appid="{$val['id']}">驳回</a> |
|||
<a href="{php echo web_url('recruit/recruitment/changeRecruitStatus', ['ids'=>$val['id'],'status'=>4])}" class="btn btn-sm btn-primary" data-toggle="ajaxPost" data-confirm="确定让当前招聘信息通过审核?">通过</a> |
|||
<a href="{php echo web_url('recruit/recruitment/recruitSee', ['id'=>$val['id']])}" class="btn btn-sm btn-warning">查看</a> |
|||
{elseif $val['status'] == 3} |
|||
<a href="{php echo web_url('recruit/recruitment/changeRecruitStatus', ['ids'=>$val['id'],'status'=>4])}" class="btn btn-sm btn-primary" data-toggle="ajaxPost" data-confirm="确定让当前招聘信息通过审核?">通过</a> |
|||
{elseif $val['status'] == 4} |
|||
<a href="{php echo web_url('recruit/recruitment/recruitEdit',['id'=>$val['id']])}" class="btn btn-warning btn-sm">编辑</a> |
|||
<a href="{php echo web_url('recruit/recruitment/changeRecruitStatus', ['ids'=>$val['id'],'status'=>5])}" class="btn btn-sm btn-default" data-toggle="ajaxPost" data-confirm="确定当前职位已结束招聘?">招聘结束</a> |
|||
{else} |
|||
<a href="{php echo web_url('recruit/recruitment/changeRecruitStatus', ['ids'=>$val['id'],'status'=>4])}" class="btn btn-sm btn-success" data-toggle="ajaxPost" data-confirm="确定再次进行招聘?">再次招聘</a> |
|||
{/if} |
|||
<a href="{php echo web_url('recruit/recruitment/recruitDel',['ids'=>$val['id']])}" class="btn btn-danger btn-sm" data-toggle="ajaxRemove" 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('recruit/recruitment/recruitDel')}">批量删除</button> |
|||
<!-- <button class="btn btn-default" type="button" data-toggle='batch' data-confirm="确定让当前选中的所有招聘信息不通过审核?" data-href="{php echo web_url('recruit/recruitment/changeRecruitStatus',['status'=>3])}">批量不通过</button>--> |
|||
<button class="btn btn-default" type="button" data-toggle='batch' data-confirm="确定让当前选中的所有招聘信息通过审核?" data-href="{php echo web_url('recruit/recruitment/changeRecruitStatus',['status'=>4])}">批量通过</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> |
|||
//行业职位三级联动 —— 改变上级行业时重新生成子行业信息 |
|||
$("[name='industry_pid']").on('change',function () { |
|||
let id = $(this).val(); |
|||
let html = '<option value="0">全部</option>'; |
|||
if(id > 0){ |
|||
//选择了行业信息 |
|||
$.post("{php echo web_url('recruit/recruitment/getSubIndustry');}",{id:id},function (res) { |
|||
if(res.errno == 1){ |
|||
$.each(res.data,function (k,v) { |
|||
html += '<option value="'+v['id']+'">'+v['title']+'</option>'; |
|||
}); |
|||
$("[name='industry_id']").html(html).change(); |
|||
}else{ |
|||
tip.alert(res.message) |
|||
} |
|||
},'json'); |
|||
}else{ |
|||
//选择了全部 |
|||
$("[name='industry_id']").html(html).change(); |
|||
} |
|||
}); |
|||
//行业职位三级联动 —— 改变子行业时重新生成职位信息 |
|||
$("[name='industry_id']").on('change',function () { |
|||
let id = $(this).val(); |
|||
let html = '<option value="0">全部</option>'; |
|||
if(id > 0){ |
|||
//选择了行业信息 |
|||
$.post("{php echo web_url('recruit/recruitment/getPosition');}",{id:id},function (res) { |
|||
if(res.errno == 1){ |
|||
$.each(res.data,function (k,v) { |
|||
html += '<option value="'+v['id']+'">'+v['title']+'</option>'; |
|||
}); |
|||
$("[name='position_id']").html(html); |
|||
}else{ |
|||
tip.alert(res.message) |
|||
} |
|||
},'json'); |
|||
}else{ |
|||
//选择了全部 |
|||
$("[name='position_id']").html(html); |
|||
} |
|||
}); |
|||
|
|||
//驳回申请理由 |
|||
$('.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('recruit/recruitment/changeRecruitStatus')}",{status:3,ids: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,243 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.none-control{ |
|||
border: none; |
|||
padding-left: 0; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('recruit/recruitment/recruitList')}">招聘列表</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"> |
|||
<label class="col-sm-2 control-label">职位名称</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" disabled="disabled" value="{$info['title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">行业职位</label> |
|||
<div class="col-sm-9"> |
|||
<div class="form-control none-control"> |
|||
<label class="label label-success">{$info['industry_pid_text']}</label> |
|||
<label class="label label-success">{$info['industry_id_text']}</label> |
|||
<label class="label label-success">{$info['position_id_text']}</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">招聘类型</label> |
|||
<div class="col-sm-9"> |
|||
{if $info['recruitment_type'] == 1} |
|||
<input class="form-control" type="text" disabled="disabled" value="个人招聘" /> |
|||
{else} |
|||
<input class="form-control" type="text" disabled="disabled" value="企业招聘" /> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否置顶</label> |
|||
<div class="col-sm-9"> |
|||
{if $info['is_top'] == 1} |
|||
<input class="form-control" type="text" disabled="disabled" value="置顶中" /> |
|||
{else} |
|||
<input class="form-control" type="text" disabled="disabled" value="未置顶" /> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
{if $info['is_top'] == 1} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">置顶结束时间</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" disabled="disabled" value="{php echo date('Y-m-d H:i',$info['top_end_time'])}" /> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">发布方</label> |
|||
<div class="col-sm-9"> |
|||
{if $info['recruitment_type'] == 1} |
|||
<input class="form-control" type="text" disabled="disabled" value="用户:{$info['release_name']}" /> |
|||
{else} |
|||
<input class="form-control" type="text" disabled="disabled" value="企业:{$info['release_name']}" /> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">工作类型</label> |
|||
<div class="col-sm-9"> |
|||
{if $info['job_type'] == 1} |
|||
<input class="form-control" type="text" disabled="disabled" value="全职" /> |
|||
{elseif $info['job_type'] == 2} |
|||
<input class="form-control" type="text" disabled="disabled" value="兼职" /> |
|||
{elseif $info['job_type'] == 3} |
|||
<input class="form-control" type="text" disabled="disabled" value="实习" /> |
|||
{/if} |
|||
</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" disabled="disabled" value="{$info['cc_str']}" /> |
|||
</div> |
|||
</div> |
|||
{if $info['job_type'] == 1} |
|||
<!-- 全职 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">薪资待遇</label> |
|||
<div class="col-sm-9"> |
|||
{if $info['full_type'] == 1} |
|||
<input class="form-control" type="text" disabled="disabled" value="面议" /> |
|||
{else} |
|||
<input class="form-control" type="text" disabled="disabled" value="{$info['full_salary_min']}元 ~ {$info['full_salary_max']}元" /> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">职位福利</label> |
|||
<div class="col-sm-9"> |
|||
<div class="form-control none-control"> |
|||
{loop $info['welfare'] $item} |
|||
<label class="label label-success" style="display: inline-block;margin-bottom: 2px;">{$item['title']}</label> |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{elseif $info['job_type'] == 2} |
|||
<!-- 兼职 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">薪资待遇</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" disabled="disabled" value="{$info['part_salary']}{if $info['part_type'] == 1}元/时{elseif $info['part_type'] == 2}元/天{elseif $info['part_type'] == 3}元/月{/if}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">结算方式</label> |
|||
<div class="col-sm-9"> |
|||
{if $info['part_settlement'] == 1} |
|||
<input class="form-control" type="text" disabled="disabled" value="日结" /> |
|||
{elseif $info['part_settlement'] == 2} |
|||
<input class="form-control" type="text" disabled="disabled" value="周结" /> |
|||
{elseif $info['part_settlement'] == 3} |
|||
<input class="form-control" type="text" disabled="disabled" value="月结" /> |
|||
{else} |
|||
<input class="form-control" type="text" disabled="disabled" value="完工结算" /> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
{elseif $info['job_type'] == 3} |
|||
<!-- 实习 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">薪资待遇</label> |
|||
<div class="col-sm-9"> |
|||
{if $info['full_type'] == 1} |
|||
<input class="form-control" type="text" disabled="disabled" value="面议" /> |
|||
{else} |
|||
<input class="form-control" type="text" disabled="disabled" value="{$info['full_salary_min']}元 ~ {$info['full_salary_max']}元" /> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">职位福利</label> |
|||
<div class="col-sm-9"> |
|||
<div class="form-control none-control"> |
|||
{loop $info['welfare'] $item} |
|||
<label class="label label-success" style="display: inline-block;margin-bottom: 2px;">{$item['title']}</label> |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">工作区域</label> |
|||
<div class="col-sm-9"> |
|||
<div class="form-control none-control"> |
|||
<label class="label label-success">{$info['work_province_text']}</label> |
|||
<label class="label label-success">{$info['work_city_text']}</label> |
|||
<label class="label label-success">{$info['work_area_text']}</label> |
|||
</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="text" disabled="disabled" value="{$info['work_address']}" /> |
|||
</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" disabled="disabled" value="{$info['contacts']}" /> |
|||
</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" disabled="disabled" value="{$info['contact_phone']}" /> |
|||
</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" disabled="disabled" value="{if $info['gender'] == 1} 不限 {elseif $info['gender'] == 2} 男 {else} 女 {/if}" /> |
|||
</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" disabled="disabled" value="{$info['age_min']} ~ {$info['age_max']}岁" /> |
|||
</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" disabled="disabled" value="{$info['education']}" /> |
|||
</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" disabled="disabled" value="{$info['experience']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">职位描述</label> |
|||
<div class="col-sm-9"> |
|||
<textarea class="form-control" rows="10" style="resize: none;font-size: 15px;" disabled="disabled">{$info['job_description']}</textarea> |
|||
</div> |
|||
</div> |
|||
<!-- 提交按钮 --> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<a href="{php echo web_url('recruit/recruitment/recruitList')}" id="backButton" class="btn btn-danger min-width">返回</a> |
|||
<a href="javascript:;" type="button" class="btn btn-primary min-width toExamine" status="4">审核通过</a> |
|||
<a href="javascript:;" type="button" class="btn btn-warning min-width toExamine" status="3">审核不通过</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
let id = "{$id}"; |
|||
let link = "{php echo web_url('recruit/recruitment/changeRecruitStatus')}"; |
|||
let backLink = "{php echo web_url('recruit/recruitment/recruitList')}"; |
|||
//审核 |
|||
$(".toExamine").on('click',function () { |
|||
let status = $(this).attr('status'); |
|||
let html = $(this).html(); |
|||
tip.confirm('确定让当前招聘信息'+html+'吗!',function () { |
|||
$.post(link,{ids:id,status:status},function (res){ |
|||
tip.alert(res.result.message,function (){ |
|||
if(res.status == 1) window.location.href = backLink; |
|||
}) |
|||
},'json'); |
|||
}) |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,177 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.user{ |
|||
height: 60px; |
|||
min-width: 180px; |
|||
} |
|||
.user .img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
float: left; |
|||
position: relative; |
|||
} |
|||
.user .img img{ |
|||
width: 60px; |
|||
height: 60px; |
|||
border-radius: 50%; |
|||
} |
|||
.user .img i{ |
|||
position: absolute; |
|||
top: 0; |
|||
right: 0px; |
|||
color: #FFF; |
|||
opacity: .7; |
|||
font-size: 13px; |
|||
border-radius: 50%; |
|||
width: 20px; |
|||
height: 20px; |
|||
line-height: 20px; |
|||
text-align: center; |
|||
} |
|||
.user .img i.icon-male{ |
|||
background: #0d8ddb; |
|||
} |
|||
.user .img i.icon-female{ |
|||
background: #ed5565; |
|||
transform: rotate( 30deg) skew( 0deg); |
|||
} |
|||
.user .info{ |
|||
float: left; |
|||
height: 60px; |
|||
width: calc(100% - 60px); |
|||
padding-left: 10px; |
|||
padding-top: 10px; |
|||
font-size: 15px; |
|||
text-align: left; |
|||
line-height: 20px; |
|||
} |
|||
</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="recruit" /> |
|||
<input type="hidden" name="ac" value="recruitment" /> |
|||
<input type="hidden" name="do" value="resumeList" /> |
|||
<input type="hidden" name="job_type" value="{$jobType}" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">用户信息</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="search" value="{$search}" 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 wl_filter_url('job_type:0');}" class="btn {if $jobType == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('job_type:1');}" class="btn {if $jobType == 1}btn-primary{else}btn-default{/if}">全职</a> |
|||
<a href="{php echo wl_filter_url('job_type:2');}" class="btn {if $jobType == 2}btn-primary{else}btn-default{/if}">兼职</a> |
|||
<a href="{php echo wl_filter_url('job_type:3');}" class="btn {if $jobType == 3}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"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
<a href="{php echo web_url('recruit/recruitment/resumeList')}" class="btn btn-danger">清除</a> |
|||
<button class="btn btn-warning" type="submit" name="export" value="export">导出</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"><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> |
|||
<th class="text-center">添加时间</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $key $val} |
|||
<tr class="text-center"> |
|||
<td><input type="checkbox" value="{$val['id']}" /></td> |
|||
<td> |
|||
<div class="user"> |
|||
<div class="img"> |
|||
<img src="{php echo tomedia($val['avatar'])}" width=""/> |
|||
{if $val['gender'] == 2} |
|||
<i class="icon icon-male"></i> |
|||
{else} |
|||
<i class="icon icon-female"></i> |
|||
{/if} |
|||
</div> |
|||
<div class="info"> |
|||
<div>{$val['name']}</div> |
|||
<div>{$val['phone']}</div> |
|||
</div> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
{if $val['work_status'] == 1} |
|||
<label class="label label-primary">随时上岗</label> |
|||
{elseif $val['work_status'] == 2} |
|||
<label class="label label-inverse">一周之内</label> |
|||
{elseif $val['work_status'] == 3} |
|||
<label class="label label-danger">一月之内</label> |
|||
{elseif $val['work_status'] == 4} |
|||
<label class="label label-success">考虑中</label> |
|||
{else} |
|||
<label class="label label-default">无换岗意向</label> |
|||
{/if} |
|||
</td> |
|||
<td>{$val['experience']}</td> |
|||
<td>{$val['education']}</td> |
|||
<td> |
|||
{if $val['job_type'] == 1} |
|||
<label class="label label-success">全职</label> |
|||
{elseif $val['job_type'] == 2} |
|||
<label class="label label-danger">兼职</label> |
|||
{elseif $val['job_type'] == 3} |
|||
<label class="label label-primary">实习</label> |
|||
{/if} |
|||
</td> |
|||
<td>{$val['expect_salary']}</td> |
|||
<td>{$val['expect_work_address']}</td> |
|||
<td>{php echo date("Y-m-d H:i",$val['create_time']);}</td> |
|||
<td> |
|||
<a href="{php echo web_url('recruit/recruitment/resumeSee',['id'=>$val['id']])}" class="btn btn-info btn-sm">查看</a> |
|||
<a href="{php echo web_url('recruit/recruitment/resumeSee',['id'=>$val['id'],'export'=>'export'])}" class="btn btn-warning btn-sm">导出</a> |
|||
<a href="{php echo web_url('recruit/recruitment/resumeDel',['ids'=>$val['id']])}" class="btn btn-danger btn-sm" data-toggle="ajaxRemove" 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('recruit/recruitment/resumeDel')}">批量删除</button> |
|||
</div> |
|||
<div class="pull-right">{$pager}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,269 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
#work{ |
|||
border: 1px solid #e8e9eb; |
|||
background-color: #eee; |
|||
font-size: 13px; |
|||
} |
|||
#work .block{ |
|||
border-bottom: 1px solid #fff; |
|||
padding: 10px 15px; |
|||
} |
|||
#work .block .title{ |
|||
width: 50%; |
|||
float: left; |
|||
height: 20px; |
|||
line-height: 20px; |
|||
} |
|||
#work .block .time{ |
|||
width: 50%; |
|||
float: right; |
|||
height: 20px; |
|||
line-height: 20px; |
|||
text-align: right; |
|||
} |
|||
#work .block .corporate{ |
|||
width: 100%; |
|||
float: left; |
|||
height: 20px; |
|||
line-height: 20px; |
|||
} |
|||
#work .block .contentTitle{ |
|||
height: 100%; |
|||
width: 70px; |
|||
display: inline-block; |
|||
text-align: left; |
|||
} |
|||
#work .block .textTitle{ |
|||
float: left; |
|||
} |
|||
#work .block .title .contentTitle{ |
|||
color: #64CF8C; |
|||
} |
|||
#work .block .time .contentTitle{ |
|||
color: #FF8F00; |
|||
} |
|||
#work .block .corporate .contentTitle{ |
|||
color: #518DF5; |
|||
} |
|||
#work .block .textTitle{ |
|||
color: #23c6c8; |
|||
} |
|||
#work .block textarea{ |
|||
width: calc(100% - 70px); |
|||
resize: none; |
|||
border: none; |
|||
background: #eee; |
|||
padding: 0!important; |
|||
min-height: 150px; |
|||
} |
|||
.educational{ |
|||
border-top: 1px solid #eeeeee; |
|||
} |
|||
.educational .left{ |
|||
float: left; |
|||
width: 150px; |
|||
font-size: 15px; |
|||
text-align: center; |
|||
padding-top: 10px; |
|||
position: relative; |
|||
height: 85px; |
|||
border-bottom: 1px solid #EEE; |
|||
} |
|||
.educational .left .spot{ |
|||
width: 6px; |
|||
height: 6px; |
|||
background: #409EFF; |
|||
border-radius: 50%; |
|||
position: absolute; |
|||
right: -3px; |
|||
top: 20px; |
|||
} |
|||
.educational .right{ |
|||
float: right; |
|||
width: calc(100% - 150px); |
|||
padding-top: 20px; |
|||
border-left: 1px solid #EEE; |
|||
border-bottom: 1px solid #EEE; |
|||
padding-left: 30px; |
|||
min-height: 85px; |
|||
} |
|||
.educational .right .info .title{ |
|||
box-sizing: border-box; |
|||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); |
|||
display: inline-block; |
|||
padding: 0 5px; |
|||
height: 20px; |
|||
line-height: 20px; |
|||
border-radius: 2px; |
|||
text-align: center; |
|||
margin-right: 10px; |
|||
margin-bottom: 5px; |
|||
} |
|||
.educational .right .info .work .title{ |
|||
color: #64CF8C; |
|||
background: #ECF9F1; |
|||
} |
|||
.educational .right .info .corporate .title{ |
|||
color: #FF8F00; |
|||
background: #FFE0D1; |
|||
} |
|||
.educational .right .info .level .title{ |
|||
color: cornflowerblue; |
|||
background: lightblue; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('recruit/recruitment/resumeList')}">简历列表</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"> |
|||
<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="text" class="form-control" disabled="disabled" value="{$info['name']}"> |
|||
<span class="input-group-addon">年龄</span> |
|||
<input type="text" class="form-control" disabled="disabled" value="{$info['age']}"> |
|||
<span class="input-group-addon">性别</span> |
|||
<input type="text" class="form-control" disabled="disabled" value="{if $info['gender'] == 2}男{else}女{/if}"> |
|||
<span class="input-group-addon">最高学历</span> |
|||
<input type="text" class="form-control" disabled="disabled" value="{$info['education']}"> |
|||
</div> |
|||
<div class="input-group" style="margin-top:2px;"> |
|||
<img src="{php echo tomedia($info['avatar']);}" class="img-responsive img-thumbnail" width="132"> |
|||
</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="text" disabled="disabled" value="{$info['phone']}"/> |
|||
</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" disabled="disabled" value="{$info['work_status']}"/> |
|||
</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" disabled="disabled" value="{$info['experience']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">期望职位</label> |
|||
<div class="col-sm-9" style="padding-top: 6px;"> |
|||
{loop $info['expect_position'] $position} |
|||
<label class="label label-primary">{$position}</label> |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">工作类型</label> |
|||
<div class="col-sm-9" style="padding-top: 6px;"> |
|||
<label class="label label-info">{if $info['job_type'] == 1}全职{elseif $info['job_type'] == 2}兼职{elseif $info['job_type'] == 3}实习{/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" disabled="disabled" value="{$info['expect_salary_min']}{if in_array($info['job_type'],[1,3])}元/月{else}元/天{/if} ~ {$info['expect_salary_max']}{if in_array($info['job_type'],[1,3])}元/月{else}元/天{/if}"/> |
|||
</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" disabled="disabled" value="{$info['expect_work_province']}{if $info['expect_work_city']}.{$info['expect_work_city']}{if $info['expect_work_area']}.{$info['expect_work_area']}{/if}{/if}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">实习经历</label> |
|||
<div class="col-sm-9"> |
|||
<div id="work"> |
|||
{loop $info['work_experience'] $work} |
|||
<div class="block"> |
|||
<div class="title"><span class="contentTitle">项目名称:</span>{$work['title']}</div> |
|||
<div class="time"><span class="contentTitle">项目时间:</span>{php echo date("Y-m-d",$work['start_time'])} ~ {if $work['end_time'] > 0}{php echo date("Y-m-d",$work['end_time'])}{else}至今{/if}</div> |
|||
<div class="corporate"><span class="contentTitle">所在企业:</span>{$work['corporate_name']}</div> |
|||
<div class="contentTitle textTitle">基本描述: </div> |
|||
<textarea disabled="disabled">{$work['content']}</textarea> |
|||
</div> |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">教育经历</label> |
|||
<div class="col-sm-9"> |
|||
<div class="educational"> |
|||
{loop $info['educational_experience'] $educational} |
|||
<div class="left"> |
|||
<div>{php echo date("Y-m-d",$educational['start_time'])}</div> |
|||
<div>至</div> |
|||
<div>{php echo date("Y-m-d",$educational['end_time'])}</div> |
|||
<div class="spot"></div> |
|||
</div> |
|||
<div class="right"> |
|||
<div class="info"> |
|||
<div class="work"> |
|||
<div class="title">就读学校:</div>{$educational['school']} |
|||
</div> |
|||
{if $educational['major']} |
|||
<div class="corporate"> |
|||
<div class="title">就读专业:</div>{$educational['major']} |
|||
</div> |
|||
{/if} |
|||
{if $educational['graduated_school']} |
|||
<div class="level"> |
|||
<div class="title">院校档次:</div>{php echo $educational['graduated_school'];} |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">在校职务</label> |
|||
<div class="col-sm-9"> |
|||
<div class="educational"> |
|||
{loop $info['school_office'] $school_office} |
|||
<div class="left"> |
|||
<div>{php echo date("Y-m-d",$school_office['start_time'])}</div> |
|||
<div>至</div> |
|||
<div>{php echo date("Y-m-d",$school_office['end_time'])}</div> |
|||
<div class="spot"></div> |
|||
</div> |
|||
<div class="right"> |
|||
<div class="info"> |
|||
<div class="work"> |
|||
<div class="title">学校:</div>{$school_office['school_name']} |
|||
</div> |
|||
<div class="corporate"> |
|||
<div class="title">职务:</div>{$school_office['position']} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">自我评价</label> |
|||
<div class="col-sm-9"> |
|||
<textarea class="form-control" rows="10" style="resize: none;font-size: 15px;" disabled="disabled">{$info['self_evaluation']}</textarea> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,176 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#setBase">基本设置</a></li> |
|||
<!-- <li><a href="#setTop">置顶设置</a></li>--> |
|||
<li><a href="#setShare">分享设置</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form-validate" id="setting-form"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-body"> |
|||
<div class="tab-content"> |
|||
<!-- 基本设置 --> |
|||
<div class="tab-pane active" id="setBase"> |
|||
<div class="panel-heading">基本设置</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[is_examine]" value="1" {if $info['is_examine'] != 2}checked="checked"{/if}> 需要审核 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="data[is_examine]" value="2" {if $info['is_examine'] == 2}checked="checked"{/if}> 免审核 |
|||
</label> |
|||
</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="text" digits="true" name="data[release_number]" class="form-control" value="{php echo $info['release_number'] ? : 0;}"> |
|||
<span class="input-group-addon">次后,每次</span> |
|||
<input type="text" name="data[release_price]" class="form-control" value="{php echo $info['release_price'] ? : 0;}"> |
|||
<span class="input-group-addon">元</span> |
|||
</div> |
|||
<div class="help-block">个人发布招聘信息时在免费次数使用完后,每次发布都需要支付对应的金额;全部设置为0则每次发布都不需要付费。</div> |
|||
</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="text" digits="true" name="data[look]" class="form-control" value="{php echo $info['look'] ? : 0;}"> |
|||
<!-- <span class="input-group-addon">分享</span>--> |
|||
<!-- <input type="text" digits="true" name="data[share]" class="form-control" value="{php echo $info['share'] ? : 0;}">--> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">免责声明(发布)</label> |
|||
<div class="col-sm-9"> |
|||
<textarea name="data[disclaimers]" class="form-control" rows="10" style="resize: none;font-size: 15px;">{$info['disclaimers']}</textarea> |
|||
<div class="help-block">发布页面显示的免责声明,招聘信息发布方可见</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">免责声明(详情)</label> |
|||
<div class="col-sm-9"> |
|||
<textarea name="data[desc_disclaimers]" class="form-control" rows="10" style="resize: none;font-size: 15px;">{$info['desc_disclaimers']}</textarea> |
|||
<div class="help-block">招聘详情页显示的免责声明,对普通用户可见</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 置顶设置 --> |
|||
<div class="tab-pane" id="setTop"> |
|||
<div class="panel-heading">置顶设置</div> |
|||
<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[top_number]" class="form-control" value="{php echo $info['top_number'] ? : 0;}"> |
|||
<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 priceList"> |
|||
<!-- 置顶价格信息列表 --> |
|||
{loop $info['top_rule'] $key $item} |
|||
<div class="input-group" style="margin-bottom: 10px;"> |
|||
<span class="input-group-addon">置顶时间(天)</span> |
|||
<input type="text" name="data[top_rule][{$key}][day]" digits="true" class="form-control day" value="{$item['day']}" required="required" min="1"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="data[top_rule][{$key}][price]" class="form-control price" value="{$item['price']}" required="required" min="0.01"> |
|||
<span class="input-group-addon btn btn-default deletePriceButton"> |
|||
<i class="fa fa-remove"></i> 删除 |
|||
</span> |
|||
</div> |
|||
{/loop} |
|||
<!-- 提示信息 --> |
|||
<span class="help-block">时间请填入整数,价格保留两位小数。</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 addPriceButton" href="javascript:;"> |
|||
<i class="fa fa-plus"></i>增加一种置顶规则 |
|||
</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 分享设置 --> |
|||
<div class="tab-pane" id="setShare"> |
|||
<div class="panel-heading">分享设置</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"> |
|||
<input type="text" name="data[share_title]" class="form-control" value="{$info['share_title']}" /> |
|||
</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_image]', $info['share_image']);} |
|||
<span class="help-block">推荐图片尺寸500X500</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="{$info['share_desc']}" /> |
|||
</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> |
|||
//点击添加一条规则信息 |
|||
$(".addPriceButton").on('click',function () { |
|||
let html = '<div class="input-group" style="margin-bottom: 10px;">\n' + |
|||
'\t\t\t\t\t\t\t\t\t\t<span class="input-group-addon">置顶时间(天)</span>\n' + |
|||
'\t\t\t\t\t\t\t\t\t\t<input type="text" name="data[top_rule][0][day]" digits="true" class="form-control day" value="" required="required" min="1">\n' + |
|||
'\t\t\t\t\t\t\t\t\t\t<span class="input-group-addon">¥</span>\n' + |
|||
'\t\t\t\t\t\t\t\t\t\t<input type="text" name="data[top_rule][0][price]" class="form-control price" value="" required="required" min="0.01">\n' + |
|||
'\t\t\t\t\t\t\t\t\t\t<span class="input-group-addon btn btn-default deletePriceButton">\n' + |
|||
'\t\t\t\t\t\t\t\t\t\t\t<i class="fa fa-remove"></i> 删除\n' + |
|||
'\t\t\t\t\t\t\t\t\t\t</span>\n' + |
|||
'\t\t\t\t\t\t\t\t\t</div>'; |
|||
$(".priceList").find('.help-block').before(html); |
|||
priceNameInit(); |
|||
}); |
|||
//点击删除当前规则信息 |
|||
$(".priceList").on('click','.deletePriceButton',function () { |
|||
$(this).parent('.input-group').remove(); |
|||
priceNameInit(); |
|||
}); |
|||
//价格规则信息name格式化 |
|||
function priceNameInit(){ |
|||
$(".priceList .input-group").each(function (k,v) { |
|||
//修改天的name |
|||
$(this).find('.day').attr('name',"data[top_rule]["+k+"][day]"); |
|||
//修改价格的name |
|||
$(this).find('.price').attr('name',"data[top_rule]["+k+"][price]"); |
|||
}); |
|||
} |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,276 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Redpack { |
|||
/** |
|||
* Comment: 获取某个红包的信息 |
|||
*/ |
|||
static function pack_get($id) { |
|||
global $_W; |
|||
return pdo_get('wlmerchant_redpacks' , ['uniacid' => $_W['uniacid'] , 'id' => $id]); |
|||
} |
|||
/** |
|||
* Comment: 红包记录 |
|||
* @param int $mid 用户ID |
|||
* @param int $id 红包ID |
|||
* @param string $type get用户自行领取,send后台发送 |
|||
* @param int $source 红包领取渠道(1=普通红包领取;2=新人红包领取;3=节日红包领取) |
|||
* @param int $festivalId 节日红包id |
|||
* @return array |
|||
*/ |
|||
static function pack_send($mid, $id, $type = 'get',$source = 1,$festivalId = 0) { |
|||
global $_W; |
|||
#1、信息判断 |
|||
$member = Member::wl_member_get($mid, ['id']); |
|||
if (empty($member)) return error(1, '用户不存在,请检查后重试'); |
|||
$pack = self::pack_get($id); |
|||
if (empty($pack)) return error(1, '红包不存在,请检查后重试'); |
|||
if (empty($pack['status'])) return error(1, '您来晚了,红包已下架'); |
|||
if (empty($pack['usetime_type']) && $pack['use_end_time'] < time()){ |
|||
return error(1, '红包已过期,无法领取'); |
|||
} |
|||
#2、判断领取限制 |
|||
if ($type == 'get') { |
|||
//剩余数量判断 |
|||
if (!empty($pack['all_count'])) { |
|||
$counts = Redpack:: getReceiveTotal($id); |
|||
if ($counts >= $pack['all_count']) return error(1, '您来晚了,没有更多红包了'); |
|||
} |
|||
//领取数量限制 |
|||
if (!empty($pack['limit_count'])) { |
|||
$mycounts = Redpack:: getReceiveTotal($id,$mid,$source,$festivalId); |
|||
if ($mycounts >= $pack['limit_count']) return error(1, '小淘气别贪心哦,你已经领完了'); |
|||
} |
|||
} |
|||
#3、信息添加 |
|||
$timetoday = strtotime(date("Y-m-d", time())); |
|||
$usetimes = [ |
|||
['start_time' => $pack['use_start_time'], 'end_time' => $pack['use_end_time']], |
|||
['start_time' => time(), 'end_time' => $timetoday + 86400 * $pack['usetime_day1']], |
|||
['start_time' => $timetoday + 86400, 'end_time' => $timetoday + 86400 * ($pack['usetime_day2'] + 1)], |
|||
]; |
|||
//获取type信息 |
|||
$typeVal = 1;//系统发放 |
|||
if ($type == 'get') $typeVal = 0;//自助领取 |
|||
if ($type == 'draw') $typeVal = 2;//抽奖获取 |
|||
$data = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $_W['aid'], |
|||
'mid' => $mid , |
|||
'status' => 0 , |
|||
'type' => intval($typeVal), |
|||
'packid' => $id , |
|||
'start_time' => $usetimes[$pack['usetime_type']]['start_time'] , |
|||
'end_time' => $usetimes[$pack['usetime_type']]['end_time'] , |
|||
'createtime' => time() , |
|||
'festival_id' => $festivalId ,//节日红包id |
|||
'source' => $source,//红包领取渠道(1=普通红包领取(默认);2=新人红包领取;3=节日红包领取) |
|||
]; |
|||
#4、红包领取 如果为新人红包 则循环进行领取 |
|||
if($source == 2){ |
|||
$newList = Setting::agentsetting_read("red_pack_new")['list']; |
|||
$idArr = array_column($newList,'id'); |
|||
$newInfo = array_combine($idArr,$newList)[$id]; |
|||
$limit = $newInfo['limit']; |
|||
for($i=1;$i<=$limit;$i++){ |
|||
$res = pdo_insert(PDO_NAME.'redpack_records', $data); |
|||
} |
|||
}else{ |
|||
$res = pdo_insert(PDO_NAME.'redpack_records', $data); |
|||
$data['id'] = pdo_insertid(); |
|||
} |
|||
//发放模板消息 |
|||
if($res){ |
|||
$first = '一个在线红包已经到账'; |
|||
$type = '在线红包到账通知'; |
|||
$content = '红包名:['.$pack['title'].']'; |
|||
$newStatus = '已到账'; |
|||
$remark = '点击查看红包'; |
|||
$url = h5_url('pages/subPages/redpacket/myredpacket'); |
|||
News::jobNotice($mid,$first,$type,$content,$newStatus,$remark,time(),$url); |
|||
} |
|||
return $data; |
|||
} |
|||
/** |
|||
* Comment: 获取某个节日红包下面所有的有效(存在并且已上架)红包信息 |
|||
* Author: zzw |
|||
* Date: 2020/2/19 9:24 |
|||
* @param int $id 节日红包id |
|||
* @param string $field 获取的字段信息,默认全部 |
|||
* @return array|bool|mixed |
|||
*/ |
|||
public static function getRedPackFestivalJoin($id,$field = '*'){ |
|||
return pdo_fetchall("SELECT {$field} FROM ".tablename(PDO_NAME."redpack_festival_join") |
|||
." as a RIGHT JOIN ".tablename(PDO_NAME."redpacks") |
|||
." as b ON a.pack_id = b.id WHERE a.festival_id = {$id} AND status = 1"); |
|||
} |
|||
/** |
|||
* Comment: 获取红包已领取的总数 |
|||
* Author: zzw |
|||
* Date: 2020/2/24 9:21 |
|||
* @param int $id 红包id |
|||
* @param int $mid 用户id |
|||
* @param int $source 领取方式 (1=普通红包领取;2=新人红包领取;3=节日红包领取) |
|||
* @param int $festivalId 节日红包id |
|||
* @return int |
|||
*/ |
|||
public static function getReceiveTotal($id,$mid = 0,$source = 1,$festivalId = 0){ |
|||
#1、条件生成 不存在mid则为获取红包总共已领取的数量 存在mid则为获取用户在该领取方式中已领取的总数量 |
|||
$where['packid'] = $id; |
|||
if($mid > 0){ |
|||
$where['source'] = $source; |
|||
$where['mid'] = $mid; |
|||
} |
|||
//存在$festivalId 则为获取某个节日礼包中某个礼包的已领取数量 |
|||
if($festivalId > 0){ |
|||
$where['festival_id'] = $festivalId; |
|||
} |
|||
$getTotal = pdo_getcolumn(PDO_NAME.'redpack_records' , $where , 'COUNT(id)'); |
|||
|
|||
return $getTotal ? : 0; |
|||
} |
|||
/** |
|||
* Comment: 获取节日礼包 - 当前id和下一条信息的id |
|||
* Author: zzw |
|||
* Date: 2020/3/10 13:41 |
|||
* @param int $id |
|||
* @return bool |
|||
*/ |
|||
public static function getDayFestivalRedPack($id = 0){ |
|||
global $_W; |
|||
#1、条件生成 只获取进行中的节日礼包信息 |
|||
$time = time(); |
|||
$where = " WHERE start_time <= {$time} AND end_time > {$time} AND status = 1 AND uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "; |
|||
#2、节日信息列表获取 |
|||
$field = "id"; |
|||
$list = pdo_fetchall("SELECT {$field} FROM ".tablename(PDO_NAME."redpack_festival") .$where." ORDER BY start_time ASC "); |
|||
#2、判断是否存在内容 |
|||
if(is_array($list) && $list) { |
|||
$ids = array_column($list , 'id');//正常数组 键=>值 |
|||
$newIds = array_flip($ids);//新数组 键值对换 值=>键 |
|||
#2、操作 |
|||
$data['current'] = $id ? $id : $ids[0]; |
|||
$key = $newIds[$id] + 1; |
|||
$data['next'] = $ids[$key] ? intval($ids[$key]) : ''; |
|||
return $data; |
|||
} |
|||
return false; |
|||
} |
|||
/** |
|||
* Comment: 根据条件获取用户已领取红包的指定信息 |
|||
* Author: zzw |
|||
* Date: 2020/3/11 9:30 |
|||
* @param string $field 要获取的字段 |
|||
* @param string $where 条件 |
|||
* @param string $limit 条数限制 |
|||
* @return array|bool |
|||
*/ |
|||
public static function getUserRedPackInfo($field,$where,$limit = ''){ |
|||
$list = pdo_fetchall("SELECT {$field} FROM ".tablename(PDO_NAME."redpack_records") |
|||
." as a RIGHT JOIN ".tablename(PDO_NAME."redpacks") |
|||
." as b ON a.packid = b.id {$where} ORDER BY a.id DESC {$limit} "); |
|||
return $list; |
|||
} |
|||
/** |
|||
* Comment: 获取用户在当前订单中可使用的红包信息列表 |
|||
* Date: 2020/4/28 16:28 |
|||
* @param $money |
|||
* @param $sid |
|||
* @param $aid |
|||
* @param $gid |
|||
* @return mixed |
|||
*/ |
|||
public function getNotUseList($money,$sid,$aid,$gid,$type){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$time = time(); |
|||
#2、条件生成 |
|||
$useWhere = " WHERE a.uniacid = {$_W['uniacid']} AND b.full_money <= {$money} AND a.mid = {$_W['mid']} AND a.status = 0 AND a.start_time < {$time} AND a.end_time > {$time}"; |
|||
if($type == 'payonline'){ |
|||
$useWhere .= " AND b.redpack_type IN (0,2) "; |
|||
}else{ |
|||
$useWhere .= " AND b.redpack_type IN (0,1) "; |
|||
} |
|||
#3、可使用列表获取 循环判断当前红包是否符合使用条件 |
|||
$useField = " a.id,b.usegoods_type,b.use_aids,b.use_sids,b.rush_ids,b.group_ids,b.fight_ids,b.bargain_ids"; |
|||
$useList = Redpack::getUserRedPackInfo($useField,$useWhere); |
|||
foreach($useList as $key => &$val){ |
|||
//使用条件处理 0全平台1指定代理2指定商家3指定商品可用 |
|||
if ($val['usegoods_type'] == 1) { |
|||
//仅限指定地区可用 |
|||
$useAid = unserialize($val['use_aids']); |
|||
if(!in_array($aid,$useAid)){ |
|||
unset($useList[$key]); |
|||
continue; |
|||
} |
|||
}else if ($val['usegoods_type'] == 2) { |
|||
//仅限指定商家可用 |
|||
$useSid = unserialize($val['use_sids']); |
|||
if(!in_array($sid,$useSid)){ |
|||
unset($useList[$key]); |
|||
continue; |
|||
} |
|||
}else if ($val['usegoods_type'] == 3){ |
|||
//仅限指定商品可用 |
|||
$useGid = []; |
|||
//获取对应类型的商品id |
|||
switch ($type){ |
|||
case 'rush': $useGid = unserialize($val['rush_ids']);break;//抢购 |
|||
case 'groupon': $useGid = unserialize($val['group_ids']);break;//团购 |
|||
case 'wlfightgroup': $useGid = unserialize($val['fight_ids']);break;//拼团 |
|||
case 'bargain': $useGid = unserialize($val['bargain_ids']);break;//砍价 |
|||
} |
|||
//判断是否可用 |
|||
if(!in_array($gid,$useGid)){ |
|||
unset($useList[$key]); |
|||
continue; |
|||
} |
|||
} |
|||
} |
|||
$useIds = implode(array_column($useList,'id'),','); |
|||
#4、判断是否存在符合使用条件的红包 |
|||
if($useIds){ |
|||
$field = " a.id,a.status,a.start_time,a.end_time,a.source,a.festival_id,b.full_money,b.cut_money,b.title,b.usegoods_type"; |
|||
// $limit = " limit {$pageStart},{$pageIndex} "; |
|||
$where = " WHERE a.id IN ({$useIds}) "; |
|||
$list = Redpack::getUserRedPackInfo($field,$where); |
|||
// $total = Redpack::getUserRedPackInfo("count(*) as total",$where); |
|||
$total = count($list); |
|||
#4、信息处理 |
|||
foreach($list as $key => &$val){ |
|||
//金额处理 |
|||
$val['full_money'] = sprintf("%0.2f",$val['full_money']); |
|||
$val['cut_money'] = sprintf("%0.2f",$val['cut_money']); |
|||
//判断是否已过期 |
|||
if($val['end_time'] <= $time) $val['status'] = 2; |
|||
//时间处理 |
|||
$val['time'] = date("Y-m-d",$val['start_time'])."至".date("Y-m-d",$val['end_time']); |
|||
//使用条件处理 0全平台1指定代理2指定商家3指定商品 |
|||
if ($val['usegoods_type'] == 1) $val['use_where'] = '仅限指定地区可用'; |
|||
else if ($val['usegoods_type'] == 2) $val['use_where'] = '仅限指定商家可用'; |
|||
else if ($val['usegoods_type'] == 3) $val['use_where'] = '仅限指定商品可用'; |
|||
else $val['use_where'] = '全平台可用'; |
|||
//判断是否为节日红包 是则获取红包标签 |
|||
$val['label'] = ''; |
|||
if($val['source'] == 2) $val['label'] = '新人'; |
|||
if($val['source'] == 3) $val['label'] = pdo_getcolumn(PDO_NAME."redpack_festival",['id'=>$val['festival_id']],'label'); |
|||
//删除多余的信息 |
|||
unset($val['start_time']); |
|||
unset($val['end_time']); |
|||
unset($val['source']); |
|||
unset($val['start_time']); |
|||
unset($val['usegoods_type']); |
|||
unset($val['festival_id']); |
|||
} |
|||
} |
|||
//排序 |
|||
$sortArr = array_column($list, 'cut_money'); |
|||
array_multisort($sortArr, SORT_DESC, $list); |
|||
#5、信息拼装 |
|||
$data['list'] = $list ? : []; |
|||
$data['total'] = $total ? : 0; |
|||
return $data; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[线上红包]]></name> |
|||
<identifie><![CDATA[redpack]]></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="redpack" do="pack_lists" actions='["do",["pack_lists","pack_edit"]]' iscover="true"/> |
|||
<entry title="领取记录" ac="redpack" do="record_lists" actions='["do",["record_lists"]]' /> |
|||
</menu> |
|||
<menu title="活动" font="fa-inbox"> |
|||
<entry title="新人红包" ac="redpack" do="new_pack" actions='["do",["new_pack"]]' /> |
|||
<entry title="节日红包" ac="redpack" do="festival_pack" actions='["do",["festival_pack","festival_pack_edit"]]' /> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="红包" font="fa-inbox"> |
|||
<entry title="红包管理" ac="redpack" do="pack_lists" actions='["do",["pack_lists","pack_edit"]]' iscover="true"/> |
|||
<entry title="领取记录" ac="redpack" do="record_lists" actions='["do",["record_lists"]]' /> |
|||
</menu> |
|||
<menu title="活动" font="fa-inbox"> |
|||
<entry title="新人红包" ac="redpack" do="new_pack" actions='["do",["new_pack"]]' /> |
|||
<entry title="节日红包" ac="redpack" do="festival_pack" actions='["do",["festival_pack","festival_pack_edit"]]' /> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="基本设置" ac="redpack" do="set" actions='["do",["set"]]' /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 3.3 KiB |
@ -0,0 +1,577 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class RedpackModuleUniapp extends Uniapp { |
|||
/** |
|||
* Comment: 普通红包列表信息获取 |
|||
* Author: zzw |
|||
* Date: 2020/2/21 11:09 |
|||
*/ |
|||
public function redPackList(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$page = $_GPC['page'] ? :1; |
|||
$pageIndex = $_GPC['page_index'] ? :10; |
|||
#2、条件生成 |
|||
$where = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'aid' => $_W['aid'], |
|||
'scene' => 0 , |
|||
'status' => 1 , |
|||
]; |
|||
#3、列表信息获取 |
|||
$field = ['id','title','full_money','cut_money','use_start_time','use_end_time','usetime_day1','usetime_day2' |
|||
,'usegoods_type','usetime_type','limit_count','use_aids','use_sids']; |
|||
$list = pdo_getslice(PDO_NAME.'redpacks' , $where , [$page , $pageIndex] , $total , $field , '' , "sort DESC,id DESC"); |
|||
foreach ($list as $key => &$val) { |
|||
//当前用户剩余可以领取的数量 删除用户不能领取的红包信息 开启后 则只显示用户可以领取的红包 |
|||
if (!empty($val['limit_count'])) { |
|||
$mycounts = Redpack::getReceiveTotal($val['id'],$_W['mid'],1,0); |
|||
if ($mycounts >= $val['limit_count']){ |
|||
$val['is_over'] = 1; |
|||
} |
|||
} |
|||
//价格处理 |
|||
$val['full_money'] = sprintf("%0.2f",$val['full_money']); |
|||
$val['cut_money'] = sprintf("%0.2f",$val['cut_money']); |
|||
//有效期处理 |
|||
$usetimes = [ |
|||
date('Y-m-d' , $val['use_start_time']) . ' ~ ' . date('Y-m-d' , $val['use_end_time']) , |
|||
'领取当日起' . $val['usetime_day1'] . '天内有效' , |
|||
'领取次日起' . $val['usetime_day2'] . '天内有效' |
|||
]; |
|||
$val['usetime_text'] = $usetimes[$val['usetime_type']]; |
|||
//使用条件处理 0全平台1指定代理2指定商家 |
|||
if ($val['usegoods_type'] == 1) { |
|||
//代理商可用 查询可用代理商信息 |
|||
$aids = unserialize($val['use_aids']); |
|||
$agents = pdo_getall(PDO_NAME."oparea",['aid'=>$aids],'areaid'); |
|||
if($agents) $areaInfo = pdo_getall(PDO_NAME."area",['id'=>array_values(array_column($agents,'areaid'))],'name'); |
|||
if($areaInfo){ |
|||
$areaName = implode(',',array_column($areaInfo,'name')); |
|||
$val['use_where'] = "仅限{$areaName}可用"; |
|||
}else{ |
|||
$val['use_where'] = "仅限指定地区可用"; |
|||
} |
|||
}else if ($val['usegoods_type'] == 2) { |
|||
//商家可用 查询可用商家信息 |
|||
$sids = unserialize($val['use_sids']); |
|||
$storeName = pdo_getall(PDO_NAME."merchantdata",['id'=>$sids],'storename'); |
|||
if($storeName){ |
|||
$storeName = implode(',',array_column($storeName,'storename')); |
|||
$val['use_where'] = "仅限{$storeName}商家可用"; |
|||
}else{ |
|||
$val['use_where'] = "仅限指定商家可用"; |
|||
} |
|||
}else if ($val['usegoods_type'] == 3) { |
|||
//指定商品可用 商品过多,直接显示固定内容 |
|||
$val['use_where'] = "仅限指定商品可用"; |
|||
}else { |
|||
$val['use_where'] = '全平台可用'; |
|||
} |
|||
//删除多余的信息 |
|||
unset($val['usegoods_type']); |
|||
unset($val['use_start_time']); |
|||
unset($val['use_end_time']); |
|||
unset($val['usetime_day1']); |
|||
unset($val['usetime_day2']); |
|||
unset($val['usetime_type']); |
|||
} |
|||
#4、信息拼装 |
|||
$data = [ |
|||
'total' => ceil($total / $pageIndex), |
|||
'list' => $list ? : [], |
|||
]; |
|||
|
|||
$this->renderSuccess('普通红包列表',$data); |
|||
} |
|||
/** |
|||
* Comment: 红包领取 |
|||
* Author: zzw |
|||
* Date: 2020/2/24 9:34 |
|||
*/ |
|||
public function getRedPack(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$id = $_GPC['id'] OR $this->renderError('领取失败,不存在的红包!');//红包id |
|||
$source = $_GPC['red_pack_source'] ? : 1;//红包领取渠道(1=普通红包领取;2=新人红包领取;3=节日红包领取) |
|||
$festivalId = $_GPC['festival_id'] ? : 0;//节日红包id |
|||
#2、红包领取操作 |
|||
if(strpos($id,',')){ |
|||
$ids = explode(',',trim($id,',')); |
|||
foreach($ids as $pack_id){ |
|||
Redpack::pack_send($_W['mid'] , $pack_id , 'get',$source,$festivalId); |
|||
} |
|||
$this->renderSuccess('领取成功'); |
|||
}else{ |
|||
$res = Redpack::pack_send($_W['mid'] , $id , 'get',$source,$festivalId); |
|||
if($res['errno'] == 1){ |
|||
$this->renderError($res['message']); |
|||
}else{ |
|||
$this->renderSuccess('领取成功'); |
|||
} |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 新人红包信息 |
|||
* Author: zzw |
|||
* Date: 2020/2/21 14:44 |
|||
*/ |
|||
public function newRedPackInfo(){ |
|||
global $_W,$_GPC; |
|||
#1、设置信息获取 |
|||
$info = Setting::agentsetting_read('red_pack_new'); |
|||
//获取红包总开关设置信息 |
|||
$set = Setting::wlsetting_read('red_pack_set'); |
|||
$info['switch'] = intval($set['switch'] ? : 0);//0=关闭;1=开启 |
|||
$info['intervalmin'] = $set['intervalmin'] ? : 180; |
|||
if($info['status'] == 1) { |
|||
#2、领取条件判断 0=未领取用户,1=未领取且未下单用户 |
|||
$ifWhere = true;//默认符合条件 |
|||
$whereRes = pdo_getcolumn(PDO_NAME . "redpack_records" , ['mid' => $_W['mid'] , 'source' => 2] , 'id');//新人红包领取信息 |
|||
if ($info['wheres'] == 1) { |
|||
//条件为未领取且未下单用户 |
|||
$orderRes = pdo_getcolumn(PDO_NAME . "order" , ['mid' => $_W['mid']] , 'id'); |
|||
$rushOrderRes = pdo_getcolumn(PDO_NAME . "rush_order" , ['mid' => $_W['mid']] , 'id'); |
|||
if ($whereRes > 0 || $orderRes > 0 || $rushOrderRes > 0) $ifWhere = false;//不符合条件 |
|||
}else { |
|||
//未领取用户 |
|||
if ($whereRes > 0) $ifWhere = false;//不符合条件 |
|||
} |
|||
#3、判断是否符合领取条件 并且循环处理信息 |
|||
if (is_array($info['list']) && count($info['list']) > 0 && $ifWhere) { |
|||
//图片处理 |
|||
$info['color'] = unserialize($info['color']); |
|||
$info['image'] = tomedia($info['image']); |
|||
//删除多余字段 |
|||
unset($info['image_url']); |
|||
unset($info['wheres']); |
|||
//红包列表获取 |
|||
$field = ['id' , 'title' , 'full_money' , 'cut_money' , 'use_start_time' , 'use_end_time' , 'usetime_day1' , |
|||
'usetime_day2' , 'usegoods_type' , 'usetime_type' , 'use_aids' , 'use_sids']; |
|||
foreach ($info['list'] as $key => &$val) { |
|||
//获取红包详细信息 |
|||
$limit = $val['limit'] ? : 0; |
|||
$val = pdo_get(PDO_NAME . "redpacks" , [ |
|||
'id' => $val['id'] , |
|||
'status' => 1 , |
|||
'uniacid' => $_W['uniacid'] |
|||
] , $field); |
|||
if (!$val) { |
|||
unset($info['list'][$key]); |
|||
continue; |
|||
} |
|||
//当前用户剩余可以领取的数量 删除用户不能领取的红包信息 |
|||
if ($_W['mid']) { |
|||
$userGetTotal = Redpack:: getReceiveTotal($val['id'] , $_W['mid'] , 2); |
|||
$surplusGet = sprintf("%.0f" , $limit - sprintf("%.0f" , $userGetTotal)); |
|||
} |
|||
else { |
|||
$surplusGet = sprintf("%.0f" , $limit); |
|||
} |
|||
if ($surplusGet <= 0) { |
|||
unset($info['list'][$key]); |
|||
continue; |
|||
} |
|||
//价格处理 |
|||
$val['full_money'] = sprintf("%0.2f" , $val['full_money']); |
|||
$val['cut_money'] = sprintf("%0.2f" , $val['cut_money']); |
|||
//有效期处理 |
|||
$usetimes = [ |
|||
date('Y-m-d' , $val['use_start_time']) . ' ~ ' . date('Y-m-d' , $val['use_end_time']) , |
|||
'领取当日起' . $val['usetime_day1'] . '天内有效' , |
|||
'领取次日起' . $val['usetime_day2'] . '天内有效' |
|||
]; |
|||
$val['usetime_text'] = $usetimes[$val['usetime_type']]; |
|||
//使用条件处理 0全平台1指定代理2指定商家 |
|||
if ($val['usegoods_type'] == 1) { |
|||
//代理商可用 查询可用代理商信息 |
|||
$aids = unserialize($val['use_aids']); |
|||
$agents = pdo_getall(PDO_NAME . "oparea" , ['aid' => $aids] , 'areaid'); |
|||
if ($agents) $areaInfo = pdo_getall(PDO_NAME . "area" , ['id' => array_values(array_column($agents , 'areaid'))] , 'name'); |
|||
if ($areaInfo) { |
|||
$areaName = implode(',' , array_column($areaInfo , 'name')); |
|||
$val['use_where'] = "仅限{$areaName}代理可用"; |
|||
} |
|||
else { |
|||
$val['use_where'] = "仅限指定地区可用"; |
|||
} |
|||
}else if ($val['usegoods_type'] == 2) { |
|||
//商家可用 查询可用商家信息 |
|||
$sids = unserialize($val['use_sids']); |
|||
$storeName = pdo_getall(PDO_NAME . "merchantdata" , ['id' => $sids] , 'storename'); |
|||
if ($storeName) { |
|||
$areaName = implode(',' , array_column($storeName , 'storename')); |
|||
$val['use_where'] = "仅限{$areaName}商家可用"; |
|||
} |
|||
else { |
|||
$val['use_where'] = "仅限指定商家可用"; |
|||
} |
|||
}else if ($val['usegoods_type'] == 3) { |
|||
//指定商品可用 商品过多,直接显示固定内容 |
|||
$val['use_where'] = "仅限指定商品可用"; |
|||
}else { |
|||
$val['use_where'] = '全平台可用'; |
|||
} |
|||
//删除多余的信息 |
|||
unset($val['usegoods_type']); |
|||
unset($val['use_start_time']); |
|||
unset($val['use_end_time']); |
|||
unset($val['usetime_day1']); |
|||
unset($val['usetime_day2']); |
|||
unset($val['usetime_type']); |
|||
} |
|||
|
|||
$info['list'] = array_values($info['list']); |
|||
$info['get_status'] = intval(0);//0=未领取,1=已领取 |
|||
$this->renderSuccess('新人红包信息' , $info); |
|||
} |
|||
} |
|||
#4、不符合领取条件 |
|||
$info['list'] = []; |
|||
$info['get_status'] = intval(1);//0=未领取,1=已领取 |
|||
$this->renderSuccess('不符合领取条件',$info); |
|||
} |
|||
/** |
|||
* Comment: 获取最近一条或者指定某一条节日礼包的信息 |
|||
* Author: zzw |
|||
* Date: 2020/3/10 13:55 |
|||
*/ |
|||
public function festivalRedPackDesc(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$id = $_GPC['id'] ? : ''; |
|||
#1、获取节日礼包顺序信息 |
|||
$idInfo = Redpack::getDayFestivalRedPack($id); |
|||
#1、获取节日礼包基本信息 |
|||
$field = ['id' , 'images' , 'color']; |
|||
$info = pdo_get(PDO_NAME . 'redpack_festival' , ['id' => $idInfo['current']] , $field); |
|||
$info['color'] = unserialize($info['color']); |
|||
$info['image'] = tomedia($info['images']); |
|||
$info['current'] = $idInfo['current']; |
|||
$info['next'] = $idInfo['next']; |
|||
#2、获取当前节日红包中的所有普通红包 |
|||
$field = 'a.limit as limit_count,b.id,b.title,b.full_money,b.cut_money,b.use_start_time,b.use_end_time, |
|||
b.usetime_day1,b.usetime_day2,b.usetime_type,b.usegoods_type,b.use_aids,b.use_sids'; |
|||
$list = Redpack::getRedPackFestivalJoin($idInfo['current'],$field); |
|||
foreach($list as $key => &$val){ |
|||
//当前用户剩余可以领取的数量 删除用户不能领取的红包信息 |
|||
if($_W['mid']){ |
|||
$userGetTotal = Redpack::getReceiveTotal($val['id'],$_W['mid'],3,$idInfo['current']); |
|||
$surplusGet = sprintf("%.0f",$val['limit_count']- sprintf("%.0f",$userGetTotal)); |
|||
}else{ |
|||
$surplusGet = sprintf("%.0f",$val['limit_count']); |
|||
} |
|||
if($surplusGet <= 0){ |
|||
unset($list[$key]); |
|||
continue; |
|||
} |
|||
//价格处理 |
|||
$val['full_money'] = sprintf("%0.2f",$val['full_money']); |
|||
$val['cut_money'] = sprintf("%0.2f",$val['cut_money']); |
|||
//有效期处理 |
|||
$usetimes = [ |
|||
date('Y-m-d' , $val['use_start_time']) . ' ~ ' . date('Y-m-d' , $val['use_end_time']) , |
|||
'领取当日起' . $val['usetime_day1'] . '天内有效' , |
|||
'领取次日起' . $val['usetime_day2'] . '天内有效' |
|||
]; |
|||
$val['usetime_text'] = $usetimes[$val['usetime_type']]; |
|||
//使用条件处理 0全平台1指定代理2指定商家 |
|||
if ($val['usegoods_type'] == 1) { |
|||
//代理商可用 查询可用代理商信息 |
|||
$aids = unserialize($val['use_aids']); |
|||
$agents = pdo_getall(PDO_NAME."oparea",['aid'=>$aids],'areaid'); |
|||
if($agents) $areaInfo = pdo_getall(PDO_NAME."area",['id'=>array_values(array_column($agents,'areaid'))],'name'); |
|||
if($areaInfo){ |
|||
$areaName = implode(',',array_column($areaInfo,'name')); |
|||
$val['use_where'] = "仅限{$areaName}代理可用"; |
|||
}else{ |
|||
$val['use_where'] = "仅限指定地区可用"; |
|||
} |
|||
}else if ($val['usegoods_type'] == 2) { |
|||
//商家可用 查询可用商家信息 |
|||
$sids = unserialize($val['use_sids']); |
|||
$storeName = pdo_getall(PDO_NAME."merchantdata",['id'=>$sids],'storename'); |
|||
if($storeName){ |
|||
$areaName = implode(',',array_column($storeName,'storename')); |
|||
$val['use_where'] = "仅限{$areaName}商家可用"; |
|||
}else{ |
|||
$val['use_where'] = "仅限指定商家可用"; |
|||
} |
|||
}else if ($val['usegoods_type'] == 3) { |
|||
//指定商品可用 商品过多,直接显示固定内容 |
|||
$val['use_where'] = "仅限指定商品可用"; |
|||
}else { |
|||
$val['use_where'] = '全平台可用'; |
|||
} |
|||
//删除多余的信息 |
|||
unset($val['limit_count']); |
|||
unset($val['usegoods_type']); |
|||
unset($val['use_start_time']); |
|||
unset($val['use_end_time']); |
|||
unset($val['usetime_day1']); |
|||
unset($val['usetime_day2']); |
|||
unset($val['usetime_type']); |
|||
} |
|||
|
|||
|
|||
$info['list'] = $list ? array_values($list) : []; |
|||
//$info['get_status'] = intval(0);//0=未领取,1=已领取 |
|||
//if(!$info['list']) $info['get_status'] = intval(1);//0=未领取,1=已领取 |
|||
//获取红包开关设置信息 |
|||
$set = Setting::wlsetting_read('red_pack_set'); |
|||
$info['switch'] = intval($set['switch'] ? : 0);//0=关闭;1=开启 |
|||
if(!$info['list']) $info['switch'] = intval(0);//无红包信息时关闭红包接口 |
|||
if($info['next'] > 0) $info['switch'] = intval(1);//如果存在其他节日红包 开启 |
|||
|
|||
$this->renderSuccess('节日红包详细信息',$info); |
|||
} |
|||
/** |
|||
* Comment: 我的红包列表 |
|||
* Author: zzw |
|||
* Date: 2020/2/27 14:06 |
|||
*/ |
|||
public function userRedPackList(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = $_GPC['page_index'] ? : 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$status = $_GPC['status'] ? : 0;//0=未使用;1=已使用;2=已过期 |
|||
$time = time(); |
|||
#2、条件生成 |
|||
$publicWhere = $where = " WHERE a.uniacid = {$_W['uniacid']} AND a.mid = {$_W['mid']} "; |
|||
if($status == 2){ |
|||
$where .= " AND a.status = {$status} ";//已过期 |
|||
}else if($status == 1){ |
|||
$where .= " AND a.status = {$status} ";//已使用 前提条件:未过期 |
|||
} else{ |
|||
$where .= " AND a.status IN (0,6) ";//未使用 前提条件:未过期 |
|||
} |
|||
#3、列表获取 |
|||
$field = " a.status,a.start_time,a.end_time,a.source,a.festival_id,b.full_money,b.cut_money,b.title |
|||
,b.usegoods_type,b.use_aids,b.use_sids,a.id,b.transferstatus,b.transfermore,b.transferlevel,a.transferflag"; |
|||
$limit = " limit {$pageStart},{$pageIndex} "; |
|||
$list = Redpack::getUserRedPackInfo($field,$where,$limit); |
|||
$total = Redpack::getUserRedPackInfo("count(*) as total",$where); |
|||
#4、信息处理 |
|||
foreach($list as $key => &$val){ |
|||
$val['transferflag'] = $val['transferflag'] ? : 0; |
|||
//金额处理 |
|||
$val['full_money'] = sprintf("%0.2f",$val['full_money']); |
|||
$val['cut_money'] = sprintf("%0.2f",$val['cut_money']); |
|||
//判断是否已过期 |
|||
if($val['end_time'] <= $time) $val['status'] = 2; |
|||
//时间处理 |
|||
$val['time'] = date("Y-m-d",$val['start_time'])."至".date("Y-m-d",$val['end_time']); |
|||
//使用条件处理 0全平台1指定代理2指定商家 |
|||
if ($val['usegoods_type'] == 1) { |
|||
//代理商可用 查询可用代理商信息 |
|||
$val['use_where'] = "仅限指定地区可用"; |
|||
}else if ($val['usegoods_type'] == 2) { |
|||
//商家可用 查询可用商家信息 |
|||
$val['use_where'] = "仅限指定商家可用"; |
|||
}else if ($val['usegoods_type'] == 3) { |
|||
//指定商品可用 商品过多,直接显示固定内容 |
|||
$val['use_where'] = "仅限指定商品可用"; |
|||
}else { |
|||
$val['use_where'] = '全平台可用'; |
|||
$val['link'] = h5_url('pages/mainPages/index/index'); |
|||
} |
|||
//判断是否为节日红包 是则获取红包标签 |
|||
$val['label'] = ''; |
|||
if($val['source'] == 3) $val['label'] = pdo_getcolumn(PDO_NAME."redpack_festival",['id'=>$val['festival_id']],'label'); |
|||
//判断是否可以转赠 |
|||
if($val['transferstatus'] > 0){ |
|||
$val['transferstatus'] = 0; |
|||
if(empty($val['transferflag']) || $val['transfermore'] > 0){ |
|||
$transferlevel = unserialize($val['transferlevel']); |
|||
if(empty($transferlevel)){ |
|||
$val['transferstatus'] = 1; |
|||
}else{ |
|||
$halfflag = WeliamWeChat::VipVerification($_W['mid']); |
|||
if(empty($halfflag)){ |
|||
$levelid = -1; |
|||
}else{ |
|||
$levelid = $halfflag['levelid']; |
|||
} |
|||
if(in_array($levelid,$transferlevel)){ |
|||
$val['transferstatus'] = 1; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
$val['transferstatus'] = $val['transferstatus'] ? : 0; |
|||
//转赠卡券信息获取 |
|||
if($val['transferflag'] > 0){ |
|||
$record = pdo_getall('wlmerchant_transferRecord',array('type' => 2,'objid' => $val['id'],'nmid' => $_W['mid']),array('omid','gettime'),'','ID DESC'); |
|||
$record = $record[0]; |
|||
$oldmember = pdo_get('wlmerchant_member',array('id' => $record['omid']),array('nickname','mobile')); |
|||
$val['oldnickname'] = $oldmember['nickname']; |
|||
$val['oldmobile'] = substr($oldmember['mobile'],0,3).'****'.substr($oldmember['mobile'], -4); |
|||
$val['gettime'] = date('Y/m/d H:i:s',$record['gettime']); |
|||
} |
|||
//删除多余的信息 |
|||
unset($val['start_time']); |
|||
unset($val['end_time']); |
|||
unset($val['source']); |
|||
unset($val['start_time']); |
|||
unset($val['festival_id']); |
|||
} |
|||
#5、统计信息获取 |
|||
//未使用红包 未过期且未使用 |
|||
$notWhere = $publicWhere." AND a.status = 0 ";//未使用条件 |
|||
$notUsed = Redpack::getUserRedPackInfo("count(*) as total" , $notWhere);//未使用 |
|||
//已使用红包 已使用 |
|||
$useWhere = $publicWhere." AND a.status = 1 AND a.end_time > ".$time;//已使用条件 |
|||
$used = Redpack::getUserRedPackInfo("count(*) as total" , $useWhere);//已使用 |
|||
//已过期红包 未使用且已过期 |
|||
$expiredWhere = $publicWhere." AND a.status = 2 ";//已过期条件 |
|||
$expired = Redpack::getUserRedPackInfo("count(*) as total" , $expiredWhere);//已过期 |
|||
//快过期红包 未过期且未使用,同时过期时间为1天内 |
|||
$expireSoonWhere = $publicWhere." AND a.status = 0 AND a.end_time > ".$time." AND a.end_time < ".($time + 86400);//未使用条件 |
|||
$expireSoon = Redpack::getUserRedPackInfo("count(*) as total" , $expireSoonWhere);//未使用 |
|||
#6、信息拼装 |
|||
$info['list'] = $list; |
|||
$info['redpacketData'] = [ |
|||
'total' => ceil(array_column($total , 'total')[0] / $pageIndex) , |
|||
'not_used' => array_column($notUsed , 'total')[0] , |
|||
'used' => array_column($used , 'total')[0] , |
|||
'expired' => array_column($expired , 'total')[0] , |
|||
'expireSoon' => array_column($expireSoon , 'total')[0] , |
|||
]; |
|||
|
|||
if(Customized::init('transfergift') > 0){ |
|||
$info['transfer'] = 1; |
|||
//统计数量 |
|||
$trwhere = " WHERE uniacid = {$_W['uniacid']} AND type = 2 AND omid = {$_W['mid']} AND status = 1"; |
|||
$alllist = pdo_fetchall("select distinct objid from " . tablename(PDO_NAME.'transferRecord').$trwhere); |
|||
$allnum = count($alllist); |
|||
$info['redpacketData']['alltr'] = $allnum; |
|||
}else{ |
|||
$info['transfer'] = 0; |
|||
//统计数量 |
|||
$info['redpacketData']['alltr'] = 0; |
|||
} |
|||
|
|||
$this->renderSuccess('我的红包列表',$info); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 获取某个红包的详细使用信息 |
|||
* Author: zzw |
|||
* Date: 2020/4/29 10:34 |
|||
*/ |
|||
public function getRedPackUserWhere(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$id = $_GPC['id'] OR $this->renderError('不存在的红包,请刷新重试!'); |
|||
#2、红包信息获取 |
|||
$packid = pdo_getcolumn(PDO_NAME."redpack_records",['id'=>$id],'packid'); |
|||
#2、信息获取 |
|||
$field = ['id','title' ,'usegoods_type','usetime_type','use_aids','use_sids' ,'rush_ids','group_ids','fight_ids','bargain_ids']; |
|||
$info = pdo_get(PDO_NAME.'redpacks' , ['id' => $packid],$field); |
|||
if(!$info) $this->renderError('不存在的红包,请刷新重试!'); |
|||
//使用条件处理 0全平台1指定代理2指定商家 |
|||
if ($info['usegoods_type'] == 1) { |
|||
//代理商可用 查询可用代理商信息 |
|||
$aids = unserialize($info['use_aids']); |
|||
//获取可用地区 |
|||
if($aids){ |
|||
foreach ($aids as $aid){ |
|||
$agents = pdo_get(PDO_NAME."oparea",['aid'=>$aid],['areaid','id']); |
|||
$age['name'] = pdo_getcolumn(PDO_NAME.'area',array('id'=>$agents['areaid']),'name'); |
|||
$age['link'] = h5_url('pages/mainPages/index/index','','',$agents['id']); |
|||
} |
|||
$info['use_where'][] = $age; |
|||
}else{ |
|||
$info['use_where'] = []; |
|||
} |
|||
}else if ($info['usegoods_type'] == 2) { |
|||
//商家可用 查询可用商家信息 |
|||
$sids = unserialize($info['use_sids']); |
|||
if($sids){ |
|||
foreach ($sids as $sid){ |
|||
$store = pdo_get(PDO_NAME."merchantdata",['id'=>$sid],['storename','aid']); |
|||
$age['name'] = $store['storename']; |
|||
$age['link'] = h5_url('pages/mainPages/store/index',['sid' => $sid],'',$store['aid']); |
|||
$info['use_where'][] = $age; |
|||
} |
|||
}else{ |
|||
$info['use_where'] = []; |
|||
} |
|||
}else if ($info['usegoods_type'] == 3) { |
|||
//仅限指定商品可用 |
|||
$rushIds = unserialize($info['rush_ids']);//抢购 |
|||
$groupIds = unserialize($info['group_ids']);//团购 |
|||
$fightIds = unserialize($info['fight_ids']);//拼团 |
|||
$bargainIds = unserialize($info['bargain_ids']);//砍价 |
|||
if($rushIds){ |
|||
foreach ($rushIds as $rgid){ |
|||
$goods = pdo_get(PDO_NAME."rush_activity",['id'=>$rgid],['name','aid','id']); |
|||
$age['name'] = '(抢购)'.$goods['name']; |
|||
$age['link'] = h5_url('pages/subPages/goods/index',['type'=>1,'id' =>$goods['id']],'',$goods['aid']); |
|||
$rushList[] = $age; |
|||
} |
|||
}else{ |
|||
$rushList = []; |
|||
} |
|||
if($groupIds){ |
|||
foreach ($groupIds as $ggid){ |
|||
$goods = pdo_get(PDO_NAME."groupon_activity",['id'=>$ggid],['name','aid','id']); |
|||
$age['name'] = '(团购)'.$goods['name']; |
|||
$age['link'] = h5_url('pages/subPages/goods/index',['type'=>2,'id' =>$goods['id']],'',$goods['aid']); |
|||
$groupList[] = $age; |
|||
} |
|||
}else{ |
|||
$groupList = []; |
|||
} |
|||
if($fightIds){ |
|||
foreach ($fightIds as $fgid){ |
|||
$goods = pdo_get(PDO_NAME."fightgroup_goods",['id'=>$fgid],['name','aid','id']); |
|||
$age['name'] = '(拼团)'.$goods['name']; |
|||
$age['link'] = h5_url('pages/subPages/goods/index',['type'=>3,'id' =>$goods['id']],'',$goods['aid']); |
|||
$fightList[] = $age; |
|||
} |
|||
}else{ |
|||
$fightList = []; |
|||
} |
|||
if($bargainIds){ |
|||
foreach ($bargainIds as $bgid){ |
|||
$goods = pdo_get(PDO_NAME."bargain_activity",['id'=>$bgid],['name','aid','id']); |
|||
$age['name'] = '(砍价)'.$goods['name']; |
|||
$age['link'] = h5_url('pages/subPages/goods/index',['type'=>7,'id' =>$goods['id']],'',$goods['aid']); |
|||
$bargainList[] = $age; |
|||
} |
|||
}else{ |
|||
$bargainList = []; |
|||
} |
|||
//数组合并 |
|||
$info['use_where'] = array_merge($rushList,$groupList,$fightList,$bargainList); |
|||
}else { |
|||
$info['use_where'] = '全平台可用'; |
|||
} |
|||
//删除多余的信息 |
|||
unset($info['usegoods_type']); |
|||
unset($info['use_start_time']); |
|||
unset($info['use_end_time']); |
|||
unset($info['usetime_day1']); |
|||
unset($info['usetime_day2']); |
|||
unset($info['usetime_type']); |
|||
unset($info['use_aids']); |
|||
unset($info['use_sids']); |
|||
unset($info['rush_ids']); |
|||
unset($info['group_ids']); |
|||
unset($info['fight_ids']); |
|||
unset($info['bargain_ids']); |
|||
|
|||
$info['id'] = $id; |
|||
|
|||
|
|||
$this->renderSuccess('红包的详细使用信息',$info); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,898 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Redpack_WeliamController{ |
|||
/** |
|||
* Comment: 红包列表 |
|||
*/ |
|||
public function pack_lists(){ |
|||
global $_W , $_GPC; |
|||
//参数获取 |
|||
$pindex = max(1 , intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$name = trim($_GPC['name']); |
|||
//条件生成 |
|||
$where = ['uniacid' => $_W['uniacid'],'aid'=>$_W['aid']]; |
|||
if ($name) $where['title LIKE'] = "%".$name."%"; |
|||
if($_GPC['status'] > 0){ |
|||
if($_GPC['status'] == 3){ |
|||
$where['status'] = 0; |
|||
}else{ |
|||
$where['status'] = $_GPC['status']; |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
if($_GPC['export'] > 0){ |
|||
$this -> exportRedpack($where); |
|||
} |
|||
//信息获取 |
|||
$lists = pdo_getslice(PDO_NAME.'redpacks' , $where , [$pindex , $psize] , $total , [] , '' , "sort DESC,id DESC"); |
|||
|
|||
foreach ($lists as $key => &$val) { |
|||
$usetimes = [ |
|||
date('Y-m-d' , $val['use_start_time']) . ' ~ ' . date('Y-m-d' , $val['use_end_time']) , |
|||
'领取当日起' . $val['usetime_day1'] . '天内有效' , |
|||
'领取次日起' . $val['usetime_day2'] . '天内有效' |
|||
]; |
|||
$val['usetime_text'] = $usetimes[$val['usetime_type']]; |
|||
$val['all_count'] = $val['all_count'] ? $val['all_count'] . '个' : '无限'; |
|||
$val['limit_count'] = $val['limit_count'] ? $val['limit_count'] . '个' : '无限'; |
|||
$val['createtime'] = date('Y-m-d H:i:s' , $val['createtime']); |
|||
$val['get_count'] = pdo_getcolumn(PDO_NAME.'redpack_records' , ['packid' => $val['id']] , 'COUNT(id)'); |
|||
} |
|||
$pager = wl_pagination($total , $pindex , $psize); |
|||
|
|||
include wl_template('redpack/pack_lists'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 导出红包 |
|||
*/ |
|||
|
|||
public function exportRedpack($where){ |
|||
global $_W , $_GPC; |
|||
$lists = pdo_getall(PDO_NAME.'redpacks' , $where ,'*', '',"sort DESC,id DESC"); |
|||
foreach ($lists as $key => &$val) { |
|||
$newinfo = []; |
|||
$usetimes = [ |
|||
date('Y-m-d' , $val['use_start_time']) . ' ~ ' . date('Y-m-d' , $val['use_end_time']) , |
|||
'领取当日起' . $val['usetime_day1'] . '天内有效' , |
|||
'领取次日起' . $val['usetime_day2'] . '天内有效' |
|||
]; |
|||
$val['all_count'] = $val['all_count'] ? $val['all_count'] . '个' : '无限'; |
|||
$val['limit_count'] = $val['limit_count'] ? $val['limit_count'] . '个' : '无限'; |
|||
$val['get_count'] = pdo_getcolumn(PDO_NAME.'redpack_records' , ['packid' => $val['id']] , 'COUNT(id)'); |
|||
//判断是否过期 |
|||
if($val['usetime_type'] == 0 && $val['use_end_time'] <= time()) $val['status'] = 2; |
|||
|
|||
$newinfo['id'] = $val['id']; |
|||
$newinfo['title'] = $val['title']; |
|||
$newinfo['price'] = $val['cut_money'].'元/满'.$val['full_money'].'可用'; |
|||
$newinfo['scene'] = $val['scene'] ? '系统发放' : '自助领取'; |
|||
$newinfo['limit'] = $val['limit_count']; |
|||
$newinfo['stk'] = $val['all_count'].'/'.$val['get_count']; |
|||
if($val['status'] == 2){ |
|||
$newinfo['status'] = '过期'; |
|||
}else if($val['status'] == 1){ |
|||
$newinfo['status'] = '上架'; |
|||
}else{ |
|||
$newinfo['status'] = '下架'; |
|||
} |
|||
$newinfo['time'] = $usetimes[$val['usetime_type']]; |
|||
$newList[] = $newinfo; |
|||
} |
|||
|
|||
|
|||
//标题内容 |
|||
$filter = [ |
|||
'id' => 'ID', |
|||
'title' => '红包名称' , |
|||
'price' => '红包金额/使用条件' , |
|||
'scene' => '红包场景' , |
|||
'limit' => '每人限量' , |
|||
'stk' => '总数量/已领数量' , |
|||
'time' => '使用期限' , |
|||
'status' => '状态' , |
|||
'mobile' => '发放手机号' |
|||
]; |
|||
|
|||
util_csv::export_csv_2($newList, $filter, '红包列表.csv'); |
|||
exit(); |
|||
|
|||
|
|||
} |
|||
|
|||
/** |
|||
* Comment: 添加/编辑红包信息 |
|||
*/ |
|||
public function pack_edit(){ |
|||
global $_W , $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
//提交操作 |
|||
if (checksubmit('submit')) { |
|||
$data = $_GPC['item']; |
|||
$data['use_aids'] = iserializer($_GPC['item']['use_aids']); |
|||
$data['use_sids'] = iserializer($_GPC['item']['use_sids']); |
|||
$data['use_start_time'] = strtotime($_GPC['usetime']['start']); |
|||
$data['use_end_time'] = strtotime($_GPC['usetime']['end']); |
|||
//商品参数处理 |
|||
$data['rush_ids'] = iserializer($_GPC['item']['rush_ids']); |
|||
$data['group_ids'] = iserializer($_GPC['item']['group_ids']); |
|||
$data['fight_ids'] = iserializer($_GPC['item']['fight_ids']); |
|||
$data['bargain_ids'] = iserializer($_GPC['item']['bargain_ids']); |
|||
$level = $_GPC['level']; |
|||
$data['transferlevel'] = serialize($level); |
|||
//信息判断 |
|||
if (($data['usetime_type'] == 1 && empty($data['usetime_day1'])) || ($data['usetime_type'] == 2 && empty($data['usetime_day2']))) wl_message('请填写有效天数' , referer() , 'error'); |
|||
//添加/编辑操作 |
|||
if (!empty($id)) { |
|||
pdo_update(PDO_NAME.'redpacks' , $data , ['id' => $id]); |
|||
}else { |
|||
$data['aid'] = $_W['aid']; |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['createtime'] = time(); |
|||
pdo_insert(PDO_NAME.'redpacks' , $data); |
|||
$id = pdo_insertid(); |
|||
} |
|||
wl_message('编辑红包成功' , web_url('redpack/redpack/pack_edit' , ['id' => $id]) , 'success'); |
|||
} |
|||
//添加/修改操作 |
|||
if (!empty($id)) { |
|||
$item = pdo_get(PDO_NAME.'redpacks' |
|||
, ['uniacid' => $_W['uniacid'] , 'id' => $id,'aid'=>$_W['aid']]); |
|||
$item['use_aids'] = iunserializer($item['use_aids']); |
|||
$item['use_sids'] = iunserializer($item['use_sids']); |
|||
//商品参数处理 |
|||
$item['rush_ids'] = iunserializer($item['rush_ids']); |
|||
$item['group_ids'] = iunserializer($item['group_ids']); |
|||
$item['fight_ids'] = iunserializer($item['fight_ids']); |
|||
$item['bargain_ids'] = iunserializer($item['bargain_ids']); |
|||
$item['level'] = unserialize($item['transferlevel']); |
|||
}else { |
|||
//默认排序为当前的最大值 |
|||
$maxSort = pdo_fetchcolumn("SELECT max(sort) FROM " . tablename(PDO_NAME . "redpacks")); |
|||
$sort = $maxSort ? ($maxSort + 1) : 1; |
|||
$item = [ |
|||
'sort' => $sort , |
|||
'status' => 1 , |
|||
'scene' => 1 , |
|||
'use_start_time' => time() , |
|||
'use_end_time' => time() + 60 * 24 * 3600, |
|||
'usegoods_type' => 1 |
|||
]; |
|||
//在代理商平台的兼容信息 |
|||
if(is_agent()){ |
|||
$item['use_aids'] = [$_W['aid']]; |
|||
} |
|||
} |
|||
//代理商列表&商家列表 |
|||
if(is_agent()){ |
|||
$agents = pdo_getall(PDO_NAME.'agentusers' , ['uniacid' => $_W['uniacid'],'id'=>$_W['aid']] , ['id' , 'agentname']); |
|||
}else{ |
|||
$agents = pdo_getall(PDO_NAME.'agentusers' , ['uniacid' => $_W['uniacid']] , ['id' , 'agentname']); |
|||
$agents = array_merge([['id'=>0,'agentname'=>'总平台']],$agents); |
|||
} |
|||
$stores = pdo_getall(PDO_NAME.'merchantdata' , ['uniacid' => $_W['uniacid'],'aid'=>$_W['aid']] , ['id' , 'storename']); |
|||
//获取当前代理的商品信息 抢购、团购、拼团、砍价 |
|||
$where = ['uniacid' => $_W['uniacid'] , 'aid' => $_W['aid'],'status'=>[1,2]]; |
|||
$rushList = pdo_getall(PDO_NAME . "rush_activity" , $where,['id','name']); |
|||
$grouponList = pdo_getall(PDO_NAME . "groupon_activity" , $where,['id','name']); |
|||
$fightList = pdo_getall(PDO_NAME . "fightgroup_goods" , $where,['id','name']); |
|||
$bargainList = pdo_getall(PDO_NAME . "bargain_activity" , $where,['id','name']); |
|||
//获取会员信息 |
|||
$levels = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_halflevel') . "WHERE uniacid = {$_W['uniacid']} AND status = 1 ORDER BY sort DESC"); |
|||
|
|||
include wl_template('redpack/pack_edit'); |
|||
} |
|||
/** |
|||
* Comment: 红包上下架操作 |
|||
* Author: zzw |
|||
* Date: 2020/2/17 10:40 |
|||
*/ |
|||
public function pack_changeStatus(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$id = intval($_GPC['id']); |
|||
$status = intval($_GPC['status']); |
|||
#2、改变状态 0=下架;1=上架 |
|||
if($status == 1) $data['status'] = 0; |
|||
else $data['status'] = 1; |
|||
#3、信息修改 |
|||
if(pdo_update(PDO_NAME."redpacks",$data,['id'=>$id])) show_json(1); |
|||
else show_json(0,'请刷新重试!'); |
|||
} |
|||
/** |
|||
* Comment: 删除红包并且同时删除已领取的红包 |
|||
*/ |
|||
public function pack_del(){ |
|||
global $_W , $_GPC; |
|||
$id = $_GPC['id'] ? : $_GPC['ids']; |
|||
|
|||
$items = pdo_getall(PDO_NAME.'redpacks' , ['id' => $id , 'uniacid' => $_W['uniacid']] , ['id']); |
|||
foreach ($items as $item) { |
|||
//删除红包信息 |
|||
pdo_delete(PDO_NAME.'redpacks' , ['id' => $item['id']]); |
|||
//删除已领取的红包信息 |
|||
pdo_delete(PDO_NAME.'redpack_records' , ['packid' => $item['id']]); |
|||
//删除已关联到节日红包中的信息 |
|||
pdo_delete(PDO_NAME."redpack_festival_join",['pack_id'=>$item['id']]); |
|||
} |
|||
|
|||
show_json(1 , ['url' => referer()]); |
|||
} |
|||
/** |
|||
* Comment: 红包发放 |
|||
*/ |
|||
public function pack_send(){ |
|||
global $_W , $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
|
|||
if ($_W['ispost']) { |
|||
$users = $_GPC['mids']; |
|||
if (!empty($users)) { |
|||
foreach ($users as $user) { |
|||
Redpack::pack_send($user , $id , 'send'); |
|||
} |
|||
} |
|||
show_json(1 , ['url' => referer()]); |
|||
} |
|||
|
|||
include wl_template('redpack/pack_send'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 导入红包发放 |
|||
*/ |
|||
public function pack_send_csv(){ |
|||
global $_W, $_GPC; |
|||
#1、将获取基本信息 |
|||
//$id = $_GPC['redpackid']; |
|||
$name = $_GPC['name'];//文件储存路径 |
|||
$fullName = PATH_ATTACHMENT . $name;//文件在本地服务器暂存地址 |
|||
#2、读取excel中的内容 |
|||
$info = util_csv::read_csv_lines($fullName, 999, 0); |
|||
unlink($fullName);//获取文件信息后将.cvs文件删除 |
|||
#3、对读取到的信息进行处理 |
|||
foreach ($info as $k => &$v) { |
|||
//3-1 判断是否存在数据 不存在是空行,不进行任何操作 |
|||
if (!is_array($v)) { |
|||
unset($info[$k]); |
|||
continue; |
|||
} |
|||
|
|||
//3-2 编码转换 由gbk转为urf-8 |
|||
$separator = '*separator*';//分割符 写成长字符串 防止出错 |
|||
$encodres = mb_detect_encoding(implode($separator, $v), array("ASCII","GB2312","GBK","UTF-8")); |
|||
if($encodres != 'UTF-8'){ |
|||
$v = explode($separator, iconv('gbk', 'utf-8', implode($separator, $v))); |
|||
} |
|||
$id = $v[0]; |
|||
$getMember = pdo_get('wlmerchant_member',array('mobile' => $v[8],'uniacid' => $_W['uniacid']),array('id','nickname')); |
|||
if(empty($getMember)){ |
|||
$v['send_result'] = '手机号不存在,无法发放'; |
|||
continue; |
|||
} |
|||
$res = Redpack::pack_send($getMember['id'] , $id , 'send'); |
|||
if(is_error($res)){ |
|||
$v['send_result'] = $res['message']; |
|||
}else{ |
|||
$v['send_result'] = '发放成功'; |
|||
} |
|||
} |
|||
|
|||
#4、定义结果表格的标题 |
|||
$filter = array( |
|||
0 => 'ID', |
|||
1 => '红包名称' , |
|||
2 => '红包金额/使用条件' , |
|||
3 => '红包场景' , |
|||
4 => '每人限量' , |
|||
5 => '总数量/已领数量' , |
|||
6 => '使用期限' , |
|||
7 => '状态' , |
|||
8 => '发放手机号', |
|||
'send_result' => '发放结果' |
|||
); |
|||
#5、返回批量发货的结果信息表 |
|||
util_csv::save_csv($info, $filter, $_W['uniacid'].'/'.date('Y-m-d',time()).'/'.'批量发放结果信息'.date('Y-m-d',time()).'.csv'); |
|||
util_csv::export_csv_2($info, $filter, '批量发放结果信息'.date('Y-m-d',time()).'.csv'); |
|||
|
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 领取记录 |
|||
*/ |
|||
public function record_lists(){ |
|||
global $_W , $_GPC; |
|||
//参数获取 |
|||
$pindex = max(1 , intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$packId = intval($_GPC['packid']); |
|||
$name = trim($_GPC['name']); |
|||
$festivalId = intval($_GPC['festival_id']); |
|||
$type = $_GPC['type']; |
|||
$status = $_GPC['status']; |
|||
|
|||
//查询条件生成 |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['aid'] = $_W['aid']; |
|||
//通过红包名称查询 |
|||
if($name){ |
|||
//信息获取 |
|||
$lists = pdo_getall(PDO_NAME."redpacks",['title LIKE'=> '%' . $name. '%'],'id'); |
|||
$ids = array_column($lists,'id'); |
|||
$where['packid IN'] = $ids; |
|||
} |
|||
if($type == 1){ |
|||
$where['type'] = 1; |
|||
}else if($type == 2){ |
|||
$where['type'] = 2; |
|||
}else if($type == 3){ |
|||
$where['type'] = 0; |
|||
} |
|||
if($status > 0){ |
|||
if($status == 4){ |
|||
$where['status'] = 0; |
|||
}else{ |
|||
$where['status'] = $status; |
|||
} |
|||
} |
|||
//通过红包id查询 |
|||
if($packId){ |
|||
$where['packid'] = $packId; |
|||
$name = pdo_getcolumn(PDO_NAME.'redpacks',array('id'=>$packId),'title'); |
|||
} |
|||
//通过节日红包活动查询 |
|||
if($festivalId) $where['festival_id'] = $festivalId; |
|||
//领取记录获取 |
|||
$lists = pdo_getslice(PDO_NAME.'redpack_records' ,$where , [$pindex , $psize] , $total , [] , '' , "id DESC"); |
|||
foreach ($lists as $key => &$val) { |
|||
$val['createtime'] = date('Y-m-d H:i:s' , $val['createtime']); |
|||
$val['usetime'] = $val['usetime'] ? date('Y-m-d H:i:s' , $val['usetime']) : '--'; |
|||
$val['pack'] = Redpack::pack_get($val['packid']); |
|||
$val['member'] = Member::wl_member_get($val['mid'] , ['mobile' , 'nickname' , 'avatar']); |
|||
//判断是否为节日红包领取 |
|||
$val['festival_name'] = $val['festival_id'] > 0 ? pdo_getcolumn(PDO_NAME."redpack_festival",['id'=>$val['festival_id']],'name') : '--'; |
|||
//判断是否有转赠记录 |
|||
$val['trflag'] = pdo_getcolumn(PDO_NAME.'transferRecord',array('type'=>2,'objid'=>$val['id']),'id'); |
|||
//查询使用商户 |
|||
if($val['plugin'] == 'rush'){ |
|||
$val['sid'] = pdo_getcolumn(PDO_NAME.'rush_order',array('id'=>$val['orderid']),'sid'); |
|||
}else{ |
|||
$val['sid'] = pdo_getcolumn(PDO_NAME.'order',array('id'=>$val['orderid']),'sid'); |
|||
} |
|||
$val['storename'] = pdo_getcolumn(PDO_NAME.'merchantdata',array('id'=>$val['sid']),'storename'); |
|||
} |
|||
$pager = wl_pagination($total , $pindex , $psize); |
|||
//统计信息获取 |
|||
$all_num = pdo_getcolumn(PDO_NAME.'redpack_records' ,array_merge(['aid'=>$_W['aid'],'uniacid' => $_W['uniacid']],$where) , 'COUNT(id)'); |
|||
$use_num = pdo_getcolumn(PDO_NAME.'redpack_records' ,array_merge($where,['aid'=>$_W['aid'],'uniacid' => $_W['uniacid'] , 'status' => 1]) , 'COUNT(id)'); |
|||
$end_num = pdo_getcolumn(PDO_NAME.'redpack_records' ,array_merge($where,['aid'=>$_W['aid'],'uniacid' => $_W['uniacid'] , 'status' => 2]), 'COUNT(id)'); |
|||
if($use_num > 0) $use_rate = sprintf("%0.2f",$use_num/$all_num*100); |
|||
else $use_rate = 0; |
|||
|
|||
$transfer_num = pdo_getcolumn(PDO_NAME.'redpack_records' ,array_merge($where, ['aid'=>$_W['aid'],'uniacid' => $_W['uniacid'],'transferflag'=>1]) , 'COUNT(id)'); |
|||
|
|||
|
|||
include wl_template('redpack/record_lists'); |
|||
} |
|||
/** |
|||
* Comment: 删除领取记录 |
|||
*/ |
|||
public function record_del(){ |
|||
global $_W , $_GPC; |
|||
$id = $_GPC['id'] ? : $_GPC['ids']; |
|||
|
|||
$items = pdo_getall(PDO_NAME.'redpack_records' , ['id' => $id , 'uniacid' => $_W['uniacid']] , ['id']); |
|||
foreach ($items as $item) { |
|||
pdo_delete(PDO_NAME.'redpack_records' , ['id' => $item['id']]); |
|||
} |
|||
|
|||
show_json(1 , ['url' => referer()]); |
|||
} |
|||
/** |
|||
* Comment: 红包使用 |
|||
*/ |
|||
public function record_use(){ |
|||
global $_W , $_GPC; |
|||
$id = $_GPC['id'] ? : $_GPC['ids']; |
|||
$items = pdo_getall(PDO_NAME.'redpack_records' , ['id' => $id , 'uniacid' => $_W['uniacid']] , ['id']); |
|||
foreach ($items as $item) { |
|||
pdo_update(PDO_NAME.'redpack_records' , ['status' => 1 , 'usetime' => time()] , ['id' => $item['id']]); |
|||
} |
|||
|
|||
show_json(1 , ['url' => referer()]); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 转赠记录 |
|||
*/ |
|||
public function record_transfer(){ |
|||
global $_W , $_GPC; |
|||
$id = $_GPC['id']; |
|||
$record = pdo_getall('wlmerchant_transferRecord',array('objid' => $id,'type' =>2),'','','createtime DESC'); |
|||
if(!empty($record)){ |
|||
foreach ($record as &$re){ |
|||
$omember = pdo_get(PDO_NAME.'member',array('id'=>$re['omid']),['nickname','avatar']); |
|||
$re['nickname'] = $omember['nickname']; |
|||
$re['avatar'] = tomedia($omember['avatar']); |
|||
if($re['nmid'] > 0){ |
|||
$nmember = pdo_get(PDO_NAME.'member',array('id'=>$re['nmid']),['nickname','avatar']); |
|||
$re['getnickname'] = $nmember['nickname']; |
|||
$re['getavatar'] = $nmember['avatar']; |
|||
} |
|||
} |
|||
} |
|||
include wl_template('redpack/record_transfer'); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 进入新人红包设置页面 |
|||
* Author: zzw |
|||
* Date: 2020/2/18 14:11 |
|||
*/ |
|||
public function new_pack(){ |
|||
global $_W , $_GPC; |
|||
#1、获取红包列表信息 仅获取上架并且为 系统发放 的红包 |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['aid'] = $_W['aid']; |
|||
//$where['status'] = 1; |
|||
$where['scene'] = 1; |
|||
$list = pdo_getall(PDO_NAME."redpacks",$where |
|||
,['id','title','all_count','limit_count','full_money','cut_money','usegoods_type','use_start_time','use_end_time','usetime_type','usetime_day1','usetime_day2']); |
|||
if(!$list) wl_message('无可使用的红包,请先添加系统发放并且上架中的红包!' ,web_url('redpack/redpack/pack_lists'), 'error'); |
|||
|
|||
include wl_template('redpack/new_pack'); |
|||
} |
|||
/** |
|||
* Comment: 新人红包信息设置 |
|||
* Author: zzw |
|||
* Date: 2020/2/18 14:10 |
|||
*/ |
|||
public function new_pack_set(){ |
|||
global $_W,$_GPC; |
|||
$setName = 'red_pack_new'; |
|||
$set = $_GPC['set']; |
|||
#2、判断是否添加红包 |
|||
$ids = array_column($set['list'],'id'); |
|||
if($set['status'] == 1 && !$set['list']) Commons::sRenderError('无红包信息,请先添加红包!'); |
|||
if(in_array(0,$ids)) Commons::sRenderError('存在未选择红包的信息!'); |
|||
if(count($ids) != count(array_unique($ids))) Commons::sRenderError('存在重复的红包信息!'); |
|||
#3、记录设置信息 |
|||
$set['color'] = serialize($set['color']);//颜色设置信息转义 |
|||
Setting::agentsetting_save($set,$setName); |
|||
|
|||
Commons::sRenderSuccess('编辑成功!'); |
|||
} |
|||
/** |
|||
* Comment: 获取新人红包设置信息 |
|||
* Author: zzw |
|||
* Date: 2020/2/18 14:10 |
|||
*/ |
|||
public function new_pack_get(){ |
|||
global $_W,$_GPC; |
|||
$setName = 'red_pack_new'; |
|||
#1、获取红包列表信息 仅获取上架并且为 系统发放 的红包 |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['aid'] = $_W['aid']; |
|||
//$where['status'] = 1; |
|||
$where['scene'] = 1; |
|||
$list = pdo_getall(PDO_NAME."redpacks",$where |
|||
,['id','title','status','all_count','limit_count','full_money','cut_money','usegoods_type','use_start_time','use_end_time','usetime_type','usetime_day1','usetime_day2']); |
|||
if(!$list) Commons::sRenderError('无可使用的红包,请先添加系统发放且上架中的红包!',['url'=>web_url('redpack/redpack/pack_lists')]); |
|||
#2、循环处理红包信息 |
|||
foreach($list as $key => &$val){ |
|||
//状态信息 |
|||
if($val['usetime_type'] == 0 && $val['use_end_time'] <= time()) { |
|||
//判断是否过期 删除当前信息并且跳出本次循环 |
|||
// unset($list[$key]); |
|||
// continue; |
|||
$state = '已过期'; |
|||
}else if($val['status'] == 0){ |
|||
$state = '已下架'; |
|||
}else{ |
|||
$state = '正常'; |
|||
} |
|||
$val['title'] = $val['title']."({$state})"; |
|||
//信息处理 |
|||
$usetimes = [ |
|||
date('Y-m-d' , $val['use_start_time']) . ' ~ ' . date('Y-m-d' , $val['use_end_time']) , |
|||
'领取当日起' . $val['usetime_day1'] . '天内有效' , |
|||
'领取次日起' . $val['usetime_day2'] . '天内有效' |
|||
]; |
|||
$val['usetime_text'] = $usetimes[$val['usetime_type']]; |
|||
$val['cut_money'] = sprintf("%.2f",$val['cut_money']); |
|||
$val['full_money'] = sprintf("%.2f",$val['full_money']); |
|||
//删除无效数据 |
|||
unset($val['use_start_time']); |
|||
unset($val['usetime_day1']); |
|||
unset($val['usetime_day2']); |
|||
unset($val['usetime_type']); |
|||
} |
|||
#2、构建一个以id作为下标的新数组 |
|||
$idArr = array_column($list,'id'); |
|||
$newList = array_combine($idArr,$list); |
|||
#2、获取设置信息 |
|||
$set = Setting::agentsetting_read($setName); |
|||
if(!$set){ |
|||
$set = [ |
|||
'status' => 0 , |
|||
'image' => URL_WEB_RESOURCE . 'images/new_redpack.png' , |
|||
'image_url' => URL_WEB_RESOURCE . 'images/new_redpack.png' , |
|||
'wheres' => 0 , |
|||
'list' => [] , |
|||
'color' => [ |
|||
'bg_color' => '#F02C2C' , |
|||
'price_color' => '#FF4444' , |
|||
'button_color' => '#FFE95D' , |
|||
'text_color' => '#F02C2C' , |
|||
] , |
|||
]; |
|||
}else{ |
|||
$set['color'] = unserialize($set['color']); |
|||
} |
|||
#2、信息拼装 |
|||
$data = [ |
|||
'list' => $list , |
|||
'new_list' => $newList , |
|||
'set' => $set , |
|||
]; |
|||
|
|||
Commons::sRenderSuccess('成功',$data); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 节日红包信息 |
|||
* Author: zzw |
|||
* Date: 2020/2/19 10:46 |
|||
*/ |
|||
public function festival_pack(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$pindex = max(1 , intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$name = trim($_GPC['name']); |
|||
#1、条件生成 |
|||
$where = ['uniacid' => $_W['uniacid'],'aid'=>$_W['aid']]; |
|||
if ($name) $where['name LIKE'] = "%".$name."%"; |
|||
#1、信息获取 |
|||
$field = ['id','status','name','label','start_time','end_time']; |
|||
$lists = pdo_getslice(PDO_NAME.'redpack_festival' , $where , [$pindex , $psize] , $total , $field , '' , "id DESC"); |
|||
foreach ($lists as $key => &$val) { |
|||
//数据处理 |
|||
$val['time'] = date("Y-m-d",$val['start_time']).' ~ '.date("Y-m-d",$val['end_time']); |
|||
$val['list'] = Redpack::getRedPackFestivalJoin($val['id'],'b.id,b.title,convert(b.full_money,decimal(10,2)) as full_money,convert(b.cut_money,decimal(10,2)) as cut_money,a.limit'); |
|||
//判断是否已经过期 |
|||
if($val['end_time'] <= time()) $val['status'] = 2; |
|||
unset($val['start_time']); |
|||
unset($val['end_time']); |
|||
} |
|||
$pager = wl_pagination($total , $pindex , $psize); |
|||
|
|||
include wl_template('redpack/festival_pack'); |
|||
} |
|||
/** |
|||
* Comment: 进入节日红包编辑页面 |
|||
* Author: zzw |
|||
* Date: 2020/2/18 17:23 |
|||
*/ |
|||
public function festival_pack_edit(){ |
|||
global $_W,$_GPC; |
|||
$id = intval($_GPC['id']); |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['aid'] = $_W['aid']; |
|||
$where['status'] = 1; |
|||
$where['scene'] = 1; |
|||
$list = pdo_getall(PDO_NAME."redpacks",$where |
|||
,['id','title','all_count','limit_count','full_money','cut_money','usegoods_type','use_start_time','use_end_time','usetime_type','usetime_day1','usetime_day2']); |
|||
if(!$list) wl_message('无可使用的红包,请先添加系统发放并且上架中的红包!' ,web_url('redpack/redpack/pack_lists'), 'error'); |
|||
|
|||
include wl_template('redpack/festival_pack_edit'); |
|||
} |
|||
/** |
|||
* Comment: 获取某条节日红包信息 |
|||
* Author: zzw |
|||
* Date: 2020/2/18 18:18 |
|||
*/ |
|||
public function festival_pack_get(){ |
|||
global $_W,$_GPC; |
|||
$id = intval($_GPC['id']); |
|||
#1、获取红包列表信息 仅获取上架并且为 系统发放 的红包 |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['aid'] = $_W['aid']; |
|||
$where['status'] = 1; |
|||
$where['scene'] = 1; |
|||
$list = pdo_getall(PDO_NAME."redpacks",$where |
|||
,['id','title','all_count','limit_count','full_money','cut_money','usegoods_type','use_start_time','use_end_time','usetime_type','usetime_day1','usetime_day2']); |
|||
if(!$list) Commons::sRenderError('无红包信息,请先添加红包!'); |
|||
#2、循环处理红包信息 |
|||
foreach($list as $key => &$val){ |
|||
//判断是否过期 删除当前信息并且跳出本次循环 |
|||
if($val['usetime_type'] == 0 && $val['use_end_time'] <= time()) { |
|||
unset($list[$key]); |
|||
continue; |
|||
} |
|||
//信息处理 |
|||
$usetimes = [ |
|||
date('Y-m-d' , $val['use_start_time']) . ' ~ ' . date('Y-m-d' , $val['use_end_time']) , |
|||
'领取当日起' . $val['usetime_day1'] . '天内有效' , |
|||
'领取次日起' . $val['usetime_day2'] . '天内有效' |
|||
]; |
|||
$val['usetime_text'] = $usetimes[$val['usetime_type']]; |
|||
$val['cut_money'] = sprintf("%.2f",$val['cut_money']); |
|||
$val['full_money'] = sprintf("%.2f",$val['full_money']); |
|||
//删除无效数据 |
|||
unset($val['use_start_time']); |
|||
unset($val['usetime_day1']); |
|||
unset($val['usetime_day2']); |
|||
unset($val['usetime_type']); |
|||
} |
|||
#2、构建一个以id作为下标的新数组 |
|||
$idArr = array_column($list,'id'); |
|||
$newList = array_combine($idArr,$list); |
|||
#2、获取当前节日红包的信息 |
|||
if($id){ |
|||
$info = pdo_get(PDO_NAME."redpack_festival",['id'=>$id]); |
|||
if(!$info) Commons::sRenderError('信息获取失败,请刷新重试!'); |
|||
$info['color'] = unserialize($info['color']); |
|||
$info['image_url'] = toimage($info['images']); |
|||
$info['start_time'] = date("Y-m-d",$info['start_time']); |
|||
$info['end_time'] = date("Y-m-d",$info['end_time']); |
|||
$info['list'] = Redpack::getRedPackFestivalJoin($id,'a.pack_id,a.limit'); |
|||
}else{ |
|||
$info = [ |
|||
'status' => 1 , |
|||
'name' => '新年红包' , |
|||
'label' => '新年' , |
|||
'images' => URL_WEB_RESOURCE . 'images/festival_redpack_5.png' , |
|||
'image_url' => URL_WEB_RESOURCE . 'images/festival_redpack_5.png' , |
|||
'color' => [ |
|||
'bg_color' => '#BD1F29' , |
|||
'price_color' => '#FF4444' , |
|||
'button_color' => '#F6D286' , |
|||
'text_color' => '#BD1F29' , |
|||
] , |
|||
'start_time' => date("Y-m-d" , time()) , |
|||
'end_time' => date("Y-m-d" , strtotime("+1 Month" , time())) , |
|||
'list' => [] , |
|||
'redpack_calss' => 5 ,//1=自定义类型,2=中秋红包,3=国庆红包,4=圣诞红包,5=新年红包,6=端午红包 |
|||
]; |
|||
} |
|||
#2、信息拼装 |
|||
$data = [ |
|||
'list' => $list , |
|||
'new_list' => $newList , |
|||
'info' => $info , |
|||
]; |
|||
|
|||
Commons::sRenderSuccess('成功',$data); |
|||
} |
|||
/** |
|||
* Comment: 编辑节日红包信息 |
|||
* Author: zzw |
|||
* Date: 2020/2/18 17:53 |
|||
*/ |
|||
public function festival_pack_set(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$id = intval($_GPC['id']); |
|||
$info = $_GPC['info'] ? : []; |
|||
#2、判断信息是否填写完整 |
|||
if($info['status'] == 1 && !$info['name']) Commons::sRenderError('请输入节日名称!'); |
|||
if($info['status'] == 1 && !$info['label']) Commons::sRenderError('请输入红包标签!'); |
|||
$ids = array_column($info['list'],'pack_id'); |
|||
if($info['status'] == 1 && !$info['list']) Commons::sRenderError('无红包信息,请先添加红包!'); |
|||
if(in_array(0,$ids)) Commons::sRenderError('存在未选择红包的信息!'); |
|||
if(count($ids) != count(array_unique($ids))) Commons::sRenderError('存在重复的红包信息!'); |
|||
#3、记录信息/修改信息 |
|||
$joinList = $info['list']; |
|||
unset($info['image_url']); |
|||
unset($info['list']); |
|||
//颜色设置信息转义 |
|||
$info['color'] = serialize($info['color']); |
|||
//时间信息转义 |
|||
$info['start_time'] = strtotime($info['start_time']); |
|||
$info['end_time'] = strtotime($info['end_time']); |
|||
if($id){ |
|||
//修改操作 |
|||
pdo_update(PDO_NAME."redpack_festival",$info,['id'=>$id]); |
|||
//删除已经存在的关联信息 |
|||
pdo_delete(PDO_NAME."redpack_festival_join",['festival_id'=>$id]); |
|||
}else{ |
|||
$info['uniacid'] = $_W['uniacid']; |
|||
$info['aid'] = $_W['aid']; |
|||
//添加操作 |
|||
pdo_insert(PDO_NAME."redpack_festival",$info); |
|||
$id = pdo_insertid(); |
|||
} |
|||
#3、添加关联信息 |
|||
foreach($joinList as $key => $val){ |
|||
$data = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'pack_id' => $val['pack_id'] ,//红包id |
|||
'festival_id' => $id ,//节日信息id |
|||
'limit' => $val['limit'] ,//每人领取限制 |
|||
]; |
|||
pdo_insert(PDO_NAME."redpack_festival_join",$data); |
|||
} |
|||
Commons::sRenderSuccess('编辑成功!',['id'=>$id]); |
|||
|
|||
} |
|||
/** |
|||
* Comment: 节日红包上下架操作 |
|||
* Author: zzw |
|||
* Date: 2020/2/19 10:28 |
|||
*/ |
|||
public function festival_pack_changeStatus(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$id = intval($_GPC['id']); |
|||
$status = intval($_GPC['status']); |
|||
#2、改变状态 0=下架;1=上架 |
|||
if($status == 1) $data['status'] = 0; |
|||
else $data['status'] = 1; |
|||
#3、信息修改 |
|||
if(pdo_update(PDO_NAME."redpack_festival",$data,['id'=>$id])) show_json(1); |
|||
else show_json(0,'请刷新重试!'); |
|||
} |
|||
/** |
|||
* Comment: 节日红包删除操作 |
|||
* Author: zzw |
|||
* Date: 2020/2/19 10:31 |
|||
*/ |
|||
public function festival_pack__del(){ |
|||
global $_W , $_GPC; |
|||
$id = $_GPC['id'] ? : $_GPC['ids']; |
|||
$items = pdo_getall(PDO_NAME.'redpack_festival' , ['id' => $id , 'uniacid' => $_W['uniacid']] , ['id']); |
|||
foreach ($items as $item) { |
|||
//删除节日红包信息 |
|||
pdo_delete(PDO_NAME.'redpack_festival' , ['id' => $item['id']]); |
|||
//删除通过当前活动领取的红包信息 |
|||
pdo_delete(PDO_NAME.'redpack_records' , ['festival_id' => $item['id']]); |
|||
} |
|||
|
|||
show_json(1); |
|||
} |
|||
/** |
|||
* Comment: 更换模板 |
|||
* Author: zzw |
|||
* Date: 2020/2/26 10:34 |
|||
*/ |
|||
public function festival_pack_modelSelect(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$id = $_GPC['id'] ? : 0; |
|||
$redPackCalss = $_GPC['redpack_calss'] ? : 1; |
|||
#2、判断是否已存在信息 并且模板类型为当前选中类型 符合条件则返回已存在的信息 否则返回默认信息 |
|||
if($id > 0){ |
|||
$info = pdo_get(PDO_NAME."redpack_festival",['id'=>$id]); |
|||
$list = Redpack::getRedPackFestivalJoin($id,'a.pack_id,a.limit'); |
|||
if($info['redpack_calss'] == $redPackCalss){ |
|||
if(!$info) Commons::sRenderError('信息获取失败,请刷新重试!'); |
|||
$info['color'] = unserialize($info['color']); |
|||
$info['image_url'] = toimage($info['images']); |
|||
$info['start_time'] = date("Y-m-d",$info['start_time']); |
|||
$info['end_time'] = date("Y-m-d",$info['end_time']); |
|||
$info['list'] = $list; |
|||
|
|||
Commons::sRenderSuccess('成功',$info); |
|||
} |
|||
} |
|||
#3、模板获取 2=中秋红包,3=国庆红包,4=圣诞红包,5=新年红包,6=端午红包 |
|||
switch ($redPackCalss){ |
|||
case 2: |
|||
$info = [ |
|||
'name' => '中秋红包' , |
|||
'label' => '中秋' , |
|||
'images' => URL_WEB_RESOURCE . 'images/festival_redpack_2.png' , |
|||
'image_url' => URL_WEB_RESOURCE . 'images/festival_redpack_2.png' , |
|||
'color' => [ |
|||
'bg_color' => '#31345D' , |
|||
'price_color' => '#FF4444' , |
|||
'button_color' => '#FFE95D' , |
|||
'text_color' => '#31345D' , |
|||
] , |
|||
'redpack_calss' => 2 , |
|||
]; |
|||
break;//中秋红包 |
|||
case 3: |
|||
$info = [ |
|||
'name' => '国庆红包' , |
|||
'label' => '国庆' , |
|||
'images' => URL_WEB_RESOURCE . 'images/festival_redpack_3.png' , |
|||
'image_url' => URL_WEB_RESOURCE . 'images/festival_redpack_3.png' , |
|||
'color' => [ |
|||
'bg_color' => '#F02C2C' , |
|||
'price_color' => '#FF4444' , |
|||
'button_color' => '#FFE95D' , |
|||
'text_color' => '#F02C2C' , |
|||
] , |
|||
'redpack_calss' => 3 , |
|||
]; |
|||
break;//国庆红包 |
|||
case 4: |
|||
$info = [ |
|||
'name' => '圣诞红包' , |
|||
'label' => '圣诞' , |
|||
'images' => URL_WEB_RESOURCE . 'images/festival_redpack_4.png' , |
|||
'image_url' => URL_WEB_RESOURCE . 'images/festival_redpack_4.png' , |
|||
'color' => [ |
|||
'bg_color' => '#E33D2C' , |
|||
'price_color' => '#FF4444' , |
|||
'button_color' => '#FFE95D' , |
|||
'text_color' => '#E33D2C' , |
|||
] , |
|||
'redpack_calss' => 4 , |
|||
]; |
|||
break;//圣诞红包 |
|||
case 5: |
|||
$info = [ |
|||
'name' => '新年红包' , |
|||
'label' => '新年' , |
|||
'images' => URL_WEB_RESOURCE . 'images/festival_redpack_5.png' , |
|||
'image_url' => URL_WEB_RESOURCE . 'images/festival_redpack_5.png' , |
|||
'color' => [ |
|||
'bg_color' => '#BD1F29' , |
|||
'price_color' => '#FF4444' , |
|||
'button_color' => '#F6D286' , |
|||
'text_color' => '#BD1F29' , |
|||
] , |
|||
'redpack_calss' => 5 , |
|||
]; |
|||
break;//新年红包 |
|||
case 6: |
|||
$info = [ |
|||
'name' => '端午红包' , |
|||
'label' => '端午' , |
|||
'images' => URL_WEB_RESOURCE . 'images/festival_redpack_6.png' , |
|||
'image_url' => URL_WEB_RESOURCE . 'images/festival_redpack_6.png' , |
|||
'color' => [ |
|||
'bg_color' => '#C1ECD3' , |
|||
'price_color' => '#FF4444' , |
|||
'button_color' => '#038233' , |
|||
'text_color' => '#C1ECD3' , |
|||
] , |
|||
'redpack_calss' => 6 , |
|||
]; |
|||
break;//端午红包 |
|||
} |
|||
#4、添加模板公共信息 |
|||
$info['status'] = 1; |
|||
$info['start_time'] = date("Y-m-d" , time()); |
|||
$info['end_time'] = date("Y-m-d" , strtotime("+1 Month" , time())); |
|||
$info['list'] = $list ? $list : []; |
|||
|
|||
Commons::sRenderSuccess('成功',$info); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* Comment: 保存设置信息 |
|||
* Author: zzw |
|||
* Date: 2020/3/17 15:13 |
|||
*/ |
|||
public function set(){ |
|||
global $_W,$_GPC; |
|||
#1、名称设置 |
|||
$name = 'red_pack_set'; |
|||
#2、保存设置信息 |
|||
if (checksubmit('submit')){ |
|||
$set = $_GPC['set']; |
|||
$set['intervalmin'] = sprintf("%.0f",$set['intervalmin']); |
|||
$res = Setting::wlsetting_save($set,$name); |
|||
if ($res) show_json(1); |
|||
else show_json(0, '保存失败'); |
|||
} |
|||
#3、获取设置信息 |
|||
$set = Setting::wlsetting_read($name); |
|||
|
|||
include wl_template('redpack/set'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
{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('redpack/redpack/festival_pack_edit')}" class="btn btn-primary">添加红包</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form class="form-horizontal" action="{php echo web_url('redpack/redpack/pack_lists')}" method="post"> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">红包信息</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="name" value="{$_GPC['name']}" 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> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</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">节日名称</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 $item} |
|||
<tr class="text-center"> |
|||
<td>{$item['name']}</td> |
|||
<td>{$item['label']}</td> |
|||
<td> |
|||
{loop $item['list'] $pack} |
|||
<div>{$pack['title']}/{$pack['cut_money']}元/{php echo $pack['full_money'] ? '满'.$pack['full_money'].'元使用' :"无门槛";}/{$pack['limit']}</div> |
|||
{/loop} |
|||
</td> |
|||
<td>{$item['time']}</td> |
|||
<td> |
|||
{if $item['status']==2} |
|||
<a href="javascript:;" class='btn btn-sm btn-danger'>过期</a> |
|||
{else} |
|||
<a data-toggle="ajaxPost" href="{php echo web_url('redpack/redpack/festival_pack_changeStatus', ['id' => $item['id'],'status'=>$item['status']])}" class='btn btn-sm {if $item['status']==1}btn-primary{else}btn-default{/if}'> |
|||
{if $item['status']==1}上架{else}下架{/if} |
|||
</a> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<a class="btn btn-sm btn-info" href="{php echo web_url('redpack/redpack/record_lists', ['festival_id' => $item['id']])}">领取记录</a> |
|||
<a class="btn btn-sm btn-primary" href="{php echo web_url('redpack/redpack/festival_pack_edit',['id' => $item['id']])}">编辑</a> |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('redpack/redpack/festival_pack__del', ['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> |
|||
{else} |
|||
<div class="no-result"> |
|||
<p>还没有相关数据</p> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,633 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.app-content { |
|||
float: left; |
|||
width: calc(100% - 30px); |
|||
} |
|||
|
|||
.left_p > img { |
|||
width: 100%; |
|||
height: 100%; |
|||
display: block; |
|||
} |
|||
|
|||
.p_i span:first-child { |
|||
font-size: 16px; |
|||
color: #fff; |
|||
line-height: 16px; |
|||
} |
|||
|
|||
.p_i span:last-child { |
|||
font-size: 25px; |
|||
color: #fff; |
|||
font-family: 'Arial'; |
|||
line-height: 28px; |
|||
display: inline-block; |
|||
vertical-align: -12px; |
|||
} |
|||
|
|||
.pm_title { |
|||
font-size: 13px; |
|||
line-height: 15px; |
|||
height: 15px; |
|||
color: #434343; |
|||
width: 150px; |
|||
margin-top: 5px; |
|||
overflow: hidden; |
|||
white-space: nowrap; |
|||
text-overflow: ellipsis; |
|||
} |
|||
|
|||
.f-a { |
|||
font-family: 'Arial' !important; |
|||
} |
|||
|
|||
.ca_line { |
|||
width: auto; |
|||
height: 19px; |
|||
line-height: 19px; |
|||
border-radius: 14.5px; |
|||
border: 1px solid #e5e5e5; |
|||
font-size: 13px; |
|||
color: #636363; |
|||
margin-bottom: 3px; |
|||
margin-top: 3px; |
|||
text-align: left; |
|||
display: inline-block; |
|||
padding: 0 10px; |
|||
} |
|||
|
|||
.data_time { |
|||
font-size: 12px; |
|||
color: #969696; |
|||
width: 150px; |
|||
} |
|||
|
|||
.env_head { |
|||
position: absolute; |
|||
top: 12px; |
|||
left: 12px; |
|||
width: 296px; |
|||
height: 148px; |
|||
display: block; |
|||
object-fit: cover; |
|||
} |
|||
|
|||
.bl_r { |
|||
position: absolute; |
|||
top: 160px; |
|||
left: 12px; |
|||
width: 296px; |
|||
height: 310px; |
|||
background: #d41625; |
|||
} |
|||
|
|||
.om_buy { |
|||
position: absolute; |
|||
left: 0; |
|||
right: 0; |
|||
bottom: 0; |
|||
height: 78px; |
|||
background: #d41625; |
|||
z-index: 2; |
|||
} |
|||
|
|||
.om_buy > div { |
|||
width: 246px; |
|||
height: 42px; |
|||
background: -webkit-linear-gradient(#f4af5f, #f8d782); |
|||
background: -o-linear-gradient(#f4af5f, #f8d782); |
|||
background: -moz-linear-gradient(#f4af5f, #f8d782); |
|||
background: linear-gradient(#f4af5f, #f8d782); |
|||
color: #d41c3b; |
|||
border-radius: 20.85px; |
|||
line-height: 42px; |
|||
font-size: 13px; |
|||
text-align: center; |
|||
margin: 18px auto; |
|||
} |
|||
|
|||
.om_buy_b > div { |
|||
width: 246px; |
|||
height: 42px; |
|||
background: #ffe937; |
|||
color: #fb5422; |
|||
border-radius: 20.85px; |
|||
line-height: 42px; |
|||
font-size: 13px; |
|||
text-align: center; |
|||
margin: 18px auto; |
|||
} |
|||
|
|||
.bl_l { |
|||
position: absolute; |
|||
top: 160px; |
|||
left: 12px; |
|||
width: 296px; |
|||
height: 232px; |
|||
overflow-y: auto; |
|||
padding-top: 8px; |
|||
} |
|||
|
|||
.list { |
|||
overflow: hidden; |
|||
width: 261px; |
|||
height: 80px; |
|||
border-radius: 20px; |
|||
margin: 0 auto; |
|||
background: #fff; |
|||
margin-bottom: 8px; |
|||
position: relative; |
|||
} |
|||
|
|||
.list_left { |
|||
width: 103px; |
|||
float: left; |
|||
color: #d41625; |
|||
position: relative; |
|||
} |
|||
|
|||
.list_right { |
|||
margin-left: 103px; |
|||
position: relative; |
|||
top: 5px; |
|||
} |
|||
|
|||
.text { |
|||
position: relative; |
|||
left: 5px; |
|||
font-size: 14px; |
|||
line-height: 32px; |
|||
} |
|||
|
|||
.triangle-topleft { |
|||
font-family: 'Arial'; |
|||
font-size: 22px; |
|||
display: inline-block; |
|||
} |
|||
|
|||
.list_text { |
|||
font-size: 10px; |
|||
color: #969696; |
|||
padding-left: 10px; |
|||
text-align: center; |
|||
} |
|||
|
|||
.bl_line { |
|||
position: absolute; |
|||
left: -8px; |
|||
top: 32px; |
|||
background: #d41625; |
|||
width: 15px; |
|||
height: 15px; |
|||
border-radius: 50%; |
|||
} |
|||
|
|||
.bl_second { |
|||
position: absolute; |
|||
right: -8px; |
|||
top: 32px; |
|||
background: #d41625; |
|||
width: 15px; |
|||
height: 15px; |
|||
border-radius: 50%; |
|||
} |
|||
|
|||
.ad_bless > i { |
|||
font-size: 10px !important; |
|||
padding-left: 14px; |
|||
padding-right: 8px; |
|||
} |
|||
|
|||
.ad_bless > span { |
|||
font-size: 14px; |
|||
} |
|||
|
|||
.look_img > img { |
|||
display: block; |
|||
width: 246px; |
|||
height: 72px; |
|||
position: absolute; |
|||
top: 24px; |
|||
left: 603px; |
|||
} |
|||
|
|||
.function_single a { |
|||
display: block; |
|||
height: 100% |
|||
} |
|||
|
|||
.function_left img { |
|||
display: block; |
|||
position: absolute; |
|||
margin: auto; |
|||
left: 0; |
|||
right: 0; |
|||
top: 0; |
|||
bottom: 0; |
|||
width: 55px; |
|||
} |
|||
|
|||
#redList .input-group { |
|||
margin-bottom: 5px; |
|||
} |
|||
|
|||
input[type="button"] { |
|||
outline: 0 none !important; |
|||
} |
|||
|
|||
select { |
|||
appearance: none !important; |
|||
-moz-appearance: none !important; |
|||
-webkit-appearance: none !important; |
|||
background: white !important; |
|||
padding-right: 14px !important; |
|||
width: 140px !important; |
|||
} |
|||
|
|||
.red { |
|||
color: #f00; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.red_price { |
|||
width: 100%; |
|||
height: 45px; |
|||
padding: 10px 0 10px 5px; |
|||
line-height: 27px; |
|||
text-align: center; |
|||
} |
|||
</style> |
|||
<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="listContent"> |
|||
<div class="form-group-title">节日红包</div> |
|||
<!-- 左边的效果栏 --> |
|||
<div class="pull-left" style="width:320px;background:#F4F5F9;margin-right:20px;border:1px solid #E7E7EB"> |
|||
<div class="card-title">节日红包</div> |
|||
<div class="card_section area" |
|||
style="position: relative;height: 480px;background-color: rgba(0, 0, 0, 0.8);"> |
|||
<img :src="info.image_url" class="env_head"> |
|||
<div class="bl_r" id="bl_r" :style="{'background':info.color['bg_color']}"> |
|||
<div class="om_buy" id="om_bg_buy" :style="{'background':info.color['bg_color']}"> |
|||
<div id="om_buy" |
|||
:style="{'background':info.color['button_color'],'color':info.color['text_color']}" |
|||
style="background: rgb(248, 215, 130); color: rgb(212, 28, 59);">立即领取 |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="bl_l"> |
|||
<div class="list" v-for="(val,key) in info.list" :key="key"> |
|||
<div v-if="val.pack_id > 0"> |
|||
<div class="list_left" style="color: rgb(212, 22, 37);"> |
|||
<div class="red_price"> |
|||
<span class="text" :style="{'color':info.color['price_color']}">¥</span> |
|||
<div class="triangle-topleft" :style="{'color':info.color['price_color']}">{{ |
|||
new_list[val['pack_id']].cut_money }} |
|||
</div> |
|||
</div> |
|||
<div class="list_text" v-if="new_list[val['pack_id']].full_money > 0">满{{ |
|||
new_list[val['pack_id']].full_money }}元可用 |
|||
</div> |
|||
<div class="list_text" v-else>无门槛</div> |
|||
</div> |
|||
<div class="list_right"> |
|||
<div class="pm_title single-ellipsis mt10">{{ new_list[val['pack_id']].title }} |
|||
</div> |
|||
<div class="ca_line single-ellipsis font10 mt-3 mb0" v-if="new_list[val['pack_id']].usegoods_type == 1">指定代理商可用</div> |
|||
<div class="ca_line single-ellipsis font10 mt-3 mb0" v-else-if="new_list[val['pack_id']].usegoods_type == 2">指定商家可用</div> |
|||
<div class="ca_line single-ellipsis font10 mt-3 mb0" v-else-if="new_list[val['pack_id']].usegoods_type == 3">指定商品可用</div> |
|||
<div class="ca_line single-ellipsis font10 mt-3 mb0" v-else>全平台可用</div> |
|||
<div class="data_time single-ellipsis font10"> |
|||
<span class="f-a f-a1">{{ new_list[val['pack_id']].usetime_text }}</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div v-else> |
|||
<div class="list_left" style="color: rgb(212, 22, 37);"> |
|||
<div class="red_price"> |
|||
<span class="text">¥</span> |
|||
<div class="triangle-topleft">0.00</div> |
|||
</div> |
|||
<div class="list_text">无门槛</div> |
|||
</div> |
|||
<div class="list_right"> |
|||
<div class="pm_title single-ellipsis mt10">请选择红包</div> |
|||
<div class="ca_line single-ellipsis font10 mt-3 mb0">请选择红包</div> |
|||
<div class="data_time single-ellipsis font10"> |
|||
<span class="f-a f-a1">请选择红包</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 卡卷两边的半圆 --> |
|||
<div class="bl_line " :style="{'background':info.color['bg_color']}"></div> |
|||
<div class="bl_second " :style="{'background':info.color['bg_color']}"></div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 右边的设置栏 --> |
|||
<div class="pull-left alert form form-area" style="width:650px;position:relative;display:block;" id="form1"> |
|||
<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" value="0" v-model="info.status">关闭 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" v-model="info.status">开启 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div v-if="info.status == 1"> |
|||
<div class="form-group"> |
|||
<!--1=自定义类型,2=中秋红包,3=国庆红包,4=圣诞红包,5=新年红包,6=端午红包--> |
|||
<label class="col-sm-2 control-label">红包模板</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="5" v-model="info.redpack_calss">新年 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="6" v-model="info.redpack_calss">端午 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="2" v-model="info.redpack_calss">中秋 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="3" v-model="info.redpack_calss">国庆 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="4" v-model="info.redpack_calss">圣诞 |
|||
</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="text" v-model="info.name" class="form-control" required placeholder="请输入节日名称"> |
|||
</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" v-model="info.label" class="form-control" maxlength="5" required |
|||
placeholder="请输入红包标签(最多5字)"> |
|||
</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" v-model="info.images" readonly class="form-control"> |
|||
<span class="input-group-btn"> |
|||
<button type="button" @click="selectImage(this)" class="btn btn-default">选择图片</button> |
|||
</span> |
|||
</div> |
|||
<div class="input-group " style="margin-top: 0.5em;"> |
|||
<img :src="info.image_url" |
|||
onerror="this.src='./resource/images/nopic.jpg'; this.title='图片未找到.'" width="150" |
|||
class="img-responsive img-thumbnail"> |
|||
<em title="删除这张图片" @click="deleteImage()" class="close" |
|||
style="position: absolute; top: 0px; right: -14px;">×</em> |
|||
</div> |
|||
<span class="help-block">推荐图片尺寸620X310</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="color" class="form-control" width="10px" v-model="info['color'].bg_color"> |
|||
<span class="input-group-addon">金额颜色</span> |
|||
<input type="color" class="form-control" width="10px" |
|||
v-model="info['color'].price_color"> |
|||
</div> |
|||
</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="color" class="form-control" width="10px" |
|||
v-model="info['color'].button_color"> |
|||
<span class="input-group-addon">字体颜色</span> |
|||
<input type="color" class="form-control" width="10px" |
|||
v-model="info['color'].text_color"> |
|||
</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"> |
|||
<button class="btn btn-default daterange daterange-date" type="button"> |
|||
<span class="date-title">{{info.start_time}} 至 {{info.end_time}}</span> |
|||
<i class="fa fa-calendar"></i> |
|||
</button> |
|||
</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" id="redList"> |
|||
<!-- 提示信息 --> |
|||
<div class="input-group"> |
|||
<span class="help-block">可增加多张,从红包列表中选择,注意重复<i class="red">设置的红包张数为单人可领数</i></span> |
|||
</div> |
|||
<!-- 红包列表 --> |
|||
<div class="input-group" v-for="(item, key) in info.list" :key="key"> |
|||
<span class="input-group-addon">红包名称</span> |
|||
<select v-model="info.list[key].pack_id" class="form-control"> |
|||
<option value="0">请选择红包</option> |
|||
<option v-for="(l, key) in list" :key="key" :value="l.id">{{ l.title }}</option> |
|||
</select> |
|||
<span class="input-group-addon">单人可领</span> |
|||
<input type="number" class="form-control" min="1" v-model="info.list[key].limit" |
|||
width="10px"> |
|||
<span class="input-group-addon">张</span> |
|||
<span class="input-group-addon btn btn-danger" @click="delRedPack(key)">X</span> |
|||
</div> |
|||
<!-- 添加按钮 --> |
|||
<div class="input-group"> |
|||
<input type="button" @click="addRedPack()" value="添加" class="btn btn-warning"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="button" @click="saveInfo()" value="提交" class="btn btn-primary min-width"/> |
|||
<input type="hidden" v-model="id"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
let this_id = "{$id}"; |
|||
let festival = new Vue({ |
|||
el: '#listContent', |
|||
data: { |
|||
id: 0, |
|||
info: { |
|||
status: 1, |
|||
name: '', |
|||
label: '', |
|||
images: '', |
|||
color: { |
|||
bg_color: '#fb5422', |
|||
price_color: '#d41625', |
|||
button_color: '#f4af5f', |
|||
text_color: '#d41625', |
|||
}, |
|||
start_time: '', |
|||
end_time: '', |
|||
list: [], |
|||
image_url: '',//图片超链接地址 |
|||
redpack_calss: 5,//1=自定义类型,2=中秋红包,3=国庆红包,4=圣诞红包,5=新年红包,6=端午红包 |
|||
},//设置信息 |
|||
list: [],//红包列表信息 |
|||
new_list: [],//以id为下标的数组 |
|||
}, |
|||
watch: { |
|||
'info.redpack_calss'(){ |
|||
this.modelChange(); |
|||
} |
|||
}, |
|||
methods: { |
|||
//信息获取 |
|||
getInfo() { |
|||
let res = commonVue.requestAjax('redpack/redpack/festival_pack_get', {id: this.id}, true, 'public'); |
|||
if (res.errno == 1) { |
|||
tip.alert(res.message); |
|||
} else { |
|||
let data = res.data; |
|||
this.info = data.info ? data.info : []; |
|||
this.list = data.list ? data.list : []; |
|||
this.new_list = data.new_list ? data.new_list : []; |
|||
} |
|||
}, |
|||
//添加红包信息 |
|||
addRedPack() { |
|||
let i = {pack_id: 0, limit: 1}; |
|||
this.info['list'].push(i); |
|||
}, |
|||
//点击删除信息 |
|||
delRedPack(key) { |
|||
this.$delete(this.info['list'], key); |
|||
}, |
|||
//信息提交 |
|||
saveInfo() { |
|||
let _this = this; |
|||
let res = commonVue.requestAjax('redpack/redpack/festival_pack_set', { |
|||
info: this.info, |
|||
id: this.id |
|||
}, true, 'public'); |
|||
if (res.errno == 1) { |
|||
tip.alert(res.message); |
|||
} else { |
|||
_this.id = res.data.id; |
|||
let url = biz.url('redpack/redpack/festival_pack_edit', {id: res.data.id}); |
|||
tip.alert(res.message, function () { |
|||
window.location.href = url; |
|||
//_this.getInfo(); |
|||
//_this.$forceUpdate(); |
|||
}); |
|||
} |
|||
}, |
|||
//选择图片 |
|||
selectImage(elm) { |
|||
let _info = this.info, _this = this; |
|||
require(["util"], function (util) { |
|||
let btn = $(elm); |
|||
let ipt = btn.parent().prev(); |
|||
let val = ipt.val(); |
|||
util.image(val, function (url) { |
|||
_info.images = url.attachment; |
|||
_info.image_url = url.url; |
|||
_this.$forceUpdate(); |
|||
}); |
|||
}); |
|||
}, |
|||
//点击删除图片 |
|||
deleteImage() { |
|||
this.info.image = ''; |
|||
this.info.image_url = ''; |
|||
}, |
|||
//时间选择 |
|||
selectTime(start, end) { |
|||
this.info.start_time = start; |
|||
this.info.end_time = end; |
|||
}, |
|||
//模板改变 |
|||
modelChange(){ |
|||
let res = commonVue.requestAjax('redpack/redpack/festival_pack_modelSelect', {id: this.id,redpack_calss:this.info.redpack_calss}, true, 'public'); |
|||
if (res.errno == 1) { |
|||
tip.alert(res.message); |
|||
} else { |
|||
this.info = res.data ? res.data : []; |
|||
this.$forceUpdate(); |
|||
} |
|||
}, |
|||
}, |
|||
//进入页面请求获取信息 |
|||
mounted() { |
|||
if (this_id > 0) this.id = this_id; |
|||
this.getInfo(); |
|||
} |
|||
}); |
|||
</script> |
|||
<script type="text/javascript"> |
|||
require(["daterangepicker"], function () { |
|||
$(function () { |
|||
$(".daterange.daterange-date").each(function () { |
|||
var elm = this; |
|||
$(this).daterangepicker({ |
|||
ranges: { |
|||
"近7天": [moment().subtract(7, "days").hours(0).minutes(0), moment().hours(23).minutes(59)], |
|||
"本月": [moment().startOf("month").hours(0).minutes(0), moment().endOf("month").hours(23).minutes(59)], |
|||
"上个月": [moment().subtract(1, "month").startOf("month").hours(0).minutes(0), moment().subtract(1, "month").endOf("month").hours(23).minutes(59)], |
|||
"本周": [moment().startOf("week").add(1,"days").hours(0).minutes(0), moment().endOf("week").add(1,"days").hours(23).minutes(59)], |
|||
"未来7天": [moment().hours(0).minutes(0),moment().add(7, "days").hours(23).minutes(59)], |
|||
"未来15天": [moment().hours(0).minutes(0),moment().add(15, "days").hours(23).minutes(59)], |
|||
"未来1个月": [moment().hours(0).minutes(0),moment().add(1, "months").hours(23).minutes(59)], |
|||
"未来6个月": [moment().hours(0).minutes(0),moment().add(6, "months").hours(23).minutes(59)], |
|||
"未来一年": [moment().hours(0).minutes(0),moment().add(1, "years").hours(23).minutes(59)], |
|||
}, |
|||
startDate: $(elm).prev().prev().val(), |
|||
endDate: $(elm).prev().val(), |
|||
format: "YYYY-MM-DD HH:mm", |
|||
timePicker: true, |
|||
timePicker12Hour: false, |
|||
timePicker24Hour: true, |
|||
locale: { |
|||
applyLabel: "确定", |
|||
cancelLabel: "取消", |
|||
fromLabel: "起始时间", |
|||
toLabel: "结束时间", |
|||
customRangeLabel: "自定义时间", |
|||
firstDay: 1 |
|||
}, |
|||
timePickerIncrement: 1, |
|||
minuteStep: 1 |
|||
}, function (start, end) { |
|||
start = start.toDateStr().indexOf("0000-01-01") != -1 ? "" : start.toDateStr(); |
|||
end = end.toDateStr().indexOf("0000-01-01") != -1 ? "" : end.toDateStr(); |
|||
var html = (start == "" ? "不限时间" : start) + (start == "" && end === "" ? "" : (" 至" + end)) |
|||
$(elm).find(".date-title").html(html); |
|||
$(elm).prev().prev().val(start); |
|||
$(elm).prev().val(end); |
|||
festival.selectTime(start, end); |
|||
}); |
|||
}); |
|||
}); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,279 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.app-content{float: left;width: calc(100% - 30px);} |
|||
.left_p>img{width: 100%;height: 100%;display: block;} |
|||
.p_i span:first-child{font-size:16px;color: #fff;line-height: 16px;} |
|||
.p_i span:last-child{font-size: 25px;color: #fff;font-family: 'Arial';line-height: 28px;display: inline-block;vertical-align: -12px;} |
|||
.pm_title{font-size: 13px;line-height: 15px;height: 15px;color: #434343;width: 150px;margin-top: 5px;overflow: hidden; white-space: nowrap; text-overflow: ellipsis;} |
|||
.f-a{font-family: 'Arial' !important;} |
|||
.ca_line{width: auto;height: 19px;line-height: 19px;border-radius: 14.5px;border: 1px solid #e5e5e5;font-size: 13px;color: #636363;margin-bottom: 3px;margin-top: 3px;text-align: left;display: inline-block;padding: 0 10px;} |
|||
.data_time{font-size: 12px;color: #969696;width: 150px;} |
|||
.env_head{position: absolute;top:13px;left:12px;width:296px;height: 148px;display: block;object-fit: cover;} |
|||
.bl_r{position: absolute;top:160px;left: 12px;width: 296px;height:310px;background:#d41625;} |
|||
.om_buy{position: absolute;left: 0;right: 0;bottom: 0;height: 78px;background:#d41625;z-index: 2;} |
|||
.om_buy>div{width:246px;height:42px;background: -webkit-linear-gradient(#f4af5f, #f8d782);background: -o-linear-gradient(#f4af5f, #f8d782);background: -moz-linear-gradient(#f4af5f, #f8d782);background: linear-gradient(#f4af5f, #f8d782);color:#d41c3b;border-radius: 20.85px;line-height: 42px;font-size: 13px;text-align: center;margin:18px auto;} |
|||
.om_buy_b>div{width:246px;height:42px;background: #ffe937;color:#fb5422;border-radius: 20.85px;line-height: 42px;font-size: 13px;text-align: center;margin:18px auto;} |
|||
.bl_l{position: absolute;top: 160px;left: 12px;width: 296px;height: 232px;overflow-y: auto;padding-top: 8px;} |
|||
.list{overflow: hidden;width: 261px;height:80px;border-radius: 20px;margin:0 auto;background: #fff;margin-bottom: 8px;position: relative;} |
|||
.list_left{width:103px;float: left;color: #d41625;position: relative;} |
|||
.list_right{margin-left: 103px;position: relative;top: 5px;} |
|||
.text{position: relative;left: 5px;font-size: 14px;line-height: 32px;} |
|||
.triangle-topleft{font-family: 'Arial';font-size: 22px;display: inline-block;} |
|||
.list_text{font-size: 10px;color: #969696;padding-left: 10px;text-align: center;} |
|||
.bl_line{position: absolute;left: -8px;top: 32px;background: #d41625;width: 15px;height: 15px;border-radius: 50%;} |
|||
.bl_second{position: absolute;right: -8px;top: 32px;background: #d41625;width: 15px;height: 15px;border-radius: 50%;} |
|||
.ad_bless>i{font-size: 10px!important;padding-left:14px;padding-right:8px;} |
|||
.ad_bless>span{font-size: 14px;} |
|||
.look_img>img{display: block;width:246px;height: 72px;position: absolute;top: 24px;left: 603px;} |
|||
.function_single a{display:block;height: 100%} |
|||
.function_left img{display: block;position: absolute;margin: auto;left: 0;right: 0;top: 0;bottom: 0;width: 55px;} |
|||
#redList .input-group{margin-bottom: 5px;} |
|||
input[type="button"]{outline:0 none !important;} |
|||
select {appearance: none !important;-moz-appearance: none !important;-webkit-appearance: none !important;background: white !important;padding-right: 14px !important;width: 140px!important;} |
|||
.red{color: #f00;font-weight: bold;} |
|||
.red_price{width: 100%;height: 45px;padding: 10px 0 10px 5px;line-height: 27px;text-align: center;} |
|||
</style> |
|||
<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="listContent"> |
|||
<div class="form-group-title">新人红包</div> |
|||
<!-- 左边的效果栏 --> |
|||
<div class="pull-left" style="width:320px;background:#F4F5F9;margin-right:20px;border:1px solid #E7E7EB"> |
|||
<div class="card-title">新人红包</div> |
|||
<div class="card_section area" style="position: relative;height: 480px;background-color: rgba(0, 0, 0, 0.8);"> |
|||
<img :src="set.image_url" class="env_head"> |
|||
<div class="bl_r" id="bl_r" :style="{'background':set.color['bg_color']}"> |
|||
<div class="om_buy" id="om_bg_buy" :style="{'background':set.color['bg_color']}"> |
|||
<div id="om_buy" :style="{'background':set.color['button_color'],'color':set.color['text_color']}" style="background: rgb(248, 215, 130); color: rgb(212, 28, 59);">立即领取</div> |
|||
</div> |
|||
</div> |
|||
<div class="bl_l"> |
|||
<div class="list" v-for="(val,key) in set.list" :key="key"> |
|||
<div v-if="new_list[val['id']]"> |
|||
<div class="list_left" style="color: rgb(212, 22, 37);"> |
|||
<div class="red_price"> |
|||
<span class="text" :style="{'color':set.color['price_color']}">¥</span> |
|||
<div class="triangle-topleft" :style="{'color':set.color['price_color']}">{{ new_list[val['id']].cut_money }}</div> |
|||
</div> |
|||
<div class="list_text" v-if="new_list[val['id']].full_money > 0">满{{ new_list[val['id']].full_money }}元可用</div> |
|||
<div class="list_text" v-else>无门槛</div> |
|||
</div> |
|||
<div class="list_right"> |
|||
<div class="pm_title single-ellipsis mt10">{{ new_list[val['id']].title }}</div> |
|||
<div class="ca_line single-ellipsis font10 mt-3 mb0" v-if="new_list[val['id']].usegoods_type == 1">指定代理商可用</div> |
|||
<div class="ca_line single-ellipsis font10 mt-3 mb0" v-else-if="new_list[val['id']].usegoods_type == 2">指定商家可用</div> |
|||
<div class="ca_line single-ellipsis font10 mt-3 mb0" v-else-if="new_list[val['id']].usegoods_type == 3">指定商品可用</div> |
|||
<div class="ca_line single-ellipsis font10 mt-3 mb0" v-else>全平台可用</div> |
|||
<div class="data_time single-ellipsis font10"> |
|||
<span class="f-a f-a1">{{ new_list[val['id']].usetime_text }}</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div v-else> |
|||
<div class="list_left" style="color: rgb(212, 22, 37);"> |
|||
<div class="red_price"> |
|||
<span class="text">¥</span> |
|||
<div class="triangle-topleft">0.00</div> |
|||
</div> |
|||
<div class="list_text">无门槛</div> |
|||
</div> |
|||
<div class="list_right"> |
|||
<div class="pm_title single-ellipsis mt10">请选择红包</div> |
|||
<div class="ca_line single-ellipsis font10 mt-3 mb0">请选择红包</div> |
|||
<div class="data_time single-ellipsis font10"> |
|||
<span class="f-a f-a1">请选择红包</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 卡卷两边的半圆 --> |
|||
<div class="bl_line " :style="{'background':set.color['bg_color']}"></div> |
|||
<div class="bl_second " :style="{'background':set.color['bg_color']}"></div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 右边的设置栏 --> |
|||
<div class="pull-left alert form form-area" style="width:650px;position:relative;display:block;" id="form1"> |
|||
<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" value="0" v-model="set.status">关闭 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" v-model="set.status">开启 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div v-if="set.status == 1"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">主题图片</label> |
|||
<div class="col-sm-9"><div class="input-group "> |
|||
<input type="text" v-model="set.image" readonly class="form-control"> |
|||
<span class="input-group-btn"> |
|||
<button type="button" @click="selectImage(this)" class="btn btn-default">选择图片</button> |
|||
</span> |
|||
</div> |
|||
<div class="input-group " style="margin-top: 0.5em;"> |
|||
<img :src="set.image_url" onerror="this.src='./resource/images/nopic.jpg'; this.title='图片未找到.'" width="150" class="img-responsive img-thumbnail"> |
|||
<em title="删除这张图片" @click="deleteImage()" class="close" style="position: absolute; top: 0px; right: -14px;">×</em> |
|||
</div> |
|||
<span class="help-block">推荐图片尺寸620X310</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"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="set.wheres" value="0">未领取用户 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" v-model="set.wheres" value="1">未领取且未下单用户 |
|||
</label> |
|||
</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="color" class="form-control" width="10px" v-model="set['color'].bg_color"> |
|||
<span class="input-group-addon">金额颜色</span> |
|||
<input type="color" class="form-control" width="10px" v-model="set['color'].price_color"> |
|||
</div> |
|||
</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="color" class="form-control" width="10px" v-model="set['color'].button_color"> |
|||
<span class="input-group-addon">字体颜色</span> |
|||
<input type="color" class="form-control" width="10px" v-model="set['color'].text_color"> |
|||
</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" id="redList"> |
|||
<!-- 提示信息 --> |
|||
<div class="input-group"> |
|||
<span class="help-block">可增加多张,从红包列表中选择,注意<i class="red">设置的红包张数为单人发放数量</i></span> |
|||
</div> |
|||
<!-- 红包列表 --> |
|||
<div class="input-group" v-for="(item, key) in set.list" :key="key"> |
|||
<span class="input-group-addon">红包名称</span> |
|||
<select v-model="set.list[key].id" class="form-control"> |
|||
<option value="0">请选择红包</option> |
|||
<option v-for="(l, key) in list" :key="key" :value="l.id">{{ l.title }}</option> |
|||
</select> |
|||
<span class="input-group-addon">单人发放</span> |
|||
<input type="number" class="form-control" min="1" v-model="set.list[key].limit" width="10px"> |
|||
<span class="input-group-addon">张</span> |
|||
<span class="input-group-addon btn btn-danger" @click="delRedPack(key)">X</span> |
|||
</div> |
|||
<!-- 添加按钮 --> |
|||
<div class="input-group"> |
|||
<input type="button" @click="addRedPack()" value="添加" class="btn btn-warning"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="button" @click="saveInfo()" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
new Vue({ |
|||
el: '#listContent', |
|||
data: { |
|||
set:{ |
|||
status: 0, |
|||
image: '../addons/{MODULE_NAME}/attachment/images/26/2020/02/Kc5oG8s68SZd82g06GUL6cqzgUNgzg.png', |
|||
wheres:0, |
|||
color: { |
|||
bg_color: '#fb5422', |
|||
price_color: '#d41625', |
|||
button_color: '#f4af5f', |
|||
text_color: '#d41625', |
|||
}, |
|||
list:[], |
|||
image_url:'https://citydev.weliam.com.cn/attachment/images/26/2020/02/Kc5oG8s68SZd82g06GUL6cqzgUNgzg.png',//图片超链接地址 |
|||
},//设置信息 |
|||
list:[],//红包列表信息 |
|||
new_list:[],//以id为下标的数组 |
|||
}, |
|||
methods: { |
|||
//信息获取 |
|||
getInfo(){ |
|||
let res = commonVue.requestAjax('redpack/redpack/new_pack_get',{},true,'public'); |
|||
let data = res.data; |
|||
if(res.errno == 0){ |
|||
this.set = data.set ? data.set : []; |
|||
this.list = data.list ? data.list : []; |
|||
this.new_list = data.new_list ? data.new_list : []; |
|||
} |
|||
}, |
|||
//添加红包信息 |
|||
addRedPack(){ |
|||
let i = {id:0,limit:1}; |
|||
if(this.set.list){ |
|||
this.set['list'].push(i); |
|||
}else{ |
|||
this.set['list'] = [i]; |
|||
} |
|||
this.$forceUpdate(); |
|||
}, |
|||
//点击删除信息 |
|||
delRedPack(key){ |
|||
this.$delete(this.set['list'],key); |
|||
}, |
|||
//信息提交 |
|||
saveInfo(){ |
|||
let res = commonVue.requestAjax('redpack/redpack/new_pack_set',{set:this.set},true,'public'); |
|||
if(res.errno == 1){ |
|||
tip.alert(res.message); |
|||
}else{ |
|||
tip.alert(res.message,function () { |
|||
history.go(0); |
|||
}); |
|||
} |
|||
}, |
|||
//选择图片 |
|||
selectImage(elm){ |
|||
let _set = this.set,_this = this; |
|||
require(["util"], function(util){ |
|||
let btn = $(elm); |
|||
let ipt = btn.parent().prev(); |
|||
let val = ipt.val(); |
|||
util.image(val, function(url){ |
|||
_set.image = url.attachment; |
|||
_set.image_url = url.url; |
|||
_this.$forceUpdate(); |
|||
}); |
|||
}); |
|||
}, |
|||
//点击删除图片 |
|||
deleteImage(){ |
|||
this.set.image = ''; |
|||
this.set.image_url = ''; |
|||
} |
|||
}, |
|||
//进入页面请求获取信息 |
|||
mounted() { |
|||
this.getInfo(); |
|||
} |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,300 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="{php echo web_url('redpack/redpack/pack_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="number" 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[title]" maxlength="16" class="form-control" value="{$item['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"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[scene]" {if !empty($id)}disabled="disabled"{/if} value="0" onclick="$('#limit_count').show();$('#all_count').show();" {if empty($item['scene'])}checked{/if}>自助领取 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[scene]" {if !empty($id)}disabled="disabled"{/if} value="1" onclick="$('#limit_count').hide();$('#all_count').hide();" {if !empty($item['scene'])}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" name="item[full_money]" value="{$item['full_money']}" min="0" required {if !empty($id)}readonly{/if}> |
|||
<span class="input-group-addon">元,减</span> |
|||
<input type="number" class="form-control" name="item[cut_money]" value="{$item['cut_money']}" min="0" required {if !empty($id)}readonly{/if}> |
|||
<span class="input-group-addon">元</span> |
|||
</div> |
|||
<div class="help-block">设置为0则为无门槛使用券。注意:设置后不可修改</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="all_count" {if !empty($item['scene'])}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" class="form-control" name="item[all_count]" value="{$item['all_count']}" min="0" required> |
|||
<span class="input-group-addon">个</span> |
|||
</div> |
|||
<div class="help-block">0表示无限</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="limit_count" {if !empty($item['scene'])}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" class="form-control" name="item[limit_count]" value="{$item['limit_count']}" min="0" required> |
|||
<span class="input-group-addon">个</span> |
|||
</div> |
|||
<div class="help-block">0表示无限,但受到总数的限制</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" style="padding-top: 3px;"> |
|||
<label class="radio-inline" onclick="$('.usetime_day1').attr('disabled','disabled');$('.usetime_day2').attr('disabled','disabled');"> |
|||
<input type="radio" name="item[usetime_type]" value="0" {if empty($item['usetime_type'])}checked{/if}>固定时间有效 |
|||
</label> |
|||
</span> |
|||
{php echo tpl_select_time_info('usetime', array('starttime' => date('Y-m-d H:i:s', $item['use_start_time']), 'endtime' => date('Y-m-d H:i:s', $item['use_end_time'])));} |
|||
</div> |
|||
</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" style="padding-top: 3px;"> |
|||
<label class="radio-inline" onclick="$('.usetime_day1').removeAttr('disabled');$('.usetime_day2').attr('disabled','disabled');"> |
|||
<input type="radio" name="item[usetime_type]" value="1" {if $item['usetime_type'] == 1}checked{/if}>领取当日起 |
|||
</label> |
|||
</span> |
|||
<input type="number" class="form-control usetime_day1" name="item[usetime_day1]" min="1" max="365" {if $item['usetime_type'] != 1}disabled{else}value="{$item['usetime_day1']}"{/if}> |
|||
<span class="input-group-addon">天内有效</span> |
|||
</div> |
|||
<div class="help-block"> 有效期按自然天计算。举例:如设置领券当日起2天内可用,用户在5月21日14:00时领取优惠券,则该优惠券的可用时间为5月21日的14:00:00至5月22日的23:59:59。</div> |
|||
</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" style="padding-top: 3px;"> |
|||
<label class="radio-inline" onclick="$('.usetime_day2').removeAttr('disabled');$('.usetime_day1').attr('disabled','disabled');"> |
|||
<input type="radio" name="item[usetime_type]" value="2" {if $item['usetime_type'] == 2}checked{/if}>领取次日起 |
|||
</label> |
|||
</span> |
|||
<input type="number" class="form-control usetime_day2" name="item[usetime_day2]" min="1" max="365" {if $item['usetime_type'] != 2}disabled{else}value="{$item['usetime_day2']}"{/if}> |
|||
<span class="input-group-addon">天内有效</span> |
|||
</div> |
|||
<div class="help-block">有效期按自然天计算。举例:如设置领券次日起2天内可用,用户在5月21日的14:00领取优惠券,则该优惠券的可用时间为5月22日的00:00:00到5月23日的23:59:59。</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"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[redpack_type]" onclick="$('#secGood').show();" value="0" {if empty($item['redpack_type'])}checked{/if}>通用红包 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[redpack_type]" onclick="$('#secGood').show();" value="1" {if $item['redpack_type'] == 1}checked{/if}>商品红包 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[redpack_type]" onclick="$('#secGood').hide();" value="2" {if $item['redpack_type'] == 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"> |
|||
{if !is_agent()} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[usegoods_type]" value="0" {if empty($item['usegoods_type'])}checked{/if}>全平台通用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[usegoods_type]" value="1" {if $item['usegoods_type'] == 1}checked{/if}>指定代理 |
|||
</label> |
|||
{/if} |
|||
{if is_agent()} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[usegoods_type]" value="1" {if $item['usegoods_type'] == 1}checked{/if}>当前代理可用 |
|||
</label> |
|||
{/if} |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[usegoods_type]" value="2" {if $item['usegoods_type'] == 2}checked{/if}>指定商家 |
|||
</label> |
|||
<label class="radio-inline" id="secGood"> |
|||
<input type="radio" name="item[usegoods_type]" value="3" {if $item['usegoods_type'] == 3}checked{/if}>指定商品 |
|||
</label> |
|||
<!--总平台可用--> |
|||
<div class="help-block useGoodsType {if $item['usegoods_type'] != 0}hide{/if}" id="useGoodsType0"> |
|||
全平台通用:用户在领取该红包后可以在当前平台任意代理,任意商家,购买任意商品时使用当前红包 |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!--指定代理--> |
|||
<div class="form-group useGoodsType {if $item['usegoods_type'] != 1}hide{/if}" id="useGoodsType1"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<select name="item[use_aids][]" class="form-control select2" multiple="" required style="width: 100%;"> |
|||
{loop $agents $agent} |
|||
<option value="{$agent['id']}" {if in_array($agent['id'], $item['use_aids'])}selected{/if}>{$agent['agentname']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<!--指定商家--> |
|||
<div class="form-group useGoodsType {if $item['usegoods_type'] != 2}hide{/if}" id="useGoodsType2"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<select name="item[use_sids][]" class="form-control select2" multiple="" required style="width: 100%;"> |
|||
{loop $stores $store} |
|||
<option value="{$store['id']}" {if in_array($store['id'], $item['use_sids'])}selected{/if}>{$store['storename']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<!--指定商品--> |
|||
<div class="form-group useGoodsType {if $item['usegoods_type'] != 3}hide{/if}" id="useGoodsType3"> |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">抢购商品</label> |
|||
<div class="col-sm-9"> |
|||
<select name="item[rush_ids][]" class="form-control select2" multiple="" style="width: 100%;"> |
|||
{loop $rushList $rush} |
|||
<option value="{$rush['id']}" {if in_array($rush['id'], $item['rush_ids'])}selected{/if}>{$rush['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">团购商品</label> |
|||
<div class="col-sm-9"> |
|||
<select name="item[group_ids][]" class="form-control select2" multiple="" style="width: 100%;"> |
|||
{loop $grouponList $group} |
|||
<option value="{$group['id']}" {if in_array($group['id'], $item['group_ids'])}selected{/if}>{$group['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">拼团商品</label> |
|||
<div class="col-sm-9"> |
|||
<select name="item[fight_ids][]" class="form-control select2" multiple="" style="width: 100%;"> |
|||
{loop $fightList $fight} |
|||
<option value="{$fight['id']}" {if in_array($fight['id'], $item['fight_ids'])}selected{/if}>{$fight['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">砍价商品</label> |
|||
<div class="col-sm-9"> |
|||
<select name="item[bargain_ids][]" class="form-control select2" multiple="" style="width: 100%;"> |
|||
{loop $bargainList $bargain} |
|||
<option value="{$bargain['id']}" {if in_array($bargain['id'], $item['bargain_ids'])}selected{/if}>{$bargain['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{if Customized::init('transfergift') > 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="item[transferstatus]" onclick="$('#trans').show();" value="1" {if !empty($item['transferstatus'])}checked{/if}>允许 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[transferstatus]" onclick="$('#trans').hide();" value="0" {if empty($item['transferstatus'])}checked{/if}>禁止 |
|||
</label> |
|||
<span class="help-block">允许转赠后用户可以将线上红包赠送给其他用户。</span> |
|||
</div> |
|||
</div> |
|||
<div id="trans" {if empty($item['transferstatus'])} style="display: none" {/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="item[transfermore]" value="1" {if !empty($item['transfermore'])}checked{/if}>允许 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[transfermore]" value="0" {if empty($item['transfermore'])}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="checkbox-inline"> |
|||
<input type="checkbox" value="-1" {if in_array(-1,$item['level'])} checked {/if} name="level[]" />非会员 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="0" {if in_array(0,$item['level'])} checked {/if} name="level[]" />{$_W['wlsetting']['halflevel']['name']} |
|||
</label> |
|||
{loop $levels $level} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{$level['id']}" {if in_array($level['id'],$item['level'])} checked {/if} name="level[]" />{$level['name']} |
|||
</label> |
|||
{/loop} |
|||
<span class="help-block">设置后需要有所设置的会员等级才可以发起转赠,不勾选即所有用户可用。</span> |
|||
</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="item[status]" value="1" {if !empty($item['status'])}checked{/if}>上架 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[status]" value="0" {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> |
|||
<script> |
|||
/** |
|||
* 改变使用限制 |
|||
*/ |
|||
$("[name='item[usegoods_type]']").on('change',function () { |
|||
let _this = $(this), |
|||
_value = _this.val(), |
|||
id = '#useGoodsType'+_value; |
|||
//隐藏所有内容 |
|||
$(".useGoodsType").addClass('hide'); |
|||
//显示当前选中内容 |
|||
$(id).removeClass('hide'); |
|||
}); |
|||
|
|||
</script> |
|||
|
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,108 @@ |
|||
{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('redpack/redpack/pack_edit')}" class="btn btn-primary">添加红包</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form class="form-horizontal" action="{php echo web_url('redpack/redpack/pack_lists')}" method="post"> |
|||
<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 empty($_GPC['status'])}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> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">红包信息</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="name" value="{$_GPC['name']}" 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> |
|||
<button class="btn btn-warning" type="submit" name="export" value="1">导出</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</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">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> |
|||
<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>{$list['id']}</td> |
|||
<td>{$list['title']}</td> |
|||
<td>{$list['cut_money']}元 / {php echo $list['full_money'] ? '满'.$list['full_money'].'元可用':"无门槛";}</td> |
|||
<td> |
|||
<span class='label {if $list['scene']==1}label-primary{else}label-warning{/if}'> |
|||
{if $list['scene']==1}系统发放{else}自助领取{/if}</span> |
|||
</td> |
|||
<td>{$list['all_count']} / {$list['get_count']}个</td> |
|||
<td>{$list['limit_count']}</td> |
|||
<td>{$list['usetime_text']}</td> |
|||
<td> |
|||
{if $list['status']==2} |
|||
<a href="javascript:;" class='btn btn-sm btn-danger'>过期</a> |
|||
{else} |
|||
<a data-toggle="ajaxPost" href="{php echo web_url('redpack/redpack/pack_changeStatus', ['id' => $list['id'],'status'=>$list['status']])}" class='btn btn-sm {if $list['status']==1}btn-primary{else}btn-default{/if}'> |
|||
{if $list['status']==1}上架{else}下架{/if} |
|||
</a> |
|||
{/if} |
|||
</td> |
|||
<td>{$list['sort']}</td> |
|||
<td> |
|||
<a class="btn btn-sm btn-info" href="{php echo web_url('redpack/redpack/record_lists', ['packid' => $list['id']])}">领取记录</a> |
|||
<!--发放按钮 需要红包上架并且为系统发放 才可以使用--> |
|||
{if $list['status']==1 && $list['scene']==1} |
|||
<a class="btn btn-sm btn-warning" href="{php echo web_url('redpack/redpack/pack_send', array('id' => $list['id']))}" data-toggle="ajaxModal">发放</a> |
|||
{/if} |
|||
<a class="btn btn-sm btn-primary" href="{php echo web_url('redpack/redpack/pack_edit', array('id' => $list['id']))}">编辑</a> |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('redpack/redpack/pack_del', array('id' => $list['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> |
|||
{else} |
|||
<div class="no-result"> |
|||
<p>还没有相关数据</p> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,92 @@ |
|||
<form action="{php echo web_url('redpack/redpack/pack_send', array('id' => $id))}" method="post" class="form-horizontal form-validate" enctype="multipart/form-data"> |
|||
<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"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label mustl">发放用户</label> |
|||
<div class="col-sm-9"> |
|||
<select name="mids[]" class="form-control chosen-select" multiple style="width: 100%;"> |
|||
</select> |
|||
<span class="help-block">请选择发放用户,支持搜索和多选</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label mustl">导入发放</label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-warning min-width" onclick="$('#excelUpload').click();return false;"><i class="fa fa-upload"></i> 导入用户列表</button> |
|||
<input type="file" id="excelUpload" class="hide"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<button class="btn btn-primary btn-submit" type="submit">确认</button> |
|||
<button data-dismiss="modal" class="btn btn-default" type="button">取消</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
<script> |
|||
myrequire(['select2'], function() { |
|||
$('.chosen-select').select2({ |
|||
ajax: { |
|||
url: "{php echo web_url('utility/member/mc_select')}", |
|||
dataType: 'json', |
|||
data: function (params) { |
|||
var query = { //请求的参数, 关键字和搜索条件之类的 |
|||
search: params.term //select搜索框里面的value |
|||
} |
|||
// Query paramters will be ?search=[term]&page=[page] |
|||
return query; |
|||
}, |
|||
processResults: function (data) { |
|||
return { |
|||
results: data //必须赋值给results并且必须返回一个obj |
|||
}; |
|||
} |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
|
|||
$("#excelUpload").on('change',function () { |
|||
var val = $("#excelUpload").get(0).files[0];//文件内容 |
|||
var type = val['name'].split(".");//文件名称+文件后缀 |
|||
type = $.trim(type[type.length - 1]);//文件后缀 |
|||
$("#excelUpload").val(''); |
|||
if(type == 'csv'){ |
|||
var fd = new FormData(); |
|||
fd.append("file",val);//上传的文件file |
|||
tip.confirm("内容处理中,请不要刷新页面/离开页面!<br />确定后开始处理",function () { |
|||
$.ajax({ |
|||
url:"{php echo web_url('order/wlOrder/bulkShipment')}", |
|||
type:"post", |
|||
data:fd, |
|||
dataType:"json", |
|||
cache: false, |
|||
processData: false, |
|||
contentType: false, |
|||
async:false, |
|||
success:function(data){ |
|||
tip.alert(data.message,function () { |
|||
if(data.errno == 1){ |
|||
var url = "{php echo web_url('redpack/redpack/pack_send_csv')}"+"name="+data.data+"&redpackid={$id}"; |
|||
window.location.href = url; |
|||
} |
|||
}); |
|||
}, |
|||
error:function(){ |
|||
tip.alert("网络错误,请重试!!"); |
|||
} |
|||
}); |
|||
}); |
|||
}else{ |
|||
tip.alert("只能上传csv类型的表格文件"); |
|||
} |
|||
}); |
|||
|
|||
|
|||
</script> |
|||
@ -0,0 +1,216 @@ |
|||
{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="panel panel-stat"> |
|||
<div class="panel-body"> |
|||
{if Customized::init('transfergift') > 0} |
|||
<div class="col-md-2"> |
|||
<div class="title">红包总数(个)</div> |
|||
<div class="num-wrapper"> |
|||
<a class="num" href="javascript:;">{$all_num}</a> |
|||
</div> |
|||
</div> |
|||
{if empty($status)} |
|||
<div class="col-md-2"> |
|||
<div class="title">已使用(个)</div> |
|||
<div class="num-wrapper"> |
|||
<a class="num" href="javascript:;">{$use_num}</a> |
|||
</div> |
|||
</div> |
|||
<div class="col-md-2"> |
|||
<div class="title">使用率(%)</div> |
|||
<div class="num-wrapper"> |
|||
<a class="num" href="javascript:;">{$use_rate}</a> |
|||
</div> |
|||
</div> |
|||
<div class="col-md-2"> |
|||
<div class="title">已转赠(个)</div> |
|||
<div class="num-wrapper"> |
|||
<a class="num" href="javascript:;">{$transfer_num}</a> |
|||
</div> |
|||
</div> |
|||
<div class="col-md-2"> |
|||
<div class="title">已过期(个)</div> |
|||
<div class="num-wrapper"> |
|||
<a class="num" href="javascript:;">{$end_num}</a> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{else} |
|||
<div class="col-md-3"> |
|||
<div class="title">红包总数(个)</div> |
|||
<div class="num-wrapper"> |
|||
<a class="num" href="javascript:;">{$all_num}</a> |
|||
</div> |
|||
</div> |
|||
{if empty($status)} |
|||
<div class="col-md-3"> |
|||
<div class="title">已使用(个)</div> |
|||
<div class="num-wrapper"> |
|||
<a class="num" href="javascript:;">{$use_num}</a> |
|||
</div> |
|||
</div> |
|||
<div class="col-md-3"> |
|||
<div class="title">使用率(%)</div> |
|||
<div class="num-wrapper"> |
|||
<a class="num" href="javascript:;">{$use_rate}</a> |
|||
</div> |
|||
</div> |
|||
<div class="col-md-3"> |
|||
<div class="title">已过期(个)</div> |
|||
<div class="num-wrapper"> |
|||
<a class="num" href="javascript:;">{$end_num}</a> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form class="form-horizontal" action="" method="get"> |
|||
<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="redpack" /> |
|||
<input type="hidden" name="ac" value="redpack" /> |
|||
<input type="hidden" name="do" value="record_lists" /> |
|||
<input type="hidden" name="type" value="{$_GPC['type']}" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">红包名称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="name" value="{$name}" placeholder="请输入红包名称"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="max-width: 1180px;"> |
|||
<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 empty($_GPC['status'])}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> |
|||
<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> |
|||
{if Customized::init('transfergift') > 0 } |
|||
<a href="{php echo wl_filter_url('status:6');}" class="btn {if $_GPC['status'] == '6'}btn-primary{else}btn-default{/if}">转赠中</a> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="max-width: 1180px;"> |
|||
<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 empty($_GPC['type'])}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('type:3');}" class="btn {if $_GPC['type'] == '3'}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> |
|||
{if p('draw')} |
|||
<a href="{php echo wl_filter_url('type:2');}" class="btn {if $_GPC['type'] == '2'}btn-primary{else}btn-default{/if}">抽奖获赠</a> |
|||
{/if} |
|||
</div> |
|||
</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> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</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> |
|||
<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['pack']['title']} |
|||
</td> |
|||
<td class="name text-left"> |
|||
<div style="display: flex"> |
|||
<img class="img-40" src="{$list['member']['avatar']}" style="border-radius:50%;border:1px solid #efefef;" onerror="this.src='../addons/{MODULE_NAME}/web/resource/images/nopic-small.jpg'" height="40" width="40"> |
|||
<span style="display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left: 5px"> |
|||
{$list['member']['nickname']} |
|||
</span> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
{$list['member']['mobile']} |
|||
</td> |
|||
<td> |
|||
{if $list['type'] == 1} |
|||
后台发送 |
|||
{elseif $list['type'] == 2} |
|||
抽奖获赠 |
|||
{else} |
|||
自主领取 |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<span class='label {if $list['status']==0}label-primary{elseif $list['status']==1}label-default{elseif $list['status']==6}label-warning{elseif $list['status']==2}btn-danger active{/if}'> |
|||
{if $list['status']==0}未使用{elseif $list['status']==1}已使用{elseif $list['status']==2}已过期{elseif $list['status']==6}转赠中{/if}</span> |
|||
</td> |
|||
<td> |
|||
{$list['createtime']} |
|||
</td> |
|||
<td> |
|||
{if $list['usetime'] > 0 } |
|||
{$list['storename']}(SID:{$list['sid']})<br/> |
|||
{/if} |
|||
{$list['usetime']} |
|||
</td> |
|||
<td> |
|||
{$list['festival_name']} |
|||
</td> |
|||
<td> |
|||
{if $list['status']==0} |
|||
<a class="btn btn-sm btn-primary" data-toggle="ajaxPost" href="{php echo web_url('redpack/redpack/record_use', array('id' => $list['id']))}" data-confirm="确定使用当前红包?">使用</a> |
|||
{/if} |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('redpack/redpack/record_del', array('id' => $list['id']))}" data-confirm="确定删除当前红包?">删除</a> |
|||
{if $list['trflag'] > 0} |
|||
<a class="btn btn-sm btn-warning" data-toggle="ajaxModal" href="{php echo web_url('redpack/redpack/record_transfer', array('id' => $list['id']))}" >转赠记录</a> |
|||
{/if} |
|||
</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('redpack/redpack/record_del')}">批量删除</button> |
|||
<button class="btn btn-default" type="button" data-toggle='batch' data-href="{php echo web_url('redpack/redpack/record_use')}">批量使用</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,98 @@ |
|||
<style> |
|||
#selectGoodsList .goodsImg img{ |
|||
width: 50px; |
|||
height: 50px; |
|||
} |
|||
#selectGoodsList .modal-body.form-horizontal{ |
|||
padding: 0 30px; |
|||
} |
|||
#selectGoodsList .modal-content{ |
|||
max-height: 800px; |
|||
} |
|||
</style> |
|||
<div class="modal-dialog selectGoodsList" id="selectGoodsList" style="min-width: 60%!important;"> |
|||
<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 selectGoodsTable" id="selectGoodsTable"> |
|||
<div class="panel panel-default"> |
|||
<table class="table table-hover table-responsive table-bordered" style="border: 1px solid #e5e5e5;"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" width="10%">转赠人</th> |
|||
<th class="text-center" width="20%">转赠时间</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="20%">领取人手机号</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody class="text-center"> |
|||
{loop $record $val} |
|||
<tr> |
|||
<td class="text-center goodsImg"> |
|||
<img src="{$val['avatar']}" /><br/> |
|||
{$val['nickname']} |
|||
</td> |
|||
<td class="text-center"> |
|||
{php echo date('Y-m-d H:i:s',$val['createtime'])} |
|||
</td> |
|||
<td> |
|||
{if $val['transfermode'] == 1} |
|||
<span class="label label-warning">电话号码</span> |
|||
{else if $val['transfermode'] == 2} |
|||
<span class="label label-success">转赠领取</span> |
|||
{else} |
|||
<span class="label label-default">批量转赠</span> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $val['status'] == 0} |
|||
<span class="label label-warning">待领取</span> |
|||
{else if $val['status'] == 1} |
|||
<span class="label label-success">已领取</span> |
|||
{else} |
|||
<span class="label label-default">已取消</span> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center goodsImg"> |
|||
{if empty($val['getnickname'])} |
|||
--- |
|||
{else} |
|||
<img src="{$val['getavatar']}" /><br/> |
|||
{$val['getnickname']} |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $val['gettime'] > 0} |
|||
{php echo date('Y-m-d H:i:s',$val['gettime'])} |
|||
{else if $val['canceltime'] > 0} |
|||
{php echo date('Y-m-d H:i:s',$val['canceltime'])} |
|||
{else} |
|||
--- |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if empty($val['mobile'])} |
|||
--- |
|||
{else} |
|||
{$val['mobile']} |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<button data-dismiss="modal" class="btn btn-default cancelSelectGoods" type="button">关闭</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,83 @@ |
|||
{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-validate" id="setting-form"> |
|||
<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-xs-12 col-sm-8"> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadioo2" name="set[switch]" value="0" {if $set['switch'] != 1}checked="checked"{/if}> |
|||
<label for="inlineRadioo2">关闭 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadioo1" name="set[switch]" value="1" {if $set['switch'] == 1}checked="checked"{/if}> |
|||
<label for="inlineRadioo1">开启 </label> |
|||
</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="number" min="0" name="set[intervalmin]" class="form-control" value="{$set['intervalmin']}"> |
|||
<span class="input-group-addon">分钟</span> |
|||
</div> |
|||
<span class="help-block">用户关闭首页领取红包弹出框后再次弹出的间隔时间,填0或不填默认为180分钟。</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"> |
|||
<input type="text" name="set[share_title]" class="form-control" value="{$set['share_title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('set[share_image]', $set['share_image']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="set[share_desc]" class="form-control" value="{$set['share_desc']}" /> |
|||
</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> |
|||
$(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,43 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[抢购活动]]></name> |
|||
<identifie><![CDATA[rush]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[market]]></type> |
|||
<description><![CDATA[可以设置限时抢购、限量抢购商品,释放用户的购买热情。]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="true" /> |
|||
<store embed="true" /> |
|||
<system embed="true" /> |
|||
<task embed="true" /> |
|||
</setting> |
|||
<storemenu> |
|||
<menu title="活动" font="fa-inbox"> |
|||
<entry title="抢购列表" ac="active" do="activelist" actions='["do",["activelist","createactive"]]' iscover="true" /> |
|||
</menu> |
|||
</storemenu> |
|||
<agentmenu> |
|||
<menu title="活动" font="fa-inbox"> |
|||
<entry title="抢购列表" ac="active" do="activelist" actions='["do",["activelist","createactive"]]' iscover="true" /> |
|||
<entry title="抢购分类" ac="category" do="index" /> |
|||
<entry title="抢购专题" ac="category" do="specialindex" /> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="基础设置" ac="set" do="base" /> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="活动" font="fa-inbox"> |
|||
<entry title="抢购列表" ac="active" do="activelist" actions='["do",["activelist","createactive"]]' iscover="true" /> |
|||
<entry title="抢购分类" ac="category" do="index" /> |
|||
<entry title="抢购专题" ac="category" do="specialindex" /> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="基础设置" ac="set" do="base" /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 4.1 KiB |
@ -0,0 +1,280 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class RushModuleUniapp extends Uniapp { |
|||
/** |
|||
* Comment: 获取抢购商品信息列表 |
|||
* Author: zzw |
|||
* Date: 2019/8/6 18:38 |
|||
*/ |
|||
public function homeList() { |
|||
global $_W, $_GPC; |
|||
#1、参数获取 |
|||
$page = $_GPC['page'] ? $_GPC['page'] : 1; |
|||
$page_index = $_GPC['page_index'] ? $_GPC['page_index'] : 10; |
|||
$page_start = $page * $page_index - $page_index; |
|||
$lng = $_GPC['lng'] ? $_GPC['lng'] : 0;//用户当前所在经度 |
|||
$lat = $_GPC['lat'] ? $_GPC['lat'] : 0;//用户当前所在纬度 |
|||
$status = !empty($_GPC['status']) ? $_GPC['status'] : ''; |
|||
$is_total = $_GPC['is_total'] ? : 0;//0=不获取总页数;1=获取总页数 |
|||
$cate_id = $_GPC['cate_id'] ? : 0;//商品分类id |
|||
$is_vip = $_GPC['is_vip'] ? : 0;//是否获取专属商品 |
|||
$cc_id = $_GPC['cc_id'] ? : 0;//培训类型id |
|||
$cc_child_id = $_GPC['cc_child_id'] ? : 0;//分类子集分类 |
|||
|
|||
$time = $_GPC['time'] ?: time();//时间筛选 |
|||
$week = date("w", $time);//当前时间的星期 |
|||
if ($week == 0) $week = 7;//星期天时值的转换 |
|||
$toDay = date("j", $time);//当前时间的日期 |
|||
|
|||
$set = Setting::agentsetting_read("pluginlist"); |
|||
$sort = $_GPC['sort'] ? : $set['qgsort']; |
|||
#2、生成基本查询条件 |
|||
$where = " a.aid = {$_W['aid']} AND a.uniacid = {$_W['uniacid']} "; |
|||
|
|||
$where .= " AND CASE a.usedatestatus |
|||
WHEN 1 THEN a.`week` LIKE '%\"{$week}\"%' |
|||
WHEN 2 THEN a.`day` LIKE '%\"{$toDay}\"%' |
|||
WHEN 0 THEN a.id > 0 |
|||
END "; |
|||
|
|||
if (!empty($status)) { |
|||
$ids = explode(',', $status); |
|||
if (count($ids) > 1) { |
|||
$where .= " AND a.status IN ({$status}) "; |
|||
} else { |
|||
$where .= " AND a.status = {$status} "; |
|||
} |
|||
} else { |
|||
$where .= " AND a.status IN (1,2) "; |
|||
} |
|||
if($cate_id > 0){ |
|||
$where .= " AND a.cateid = {$cate_id} "; |
|||
} |
|||
if ($is_vip == 1) $where .= " AND a.vipstatus IN (1,2) "; |
|||
#培训类型 |
|||
if ($cc_id > 0) $where .= " AND a.cc_id = {$cc_id} "; |
|||
#培训类型 |
|||
if ($cc_child_id > 0) $where .= " AND a.cc_child_id = {$cc_child_id} "; |
|||
#标题筛选 |
|||
if (!empty($_GPC['title'])) $where .= " AND name like '%{$_GPC['title']}%'"; |
|||
#4、生成排序条件 1=创建时间 2=店铺距离 3=推荐设置 4=浏览人气 5=商品销量 |
|||
switch ($sort) { |
|||
case 1: |
|||
$order = " ORDER BY a.id DESC "; |
|||
break;//创建时间 |
|||
case 2: |
|||
break;//店铺距离 |
|||
case 3: |
|||
$order = " ORDER BY a.sort DESC,a.id DESC "; |
|||
break;//默认排序 |
|||
case 4: |
|||
$order = " ORDER BY a.pv DESC,a.id DESC "; |
|||
break;//浏览人气 |
|||
case 5: |
|||
$order = " ORDER BY buy_num DESC,a.id DESC "; |
|||
break;//商品销量 |
|||
case 6: |
|||
$order = " ORDER BY a.sort DESC,buy_num DESC,a.id DESC "; |
|||
break;//超值精选 推荐、销量排序 |
|||
case 7: |
|||
$order = " ORDER BY a.pv DESC,buy_num DESC,a.id DESC "; |
|||
break;//热门好货 浏览量、销量排序 |
|||
case 8: |
|||
$order = " ORDER BY a.sort DESC,pv DESC,a.id DESC "; |
|||
break;//即将开场 未开始、推荐、浏览量 |
|||
} |
|||
#5、按照排序方式获取商品列表 |
|||
if ($sort != 2) { |
|||
$sql = "SELECT a.id,a.id as goods_id,(IFNULL(sum(b.num),0) + a.allsalenum) as buy_num FROM " |
|||
. tablename(PDO_NAME . "rush_activity") |
|||
. " as a LEFT JOIN " . tablename(PDO_NAME . "rush_order") |
|||
. " as b ON a.id = b.activityid AND b.uniacid = {$_W['uniacid']} AND b.status IN (0,1,2,3,6,9,4,8) AND b.aid = {$_W['aid']} " |
|||
. " WHERE {$where} GROUP BY a.id {$order}" . " LIMIT {$page_start},{$page_index} "; |
|||
$info = pdo_fetchall($sql); |
|||
} else if ($sort == 2) { |
|||
//店铺距离排序 |
|||
$info = pdo_fetchall("SELECT a.id as goods_id,b.id,b.location FROM " |
|||
. tablename(PDO_NAME . "rush_activity") |
|||
. " as a LEFT JOIN " |
|||
. tablename(PDO_NAME . "merchantdata") |
|||
. " as b ON a.sid = b.id WHERE {$where} "); |
|||
$info = Store::getstores($info, $lng, $lat, 2); |
|||
$info = array_slice($info, $page_start, $page_index); |
|||
} |
|||
#6、循环处理信息 |
|||
foreach ($info as $key => &$val) { |
|||
//获取最新的商品信息 |
|||
$val = WeliamWeChat::getHomeGoods(1, $val['goods_id']); |
|||
$val['url'] = h5_url('pages/subPages/goods/index', ['type' => 1, 'id' => $val['id']]); |
|||
$val['status'] = strval($val['status']); |
|||
//当商品信息中带有sid时添加店铺链接 |
|||
if ($val['sid'] > 0) { |
|||
$val['shop_url'] = h5_url('pages/mainPages/store/index', ['sid' => $val['sid']]); |
|||
$val['distance'] = Store::shopLocation($val['sid'], $lng, $lat); |
|||
$val['store_address'] = pdo_getcolumn(PDO_NAME . 'merchantdata',['id' => $val['sid']],'address'); |
|||
}else{ |
|||
$val['storename'] = '平台商品'; |
|||
} |
|||
//一卡通首页 会员特供时用普通价覆盖折扣价 |
|||
if($is_vip == 1){ |
|||
$val['price'] = sprintf("%.2f",$val['price'] - $val['discount_price']); |
|||
} |
|||
//删除多余的信息 |
|||
unset($val['user_list']); |
|||
unset($val['address']); |
|||
unset($val['user_num']); |
|||
unset($val['totalnum']); |
|||
} |
|||
#7、获取总页数 |
|||
if ($is_total == 1) { |
|||
$total = pdo_fetchcolumn("SELECT count(*) FROM " . tablename(PDO_NAME . "rush_activity") . " as a WHERE {$where}"); |
|||
$data['total'] = ceil($total / $page_index); |
|||
$data['list'] = $info; |
|||
|
|||
$this->renderSuccess('抢购商品信息列表', $data); |
|||
} |
|||
|
|||
$this->renderSuccess('抢购商品信息列表', $info); |
|||
} |
|||
/** |
|||
* Comment: 获取抢购专题信息 |
|||
* Author: zzw |
|||
* Date: 2019/8/14 9:51 |
|||
*/ |
|||
public function specialInfo() { |
|||
global $_W, $_GPC; |
|||
#1、参数获取 |
|||
$id = intval($_GPC['id']) OR $this->renderError('缺少参数:专题id'); |
|||
$lng = $_GPC['lng'] ? $_GPC['lng'] : 0;//用户当前所在经度 |
|||
$lat = $_GPC['lat'] ? $_GPC['lat'] : 0;//用户当前所在纬度 |
|||
#2、获取专题信息 |
|||
$info = pdo_get(PDO_NAME . "rush_special", ['id' => $id], ['bgcolor','title', 'thumb', 'share_title', 'share_desc', 'rule']); |
|||
$info['rule'] = htmlspecialchars_decode($info['rule']); |
|||
$info['thumb'] = tomedia($info['thumb']); |
|||
$info['bgcolor'] = $info['bgcolor'] ? : '#FF4444'; |
|||
#3、获取抢购商品列表 |
|||
$sql = " SELECT a.id,b.location FROM ".tablename(PDO_NAME."rush_activity") |
|||
." as a LEFT JOIN ".tablename(PDO_NAME."merchantdata") |
|||
." as b ON a.sid = b.id WHERE a.status = 2 AND a.specialid = {$id} ORDER BY sort DESC "; |
|||
$list = pdo_fetchall($sql); |
|||
if (is_array($info) && count($list) > 0) { |
|||
foreach ($list as $key => &$val) { |
|||
//距离获取 |
|||
$location = unserialize($val['location']); |
|||
$distance = Store::getdistance($location['lng'], $location['lat'], $lng, $lat); |
|||
if (!empty($distance)) { |
|||
if($distance > 9999998){ |
|||
$distance = " "; |
|||
}else if ($distance > 1000) { |
|||
$distance = (floor(($distance / 1000) * 10) / 10) . "km"; |
|||
} else { |
|||
$distance = round($distance) . "m"; |
|||
} |
|||
} |
|||
//获取抢购信息 |
|||
$val = WeliamWeChat::getHomeGoods(1, $val['id']); |
|||
$val['distance'] = $distance; |
|||
$val['url'] = h5_url('pages/subPages/goods/index',['id'=>$val['id'],'type'=>1]); |
|||
unset($val['user_list']); |
|||
unset($val['buy_limit']); |
|||
unset($val['totalnum']); |
|||
unset($val['allsalenum']); |
|||
unset($val['plugin']); |
|||
unset($val['user_num']); |
|||
unset($val['pay_state']); |
|||
unset($val['address']); |
|||
} |
|||
} |
|||
$info['list'] = $list; |
|||
|
|||
$this->renderSuccess("抢购专题信息", $info); |
|||
} |
|||
/** |
|||
* Comment: 抢购商品关注接口(仅允许关注未开始的商品) |
|||
* Author: zzw |
|||
* Date: 2019/11/12 16:50 |
|||
*/ |
|||
public function follow(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$id = $_GPC['id'] OR $this->renderError('网络错误,请刷新重试!'); |
|||
//判断是取消还是关注 |
|||
$flagid = pdo_getcolumn(PDO_NAME.'rush_follows',array('actid'=>$id,'mid'=>$_W['mid']),'id'); |
|||
if($flagid>0){ |
|||
pdo_delete(PDO_NAME.'rush_follows',array('id'=>$flagid)); |
|||
$this->renderSuccess('取消关注成功!'); |
|||
}else{ |
|||
#2、计算提醒信息发送时间 |
|||
$config = Setting::agentsetting_read('rush'); |
|||
if($config['follow_time']) $sendTime = time() + 60*$config['follow_time']; |
|||
else $sendTime = time() + 600; |
|||
#3、判断是否符合发送提醒信息的条件 |
|||
$startTime = pdo_getcolumn(PDO_NAME."rush_activity",['id'=>$id],'starttime'); |
|||
if($startTime < time()) $this->renderError('只能关注未开始的商品哦!'); |
|||
if($startTime < $sendTime) $this->renderError('即将开始,无需关注'); |
|||
$isFollow = pdo_getcolumn(PDO_NAME.'rush_follows',['mid'=>$_W['mid'],'actid'=>$id],'id'); |
|||
if($isFollow) $this->renderError('请勿重复关注!'); |
|||
#4、关注成功,记录将要发送的提示信息 |
|||
$data = [ |
|||
'uniacid' => $_W['uniacid'] , |
|||
'mid' => $_W['mid'] , |
|||
'aid' => $_W['aid'] , |
|||
'actid' => $id , |
|||
'sendtime' => ($startTime - ($sendTime - time())) |
|||
]; |
|||
$res = pdo_insert(PDO_NAME.'rush_follows',$data); |
|||
if($res) $this->renderSuccess('关注成功!'); |
|||
else $this->renderError('网络错误,请刷新重试!'); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 获取抢购分类列表 |
|||
* Author: wlf |
|||
* Date: 2020/09/21 14:13 |
|||
*/ |
|||
public function cateList(){ |
|||
global $_W , $_GPC; |
|||
$list = pdo_getall('wlmerchant_rush_category',array('uniacid' => $_W['uniacid'],'aid' => $_W['aid'],'is_show' => 0),array('id','name'), '' , 'sort DESC'); |
|||
$this->renderSuccess('抢购分类',$list); |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
@ -0,0 +1,371 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Active_WeliamController { |
|||
|
|||
public function activelist() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
|
|||
$data = array(); |
|||
if ($_GPC['status'] == 4) { |
|||
$data['status#'] = "(0,4)"; |
|||
} else if (!empty($_GPC['status'])) { |
|||
$data['status'] = intval($_GPC['status']); |
|||
} |
|||
$data['aid'] = $_W['aid']; |
|||
if (is_store()) { |
|||
$data['sid'] = $_W['storeid']; |
|||
} |
|||
if (!empty($_GPC['keyword'])) { |
|||
if (!empty($_GPC['keywordtype'])) { |
|||
switch ($_GPC['keywordtype']) { |
|||
case 1: |
|||
$data['@name@'] = $_GPC['keyword']; |
|||
break; |
|||
case 2: |
|||
$data['@id@'] = $_GPC['keyword']; |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
if ($_GPC['keywordtype'] == 3) { |
|||
$keyword = $_GPC['keyword']; |
|||
$params[':storename'] = "%{$keyword}%"; |
|||
$merchants = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_merchantdata') . "WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND storename LIKE :storename", $params); |
|||
if ($merchants) { |
|||
$sids = "("; |
|||
foreach ($merchants as $key => $v) { |
|||
if ($key == 0) { |
|||
$sids .= $v['id']; |
|||
} else { |
|||
$sids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$sids .= ")"; |
|||
$data['sid#'] = $sids; |
|||
} else { |
|||
$data['sid#'] = "(0)"; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
if (!empty($_GPC['cc_id'])) $data['cc_id'] = $_GPC['cc_id']; |
|||
$activity = Rush::getNumActive('*', $data, 'sort DESC,ID DESC', $pindex, $psize, 1); |
|||
$pager = $activity[1]; |
|||
$activity = $activity[0]; |
|||
foreach ($activity as $key => &$value) { |
|||
if($value['sid'] > 0){ |
|||
$value['storename'] = pdo_getcolumn(PDO_NAME . 'merchantdata', array('id' => $value['sid']), 'storename'); |
|||
}else if(empty($value['threestatus'])){ |
|||
$value['storename'] = '票付通平台商品'; |
|||
}else if($value['threestatus'] == 1){ |
|||
$value['storename'] = '亿奇达平台商品'; |
|||
}else{ |
|||
$value['storename'] = '其他平台商品'; |
|||
} |
|||
Rush::changeActivestatus($value); |
|||
$value['placeorder'] = WeliamWeChat::getSalesNum(1,$value['id'],0,1,0,0,0,$value['pftid']); //已下单 |
|||
if (empty($value['placeorder'])) { |
|||
$value['placeorder'] = 0; |
|||
} |
|||
$value['alreadypay'] = WeliamWeChat::getSalesNum(1,$value['id'],0,2,0,0,0,$value['pftid']); //已支付 |
|||
if (empty($value['alreadypay'])) { |
|||
$value['alreadypay'] = 0; |
|||
} |
|||
$value['alreadyuse'] = WeliamWeChat::getSalesNum(1,$value['id'],0,3,0,0,0,$value['pftid']);; //已使用 |
|||
if (empty($value['alreadyuse'])) { |
|||
$value['alreadyuse'] = 0; |
|||
} |
|||
# 1级分类 |
|||
$ccRes = Category::getSingleCategory($value['cc_id']); |
|||
if ($ccRes) $value['cc_name'] = $ccRes['name']; |
|||
# 2级分类 |
|||
$cChildRes = Category::getSingleCategory($value['cc_child_id']); |
|||
if ($cChildRes) $value['cc_child_name'] = $cChildRes['name']; |
|||
} |
|||
|
|||
if (is_store()) { |
|||
$status0 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and aid={$_W['aid']} and sid = {$_W['storeid']}"); |
|||
$status1 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status=1 and aid={$_W['aid']} and sid = {$_W['storeid']}"); |
|||
$status2 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status=2 and aid={$_W['aid']} and sid = {$_W['storeid']}"); |
|||
$status3 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status=3 and aid={$_W['aid']} and sid = {$_W['storeid']}"); |
|||
$status4 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status IN (0,4) and aid={$_W['aid']} and sid = {$_W['storeid']}"); |
|||
$status5 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status=5 and aid={$_W['aid']} and sid = {$_W['storeid']}"); |
|||
$status6 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status=6 and aid={$_W['aid']} and sid = {$_W['storeid']}"); |
|||
$status8 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status=8 and aid={$_W['aid']} and sid = {$_W['storeid']}"); |
|||
$status7 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status=7 and aid={$_W['aid']} and sid = {$_W['storeid']}"); |
|||
} else { |
|||
$status0 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and aid={$_W['aid']}"); |
|||
$status1 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status=1 and aid={$_W['aid']}"); |
|||
$status2 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status=2 and aid={$_W['aid']}"); |
|||
$status3 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status=3 and aid={$_W['aid']}"); |
|||
$status4 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status IN (0,4) and aid={$_W['aid']}"); |
|||
$status5 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status=5 and aid={$_W['aid']}"); |
|||
$status6 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status=6 and aid={$_W['aid']}"); |
|||
$status8 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status=8 and aid={$_W['aid']}"); |
|||
$status7 = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME . 'rush_activity') . " WHERE uniacid={$_W['uniacid']} and status=7 and aid={$_W['aid']}"); |
|||
} |
|||
|
|||
$categoryList = Category::getStoreCategory(); |
|||
include wl_template('active/active_list'); |
|||
} |
|||
|
|||
public function ajax() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$da = Rush::getSingleGoods($id, '*'); |
|||
die(json_encode($da)); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 批量修改商品信息 |
|||
* Author: wlf |
|||
* Date: 2020/06/01 14:38 |
|||
*/ |
|||
public function changestatus(){ |
|||
global $_W, $_GPC; |
|||
$ids = $_GPC['ids']; |
|||
$type = $_GPC['type']; |
|||
foreach ($ids as$k=>$v){ |
|||
$rush = pdo_get('wlmerchant_rush_activity',array('id' => $v),array('starttime','endtime','sid','status')); |
|||
if($type == 1){ |
|||
$status = 0; |
|||
if(is_store()){ |
|||
$examine = pdo_getcolumn(PDO_NAME.'merchantdata',array('id'=>$rush['sid']),'audits'); |
|||
if(empty($examine)){ |
|||
$status = 5; |
|||
} |
|||
} |
|||
if(empty($status)){ |
|||
if ($rush['starttime'] > time()) { |
|||
$status = 1; |
|||
} |
|||
else if ($rush['starttime'] < time() && time() < $rush['endtime']) { |
|||
$status = 2; |
|||
} |
|||
else if ($rush['endtime'] < time()) { |
|||
$status = 3; |
|||
} |
|||
} |
|||
pdo_update('wlmerchant_rush_activity', array('status' => $status), array('id' => $v)); |
|||
}else if($type == 8 && $rush['status'] == 8){ |
|||
Rush::deleteActive(array('id' => $v, 'uniacid' => $_W['uniacid'])); |
|||
}else{ |
|||
pdo_update('wlmerchant_rush_activity', array('status' => $type), array('id' => $v)); |
|||
} |
|||
} |
|||
show_json(1, '操作成功'); |
|||
} |
|||
|
|||
public function delete() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$status = $_GPC['status']; |
|||
if ($status == 4) { |
|||
$rush = pdo_get('wlmerchant_rush_activity',array('id' => $id),array('starttime','endtime','sid','status')); |
|||
if(is_store()){ |
|||
$examine = pdo_getcolumn(PDO_NAME.'merchantdata',array('id'=>$rush['sid']),'audits'); |
|||
if(empty($examine)){ |
|||
$changestatus = 5; |
|||
} |
|||
} |
|||
if(empty($changestatus)){ |
|||
if ($rush['starttime'] > time()) { |
|||
$changestatus = 1; |
|||
} |
|||
else if ($rush['starttime'] < time() && time() < $rush['endtime']) { |
|||
$changestatus = 2; |
|||
} |
|||
else if ($rush['endtime'] < time()) { |
|||
$changestatus = 3; |
|||
} |
|||
} |
|||
$res = pdo_update('wlmerchant_rush_activity', array('status' => $changestatus), array('id' => $id)); |
|||
} else { |
|||
$res = Rush::updateActive(array('status' => 4), array('id' => $id)); |
|||
} |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0))); |
|||
} else { |
|||
die(json_encode(array('errno' => 1))); |
|||
} |
|||
} |
|||
|
|||
public function delall() { |
|||
global $_W, $_GPC; |
|||
$res = Rush::deleteActive(array('id' => intval($_GPC['id']), 'uniacid' => $_W['uniacid'])); |
|||
if ($res) { |
|||
show_json(1, '彻底删除成功'); |
|||
} else { |
|||
show_json(0, '彻底删除失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
public function cutoff() { |
|||
global $_W, $_GPC; |
|||
$res = pdo_update('wlmerchant_rush_activity', array('status' => 8), array('id' => intval($_GPC['id']))); |
|||
if ($res) { |
|||
show_json(1, '删除成功'); |
|||
} else { |
|||
show_json(0, '删除失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
public function examine() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$flag = $_GPC['flag']; |
|||
if ($flag == 1) { |
|||
$res = Rush::updateActive(array('status' => 1), array('id' => $id)); |
|||
News::goodsToExamine($id,'rush'); |
|||
} else { |
|||
$res = Rush::updateActive(array('status' => 6), array('id' => $id)); |
|||
News::goodsToExamine($id,'rush','未通过'); |
|||
} |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0))); |
|||
} else { |
|||
die(json_encode(array('errno' => 1))); |
|||
} |
|||
} |
|||
|
|||
public function copygood() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$da = Rush::getSingleActive($id, '*'); |
|||
unset($da['id']); |
|||
unset($da['a']); |
|||
unset($da['plugin']); |
|||
$da['levelnum'] = $da['num']; |
|||
$da['status'] = 4; |
|||
$res = pdo_insert('wlmerchant_rush_activity', $da); |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0))); |
|||
} else { |
|||
die(json_encode(array('errno' => 1))); |
|||
} |
|||
} |
|||
|
|||
public function changepv() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$type = $_GPC['type']; |
|||
$newvalue = trim($_GPC['value']); |
|||
if ($type == 1) { |
|||
$res = pdo_update('wlmerchant_rush_activity', array('pv' => $newvalue), array('id' => $id)); |
|||
} elseif ($type == 2) { |
|||
$res = pdo_update('wlmerchant_rush_activity', array('sort' => $newvalue), array('id' => $id)); |
|||
} elseif ($type == 3) { |
|||
$res = pdo_update('wlmerchant_rush_activity', array('num' => $newvalue), array('id' => $id)); |
|||
} |
|||
if ($res) { |
|||
show_json(1, '修改成功'); |
|||
} else { |
|||
show_json(0, '修改失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 获取抢购商品信息列表 |
|||
* Author: zzw |
|||
* Date: 2019/7/11 14:52 |
|||
*/ |
|||
public function rushList() { |
|||
global $_W, $_GPC; |
|||
#1、条件生成 |
|||
$where = " a.aid = {$_W['aid']} AND a.uniacid = {$_W['uniacid']}";//默认条件 |
|||
!empty($_GPC['name']) && $where .= " AND a.name LIKE '%{$_GPC['name']}%' ";//商品名称 |
|||
$_GPC['status'] > -1 && $where .= " AND a.status = {$_GPC['status']} ";//商品名称 |
|||
!empty($_GPC['goods_id']) && $where .= " AND a.id = {$_GPC['goods_id']} ";//商品id |
|||
!empty($_GPC['shop_name']) && $where .= " AND m.storename LIKE '%{$_GPC['shop_name']}%' ";//商户名称 |
|||
$_GPC['cate_id'] > -1 && $where .= " AND a.cateid = {$_GPC['cate_id']} ";//商户名称 |
|||
!empty($_GPC['shop_id']) && $where .= " AND a.sid = {$_GPC['shop_id']} ";//商户id |
|||
#2、排序操作 |
|||
$order = " a.sort DESC ,a.id DESC "; |
|||
#3、分页操作 |
|||
$page = $_GPC['page'] ? $_GPC['page'] : 1;//当前页 |
|||
$index = $_GPC['index'] ? $_GPC['index'] : 10;//每页的数量 |
|||
$start = $page * $index - $index;//开始查询的点 = 当前页 * 每页的数量 - 每页的数量 |
|||
$limit = " LIMIT {$start},{$index}"; |
|||
#4、查询信息内容 |
|||
$field = 'a.id,a.thumb,a.name,a.starttime,a.endtime,a.status,a.pv,a.sort,a.num,m.storename,b.name as cate_name'; |
|||
$sql = "SELECT {$field} FROM " . tablename(PDO_NAME . 'rush_activity') |
|||
. " a LEFT JOIN " . tablename(PDO_NAME . "rush_category") |
|||
. " b ON a.cateid = b.id LEFT JOIN " . tablename(PDO_NAME . "merchantdata") |
|||
. " m ON a.sid = m.id"; |
|||
!empty($where) && $sql .= " WHERE {$where} "; |
|||
$sql .= ' GROUP BY a.id '; |
|||
!empty($order) && $sql .= " ORDER BY {$order} "; |
|||
$total = count(pdo_fetchall(str_replace($field, "a.id", $sql)));//获取符合条件的总数量 |
|||
$data['page_num'] = ceil($total / $index);//获取一共有多少页 |
|||
!empty($limit) && $sql .= $limit; |
|||
$data['list'] = pdo_fetchall($sql);//获取要查询的列表数据 |
|||
#5、处理相关信息 |
|||
$orderModel = new Order(); |
|||
foreach ($data['list'] as $k => &$v) { |
|||
//图片信息转换 |
|||
$v['thumb'] = tomedia($v['thumb']); |
|||
//获取销量信息 |
|||
$orderW = " activityid = {$v['id']} AND status in "; |
|||
$v['order_purchase'] = $orderModel->getPurchaseQuantity($orderW . " (0,1,2,3,4,6,8,9) ", true) ?: 0;//已下单 |
|||
$v['order_payment'] = $orderModel->getPurchaseQuantity($orderW . " (1,2,3,4,6,8,9) ", true) ?: 0;//已支付 |
|||
$v['order_used'] = $orderModel->getPurchaseQuantity($orderW . " (2,3) ", true) ?: 0;//已完成 |
|||
//时间戳转时间 |
|||
$v['starttime'] = date("Y-m-d H:i:s", $v['starttime']); |
|||
$v['endtime'] = date("Y-m-d H:i:s", $v['endtime']); |
|||
} |
|||
|
|||
wl_json(1, '抢购商品列表', $data); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 获取抢购商品分类列表 |
|||
* Author: zzw |
|||
* Date: 2019/7/11 14:59 |
|||
*/ |
|||
public function getClassList() { |
|||
global $_W, $_GPC; |
|||
$where = " uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "; |
|||
$list = pdo_fetchall("SELECT id,name FROM " . tablename(PDO_NAME . 'rush_category') . " WHERE {$where} ORDER BY sort DESC "); |
|||
|
|||
wl_json(1, '抢购分类列表', $list); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 修改抢购商品的某个单项数据信息 |
|||
* Author: zzw |
|||
* Date: 2019/7/12 18:16 |
|||
*/ |
|||
public function updateInfo() { |
|||
global $_W, $_GPC; |
|||
#1、参数接收 |
|||
if (empty($_GPC['field'])) show_json(0, "缺少参数:修改的字段名称"); |
|||
#2、修改内容 |
|||
$data[$_GPC['field']] = $_GPC['value']; |
|||
$res = pdo_update(PDO_NAME . 'rush_activity', $data, array('id' => $_GPC['id'])); |
|||
if ($res) { |
|||
show_json(1, "修改成功"); |
|||
} else { |
|||
show_json(0, "修改失败"); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 修改状态 |
|||
* Author: zzw |
|||
* Date: 2023/5/6 13:52 |
|||
*/ |
|||
public function changeRecommend() |
|||
{ |
|||
global $_W, $_GPC; |
|||
#1、获取参数信息 |
|||
$id = $_GPC['id'] or Commons::sRenderError('缺少参数:导航id'); |
|||
$recommend = $_GPC['status'] ?: 0; |
|||
#1、修改操作 |
|||
$res = pdo_update(PDO_NAME . "rush_activity", ['recommend' => $recommend], ['id' => $id]); |
|||
if ($res) Commons::sRenderSuccess('修改成功'); |
|||
else Commons::sRenderError('修改失败,请刷新重试!'); |
|||
} |
|||
} |
|||
@ -0,0 +1,120 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Category_WeliamController { |
|||
/** |
|||
* Comment: 抢购分类列表 |
|||
* Author: zzw |
|||
* Date: 2019/12/20 11:41 |
|||
*/ |
|||
public function index() { |
|||
global $_W, $_GPC; |
|||
#1、参数获取 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = 10; |
|||
$keyword = $_GPC['keyword'] ? : ''; |
|||
#1、条件生成 |
|||
$where = ['aid'=>$_W['aid'],'uniacid'=>$_W['uniacid']]; |
|||
if(!empty($keyword)) $where['name LIKE'] = '%' . $keyword . '%'; |
|||
#1、列表获取 |
|||
$list = pdo_getslice(PDO_NAME . 'rush_category',$where,[$page, $pageIndex],$total,['id','name','sort','thumb'],'','sort DESC'); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
|
|||
include wl_template('goodshouse/cate_list'); |
|||
} |
|||
/** |
|||
* Comment: 异步修改抢购商品排序功能 |
|||
* Author: zzw |
|||
*/ |
|||
public function editSort() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
$sort = trim($_GPC['value']); |
|||
$item = pdo_fetch('SELECT id FROM ' . tablename(PDO_NAME . 'rush_category') . " WHERE id = {$id} and aid = {$_W['aid']} and uniacid = {$_W['uniacid']} "); |
|||
if (!empty($item)) { |
|||
pdo_update(PDO_NAME . 'rush_category', array('sort' => $sort), array('id' => $id, 'aid' => intval($_W['aid']))); |
|||
show_json(1, '分类修改成功'); |
|||
} else { |
|||
show_json(0, '分类不存在,请刷新页面重试!'); |
|||
} |
|||
} |
|||
|
|||
|
|||
public function specialindex() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 20; |
|||
|
|||
$condition = ' and aid=:aid and uniacid=:uniacid '; |
|||
$keyword = trim($_GPC['keyword']); |
|||
|
|||
if (!empty($keyword)) { |
|||
$condition .= ' and title like \'%' . $keyword . '%\' '; |
|||
} |
|||
|
|||
$list = pdo_fetchall('select id,`title` from ' . tablename('wlmerchant_rush_special') . ' where 1 ' . $condition . ' order by id desc limit ' . (($pindex - 1) * $psize) . ',' . $psize, array(':aid' => intval($_W['aid']), ':uniacid' => $_W['uniacid'])); |
|||
$total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('wlmerchant_rush_special') . ' where aid=:aid and uniacid=:uniacid ', array(':aid' => intval($_W['aid']), ':uniacid' => $_W['uniacid'])); |
|||
$pager = wl_pagination($total, $pindex, $psize); |
|||
|
|||
|
|||
include wl_template('cate/specialindex'); |
|||
} |
|||
|
|||
public function sptitleedit() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
$title = trim($_GPC['value']); |
|||
$res = pdo_update('wlmerchant_rush_special', array('title' => $title), array('id' => $id)); |
|||
if ($res) { |
|||
show_json(1, '修改成功'); |
|||
} else { |
|||
show_json(0, '修改失败,请刷新页面重试!'); |
|||
} |
|||
} |
|||
|
|||
public function specialdelete() { |
|||
global $_W, $_GPC; |
|||
if ($_W['ispost']) { |
|||
$id = intval($_GPC['id']); |
|||
if (empty($id)) { |
|||
show_json(0, '参数错误,请刷新重试!'); |
|||
} else { |
|||
$res = pdo_delete('wlmerchant_rush_special', array('id' => $id, 'aid' => intval($_W['aid']))); |
|||
} |
|||
if ($res) { |
|||
show_json(1); |
|||
} else { |
|||
show_json(0, '删除失败,请刷新页面重试!'); |
|||
} |
|||
} |
|||
} |
|||
|
|||
public function specialedit() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
if ($id) { |
|||
$special = pdo_get('wlmerchant_rush_special', array('id' => $id)); |
|||
} |
|||
if (checksubmit('submit')) { |
|||
$special = $_GPC['special']; |
|||
if (empty($special['title'])) wl_message('请填写专题标题'); |
|||
if (empty($special['share_title'])) wl_message('请填写分享标题'); |
|||
if (empty($special['share_desc'])) wl_message('请填写分享描述'); |
|||
if (empty($special['thumb'])) wl_message('请上传专题图片'); |
|||
$special['rule'] = htmlspecialchars_decode($special['rule']); |
|||
|
|||
if ($id) { |
|||
pdo_update('wlmerchant_rush_special', $special, array('id' => $id)); |
|||
} else { |
|||
$special['uniacid'] = $_W['uniacid']; |
|||
$special['aid'] = $_W['aid']; |
|||
$special['createtime'] = time(); |
|||
pdo_insert('wlmerchant_rush_special', $special); |
|||
} |
|||
wl_message('保存成功!', web_url('rush/category/specialindex'), 'success'); |
|||
} |
|||
include wl_template('cate/specialedit'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Set_WeliamController { |
|||
|
|||
function base() { |
|||
global $_W, $_GPC; |
|||
if (checksubmit('submit')) { |
|||
$base = $_GPC['base']; |
|||
Setting::agentsetting_save($base, 'rush'); |
|||
wl_message('保存设置成功!', referer(), 'success'); |
|||
} |
|||
$base = Setting::agentsetting_read('rush'); |
|||
//获取社群 |
|||
$communitylist = pdo_getall('wlmerchant_community', array('uniacid' => $_W['uniacid'], 'aid' => $_W['aid']), array('id', 'communname')); |
|||
|
|||
include wl_template('set/base'); |
|||
} |
|||
} |
|||
@ -0,0 +1,314 @@ |
|||
{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 {if empty($_GPC['status'])}class="active"{/if}><a href="{php echo wl_filter_url('status:0');}">全部抢购{if $status0}<span class="label label-warning pull-right" style="margin-left: 10px;">{$status0}</span>{/if}</a></li> |
|||
<li {if $_GPC['status']==1}class="active"{/if}><a href="{php echo wl_filter_url('status:1');}">待开始{if $status1}<span class="label label-warning pull-right" style="margin-left: 10px;">{$status1}</span>{/if}</a></li> |
|||
<li {if $_GPC['status']==2}class="active"{/if}><a href="{php echo wl_filter_url('status:2');}">进行中{if $status2}<span class="label label-warning pull-right" style="margin-left: 10px;">{$status2}</span>{/if}</a></li> |
|||
<li {if $_GPC['status']==3}class="active"{/if}><a href="{php echo wl_filter_url('status:3');}">已结束{if $status3}<span class="label label-warning pull-right" style="margin-left: 10px;">{$status3}</span>{/if}</a></li> |
|||
<li {if $_GPC['status']==7}class="active"{/if}><a href="{php echo wl_filter_url('status:7');}">已抢完{if $status7}<span class="label label-warning pull-right" style="margin-left: 10px;">{$status7}</span>{/if}</a></li> |
|||
<li {if $_GPC['status']==4}class="active"{/if}><a href="{php echo wl_filter_url('status:4');}">已下架{if $status4}<span class="label label-warning pull-right" style="margin-left: 10px;">{$status4}</span>{/if}</a></li> |
|||
<li {if $_GPC['status']==5}class="active"{/if}><a href="{php echo wl_filter_url('status:5');}">待审核{if $status5}<span class="label label-warning pull-right" style="margin-left: 10px;">{$status5}</span>{/if}</a></li> |
|||
<li {if $_GPC['status']==6}class="active"{/if}><a href="{php echo wl_filter_url('status:6');}">被驳回{if $status6}<span class="label label-warning pull-right" style="margin-left: 10px;">{$status6}</span>{/if}</a></li> |
|||
<li {if $_GPC['status']==8}class="active"{/if}><a href="{php echo wl_filter_url('status:8');}">回收站{if $status8}<span class="label label-warning pull-right" style="margin-left: 10px;">{$status8}</span>{/if}</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('goodshouse/goodshouse/createactive')}" 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="rush" /> |
|||
<input type="hidden" name="ac" value="active" /> |
|||
<input type="hidden" name="do" value="activelist" /> |
|||
<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}>活动商品ID</option> |
|||
{if !is_store()} |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>商家名称</option> |
|||
{/if} |
|||
</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"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('cc_id:0');}" class="btn {if $_GPC['cc_id'] == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
{loop $categoryList $cList} |
|||
<a href="{php echo wl_filter_url('cc_id:'.$cList['id']);}" class="btn {if $_GPC['cc_id'] == $cList['id']}btn-primary{else}btn-default{/if}">{$cList['name']}</a> |
|||
{/loop} |
|||
</div> |
|||
</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 class="text-center" width="30px"><input type="checkbox" name="checkall" value="" id="checkall" class="checkboxall" onclick="var ck = this.checked; $(':checkbox').each(function(){this.checked = ck});"/></th> |
|||
<th style="width:30px;text-align:center;">ID</th> |
|||
<th style="width:120px;">商品</th> |
|||
<th style="width:70px; text-align:center;">商品类型<br>商品分类</th> |
|||
<th style="width:100px; text-align:center;">活动时间</th> |
|||
<th style="width:60px; text-align:center;">活动状态</th> |
|||
<th style="width:60px; text-align:center;">属性</th> |
|||
<th style="width:70px; text-align:center;">库存/下单</th> |
|||
<th style="width:70px; text-align:center;">数据统计</th> |
|||
{if $_GPC['cc_id'] == 51 || $_GPC['cc_id'] <= 0} |
|||
<th style="width:70px; text-align:center;">推荐</th> |
|||
{/if} |
|||
<!--<th style="width:120px; text-align:center;">核销截止时间</th>--> |
|||
<th style="width:100px; text-align:center;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $activity $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>商家:{$item['storename']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" > |
|||
{php echo $item['cc_name'] ?: '-'}<br> |
|||
{php echo $item['cc_child_name'] ?: '-'} |
|||
</td> |
|||
<td class="line-feed" style="width:150px;padding-left: 5px;"> |
|||
<div class="title" style="text-align: center;"> |
|||
<span>从:{php echo date('m-d H:i',$item['starttime'])}</span> |
|||
<span>到:{php echo date('m-d H:i',$item['endtime'])}</span><br /> |
|||
{if $item['cutoffstatus'] == 1} |
|||
<span style="display: inline-block;">购买后{$item['cutoffday']}天有效</span> |
|||
{else} |
|||
<span style="display: inline-block;">消费截止:{php echo date('m-d H:i',$item['cutofftime'])}</span> |
|||
{/if} |
|||
</div> |
|||
</td> |
|||
<td class="text-center" style="width:60px;"> |
|||
{if $item['status'] == 0 }<span class="label label-default">下架中</span>{/if} |
|||
{if $item['status'] == 1 }<span class="label label-warning">未开始</span>{/if} |
|||
{if $item['status'] == 2 }<span class="label label-success">进行中</span>{/if} |
|||
{if $item['status'] == 5 }<span class="label label-warning">审核中</span>{/if} |
|||
{if $item['status'] == 6 }<span class="label label-danger">被驳回</span>{/if} |
|||
{if $item['status'] == 8 }<span class="label label-default">回收站</span>{/if} |
|||
{if $item['status'] == 3 }<span class="label label-danger">已结束</span>{/if} |
|||
{if $item['status'] == 4 }<span class="label label-default">已下架</span>{/if} |
|||
{if $item['status'] == 7 }<span class="label label-default">已抢完</span>{/if} |
|||
</td> |
|||
<td class="text-center" style="width:60px;"> |
|||
{if is_store()} |
|||
<p>人气:{$item['pv']}</p> |
|||
<p>排序:{$item['sort']}</p> |
|||
{else} |
|||
<p>人气:<a style="color: #428bca;" data-href="{php echo web_url('rush/active/changepv',array('id' => $item['id'],'type'=>1))}" href="javascript:;" title="修改人气" data-toggle="ajaxEdit" >{$item['pv']}</a></p> |
|||
<p>排序:<a style="color: #428bca;" data-href="{php echo web_url('rush/active/changepv',array('id' => $item['id'],'type'=>2))}" href="javascript:;" title="修改排序" data-toggle="ajaxEdit" >{$item['sort']}</a></p> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center" style="width:70px;"> |
|||
<p>提供:<a style="color: #428bca;" data-href="{php echo web_url('rush/active/changepv',array('id' => $item['id'],'type'=>3))}" href="javascript:;" title="修改库存" data-toggle="ajaxEdit" >{$item['num']}</a></p> |
|||
<p style="color: #428bca;"><a href="{php echo web_url('order/wlOrder/checkcodeList',array('plugin' => 'rush','status'=>1,'id'=>$item['id']))}">已下单:{$item['placeorder']}</a></p> |
|||
</td> |
|||
<td class="text-center" style="width:70px;"> |
|||
<p style="color: #428bca;"><a href="{php echo web_url('order/wlOrder/checkcodeList',array('plugin' => 'rush','status'=>2,'id'=>$item['id']))}">已支付:{$item['alreadypay']}</a></p> |
|||
<p style="color: #428bca;"><a href="{php echo web_url('order/wlOrder/checkcodeList',array('plugin' => 'rush','status'=>3,'id'=>$item['id']))}">已完成:{$item['alreadyuse']}</a></p> |
|||
</td> |
|||
{if $_GPC['cc_id'] == 51 || $_GPC['cc_id'] <= 0} |
|||
<td class="text-center" style="width:70px;"> |
|||
{if $item['cc_id'] == 51} |
|||
{php echo tpl_change_status('rush/active/changeRecommend&id='.$item['id'],$item['recommend'])} |
|||
{/if} |
|||
</td> |
|||
{/if} |
|||
<td class="text-center" style="position: relative;"> |
|||
{if p('wxplatform')} |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="js-clip" data-url="{php echo h5_url('pages/subPages/goods/index?type=1',['id'=>$item['id']])}">复制链接</a> </p> |
|||
{/if} |
|||
{if p('wxapp')} |
|||
<a href="javascript:;" data-url="pages/subPages/goods/index?type=1&goodsType=1&id={$item['id']}" class="js-clip">复制路径</a> |
|||
{/if} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('goodshouse/goodshouse/createactive', array('id' => $item['id'],'page'=>$pindex))}">编辑</a> </p> |
|||
<br /> |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="js-copy" order-id="{$item['id']}">复制商品</a></p> |
|||
{if ($item['status'] == 1 || $item['status'] == 2 || $item['status'] == 3)} |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="js-remove" order-id="{$item['id']}" order-status="{$item['status']}">下架</a></p> |
|||
{/if} |
|||
{if $item['status'] ==4 || $item['status'] ==8} |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="js-remove" order-id="{$item['id']}" order-status="{$item['status']}">上架</a></p> |
|||
{/if} |
|||
{if $item['status']==5 && !is_store()} |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="js-pass" order-id="{$item['id']}" flag = '1' order-status="{$item['status']}">通过</a> </p> |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="js-pass" order-id="{$item['id']}" flag = '0' order-status="{$item['status']}">不通过</a></p> |
|||
{/if} |
|||
{if $item['status']==6 && !is_store()} |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="js-pass" order-id="{$item['id']}" flag = '1' order-status="{$item['status']}">通过</a></p> |
|||
{/if} |
|||
{if $item['status'] == 8} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('rush/active/delall', array('id'=>$item['id']))}" data-toggle="ajaxRemove" data-confirm="此操作会删除抢购活动,同时导致订单商品数据缺失或其他问题,确定要删除吗?">彻底删除</a></p> |
|||
{else} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('rush/active/cutoff', array('id'=>$item['id']))}" data-toggle="ajaxRemove" data-confirm="确定放入回收站?">删除</a></p> |
|||
{/if} |
|||
{if empty($item['pftid']) && Customized::init('pft147') > 0 } |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('goodshouse/goodshouse/checklist', array('id' => $item['id'],'plugin'=>'rush'))}">核销码</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(4);">批量下架</button> |
|||
</div> |
|||
<button class="btn btn-default btn-sm" type="button" disabled="disabled" id="delete" onclick="checkOrDelete(8);"><i class="fa fa-trash"></i> 回收站</button> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
</script> |
|||
<script type="text/javascript"> |
|||
|
|||
function checkOrDelete(check){ |
|||
var content = ''; |
|||
if(check==1) content = '确认上架选中商品?'; |
|||
if(check==4) content = '确认下架选中商品?'; |
|||
if(check==8) content = '确认把选中商品放入回收站?如果商品已在回收站将会被彻底删除。'; |
|||
layer.open({ |
|||
title: [ |
|||
'提示', |
|||
'background-color:#23c6c8; 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('rush/active/changestatus')}", { ids : ids ,type:check}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("操作成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.message); |
|||
}; |
|||
}, 'json'); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
|
|||
$(function(){ |
|||
$('.order-list').delegate('.js-remove', 'click', function(e){ |
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('order-id'); |
|||
var status = $this.attr('order-status'); |
|||
var statushtml = (status == 4) ? "上架" : "下架"; |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('rush/active/delete')}", {id:id,status:status}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips(statushtml+"成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认'+statushtml+"?"}); |
|||
}); |
|||
$('.order-list').delegate('.js-pass', 'click', function(e){ |
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('order-id'); |
|||
var flag = $this.attr('flag'); |
|||
var statushtml = (flag == 1) ? "通过" : "不通过"; |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('rush/active/examine')}", {id:id,flag:flag}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips(statushtml+"成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认'+statushtml+"审核?"}); |
|||
}); |
|||
|
|||
$('.order-list').delegate('.js-copy', 'click', function(e){ |
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('order-id'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('rush/active/copygood')}", {id:id}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("复制成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认复制该活动?被复制的活动会在已下架中显示'}); |
|||
}); |
|||
|
|||
$('.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); |
|||
} |
|||
}); |
|||
|
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,66 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('rush/category/specialindex');}">专题管理</a></li> |
|||
<li class="active"><a href="{php echo web_url('rush/category/specialedit');}">{if $id}编辑{else}新建{/if}专题</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="panel panel-default"> |
|||
<div class="panel-heading">抢购专题</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">专题标题<span style="color: orangered;">*</span></label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="special[title]" class="form-control" value="{$special['title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">顶部图片<span style="color: orangered;">*</span></label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('special[thumb]',$special['thumb']);} |
|||
<span class="help-block">图片建议为750X520</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">背景颜色<span style="color: orangered;">*</span></label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_form_field_color('special[bgcolor]',$special['bgcolor']);} |
|||
<span class="help-block">默认背景颜色为白色</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享标题<span style="color: orangered;">*</span></label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="special[share_title]" class="form-control" value="{$special['share_title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述<span style="color: orangered;">*</span></label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="special[share_desc]" class="form-control" value="{$special['share_desc']}" /> |
|||
</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('special[rule]',$special['rule']);} |
|||
<span class="help-block">不添加规则不显示</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="hidden" name="id" value="{$id}" id="id"/> |
|||
<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,74 @@ |
|||
{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('rush/category/specialedit')}" class="btn btn-primary">新建专题</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="./cityagent.php" method="get"> |
|||
<input type="hidden" name="p" value="rush" /> |
|||
<input type="hidden" name="ac" value="category" /> |
|||
<input type="hidden" name="do" value="specialindex" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<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" type="submit">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead class="navbar-inner"> |
|||
<tr> |
|||
<th style="width: 40px;">ID</th> |
|||
<th style="width: 200px;">专题标题(点击编辑)</th> |
|||
<th style="width: 120px">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr> |
|||
<td>{$item['id']}</td> |
|||
<td> |
|||
<a href='javascript:;' data-toggle='ajaxEdit' data-href="{php echo web_url('rush/category/sptitleedit',array('id'=>$item['id']))}"> |
|||
{$item['title']} |
|||
</a> |
|||
</td> |
|||
<td style="position: relative;"> |
|||
<a class="btn btn-sm btn-info" href="{php echo web_url('rush/category/specialedit',array('id' => $item['id']))}">编辑</a> |
|||
<a class="btn btn-sm btn-primary js-clip" href='javascript:;' data-url="{php echo h5_url('pages/subPages/special/rushspeci/rushspeci',['id'=>$item['id']])}">复制链接</a> |
|||
{if p('wxapp')} |
|||
<a href="javascript:;" data-url="pages/subPages/special/rushspeci/rushspeci?id={$item['id']}" class="js-clip btn btn-sm btn-primary"> |
|||
小程序路径 |
|||
</a> |
|||
{/if} |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('rush/category/specialdelete', array('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,97 @@ |
|||
{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-validate" id="setting-form"> |
|||
<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"> |
|||
<div class="input-group"> |
|||
<input type="text" name="base[follow_time]" min="0" class="form-control" value="{$base['follow_time']}" /> |
|||
<span class="input-group-addon">分钟</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"> |
|||
<select name="base[communityid]" class="form-control chosen-select"> |
|||
<option value="0" >不显示社群</option> |
|||
{loop $communitylist $key $val} |
|||
<option value="{$val['id']}" {if $val['id'] == $base['communityid']}selected{/if}>{$val['communname']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block">请选择首页是否显示社群</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group hide"> |
|||
<label class="col-sm-2 control-label">选项卡分类是否显示图片</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadioo2" name="base[img_switch]" value="0" {if $base['img_switch'] != 1}checked="checked"{/if}> |
|||
<label for="inlineRadioo2">关闭 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadioo1" name="base[img_switch]" value="1" {if $base['img_switch'] == 1}checked="checked"{/if}> |
|||
<label for="inlineRadioo1">开启 </label> |
|||
</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"> |
|||
<input type="text" name="base[share_title]" class="form-control" value="{$base['share_title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('base[share_image]', $base['share_image']);} |
|||
<span class="help-block">推荐图片尺寸500X500</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[share_desc]" class="form-control" value="{$base['share_desc']}" /> |
|||
</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> |
|||
$(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,141 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Salesman { |
|||
|
|||
static function saleCore($sid,$plugin){ |
|||
global $_W; |
|||
$salemans = pdo_getall('wlmerchant_merchantuser',array('ismain' => 4,'storeid'=> $sid,'enabled'=>1),array('aid','id','mid','alone','scale','alone_plugin','sales_plugin')); |
|||
$salearray = []; |
|||
if(!empty($salemans)){ |
|||
foreach ($salemans as $sale){ |
|||
$setting = pdo_get('wlmerchant_agentsetting',array('uniacid' => $_W['uniacid'],'aid'=>$sale['aid'],'key' => 'salesman'),array('value')); |
|||
$setting = unserialize($setting['value']); |
|||
if($setting['isopen']){ |
|||
$saleinfo = []; |
|||
if($sale['alone_plugin']){ |
|||
$piugins = unserialize($sale['sales_plugin']); |
|||
}else{ |
|||
$piugins = unserialize($setting['plugin']); |
|||
} |
|||
if(in_array($plugin,$piugins) || empty($piugins)){ |
|||
if($sale['alone']){ |
|||
$saleinfo['scale'] = $sale['scale']; |
|||
}else{ |
|||
$saleinfo['scale'] = $setting['scale']; |
|||
} |
|||
$saleinfo['mid'] = $sale['mid']; |
|||
if($saleinfo['scale']>0){ |
|||
$salearray[] = $saleinfo; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
if(!empty($salearray)){$salearray = serialize($salearray);} |
|||
return $salearray; |
|||
} |
|||
|
|||
static function doTask(){ |
|||
global $_W; |
|||
//结算佣金(废弃) |
|||
// $h = date(G,time()); |
|||
// $w = date(w,time()); |
|||
// $d = date(d,time()); |
|||
// $start = strtotime(date('Y-m-d')); |
|||
// $last = $start - 86400; |
|||
// if($h > 2 && $h < 9) { //每天凌晨两点生成任务记录 |
|||
// $stores = pdo_fetchall('select distinct storeid,uniacid from ' . tablename(PDO_NAME . 'merchantuser') . " WHERE ismain = 4 AND enabled = 1"); |
|||
// if ($stores) { |
|||
// foreach ($stores as $store) { |
|||
// $flag = pdo_fetch("SELECT id FROM " . tablename('wlmerchant_report') . "WHERE storeid = {$store['storeid']} AND createtime > {$start} "); |
|||
// if (empty($flag)) { |
|||
// $data = array( |
|||
// 'uniacid' => $store['uniacid'], |
|||
// 'storeid' => $store['storeid'], |
|||
// 'createtime' => time(), |
|||
// 'status' => 0 |
|||
// ); |
|||
// } |
|||
// pdo_insert(PDO_NAME . 'report', $data); |
|||
// } |
|||
// } |
|||
// } |
|||
// |
|||
// //开始填充报表 |
|||
// $reports = pdo_fetchall('select * from ' . tablename(PDO_NAME . 'report') . " WHERE status = 0 LIMIT 3"); |
|||
// if($reports){ |
|||
// foreach ($reports as $report){ |
|||
// $rush_order_money = pdo_fetchcolumn('SELECT SUM(actualprice) FROM '.tablename(PDO_NAME."rush_order")." WHERE sid = {$report['storeid']} AND settletime < {$start} AND settletime > {$last} AND reportid = 0 "); |
|||
// $order_money = pdo_fetchcolumn('SELECT SUM(price) FROM '.tablename(PDO_NAME."order")." WHERE sid = {$report['storeid']} AND settletime < {$start} AND settletime > {$last} AND reportid = 0 AND plugin != 'store' "); |
|||
// $rush_order_num = pdo_fetchcolumn('SELECT count(id) FROM '.tablename(PDO_NAME."rush_order")." WHERE sid = {$report['storeid']} AND settletime < {$start} AND settletime > {$last} AND reportid = 0 "); |
|||
// $order_num = pdo_fetchcolumn('SELECT count(id) FROM '.tablename(PDO_NAME."order")." WHERE sid = {$report['storeid']} AND settletime < {$start} AND settletime > {$last} AND reportid = 0 AND plugin != 'store' "); |
|||
// $money = sprintf("%.2f",$rush_order_money + $order_money); |
|||
// $num = $rush_order_num + $order_num; |
|||
// $_W['uniacid'] = $report['uniacid']; |
|||
// $setting = Setting::wlsetting_read('salesman'); |
|||
// $upg = array( |
|||
// 'money' => $money, |
|||
// 'num' => $num, |
|||
// 'status' => 1, |
|||
// 'setttype' => $setting['settle'] |
|||
// ); |
|||
// $res = pdo_update('wlmerchant_report',$upg,array('id' => $report['id'])); |
|||
// if($res){ |
|||
// pdo_fetchall("update" . tablename('wlmerchant_rush_order') . "SET reportid = {$report['id']} WHERE sid = {$report['storeid']} AND settletime < {$start} AND settletime > {$last} AND reportid = 0"); |
|||
// pdo_fetchall("update" . tablename('wlmerchant_order') . "SET reportid = {$report['id']} WHERE sid = {$report['storeid']} AND settletime < {$start} AND settletime > {$last} AND reportid = 0 AND plugin != 'store'"); |
|||
// } |
|||
// } |
|||
// } |
|||
// |
|||
// //开始结算报表 |
|||
// if($h > 2 && $h < 9){ |
|||
// $settreports1 = pdo_fetchall('select * from ' . tablename(PDO_NAME . 'report') . " WHERE status = 1 AND setttype = 0 AND createtime < {$start} LIMIT 3"); |
|||
// if($settreports1){ |
|||
// foreach ($settreports1 as $sett){ |
|||
// self::salesettle($sett); |
|||
// } |
|||
// } |
|||
// } |
|||
// if($h > 2 && $h < 9 && $w == 1){ |
|||
// $settreports2 = pdo_fetchall('select * from ' . tablename(PDO_NAME . 'report') . " WHERE status = 1 AND setttype = 1 AND createtime < {$start} LIMIT 3"); |
|||
// if($settreports2){ |
|||
// foreach ($settreports2 as $sett2){ |
|||
// self::salesettle($sett2); |
|||
// } |
|||
// } |
|||
// } |
|||
// if($h > 2 && $h < 9 && $d == 01){ |
|||
// $settreports3 = pdo_fetchall('select * from ' . tablename(PDO_NAME . 'report') . " WHERE status = 1 AND setttype = 2 AND createtime < {$start} LIMIT 3"); |
|||
// if($settreports3){ |
|||
// foreach ($settreports3 as $sett3){ |
|||
// self::salesettle($sett3); |
|||
// } |
|||
// } |
|||
// } |
|||
} |
|||
|
|||
static function salesettle($report){ |
|||
global $_W; |
|||
$_W['uniacid'] = $report['uniacid']; |
|||
$setting = Setting::wlsetting_read('salesman'); |
|||
$sales = pdo_getall('wlmerchant_merchantuser',array('storeid' => $report['storeid'],'ismain'=>4),array('mid','alone','scale')); |
|||
foreach ($sales as $sale){ |
|||
if($sale['alone']){ |
|||
$scale = $sale['scale']; |
|||
}else{ |
|||
$scale = $setting['scale']; |
|||
} |
|||
$reportmoney = sprintf("%.2f",$report['money'] * $scale/100); |
|||
if($reportmoney > 0){ |
|||
pdo_fetch("update" . tablename('wlmerchant_distributor') . "SET dismoney=dismoney+{$reportmoney},nowmoney=nowmoney+{$reportmoney} WHERE mid = {$sale['mid']}"); |
|||
$onenowmoney = pdo_getcolumn(PDO_NAME.'distributor',array('mid'=> $sale['mid']),'nowmoney'); |
|||
Distribution::adddisdetail($report['id'],$sale['mid'],$report['storeid'],1,$reportmoney,'salesman',1,'业务员佣金结算',$onenowmoney,$report['id']); |
|||
} |
|||
} |
|||
pdo_update('wlmerchant_report',array('status'=>2),array('id' => $report['id'])); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[业务员]]></name> |
|||
<identifie><![CDATA[salesman]]></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="salesman" do="lists" iscover="true"/> |
|||
<entry title="佣金明细" ac="salesman" do="details" /> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="业务员设置" ac="salesman" do="setting" /> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="业务员" font="fa-inbox"> |
|||
<entry title="业务员管理" ac="salesman" do="lists" iscover="true"/> |
|||
<entry title="佣金明细" ac="salesman" do="details" /> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="业务员设置" ac="salesman" do="setting" /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 6.1 KiB |
@ -0,0 +1,315 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class SalesmanModuleUniapp extends Uniapp { |
|||
/** |
|||
* Comment: 我的商家列表 |
|||
* Author: hexin |
|||
* Date: 2019/8/14 23:51 |
|||
*/ |
|||
public function myStore() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$stores = pdo_fetchall("SELECT a.alone,a.alone_plugin,a.sales_plugin,a.scale,b.id,a.createtime,a.aid,b.storename,b.logo,b.realname,b.tel,b.endtime FROM " |
|||
. tablename(PDO_NAME . "merchantuser") |
|||
. " as a Left JOIN " |
|||
. tablename(PDO_NAME . "merchantdata") |
|||
. " as b ON a.storeid = b.id WHERE a.uniacid = {$_W['uniacid']} AND a.mid = {$_W['mid']} AND a.ismain = 4 AND a.enabled = 1 ORDER BY b.id DESC Limit " . ($pindex - 1) * 10 . ',' . 10); |
|||
foreach ($stores as &$store) { |
|||
$setting = pdo_get('wlmerchant_agentsetting',array('uniacid' => $_W['uniacid'],'aid'=>$store['aid'],'key' => 'salesman'),array('value')); |
|||
$setting = unserialize($setting['value']); |
|||
$store['logo'] = tomedia($store['logo']); |
|||
$store['endtime'] = date('Y-m-d', $store['endtime']); |
|||
if($store['alone'] == 1){ |
|||
$store['scale'] = $store['scale']; |
|||
}else{ |
|||
$store['scale'] = $setting['scale']; |
|||
} |
|||
//权限 |
|||
if($store['alone_plugin']){ |
|||
$sales_plugin = unserialize($store['sales_plugin']); |
|||
}else{ |
|||
$sales_plugin = unserialize($setting['plugin']); |
|||
} |
|||
//统计 |
|||
if(in_array('rush',$sales_plugin) || empty($sales_plugin)){ |
|||
$rush_order_money = pdo_fetchcolumn('SELECT SUM(actualprice) FROM '.tablename(PDO_NAME."rush_order")." WHERE sid = {$store['id']} AND settletime > {$store['createtime']} "); |
|||
$rush_order_num = pdo_fetchcolumn('SELECT count(id) FROM '.tablename(PDO_NAME."rush_order")." WHERE sid = {$store['id']} AND settletime > {$store['createtime']} "); |
|||
}else{ |
|||
$rush_order_money = 0; |
|||
$rush_order_num = 0; |
|||
} |
|||
if(!empty($sales_plugin)){ |
|||
$whereplugin = "("; |
|||
foreach ($sales_plugin as $key => $v) { |
|||
if($v == 'payonline'){ |
|||
$v = 'halfcard'; |
|||
} |
|||
if($v == 'fightgroup'){ |
|||
$v = 'wlfightgroup'; |
|||
} |
|||
if ($key == 0) { |
|||
$whereplugin .= "'".$v."'"; |
|||
} else { |
|||
$whereplugin .= ",'" . $v."'"; |
|||
} |
|||
} |
|||
$whereplugin .= ")"; |
|||
$order_money = pdo_fetchcolumn('SELECT SUM(price) FROM '.tablename(PDO_NAME."order")." WHERE sid = {$store['id']} AND settletime > {$store['createtime']} AND plugin IN {$whereplugin}"); |
|||
$order_num = pdo_fetchcolumn('SELECT count(id) FROM '.tablename(PDO_NAME."order")." WHERE sid = {$store['id']} AND settletime > {$store['createtime']} AND plugin IN {$whereplugin}"); |
|||
}else{ |
|||
$order_money = pdo_fetchcolumn('SELECT SUM(price) FROM '.tablename(PDO_NAME."order")." WHERE sid = {$store['id']} AND settletime > {$store['createtime']} AND plugin IN ('groupon','coupon','wlfightgroup','bargain') "); |
|||
$order_num = pdo_fetchcolumn('SELECT count(id) FROM '.tablename(PDO_NAME."order")." WHERE sid = {$store['id']} AND settletime > {$store['createtime']} AND plugin IN ('groupon','coupon','wlfightgroup','bargain')"); |
|||
} |
|||
$store['ordermoney'] = sprintf("%.2f",$rush_order_money + $order_money); |
|||
$store['ordernum'] = $rush_order_num + $order_num; |
|||
|
|||
if(empty($store['ordermoney'])){ |
|||
$store['ordermoney'] = 0; |
|||
} |
|||
if(empty($store['ordernum'])){ |
|||
$store['ordernum'] = 0; |
|||
} |
|||
} |
|||
$data['stores'] = $stores; |
|||
//计算分页 |
|||
$total = pdo_fetchcolumn("SELECT count(b.id) FROM " |
|||
. tablename(PDO_NAME . "merchantuser") |
|||
. " as a Left JOIN " |
|||
. tablename(PDO_NAME . "merchantdata") |
|||
. " as b ON a.storeid = b.id WHERE a.uniacid = {$_W['uniacid']} AND a.mid = {$_W['mid']} AND a.ismain = 4 AND a.enabled = 1"); |
|||
$data['pagetotal'] = ceil($total/10); |
|||
if($_GPC['initflag']){ |
|||
$data['settle'] = $setting['settle']; |
|||
//累计交易额 |
|||
$allmoney = 0; |
|||
$sealstore = pdo_getall('wlmerchant_merchantuser',array('mid' => $_W['mid'],'ismain' => 4, 'enabled' => 1),array('alone_plugin','sales_plugin','storeid','alone','scale','createtime')); |
|||
//今日/本周/本月预估收益 与 昨日/上周/上月收益 |
|||
$estimatemoney = 0; |
|||
$start = strtotime(date('Y-m-d')); |
|||
$last = $start - 86400; |
|||
// else if($data['settle'] == 1){ |
|||
// $start = strtotime(date('Y-m-d', strtotime("this week Monday", time()))); |
|||
// $last = $start - 86400 * 7; |
|||
// }else if($data['settle'] == 2){ |
|||
// $start = mktime(0, 0, 0, date('m'), 1, date('Y')); |
|||
// $last = mktime(0, 0, 0, date('m') - 1, 1, date('Y')); |
|||
// } |
|||
foreach ($sealstore as $seal){ |
|||
$setting = pdo_get('wlmerchant_agentsetting',array('uniacid' => $_W['uniacid'],'aid'=>$store['aid'],'key' => 'salesman'),array('value')); |
|||
$setting = unserialize($setting['value']); |
|||
if($store['alone_plugin']){ |
|||
$sales_plugin = unserialize($store['sales_plugin']); |
|||
}else{ |
|||
$sales_plugin = unserialize($setting['plugin']); |
|||
} |
|||
if(in_array('rush',$sales_plugin) || empty($sales_plugin)) { |
|||
$rush_order_money = pdo_fetchcolumn('SELECT SUM(actualprice) FROM '.tablename(PDO_NAME."rush_order")." WHERE sid = {$seal['storeid']} AND settletime > {$seal['createtime']} "); |
|||
$rushordermoney = pdo_fetchcolumn('SELECT SUM(actualprice) FROM '.tablename(PDO_NAME."rush_order")." WHERE sid = {$seal['storeid']} AND settletime > {$start}"); |
|||
}else{ |
|||
$rush_order_money = 0; |
|||
$rushordermoney = 0; |
|||
} |
|||
if(!empty($sales_plugin)){ |
|||
$whereplugin = "("; |
|||
foreach ($sales_plugin as $key => $v) { |
|||
if($v == 'payonline'){ |
|||
$v = 'halfcard'; |
|||
} |
|||
if($v == 'fightgroup'){ |
|||
$v = 'wlfightgroup'; |
|||
} |
|||
if ($key == 0) { |
|||
$whereplugin .= "'".$v."'"; |
|||
} else { |
|||
$whereplugin .= ",'" . $v."'"; |
|||
} |
|||
} |
|||
$whereplugin .= ")"; |
|||
$order_money = pdo_fetchcolumn('SELECT SUM(price) FROM '.tablename(PDO_NAME."order")." WHERE sid = {$seal['storeid']} AND settletime > {$seal['createtime']} AND plugin IN {$whereplugin} "); |
|||
$ordermoney = pdo_fetchcolumn('SELECT SUM(price) FROM '.tablename(PDO_NAME."order")." WHERE sid = {$seal['storeid']} AND settletime > {$start} AND plugin IN {$whereplugin}"); |
|||
}else{ |
|||
$order_money = pdo_fetchcolumn('SELECT SUM(price) FROM '.tablename(PDO_NAME."order")." WHERE sid = {$seal['storeid']} AND settletime > {$seal['createtime']} AND plugin IN ('groupon','coupon','wlfightgroup','bargain') "); |
|||
$ordermoney = pdo_fetchcolumn('SELECT SUM(price) FROM '.tablename(PDO_NAME."order")." WHERE sid = {$seal['storeid']} AND settletime > {$start} AND plugin IN ('groupon','coupon','wlfightgroup','bargain') "); |
|||
} |
|||
$allmoney += $rush_order_money + $order_money ; |
|||
$scale = $seal['alone']?$seal['scale']:$setting['scale']; |
|||
$nowmoney = sprintf("%.2f",($rushordermoney+$ordermoney)*$scale/100); |
|||
$estimatemoney += $nowmoney; |
|||
} |
|||
$data['allmoney'] = sprintf("%.2f",$allmoney); |
|||
$lastmoney = pdo_fetchcolumn('SELECT SUM(price) FROM '.tablename(PDO_NAME."disdetail")." WHERE leadid = {$_W['mid']} AND status = 1 AND createtime < {$start} AND createtime > {$last} "); |
|||
$data['estimatemoney'] = sprintf("%.2f",$estimatemoney); |
|||
$data['lastmoney'] = sprintf("%.2f",$lastmoney); |
|||
//累计收益 |
|||
$profit = pdo_fetchcolumn('SELECT SUM(price) FROM '.tablename(PDO_NAME."disdetail")." WHERE leadid = {$_W['mid']} AND status = 1"); |
|||
$data['profitmoney'] = sprintf("%.2f",$profit); |
|||
} |
|||
$data['settle'] = 0; |
|||
$this->renderSuccess('我的商家列表', $data); |
|||
} |
|||
/** |
|||
* Comment: 商家详情 |
|||
* Author: hexin |
|||
* Date: 2019/8/15 00:22 |
|||
*/ |
|||
public function storeDetail() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
$store = pdo_fetch("SELECT a.alone,a.scale,a.alone_plugin,a.sales_plugin,a.aid,b.id,b.storename,a.createtime,b.logo,b.endtime FROM " |
|||
. tablename(PDO_NAME . "merchantuser") |
|||
. " as a Left JOIN " |
|||
. tablename(PDO_NAME . "merchantdata") |
|||
. " as b ON a.storeid = b.id WHERE a.uniacid = {$_W['uniacid']} AND a.mid = {$_W['mid']} AND b.id = {$id} AND ismain = 4"); |
|||
|
|||
$setting = pdo_get('wlmerchant_agentsetting',array('uniacid' => $_W['uniacid'],'aid'=>$store['aid'],'key' => 'salesman'),array('value')); |
|||
$setting = unserialize($setting['value']); |
|||
//权限 |
|||
if($store['alone_plugin']){ |
|||
$sales_plugin = unserialize($store['sales_plugin']); |
|||
}else{ |
|||
$sales_plugin = unserialize($setting['plugin']); |
|||
} |
|||
|
|||
$store['logo'] = tomedia($store['logo']); |
|||
$store['endtime'] = date('Y-m-d', $store['endtime']); |
|||
$store['scale'] = $store['alone'] == 1 ? $store['scale'] : $_W['wlsetting']['salesman']['scale']; |
|||
if($store['alone'] != 1){ |
|||
$setting = pdo_get('wlmerchant_agentsetting',array('uniacid' => $_W['uniacid'],'aid'=>$store['aid'],'key' => 'salesman'),array('value')); |
|||
$setting = unserialize($setting['value']); |
|||
$store['scale'] = $setting['scale']; |
|||
} |
|||
|
|||
if(in_array('rush',$sales_plugin) || empty($sales_plugin)) { |
|||
$rush_order_money = pdo_fetchcolumn('SELECT SUM(actualprice) FROM '.tablename(PDO_NAME."rush_order")." WHERE sid = {$id} AND settletime > {$store['createtime']} "); |
|||
$rush_order_num = pdo_fetchcolumn('SELECT count(id) FROM '.tablename(PDO_NAME."rush_order")." WHERE sid = {$id} AND settletime > {$store['createtime']} "); |
|||
}else{ |
|||
$rush_order_money = 0; |
|||
$rush_order_num = 0; |
|||
} |
|||
|
|||
if(!empty($sales_plugin)){ |
|||
$whereplugin = "("; |
|||
foreach ($sales_plugin as $key => $v) { |
|||
if($v == 'payonline'){ |
|||
$v = 'halfcard'; |
|||
} |
|||
if($v == 'fightgroup'){ |
|||
$v = 'wlfightgroup'; |
|||
} |
|||
if ($key == 0) { |
|||
$whereplugin .= "'".$v."'"; |
|||
} else { |
|||
$whereplugin .= ",'" . $v."'"; |
|||
} |
|||
} |
|||
$whereplugin .= ")"; |
|||
$order_money = pdo_fetchcolumn('SELECT SUM(price) FROM '.tablename(PDO_NAME."order")." WHERE sid = {$id} AND settletime > {$store['createtime']} AND plugin IN {$whereplugin} "); |
|||
$order_num = pdo_fetchcolumn('SELECT count(id) FROM '.tablename(PDO_NAME."order")." WHERE sid = {$id} AND settletime > {$store['createtime']} AND plugin IN {$whereplugin}"); |
|||
|
|||
}else{ |
|||
$order_money = pdo_fetchcolumn('SELECT SUM(price) FROM '.tablename(PDO_NAME."order")." WHERE sid = {$id} settletime > {$store['createtime']} AND plugin IN ('groupon','coupon','wlfightgroup','bargain') "); |
|||
$order_num = pdo_fetchcolumn('SELECT count(id) FROM '.tablename(PDO_NAME."order")." WHERE sid = {$id} settletime > {$store['createtime']} AND plugin IN ('groupon','coupon','wlfightgroup','bargain')"); |
|||
} |
|||
$store['turnover'] = sprintf("%.2f",$rush_order_money + $order_money); |
|||
$store['ordernum'] = $rush_order_num + $order_num; |
|||
if(empty($store['turnover'])){ |
|||
$store['turnover'] = 0; |
|||
} |
|||
if(empty($store['ordernum'])){ |
|||
$store['ordernum'] = 0; |
|||
} |
|||
$this->renderSuccess('商家详情', $store); |
|||
} |
|||
/** |
|||
* Comment: 商家每日报表 |
|||
* Author: hexin |
|||
* Date: 2019/8/15 00:22 |
|||
*/ |
|||
public function storeReport() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$report = pdo_fetchall("SELECT status,money,num,createtime FROM ".tablename('wlmerchant_report')."WHERE storeid = {$id} ORDER BY id DESC LIMIT " .($pindex - 1) * 20 .','. 20 ); |
|||
//计算分页 |
|||
$total = pdo_fetchcolumn("SELECT count(id) FROM ".tablename('wlmerchant_report')."WHERE storeid = {$id}"); |
|||
$data['pagetotal'] = ceil($total/20); |
|||
$data['reportlist'] = $report; |
|||
$this->renderSuccess('商家每日报表', $data); |
|||
} |
|||
/** |
|||
* Comment: 商家结算记录 |
|||
* Author: hexin |
|||
* Date: 2019/8/15 00:22 |
|||
*/ |
|||
public function storeSettle() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$disdetail = pdo_fetchall("SELECT price,createtime,plugin FROM ".tablename('wlmerchant_disdetail')."WHERE leadid = {$_W['mid']} AND status = 1 AND buymid = {$id} ORDER BY id DESC LIMIT " .($pindex - 1) * 20 .','. 20 ); |
|||
foreach ($disdetail as &$dis){ |
|||
switch ($dis['plugin']) { |
|||
case 'rush': |
|||
$dis['pluginname'] = '抢购订单'; |
|||
break; |
|||
case 'groupon': |
|||
$dis['pluginname'] = '团购订单'; |
|||
break; |
|||
case 'fightgroup': |
|||
$dis['pluginname'] = '拼团订单'; |
|||
break; |
|||
case 'coupon': |
|||
$dis['pluginname'] = '卡券订单'; |
|||
break; |
|||
case 'bargain': |
|||
$dis['pluginname'] = '砍价活动'; |
|||
break; |
|||
case 'payonline': |
|||
$dis['pluginname'] = '在线买单'; |
|||
break; |
|||
case 'citydelivery': |
|||
$dis['pluginname'] = '同城配送'; |
|||
break; |
|||
default: |
|||
$dis['pluginname'] = '未知插件'; |
|||
break; |
|||
} |
|||
$dis['createtime'] = date('Y-m-d H:i:s',$dis['createtime']); |
|||
} |
|||
$data['dislist'] = $disdetail; |
|||
//计算分页 |
|||
$total = pdo_fetchcolumn("SELECT count(id) FROM ".tablename('wlmerchant_disdetail')."WHERE leadid = {$_W['mid']} AND status = 1 AND buymid = {$id}"); |
|||
$data['pagetotal'] = ceil($total/20); |
|||
|
|||
$this->renderSuccess('商家结算记录', $data); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 获取业务员商户入驻二维码 |
|||
* Author: wlf |
|||
* Date: 2020/04/21 15:56 |
|||
*/ |
|||
public function getSaleQr(){ |
|||
global $_W, $_GPC; |
|||
$source = $_W['source']; |
|||
//使用默认二维码 |
|||
$path = 'pages/mainPages/Settled/Settled?sale_id=' . $_W['mid'].'&head_id='.$_W['mid'];//基本路径,也是小程序路径 |
|||
if ($source != 3){ |
|||
$path = h5_url($path); |
|||
} //非小程序渠道 基本路径转超链接 |
|||
#3、二维码生成 |
|||
$filename = md5('sale_id'.$_W['mid'].'source' .$source.'path'.$path); |
|||
if ($source == 3) { |
|||
//小程序 |
|||
$qrCodeLink = WeApp::getQrCode($path , 'qrcode_' . $filename . '.png'); |
|||
if (is_array($qrCodeLink)) $qrCodeLink = Poster::qrcodeimg($path , $filename); |
|||
} |
|||
else { |
|||
//公众号/H5 |
|||
$qrCodeLink = Poster::qrcodeimg($path , $filename); |
|||
} |
|||
$qrCodeLink = tomedia($qrCodeLink); |
|||
$this->renderSuccess('推广二维码',array('imgurl'=>$qrCodeLink)); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,366 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Salesman_WeliamController { |
|||
|
|||
public function lists() { |
|||
global $_W, $_GPC; |
|||
$settings = Setting::agentsetting_read('salesman'); |
|||
$where = array('uniacid' => $_W['uniacid'], 'ismain' => 4,'aid'=>$_W['aid']); |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 15; |
|||
if ($_GPC['name']) { |
|||
$where['name LIKE'] = '%' . $_GPC['name'] . '%'; |
|||
} |
|||
|
|||
$lists = pdo_getslice('wlmerchant_merchantuser', $where, array($pindex, $psize), $total, array(), '', "id DESC"); |
|||
foreach ($lists as &$list) { |
|||
$list['member'] = pdo_get('wlmerchant_member', array('id' => $list['mid']), array('nickname', 'avatar')); |
|||
$list['store'] = pdo_get('wlmerchant_merchantdata', array('id' => $list['storeid']), array('storename', 'logo')); |
|||
} |
|||
$pager = wl_pagination($total, $pindex, $psize); |
|||
|
|||
include wl_template('salesman/lists'); |
|||
} |
|||
|
|||
public function edit() { |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
|
|||
if (checksubmit('submit')) { |
|||
$data = array( |
|||
'mid' => intval($_GPC['mid']), |
|||
'storeid' => intval($_GPC['storeid']), |
|||
'name' => trim($_GPC['name']), |
|||
'mobile' => trim($_GPC['mobile']), |
|||
'alone' => intval($_GPC['alone']), |
|||
'scale' => sprintf("%.2f", trim($_GPC['scale'])), |
|||
'manage_store' => intval($_GPC['manage_store']), |
|||
'hasmanage' => intval($_GPC['hasmanage']), |
|||
'enabled' => intval($_GPC['enabled']), |
|||
'alone_plugin' => intval($_GPC['alone_plugin']), |
|||
'sales_plugin' => serialize($_GPC['plugin']) |
|||
); |
|||
|
|||
if (!empty($id)) { |
|||
pdo_update('wlmerchant_merchantuser', $data, array('id' => $id)); |
|||
} else { |
|||
$has = pdo_getcolumn('wlmerchant_merchantuser', array('mid' => $data['mid'], 'storeid' => $data['storeid'],'ismain'=>4), 'id'); |
|||
if (!empty($has)) { |
|||
wl_message('当前商家已存在此业务员,请勿重复添加', referer(), 'error'); |
|||
} |
|||
$aid = pdo_getcolumn(PDO_NAME.'merchantdata',array('id'=>$data['storeid']),'aid'); |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $aid; |
|||
$data['ismain'] = 4; |
|||
$data['createtime'] = time(); |
|||
pdo_insert('wlmerchant_merchantuser', $data); |
|||
$id = pdo_insertid(); |
|||
} |
|||
wl_message('编辑业务员成功', web_url('salesman/salesman/lists'), 'success'); |
|||
} |
|||
|
|||
if (!empty($id)) { |
|||
$item = pdo_get('wlmerchant_merchantuser', array('uniacid' => $_W['uniacid'], 'id' => $id)); |
|||
if (!empty($item['mid'])) { |
|||
$member = pdo_get(PDO_NAME.'member' , ['id' => $item['mid']] , ['nickname','avatar']); |
|||
$item['nickname'] = $member['nickname']; |
|||
$item['avatar'] = tomedia($member['avatar']); |
|||
} |
|||
if (!empty($item['storeid'])) { |
|||
$store = pdo_get(PDO_NAME.'merchantdata', ['id' => $item['storeid']] , ['storename','logo']); |
|||
$item['storename'] = $store['storename']; |
|||
$item['logo'] = tomedia($store['logo']); |
|||
} |
|||
$plugin = unserialize($item['sales_plugin']); |
|||
} |
|||
|
|||
|
|||
include wl_template('salesman/edit'); |
|||
} |
|||
|
|||
public function details() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$where['status'] = 1; |
|||
$where['aid'] = $_W['aid']; |
|||
if (!empty($_GPC['keyword'])) { |
|||
if (!empty($_GPC['keywordtype'])) { |
|||
switch ($_GPC['keywordtype']) { |
|||
case 1: |
|||
$where['leadid'] = $_GPC['keyword']; |
|||
break; |
|||
case 5: |
|||
$where['buymid'] = $_GPC['keyword']; |
|||
break; |
|||
case 3: |
|||
$where['price>'] = $_GPC['keyword']; |
|||
break; |
|||
case 4: |
|||
$where['price<'] = $_GPC['keyword']; |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
if ($_GPC['keywordtype'] == 2) { |
|||
$keyword = $_GPC['keyword']; |
|||
$params[':nickname'] = "%{$keyword}%"; |
|||
$goods = pdo_fetchall("SELECT id,nickname FROM " . tablename('wlmerchant_member') . "WHERE uniacid = {$_W['uniacid']} AND nickname LIKE :nickname", $params); |
|||
if ($goods) { |
|||
$goodids = "("; |
|||
foreach ($goods as $key => $v) { |
|||
if ($key == 0) { |
|||
$goodids .= $v['id']; |
|||
} else { |
|||
$goodids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$goodids .= ")"; |
|||
$where['leadid#'] = $goodids; |
|||
} else { |
|||
$where['leadid#'] = "(0)"; |
|||
} |
|||
} |
|||
if ($_GPC['keywordtype'] == 6) { |
|||
$keyword = $_GPC['keyword']; |
|||
$params[':nickname'] = "%{$keyword}%"; |
|||
$goods = pdo_fetchall("SELECT id,nickname FROM " . tablename('wlmerchant_member') . "WHERE uniacid = {$_W['uniacid']} AND nickname LIKE :nickname", $params); |
|||
if ($goods) { |
|||
$goodids = "("; |
|||
foreach ($goods as $key => $v) { |
|||
if ($key == 0) { |
|||
$goodids .= $v['id']; |
|||
} else { |
|||
$goodids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$goodids .= ")"; |
|||
$where['buymid#'] = $goodids; |
|||
} else { |
|||
$where['buymid#'] = "(0)"; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
if ($_GPC['orderstatus']) { |
|||
$where['type'] = $_GPC['orderstatus']; |
|||
} |
|||
if ($_GPC['ordertype']) { |
|||
$where['plugin'] = $_GPC['ordertype']; |
|||
} |
|||
|
|||
if ($_GPC['time_limit']) { |
|||
$time_limit = $_GPC['time_limit']; |
|||
$starttime = strtotime($_GPC['time_limit']['start']); |
|||
$endtime = strtotime($_GPC['time_limit']['end']); |
|||
$where['createtime>'] = $starttime; |
|||
$where['createtime<'] = $endtime; |
|||
} |
|||
|
|||
if (empty($starttime) || empty($endtime)) { |
|||
$starttime = strtotime('-1 month'); |
|||
$endtime = time() + 86400; |
|||
} |
|||
if ($_GPC['exportflag']) { |
|||
$this->exportdetail($where); |
|||
} |
|||
$details = Util::getNumData('*', PDO_NAME . 'disdetail', $where, 'ID DESC', $pindex, $psize, 1); |
|||
$pager = $details[1]; |
|||
$details = $details[0]; |
|||
foreach ($details as $key => &$detail) { |
|||
$detail['leadname'] = pdo_getcolumn(PDO_NAME . 'member', array('id' => $detail['leadid']), 'nickname'); |
|||
if ($detail['buymid'] < 0) { |
|||
$detail['buyname'] = '系统'; |
|||
} else if($detail['status'] == 1){ |
|||
$detail['buyname'] = pdo_getcolumn(PDO_NAME . 'merchantdata', array('id' => $detail['buymid']), 'storename'); |
|||
}else{ |
|||
$detail['buyname'] = pdo_getcolumn(PDO_NAME . 'member', array('id' => $detail['buymid']), 'nickname'); |
|||
} |
|||
$detail['typetext'] = $detail['type'] == 1 ? '收入' : "支出"; |
|||
switch ($detail['plugin']) { |
|||
case 'rush': |
|||
$detail['pluginname'] = '抢购订单'; |
|||
$detail['pluginno'] = 1; |
|||
break; |
|||
case 'groupon': |
|||
$detail['pluginname'] = '团购订单'; |
|||
$detail['pluginno'] = 10; |
|||
break; |
|||
case 'fightgroup': |
|||
$detail['pluginname'] = '拼团订单'; |
|||
$detail['pluginno'] = 2; |
|||
break; |
|||
case 'coupon': |
|||
$detail['pluginname'] = '卡券订单'; |
|||
$detail['pluginno'] = 3; |
|||
break; |
|||
case 'bargain': |
|||
$detail['pluginname'] = '砍价活动'; |
|||
$detail['pluginno'] = 12; |
|||
break; |
|||
case 'payonline': |
|||
$detail['pluginname'] = '在线买单'; |
|||
$detail['orderurl'] = web_url("order/orderPayOnline/payonlinelist", array('orderid' => $detail['disorderid'])); |
|||
break; |
|||
case 'citydelivery': |
|||
$detail['pluginname'] = '同城配送'; |
|||
$detail['pluginno'] = 14; |
|||
break; |
|||
default: |
|||
$detail['pluginname'] = '未知插件'; |
|||
break; |
|||
} |
|||
if(empty($detail['orderurl'])){ |
|||
$detail['orderurl'] = web_url("order/wlOrder/orderdetail", array('orderid' => $detail['disorderid'], 'type' => $detail['pluginno'])); |
|||
} |
|||
$detail['pluginname'] = $detail['pluginname'] . '业务员佣金'; |
|||
$detail['createtime'] = date('Y-m-d H:i:s', $detail['createtime']); |
|||
} |
|||
|
|||
include wl_template('salesman/disdetail'); |
|||
} |
|||
|
|||
function exportdetail($where) { |
|||
global $_W, $_GPC; |
|||
|
|||
$details = Util::getNumData('*', PDO_NAME . 'disdetail', $where, 'ID DESC', 0, 0, 1); |
|||
$details = $details[0]; |
|||
foreach ($details as $key => &$detail) { |
|||
$detail['leadname'] = pdo_getcolumn(PDO_NAME . 'merchantuser', array('mid' => $detail['leadid'],'storeid'=>$detail['buymid']), 'name'); |
|||
if ($detail['buymid'] < 0) { |
|||
$detail['buyname'] = '系统'; |
|||
} else if($detail['status'] == 1){ |
|||
$detail['buyname'] = pdo_getcolumn(PDO_NAME . 'merchantdata', array('id' => $detail['buymid']), 'storename'); |
|||
}else{ |
|||
$detail['buyname'] = pdo_getcolumn(PDO_NAME . 'member', array('id' => $detail['buymid']), 'nickname'); |
|||
} |
|||
$detail['typetext'] = $detail['type'] == 1 ? '收入' : "支出"; |
|||
switch ($detail['plugin']) { |
|||
case 'rush': |
|||
$detail['pluginname'] = '抢购订单'; |
|||
$detail['pluginno'] = 1; |
|||
break; |
|||
case 'groupon': |
|||
$detail['pluginname'] = '团购订单'; |
|||
$detail['pluginno'] = 10; |
|||
break; |
|||
case 'fightgroup': |
|||
$detail['pluginname'] = '拼团订单'; |
|||
$detail['pluginno'] = 2; |
|||
break; |
|||
case 'coupon': |
|||
$detail['pluginname'] = '卡券订单'; |
|||
$detail['pluginno'] = 3; |
|||
break; |
|||
case 'bargain': |
|||
$detail['pluginname'] = '砍价活动:'; |
|||
$detail['pluginno'] = 12; |
|||
break; |
|||
default: |
|||
$detail['pluginname'] = '未知插件'; |
|||
break; |
|||
} |
|||
$detail['pluginname'] = $detail['pluginname'] . '业务员佣金'; |
|||
$detail['createtime'] = date('Y-m-d H:i:s', $detail['createtime']); |
|||
//查询订单编号 |
|||
if ($detail['plugin'] == 'rush') { |
|||
$detail['orderno'] = pdo_getcolumn(PDO_NAME . 'rush_order', array('id' => $detail['disorderid']), 'orderno'); |
|||
} else if ($detail['plugin'] != 'cash' && $detail['plugin'] != 'system') { |
|||
$detail['orderno'] = pdo_getcolumn(PDO_NAME . 'order', array('id' => $detail['disorderid']), 'orderno'); |
|||
} |
|||
$detail['orderno'] = $detail['orderno'] . "\t"; |
|||
} |
|||
/* 输出表头 */ |
|||
$filter = array( |
|||
'id' => '记录id', |
|||
'leadid' => '业务员MID', |
|||
'leadname' => '业务员姓名', |
|||
'orderno' => '订单编号', |
|||
'typetext' => '收支', |
|||
'price' => '金额', |
|||
'buyname' => '来源', |
|||
'pluginname' => '描述', |
|||
'createtime' => '时间', |
|||
); |
|||
$data = array(); |
|||
foreach ($details as $k => $v) { |
|||
foreach ($filter as $key => $title) { |
|||
$data[$k][$key] = $v[$key]; |
|||
} |
|||
} |
|||
util_csv::export_csv_2($data, $filter, '业务员明细.csv'); |
|||
exit; |
|||
} |
|||
|
|||
|
|||
public function del() { |
|||
global $_W, $_GPC; |
|||
if ($_GPC['id']) { |
|||
pdo_delete('wlmerchant_merchantuser', array('uniacid' => $_W['uniacid'], 'id' => $_GPC['id'])); |
|||
show_json(1); |
|||
} else { |
|||
show_json(0, '删除失败'); |
|||
} |
|||
} |
|||
|
|||
public function getmember() { |
|||
global $_W, $_GPC; |
|||
$where = array('uniacid' => $_W['uniacid'], 'disflag' => 1); |
|||
if (!empty($_GPC['search'])) { |
|||
$where['nickname LIKE'] = "%" . trim($_GPC['search']) . "%"; |
|||
} |
|||
|
|||
$members = pdo_getall('wlmerchant_distributor', $where, array('mid', 'nickname'), '', '', 10); |
|||
$data = []; |
|||
foreach ($members as &$member) { |
|||
$data[] = ['id' => $member['mid'], 'text' => $member['nickname']]; |
|||
} |
|||
|
|||
die(json_encode($data)); |
|||
} |
|||
|
|||
public function getstore() { |
|||
global $_W, $_GPC; |
|||
$where = array('uniacid' => $_W['uniacid'],'aid' => $_W['aid'],'enabled' => 1); |
|||
if (!empty($_GPC['search'])) { |
|||
$where['storename LIKE'] = "%" . trim($_GPC['search']) . "%"; |
|||
} |
|||
|
|||
$members = pdo_getall('wlmerchant_merchantdata', $where, array('id', 'storename'), '', '', 100); |
|||
$data = []; |
|||
foreach ($members as &$member) { |
|||
$data[] = ['id' => $member['id'], 'text' => $member['storename']]; |
|||
} |
|||
|
|||
die(json_encode($data)); |
|||
} |
|||
|
|||
public function setting() { |
|||
global $_W, $_GPC; |
|||
$settings = Setting::agentsetting_read('salesman'); |
|||
$plugin = unserialize($settings['plugin']); |
|||
if (checksubmit('submit')) { |
|||
$base = array( |
|||
'scale' => sprintf("%.2f", trim($_GPC['scale'])), |
|||
'hasmanage' => intval($_GPC['hasmanage']), |
|||
'ismanager' => intval($_GPC['ismanager']), |
|||
'isopen' => intval($_GPC['isopen']), |
|||
'plugin' => serialize($_GPC['plugin']), |
|||
); |
|||
Setting::agentsetting_save($base, 'salesman'); |
|||
wl_message('更新设置成功!', web_url('salesman/salesman/setting')); |
|||
} |
|||
include wl_template('salesman/setting'); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
@ -0,0 +1,118 @@ |
|||
{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="salesman" /> |
|||
<input type="hidden" name="ac" value="salesman" /> |
|||
<input type="hidden" name="do" value="details" /> |
|||
<input type="hidden" name="ordertype" value="{$_GPC['ordertype']}" /> |
|||
<div class="form-group max-with-all"> |
|||
<label class="col-sm-2 control-label">订单类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('ordertype:');}" class="btn {if $_GPC['ordertype'] == ''}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('ordertype:rush');}" class="btn {if $_GPC['ordertype'] == 'rush'}btn-primary{else}btn-default{/if}">抢购订单</a> |
|||
<a href="{php echo wl_filter_url('ordertype:groupon');}" class="btn {if $_GPC['ordertype'] == 'groupon'}btn-primary{else}btn-default{/if}">团购订单</a> |
|||
<a href="{php echo wl_filter_url('ordertype:fightgroup');}" class="btn {if $_GPC['ordertype'] == 'fightgroup'}btn-primary{else}btn-default{/if}">拼团订单</a> |
|||
<a href="{php echo wl_filter_url('ordertype:coupon');}" class="btn {if $_GPC['ordertype'] == 'coupon'}btn-primary{else}btn-default{/if}">超级券订单</a> |
|||
<a href="{php echo wl_filter_url('ordertype:bargain');}" class="btn {if $_GPC['ordertype'] == 'bargain'}btn-primary{else}btn-default{/if}">砍价订单</a> |
|||
<a href="{php echo wl_filter_url('ordertype:payonline');}" class="btn {if $_GPC['ordertype'] == 'payonline'}btn-primary{else}btn-default{/if}">在线买单</a> |
|||
<a href="{php echo wl_filter_url('ordertype:citydelivery');}" class="btn {if $_GPC['ordertype'] == 'citydelivery'}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="">关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>业务员MID</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>业务员昵称</option> |
|||
<option value="5" {if $_GPC['keywordtype']==5}selected="selected"{/if}>店家SID</option> |
|||
<option value="6" {if $_GPC['keywordtype']==6}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> |
|||
</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> |
|||
<button class="btn btn-default" name="exportflag" type="submit" value="export"><i class="fa fa-download"></i> 导出</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
</script> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead class="navbar-inner"> |
|||
<tr> |
|||
<th style="width:5%;">MID</th> |
|||
<th style="width:15%;">业务员姓名</th> |
|||
<th style="width:10%;">收支</th> |
|||
<th style="width:10%;">金额</th> |
|||
<th style="width:10%;">来源</th> |
|||
<th style="width:15%;">描述</th> |
|||
<th style="width:25%;">时间</th> |
|||
<th style="width:10%;">订单</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $details $de} |
|||
<tr> |
|||
<td>{$de['leadid']}</td> |
|||
<td>{$de['leadname']}</td> |
|||
<td><span {if $de['type'] == 1} class="label label-success" {else} class="label label-danger" {/if} >{$de['typetext']}</span></td> |
|||
<td style="color: red;">{$de['price']}</td> |
|||
<td>{$de['buyname']}</td> |
|||
<td> |
|||
{$de['pluginname']} |
|||
{if $de['checkcode']} |
|||
<br/>核销码:{$de['checkcode']} |
|||
{/if} |
|||
</td> |
|||
<td>{$de['createtime']}</td> |
|||
<td>{if $de['orderurl']}<a class="btn btn-primary btn-sm" target="_blank" href="{$de['orderurl']}">查看</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> |
|||
<style> |
|||
.change:hover{ |
|||
cursor:pointer; |
|||
} |
|||
</style> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,234 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="{php echo web_url('setting/noticeset/smsadd')}">编辑业务员</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="alert alert-warning"> |
|||
<p>业务员务必已经开通分销,未开通分销无法添加为业务员</p> |
|||
</div> |
|||
<div class="panel-body"> |
|||
<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="{$item['nickname']}" readonly="" class="form-control user_nickname"> |
|||
<input type="hidden" name="mid" value="{$item['mid']}" class="user_mid"> |
|||
<span class="btn input-group-addon" data-toggle="selectUser" data-params='{"is_salesman":1}'>选择用户</span> |
|||
</div> |
|||
<div class="input-group" style="margin-top:.5em;"> |
|||
<img src="{$item['avatar']}" onerror="this.src='./resource/images/nopic.jpg';" class="img-responsive img-thumbnail" width="132"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关联商家</label> |
|||
<div class="col-sm-9"> |
|||
<div class='input-group'> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control col-sm-9" id="namemerchant" name="" value="{$item['storename']}" disabled style="width: 460px;"> |
|||
<span class="input-group-btn"><button class="btn btn-default" type="button" onclick="popwin = $('#modal-module-merchant').modal();">选择商家</button></span> |
|||
</div> |
|||
<div class="input-group " style="margin-top:.5em;"> |
|||
<input type="hidden" value="{$item['storeid']}" name="storeid" id="sidmerchant"> |
|||
<img src="{if empty($item['logo'])}../web/resource/images/nopic.jpg{else}{php echo tomedia($item['logo'])}{/if}" class="img-responsive img-thumbnail" width="150" id="imgmerchant" /> |
|||
<em class="close" style="position:absolute; top: 0px; right: -14px;" title="删除" onclick="remove_merchant(this)">×</em> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<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="请输入业务员姓名" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label must">业务员电话</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="mobile" class="form-control" value="{$item['mobile']}" placeholder="请输入业务员电话" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label must">适用插件</label> |
|||
<div class="col-sm-9"> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" {if $item['alone_plugin'] == 1} checked="checked" {/if} name="alone_plugin" value="1" id="plugin-checkbox">启用独立设置适用插件 |
|||
</label> |
|||
<div class="help-block">默认适用插件按系统设置,可单独设置业务员的适用插件</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group plugin-input" {if $item['alone_plugin'] != 1}style="display: none"{/if}> |
|||
<label class="col-sm-2 control-label must"></label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<label class="checkbox-inline" style="padding-left: 30px;margin-left: 0;"> |
|||
<input type="checkbox" name="plugin[]" value="rush" {if in_array('rush',$plugin)}checked="true"{/if}>抢购 |
|||
</label> |
|||
<label class="checkbox-inline" style="padding-left: 30px;margin-left: 0;"> |
|||
<input type="checkbox" name="plugin[]" value="groupon" {if in_array('groupon',$plugin)}checked="true"{/if}>团购 |
|||
</label> |
|||
<label class="checkbox-inline" style="padding-left: 30px;margin-left: 0;"> |
|||
<input type="checkbox" name="plugin[]" value="fightgroup" {if in_array('fightgroup',$plugin)}checked="true"{/if}>拼团 |
|||
</label> |
|||
<label class="checkbox-inline" style="padding-left: 30px;margin-left: 0;"> |
|||
<input type="checkbox" name="plugin[]" value="coupon" {if in_array('coupon',$plugin)}checked="true"{/if}>卡券 |
|||
</label> |
|||
<label class="checkbox-inline" style="padding-left: 30px;margin-left: 0;"> |
|||
<input type="checkbox" name="plugin[]" value="bargain" {if in_array('bargain',$plugin)}checked="true"{/if}>砍价 |
|||
</label> |
|||
<label class="checkbox-inline" style="padding-left: 30px;margin-left: 0;"> |
|||
<input type="checkbox" name="plugin[]" value="payonline" {if in_array('payonline',$plugin)}checked="true"{/if}>买单 |
|||
</label> |
|||
{if uniacid_p('citydelivery')} |
|||
<label class="checkbox-inline" style="padding-left: 30px;margin-left: 0;"> |
|||
<input type="checkbox" name="plugin[]" value="citydelivery" {if in_array('citydelivery',$plugin)}checked="true"{/if}>同城配送 |
|||
</label> |
|||
{/if} |
|||
</div> |
|||
<div class="help-block">一项都不勾选则视为全部勾选</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label must">佣金比例</label> |
|||
<div class="col-sm-9"> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" {if $item['alone'] == 1} checked="checked" {/if} name="alone" value="1" id="alone-checkbox">启用独立佣金 |
|||
</label> |
|||
<div class="help-block">默认佣金比例按系统设置默认比例,可单独设置业务员佣金比例</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group scale-input" {if $item['alone'] != 1}style="display: none"{/if}> |
|||
<label class="col-sm-2 control-label must"></label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="scale" required placeholder="请输入业务员提成比例" autocomplete="off" class="form-control" value="{$item['scale']}"> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label must">管理店铺</label> |
|||
<div class="col-sm-9"> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" {if $item['manage_store'] == 1} checked="checked" {/if} name="manage_store" value="1" id="manage-store-checkbox">启用独立设置 |
|||
</label> |
|||
<div class="help-block">默认跟随系统设置,可启用独立设置业务员权限</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group hasmanage-input" {if $item['manage_store'] != 1}style="display: none"{/if}> |
|||
<label class="col-sm-2 control-label must"></label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="hasmanage" value="0" {if empty($item['hasmanage'])}checked{/if}>禁用管理店铺 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="hasmanage" value="1" {if !empty($item['hasmanage'])}checked{/if}>启用管理店铺 |
|||
</label> |
|||
</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="enabled" value="0" {if empty($item['enabled'])}checked{/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="enabled" value="1" {if !empty($item['enabled'])}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> |
|||
|
|||
<div id="modal-module-merchant" 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"> |
|||
<div class="row"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control" name="keyword" value="" id="search-kwd-merchant" placeholder="请输入商家名称,不输入任何内容搜索结果为所有商家。" /> |
|||
<span class='input-group-btn'><button type="button" class="btn btn-default" onclick="search_merchant();">搜索</button></span> |
|||
</div> |
|||
</div> |
|||
<div id="module-merchant" style="padding-top:5px;"></div> |
|||
</div> |
|||
<div class="modal-footer"><a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a></div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<script> |
|||
$("#plugin-checkbox").click(function(){ |
|||
if($('#plugin-checkbox').is(':checked')) { |
|||
$('.plugin-input').show(); |
|||
} else { |
|||
$('.plugin-input').hide(); |
|||
} |
|||
}); |
|||
$("#alone-checkbox").click(function(){ |
|||
if($('#alone-checkbox').is(':checked')) { |
|||
$('.scale-input').show(); |
|||
} else { |
|||
$('.scale-input').hide(); |
|||
} |
|||
}); |
|||
$("#manage-store-checkbox").click(function(){ |
|||
if($('#manage-store-checkbox').is(':checked')) { |
|||
$('.hasmanage-input').show(); |
|||
} else { |
|||
$('.hasmanage-input').hide(); |
|||
} |
|||
}); |
|||
function search_merchant() { |
|||
$("#module-merchant").html("正在搜索....") |
|||
$.get("{php echo web_url('goodshouse/goodshouse/selectMerchant')}", { |
|||
keyword: $.trim($('#search-kwd-merchant').val()) |
|||
}, function(dat){ |
|||
$('#module-merchant').html(dat); |
|||
}); |
|||
} |
|||
function remove_merchant(obj){ |
|||
$('#goodsidmerchant').val(''); |
|||
$('#namemerchant').val(''); |
|||
$('#imgmerchant').attr("src",''); |
|||
} |
|||
function select_merchant(o) { |
|||
if($('#sidmerchant').val() != o.id){ |
|||
$.post("{php echo web_url('citydelivery/active/cateinfo')}",{sid:o.id},function(d){ |
|||
$('#cateinfo').html(''); |
|||
var html = '<option value="">请选择商品分类</option>'; |
|||
for(var i=0;i<d.twotype.length;i++){ |
|||
html += '<option value='+d.twotype[i].id+'>'+d.twotype[i].name+'</option>'; |
|||
} |
|||
$('#cateinfo').append(html); |
|||
},"json"); |
|||
} |
|||
$('#sidmerchant').val(o.id); |
|||
$('#namemerchant').val(o.storename); |
|||
$('#imgmerchant').attr("src",o.logo); |
|||
$('#modal-module-merchant').modal('hide'); |
|||
util.tips("操作成功"); |
|||
|
|||
|
|||
} |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,110 @@ |
|||
{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('salesman/salesman/edit')}" class="btn btn-primary">添加业务员</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form class="form-horizontal" action="" method="get"> |
|||
<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="salesman" /> |
|||
<input type="hidden" name="ac" value="salesman" /> |
|||
<input type="hidden" name="do" value="lists" /> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">业务员信息</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="name" value="{$_GPC['name']}" placeholder="请输入业务员姓名"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-6"> |
|||
<div class="input-group"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div id="list" class="panel tab-pane panel-default"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" style="width:5%">业务员ID</th> |
|||
<th class="text-center" style="width:20%">业务员信息</th> |
|||
<th class="text-center" style="width:15%">姓名/电话</th> |
|||
<th class="text-center" style="width:10%">提成比例</th> |
|||
<th class="text-center" style="width:20%">店铺信息</th> |
|||
<th class="text-center" style="width:10%">状态</th> |
|||
<th class="text-center" style="width:10%">创建时间</th> |
|||
<th class="text-center" style="width:10%">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $lists $k $v} |
|||
<tr class="text-center"> |
|||
<td> |
|||
{$v['id']} |
|||
</td> |
|||
<td class="name text-left"> |
|||
<div style="display: flex"> |
|||
<img class="img-40" src="{$v['member']['avatar']}" style="border-radius:50%;border:1px solid #efefef;" onerror="this.src='../addons/{MODULE_NAME}/web/resource/images/nopic-small.jpg'" height="40" width="40"> |
|||
<span style="display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left: 5px"> |
|||
<span class="nickname">{$v['member']['nickname']}</span> |
|||
</span> |
|||
</div> |
|||
</td> |
|||
<td class="sort"> |
|||
{$v['name']}<br> |
|||
{$v['mobile']} |
|||
</td> |
|||
<td class="sort"> |
|||
{if $v['alone'] == 1} |
|||
{$v['scale']}% |
|||
{else} |
|||
{$settings['scale']}% |
|||
{/if} |
|||
</td> |
|||
<td class="sort"> |
|||
<div style="display: flex"> |
|||
<img class="img-40" src="{php echo tomedia($v['store']['logo'])}" style="border-radius:50%;border:1px solid #efefef;" onerror="this.src='../addons/{MODULE_NAME}/web/resource/images/nopic-small.jpg'" height="40" width="40"> |
|||
<span style="display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left: 5px"> |
|||
<span class="nickname">{$v['store']['storename']}</span> |
|||
</span> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
<span class='label {if $v['enabled']==1}label-primary{else}label-default{/if}'> |
|||
{if $v['enabled']==1}启用{else}禁用{/if}</span> |
|||
</td> |
|||
<td> |
|||
{php echo date('Y-m-d H:i:s',$v['createtime'])} |
|||
</td> |
|||
<td> |
|||
<a class="btn btn-sm btn-primary" href="{php echo web_url('salesman/salesman/edit',array('id'=>$v['id']))}">编辑</a> |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('salesman/salesman/del',array('id'=>$v['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> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,87 @@ |
|||
{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"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">业务员设置</div> |
|||
<div class="alert alert-warning"> |
|||
<p>业务员提成佣金按照店铺有效订单金额(成功交易的订单,不包括已退款订单)进行计算</p> |
|||
</div> |
|||
<div class="panel-body"> |
|||
<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="isopen" value="0" {if empty($settings['isopen'])}checked{/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="isopen" value="1" {if !empty($settings['isopen'])}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"> |
|||
<label class="checkbox-inline" style="padding-left: 30px;margin-left: 0;"> |
|||
<input type="checkbox" name="plugin[]" value="rush" {if in_array('rush',$plugin)}checked="true"{/if}>抢购 |
|||
</label> |
|||
<label class="checkbox-inline" style="padding-left: 30px;margin-left: 0;"> |
|||
<input type="checkbox" name="plugin[]" value="groupon" {if in_array('groupon',$plugin)}checked="true"{/if}>团购 |
|||
</label> |
|||
<label class="checkbox-inline" style="padding-left: 30px;margin-left: 0;"> |
|||
<input type="checkbox" name="plugin[]" value="fightgroup" {if in_array('fightgroup',$plugin)}checked="true"{/if}>拼团 |
|||
</label> |
|||
<label class="checkbox-inline" style="padding-left: 30px;margin-left: 0;"> |
|||
<input type="checkbox" name="plugin[]" value="coupon" {if in_array('coupon',$plugin)}checked="true"{/if}>卡券 |
|||
</label> |
|||
<label class="checkbox-inline" style="padding-left: 30px;margin-left: 0;"> |
|||
<input type="checkbox" name="plugin[]" value="bargain" {if in_array('bargain',$plugin)}checked="true"{/if}>砍价 |
|||
</label> |
|||
<label class="checkbox-inline" style="padding-left: 30px;margin-left: 0;"> |
|||
<input type="checkbox" name="plugin[]" value="payonline" {if in_array('payonline',$plugin)}checked="true"{/if}>买单 |
|||
</label> |
|||
{if uniacid_p('citydelivery')} |
|||
<label class="checkbox-inline" style="padding-left: 30px;margin-left: 0;"> |
|||
<input type="checkbox" name="plugin[]" value="citydelivery" {if in_array('citydelivery',$plugin)}checked="true"{/if}>同城配送 |
|||
</label> |
|||
{/if} |
|||
<div class="help-block">一项都不勾选则视为全部勾选</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="number" name="scale" required min="0.01" max="100" placeholder="请输入业务员提成比例" autocomplete="off" class="form-control" value="{$settings['scale']}"> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
</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="hasmanage" value="0" {if empty($settings['hasmanage'])}checked{/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="hasmanage" value="1" {if !empty($settings['hasmanage'])}checked{/if}>启用 |
|||
</label> |
|||
</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> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,70 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Sharegift{ |
|||
|
|||
static function addrecord($id,$mid,$buymid,$sharestatus,$sharemoney,$plugin){ |
|||
global $_W; |
|||
$data = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'aid' => $_W['aid'], |
|||
'status' => 0, |
|||
'type' => $sharestatus, |
|||
'plugin' => $plugin, |
|||
'goodsid' => $id, |
|||
'mid' => $mid, |
|||
'buymid' => $buymid, |
|||
'price' => $sharemoney, |
|||
'createtime' => time() |
|||
); |
|||
$res = pdo_insert(PDO_NAME.'sharegift_record',$data); |
|||
return $res; |
|||
} |
|||
|
|||
//添加明细 |
|||
static function addcurrent($shareid,$price,$type,$reason='',$nowmoney,$sys=0){ |
|||
global $_W; |
|||
if($sys){ |
|||
$sharerecore = pdo_get('wlmerchant_shareapply',array('id' => $shareid)); |
|||
}else{ |
|||
$sharerecore = pdo_get('wlmerchant_sharegift_record',array('id' => $shareid)); |
|||
} |
|||
$data = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'aid' => $_W['aid'], |
|||
'shareid' => $shareid, |
|||
'mid' => $sharerecore['mid'], |
|||
'type' => $type, |
|||
'price' => $price, |
|||
'createtime' => time(), |
|||
'plugin' => $sharerecore['plugin'], |
|||
'reason' => $reason, |
|||
'nowmoney' => $nowmoney |
|||
); |
|||
pdo_insert(PDO_NAME.'sharecurrent',$data); |
|||
} |
|||
|
|||
static function doTask(){ |
|||
global $_W; |
|||
//结算分享分佣 |
|||
$records = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_sharegift_record')."WHERE uniacid = {$_W['uniacid']} AND status = 1 AND type = 2 ORDER BY createtime ASC limit 20"); |
|||
if($records){ |
|||
foreach ($records as $key => &$reco){ |
|||
if($reco['plugin'] == 1){ |
|||
$num = pdo_getcolumn(PDO_NAME.'rush_order',array('id'=>$reco['orderid']),'num'); |
|||
}else if($reco['plugin'] == 2){ |
|||
$num = pdo_getcolumn(PDO_NAME.'order',array('id'=>$reco['orderid']),'num'); |
|||
} |
|||
$price = sprintf("%.2f",$reco['price']*$num); |
|||
pdo_fetch("update" . tablename('wlmerchant_member') . "SET sharemoney=sharemoney+{$price},sharenowmoney=sharenowmoney+{$price} WHERE id = {$reco['mid']}"); |
|||
pdo_update('wlmerchant_sharegift_record',array('status' => 2),array('id' => $reco['id'])); |
|||
$nowmoney = pdo_get('wlmerchant_member',array('id' => $reco['mid']),array('sharenowmoney')); |
|||
self::addcurrent($reco['id'],$price,1,'分享分佣结算',$nowmoney['sharenowmoney']); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
} |
|||
?> |
|||
@ -0,0 +1,29 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[分享有礼]]></name> |
|||
<identifie><![CDATA[sharegift]]></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="false" /> |
|||
<system embed="true" /> |
|||
<task embed="true" /> |
|||
</setting> |
|||
<agentmenu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="记录" font="fa-inbox"> |
|||
<entry title="分享记录" do="sharerecord" ac="sharebase" iscover="true"/> |
|||
<entry title="佣金明细" do="sharecurrent" ac="sharebase"/> |
|||
<entry title="提现记录" do="shareapply" ac="sharebase"/> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="基础设置" do="baseset" ac="sharebase" /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 4.1 KiB |
@ -0,0 +1,322 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Sharebase_WeliamController { |
|||
|
|||
|
|||
public function sharerecord(){ |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$where = array('uniacid' => $_W['uniacid']); |
|||
|
|||
if (!empty($_GPC['keyword'])) { |
|||
if ($_GPC['keywordtype'] == 1) { |
|||
$keyword = $_GPC['keyword']; |
|||
$params[':name'] = "%{$keyword}%"; |
|||
if($_GPC['plugin'] == 1 || empty($_GPC['plugin'])){ |
|||
$goods = pdo_fetchall("SELECT id FROM " . tablename('wlmerchant_rush_activity') . "WHERE uniacid = {$_W['uniacid']} AND name LIKE :name", $params); |
|||
}else if($_GPC['plugin'] == 2){ |
|||
$goods = pdo_fetchall("SELECT id FROM " . tablename('wlmerchant_groupon_activity') . "WHERE uniacid = {$_W['uniacid']} AND name LIKE :name", $params); |
|||
} |
|||
if ($goods) { |
|||
$goodsids = "("; |
|||
foreach ($goods as $key => $v) { |
|||
if ($key == 0) { |
|||
$goodsids .= $v['id']; |
|||
} else { |
|||
$goodsids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$goodsids .= ")"; |
|||
$where['goodsid#'] = $goodsids; |
|||
} else { |
|||
$where['goodsid#'] = "(0)"; |
|||
} |
|||
} |
|||
if($_GPC['keywordtype'] == 2){ |
|||
$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) { |
|||
$memberids = "("; |
|||
foreach ($members as $key => $v) { |
|||
if ($key == 0) { |
|||
$memberids .= $v['id']; |
|||
} else { |
|||
$memberids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$memberids .= ")"; |
|||
$where['mid#'] = $memberids; |
|||
} else { |
|||
$where['mid#'] = "(0)"; |
|||
} |
|||
} |
|||
if($_GPC['keywordtype'] == 3){ |
|||
$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) { |
|||
$memberids = "("; |
|||
foreach ($members as $key => $v) { |
|||
if ($key == 0) { |
|||
$memberids .= $v['id']; |
|||
} else { |
|||
$memberids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$memberids .= ")"; |
|||
$where['buymid#'] = $memberids; |
|||
} else { |
|||
$where['buymid#'] = "(0)"; |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
if($_GPC['type']){ |
|||
$where['type'] = intval($_GPC['type']); |
|||
} |
|||
if($_GPC['plugin']){ |
|||
$where['plugin'] = intval($_GPC['plugin']); |
|||
} |
|||
if($_GPC['status']){ |
|||
if($_GPC['status'] == 4){ |
|||
$where['status'] = 0; |
|||
}else{ |
|||
$where['status'] = intval($_GPC['status']); |
|||
} |
|||
} |
|||
if ($_GPC['time_limit']) { |
|||
$time_limit = $_GPC['time_limit']; |
|||
$starttime = strtotime($_GPC['time_limit']['start']); |
|||
$endtime = strtotime($_GPC['time_limit']['end']); |
|||
$where['createtime>'] = $starttime; |
|||
$where['createtime<'] = $endtime; |
|||
} |
|||
if (empty($starttime) || empty($endtime)) { |
|||
$starttime = strtotime('-1 month'); |
|||
$endtime = time()+86400; |
|||
} |
|||
|
|||
|
|||
$records = Util::getNumData('*', 'wlmerchant_sharegift_record', $where,'ID DESC',$pindex, $psize, 1); |
|||
|
|||
$pager = $records[1]; |
|||
$records = $records[0]; |
|||
if($records){ |
|||
foreach ($records as $key => &$re) { |
|||
//商品信息 |
|||
if($re['plugin'] == 1){ |
|||
$goods = pdo_get('wlmerchant_rush_activity',array('id' => $re['goodsid']),array('name','sid')); |
|||
}else if($re['plugin'] == 2) { |
|||
$goods = pdo_get('wlmerchant_groupon_activity',array('id' => $re['goodsid']),array('name','sid')); |
|||
} |
|||
$re['title'] = $goods['name']; |
|||
$re['storename'] = pdo_getcolumn(PDO_NAME.'merchantdata',array('id'=>$goods['sid']),'storename'); |
|||
//分享人信息 |
|||
$sharemember = pdo_get('wlmerchant_member',array('id' => $re['mid']),array('nickname','avatar')); |
|||
$re['sharename'] = $sharemember['nickname']; |
|||
$re['shareavatar'] = tomedia($sharemember['avatar']); |
|||
//购买人信息 |
|||
$buymember = pdo_get('wlmerchant_member',array('id' => $re['buymid']),array('nickname','avatar')); |
|||
$re['buyname'] = $buymember['nickname']; |
|||
$re['buyavatar'] = tomedia($buymember['avatar']); |
|||
|
|||
} |
|||
} |
|||
|
|||
include wl_template('sharesys/sharerecord'); |
|||
} |
|||
|
|||
|
|||
|
|||
public function sharecurrent(){ |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
|
|||
if (!empty($_GPC['keyword'])){ |
|||
if(!empty($_GPC['keywordtype'])){ |
|||
switch($_GPC['keywordtype']){ |
|||
case 1: $where['mid'] = $_GPC['keyword'];break; |
|||
case 3: $where['price>'] = $_GPC['keyword'];break; |
|||
case 4: $where['price<'] = $_GPC['keyword'];break; |
|||
default:break; |
|||
} |
|||
} |
|||
if($_GPC['keywordtype'] == 2){ |
|||
$keyword = $_GPC['keyword']; |
|||
$params[':nickname'] = "%{$keyword}%"; |
|||
$goods = pdo_fetchall("SELECT id,nickname FROM ".tablename('wlmerchant_member')."WHERE uniacid = {$_W['uniacid']} AND nickname LIKE :nickname",$params); |
|||
if($goods){ |
|||
$goodids = "("; |
|||
foreach ($goods as $key => $v) { |
|||
if($key == 0){ |
|||
$goodids.= $v['id']; |
|||
}else{ |
|||
$goodids.= ",".$v['id']; |
|||
} |
|||
} |
|||
$goodids.= ")"; |
|||
$where['mid#'] = $goodids; |
|||
}else { |
|||
$where['mid#'] = "(0)"; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
if($_GPC['type']){ |
|||
$where['type'] = $_GPC['type']; |
|||
} |
|||
if($_GPC['plugin']){ |
|||
$where['plugin'] = $_GPC['plugin']; |
|||
} |
|||
|
|||
if($_GPC['time_limit']){ |
|||
$time_limit = $_GPC['time_limit']; |
|||
$starttime = strtotime($_GPC['time_limit']['start']); |
|||
$endtime = strtotime($_GPC['time_limit']['end']) ; |
|||
$where['createtime>'] = $starttime; |
|||
$where['createtime<'] = $endtime; |
|||
} |
|||
|
|||
if (empty($starttime) || empty($endtime)) { |
|||
$starttime = strtotime('-1 month'); |
|||
$endtime = time()+86400; |
|||
} |
|||
|
|||
|
|||
|
|||
$details = Util::getNumData('*',PDO_NAME.'sharecurrent',$where,'ID DESC',$pindex,$psize,1); |
|||
$pager = $details[1]; |
|||
$details = $details[0]; |
|||
if($details){ |
|||
foreach ($details as $key => &$vde) { |
|||
$vde['nickname'] = pdo_getcolumn(PDO_NAME.'member',array('id'=>$vde['mid']),'nickname'); |
|||
$buymid = pdo_getcolumn(PDO_NAME.'sharegift_record',array('id'=>$vde['shareid']),'buymid'); |
|||
$vde['buyname'] = pdo_getcolumn(PDO_NAME.'member',array('id'=>$buymid),'nickname'); |
|||
} |
|||
} |
|||
|
|||
|
|||
include wl_template('sharesys/sharecurrent'); |
|||
} |
|||
|
|||
|
|||
public function shareapply(){ |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$where = array('uniacid' => $_W['uniacid']); |
|||
|
|||
$list = Util::getNumData('*', 'wlmerchant_shareapply', $where,'createtime DESC',$pindex, $psize, 1); |
|||
$pager = $list[1]; |
|||
$list = $list[0]; |
|||
if($list){ |
|||
foreach ($list as $key => &$vaa) { |
|||
$vaa['nickname'] = pdo_getcolumn(PDO_NAME.'member',array('id'=>$vaa['mid']),'nickname'); |
|||
$vaa['avatar'] = pdo_getcolumn(PDO_NAME.'member',array('id'=>$vaa['mid']),'avatar'); |
|||
$vaa['avatar'] = tomedia($vaa['avatar']); |
|||
} |
|||
} |
|||
|
|||
|
|||
include wl_template('sharesys/shareapply'); |
|||
} |
|||
|
|||
public function settlementing(){ |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$type = $_GPC['type']; |
|||
|
|||
$settlementRecord = pdo_get('wlmerchant_shareapply',array('id' => $id)); |
|||
if($settlementRecord['status'] != 1){ |
|||
show_json(0,'该申请已完成或已驳回'); |
|||
} |
|||
if($type == 'reject'){ |
|||
$res = pdo_update('wlmerchant_shareapply',array('status' => 3,'dotime'=>time()),array('id' => $id)); |
|||
if($res){ |
|||
pdo_fetch("update".tablename('wlmerchant_member') . "SET sharenowmoney=sharenowmoney+{$settlementRecord['applymoney']} WHERE id = {$settlementRecord['mid']}"); |
|||
$nowmoney = pdo_getcolumn(PDO_NAME.'member',array('id'=>$settlementRecord['mid']),'sharenowmoney'); |
|||
Sharegift::addcurrent($id,$settlementRecord['applymoney'],1,'驳回提现申请',$nowmoney,1); |
|||
show_json(1,'已成功驳回'); |
|||
}else { |
|||
show_json(0,'驳回失败,请重试'); |
|||
} |
|||
}else if($type == 'wechat'){ |
|||
$openid = pdo_getcolumn(PDO_NAME.'member',array('id'=>$settlementRecord['mid']),'openid'); |
|||
if(empty($openid)){ |
|||
show_json(0,'该用户没有openid,无法微信打款'); |
|||
} |
|||
|
|||
if (is_numeric($settlementRecord['money'])) { |
|||
if ($settlementRecord['money'] < 1){ |
|||
show_json(0,'到账金额需要大于1元'); |
|||
} |
|||
$rem = '分享佣金提现'; |
|||
$realname = pdo_getcolumn(PDO_NAME.'member',array('id'=>$settlementRecord['mid']),'realname'); |
|||
$result1 = wlPay::finance($openid,$settlementRecord['money'],$rem,$realname); |
|||
//结算操作 |
|||
if ($result1['return_code'] == 'SUCCESS' && $result1['result_code'] == 'SUCCESS') { |
|||
$res = pdo_update('wlmerchant_shareapply',array('status' => 2,'cashstatus'=>1,'dotime'=>time()),array('id' => $id)); |
|||
if ($res) { |
|||
show_json(1,'已结算给用户'); |
|||
} else { |
|||
show_json(0,'结算失败,请重试'); |
|||
} |
|||
} else { |
|||
if(empty($result1['err_code_des'])){ |
|||
$result1['err_code_des'] = $result1['message']; |
|||
} |
|||
// 结算失败 |
|||
show_json(0,'微信钱包提现失败: '.$result1['err_code_des']); |
|||
} |
|||
} else { |
|||
show_json(0,'结算金额错误'); |
|||
} |
|||
show_json(1,'操作成功'); |
|||
}else if($type == 'f2f'){ |
|||
/*先判断是否有已结算*/ |
|||
if ($settlementRecord['status'] != 1){ |
|||
show_json(0,'该申请已完成或已驳回'); |
|||
} |
|||
if (is_numeric($settlementRecord['money'])) { |
|||
$res = pdo_update('wlmerchant_shareapply',array('status' => 2,'cashstatus'=>2,'dotime'=>time()),array('id' => $id)); |
|||
if ($res) { |
|||
show_json(1,'已结算给用户'); |
|||
} else { |
|||
show_json(0,'结算失败,请重试'); |
|||
} |
|||
} else { |
|||
show_json(0,'结算金额错误'); |
|||
} |
|||
show_json(1,'操作成功'); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
public function baseset(){ |
|||
global $_W, $_GPC; |
|||
$base = Setting::wlsetting_read('sharegift'); |
|||
if (checksubmit('submit')){ |
|||
$data = $_GPC['base']; |
|||
$data['describe'] = htmlspecialchars_decode($data['describe']); |
|||
$res1 = Setting::wlsetting_save($data,'sharegift'); |
|||
if ($res1) { |
|||
wl_message('设置保存成功!', referer(), 'success'); |
|||
} else { |
|||
wl_message('设置保存失败!', referer(), 'error'); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
include wl_template('sharesys/baseset'); |
|||
} |
|||
} |
|||
?> |
|||
@ -0,0 +1,77 @@ |
|||
{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" id="setting-form"> |
|||
<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="base[switch]" {if $base['switch'] == 1} checked {/if} /> 开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="base[switch]" {if $base['switch'] == 0 || empty($base['switch'])} checked {/if} /> 关闭 |
|||
</label> |
|||
</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="text" name="base[lowestmoney]" class="form-control" value="{$base['lowestmoney']}"> |
|||
</div> |
|||
<span class="help-block">最小值默认为1元</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" name="base[frequency]" class="form-control" value="{$base['frequency']}"> |
|||
<span class="input-group-addon">天一次</span> |
|||
</div> |
|||
<span class="help-block">不填或填0则默认无限制,填1则为一天一次,以此类推。</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" name="base[withdrawcharge]" class="form-control" value="{$base['withdrawcharge']}"> |
|||
<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"> |
|||
{php echo tpl_diy_editor_create('base[describe]',$base['describe']);} |
|||
</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> |
|||
|
|||
{php include wl_template('common/footer');} |
|||
|
|||
|
|||
@ -0,0 +1,78 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="#">提现列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover" style="min-width: 300px;"> |
|||
<thead class="navbar-inner"> |
|||
<tr> |
|||
<th class="col-sm-3">申请信息</th> |
|||
<th class="col-sm-2">申请金额</th> |
|||
<th class="col-sm-2">系统提成</th> |
|||
<th class="col-sm-2">实获金额</th> |
|||
<th class="col-sm-3">提现</th> |
|||
<th class="col-sm-3">申请时间</th> |
|||
<th class="col-sm-3">操作时间</th> |
|||
<th class="col-sm-3">状态</th> |
|||
<th class="col-sm-5 text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $merchant} |
|||
<tr> |
|||
<td><img src="{$merchant['avatar']}" style="width: 50px;height: 50px;margin-right: 5px;"> {$merchant['nickname']}</td> |
|||
<td>{$merchant['applymoney']}元</td> |
|||
<td>{$merchant['agentmoney']}元</td> |
|||
<td>{$merchant['money']}元</td> |
|||
<td> |
|||
<label class="label label-default label-danger">分享佣金提现</label> |
|||
<br><br>{if $merchant['cashstatus']==1}<label class="label label-default label-success">微信零钱{elseif $merchant['cashstatus']==2}<label class="label label-default label-info">手动完成{else}<label class="label label-default">未结算{/if}</label> |
|||
</td> |
|||
<td>{php echo date('Y-m-d',$merchant['createtime'])}<br>{php echo date('H:i:s',$merchant['createtime'])}</td> |
|||
<td> |
|||
{if $merchant['dotime']} |
|||
{php echo date('Y-m-d',$merchant['dotime'])}<br>{php echo date('H:i:s',$merchant['dotime'])} |
|||
{else} |
|||
<label class="label label-default label-info">未处理</label> |
|||
{/if} |
|||
</td> |
|||
<td>{if $merchant['status']==1} |
|||
<label class="label label-default label-default">申请中</label> |
|||
{elseif $merchant['status']==2} |
|||
<label class="label label-default label-success">已完成</label> |
|||
{elseif $merchant['status']==3} |
|||
<label class="label label-default label-danger">已驳回</label> |
|||
{/if} |
|||
</td> |
|||
<td style="text-align: center;"> |
|||
{if $merchant['status']==1} |
|||
<a href="{php echo web_url('sharegift/sharebase/settlementing', array('id'=>$merchant['id'],'type'=>'wechat'));}" title="微信打款" class="btn btn-primary btn-sm" data-toggle="ajaxRemove" data-confirm="此操作不可逆,确认通过微信打款给申请人?">微信打款</a> |
|||
<a href="{php echo web_url('sharegift/sharebase/settlementing', array('id'=>$merchant['id'],'type'=>'f2f'));}" title="设为已处理" class="btn btn-default btn-sm"data-toggle="ajaxRemove" data-confirm="此操作不可逆,确认修改申请状态为已完成?">设为手动处理</a> |
|||
<a href="{php echo web_url('sharegift/sharebase/settlementing', array('id'=>$merchant['id'],'type'=>'reject'));}" title="驳回" class="btn btn-danger btn-sm"data-toggle="ajaxRemove" data-confirm="此操作不可逆,确认要驳回该提现申请吗">驳回申请</a> |
|||
{else} |
|||
<label class="label label-default label-danger">无操作</label> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
{if empty($list)} |
|||
<div class="panel-body" style="text-align: center;padding:30px;"> |
|||
暂时没有任何数据! |
|||
</div> |
|||
{/if} |
|||
</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,129 @@ |
|||
{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="sharegift" /> |
|||
<input type="hidden" name="ac" value="sharebase" /> |
|||
<input type="hidden" name="do" value="sharecurrent" /> |
|||
<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 intval($_GPC['type']) == 1}btn-primary{else}btn-default{/if}">收入</a> |
|||
<a href="{php echo wl_filter_url('type:2');}" class="btn {if intval($_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('plugin:0');}" class="btn {if intval($_GPC['plugin']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('plugin:1');}" class="btn {if intval($_GPC['plugin']) == 1}btn-primary{else}btn-default{/if}">抢购</a> |
|||
<a href="{php echo wl_filter_url('plugin:2');}" class="btn {if intval($_GPC['plugin']) == 2}btn-primary{else}btn-default{/if}">团购</a> |
|||
<a href="{php echo wl_filter_url('plugin:3');}" class="btn {if intval($_GPC['plugin']) == 3}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"> |
|||
{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 form-inline"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-sm-9"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="">关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>分享人MID</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> |
|||
</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"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
|
|||
|
|||
</script> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead class="navbar-inner"> |
|||
<tr> |
|||
<th style="width:5%;">MID</th> |
|||
<th style="width:15%;">分享人姓名</th> |
|||
<th style="width:10%;">收支</th> |
|||
<th style="width:10%;">金额</th> |
|||
<th style="width:15%;">来源</th> |
|||
<th style="width:20%;">插件</th> |
|||
<th style="width:25%;">时间</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $details $de} |
|||
<tr> |
|||
<td>{$de['mid']}</td> |
|||
<td>{$de['nickname']}</td> |
|||
<td> |
|||
{if $de['type'] == 1} |
|||
<span class="label label-success">收入</span> |
|||
{else} |
|||
<span class="label label-danger" >支出</span> |
|||
{/if} |
|||
</td> |
|||
<td style="color: red;">{$de['price']}</td> |
|||
<td>{$de['buyname']}</td> |
|||
<td> |
|||
{if $de['plugin'] == 1} |
|||
<span class="label label-success">抢购</span> |
|||
{else if $de['plugin'] == 2} |
|||
<span class="label label-warning">团购</span> |
|||
{else if $de['plugin'] == 3} |
|||
<span class="label label-primary">掌上信息</span> |
|||
{/if} |
|||
</td> |
|||
<td>{php echo date('Y-m-d H:i:s',$de['createtime'])}</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> |
|||
<style> |
|||
.change:hover{ |
|||
cursor:pointer; |
|||
} |
|||
</style> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,156 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.elli{overflow: hidden;text-overflow:ellipsis;white-space:nowrap;} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="">分享记录</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="sharegift" /> |
|||
<input type="hidden" name="ac" value="sharebase" /> |
|||
<input type="hidden" name="do" value="sharerecord" /> |
|||
<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 intval($_GPC['type']) == 1}btn-primary{else}btn-default{/if}">分享立减</a> |
|||
<a href="{php echo wl_filter_url('type:2');}" class="btn {if intval($_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('plugin:0');}" class="btn {if intval($_GPC['plugin']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('plugin:1');}" class="btn {if intval($_GPC['plugin']) == 1}btn-primary{else}btn-default{/if}">抢购</a> |
|||
<a href="{php echo wl_filter_url('plugin:2');}" class="btn {if intval($_GPC['plugin']) == 2}btn-primary{else}btn-default{/if}">团购</a> |
|||
<a href="{php echo wl_filter_url('plugin:3');}" class="btn {if intval($_GPC['plugin']) == 3}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:1');}" class="btn {if intval($_GPC['status']) == 1}btn-primary{else}btn-default{/if}">已付款</a> |
|||
<a href="{php echo wl_filter_url('status:2');}" class="btn {if intval($_GPC['status']) == 2}btn-primary{else}btn-default{/if}">已分佣</a> |
|||
<a href="{php echo wl_filter_url('status:4');}" class="btn {if intval($_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"> |
|||
{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 form-inline"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-sm-9"> |
|||
<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> |
|||
</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"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
</script> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-bordered table-hover"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th style="width:100px;text-align:center;">商品信息</th> |
|||
<th style="width:80px; text-align: center;">分享人信息</th> |
|||
<th style="width:80px;text-align: center;">买家信息</th> |
|||
<th style="width:80px;text-align: center;">金额</th> |
|||
<th style="width:80px; text-align:center;">插件</th> |
|||
<th style="width:80px; text-align:center;">类型</th> |
|||
<th style="width:80px;text-align: center;">状态</th> |
|||
<th style="width:100px; text-align:center;">时间</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody > |
|||
{loop $records $item} |
|||
<tr> |
|||
<!--商品信息--> |
|||
<td class="goods-info line-feed" style="padding-left: 10px;"> |
|||
<div class="all-tips"> |
|||
<p class="elli" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;">{$item['title']}</p> |
|||
{if $item['storename']}<p class="elli">商家:{$item['storename']}</p>{/if} |
|||
</div> |
|||
</td> |
|||
<!--分享人信息--> |
|||
<td style="position: relative;height:60px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
<div class="img"><img class="scrollLoading" style="width: 50px;height: 50px;" src="{$item['shareavatar']}"></div> |
|||
<div class="title" style="padding-left: 60px;position: absolute;top: 30px;"> |
|||
<span>{$item['sharename']}</span> |
|||
</div> |
|||
</td> |
|||
<!--买家信息--> |
|||
<td style="position: relative;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
<div class="img"><img class="scrollLoading" style="width: 50px;height: 50px;" src="{$item['buyavatar']}"></div> |
|||
<div class="title" style="padding-left: 60px;position: absolute;top: 30px;"> |
|||
<span>{$item['buyname']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{if $item['plugin']==3}分享佣金{else}每份商品{/if}¥{$item['price']} |
|||
</td> |
|||
<td class="text-center" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{if $item['plugin']==1}<span class="label label-success">抢购</span>{/if} |
|||
{if $item['plugin']==2}<span class="label label-info">团购</span>{/if} |
|||
{if $item['plugin']==3}<span class="label label-primary">掌上信息</span>{/if} |
|||
</td> |
|||
<td class="text-center" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{if $item['type']==1}<span class="label label-success">分享立减</span>{/if} |
|||
{if $item['type']==2}<span class="label label-info">分享分佣</span>{/if} |
|||
</td> |
|||
<td class="text-center" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{if $item['status']==0}<span class="label label-default">未支付</span>{/if} |
|||
{if $item['status']==1}<span class="label label-info">已支付</span>{/if} |
|||
{if $item['status']==2}<span class="label label-success">已结算</span>{/if} |
|||
</td> |
|||
<td class="text-center" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{php echo date('Y-m-d H:i:s',$item['createtime'])} |
|||
</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,111 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Storeqr { |
|||
|
|||
static function get_storeqr($sid) { |
|||
global $_W; |
|||
$merchant = pdo_get(PDO_NAME . 'merchantdata', ['uniacid' => $_W['uniacid'], 'id' => $sid], ['id', 'cardsn']); |
|||
if (empty($merchant)) { |
|||
return error(-1, '商户不存在,请检查后重试'); |
|||
} |
|||
if (!empty($merchant['cardsn'])) { |
|||
$qrid = pdo_getcolumn(PDO_NAME . 'qrcode', array('sid' => $sid, 'status' => 2), 'qrid'); |
|||
} else { |
|||
$qrid = self::create_storeqr($sid); |
|||
} |
|||
$ticket = pdo_getcolumn('qrcode', array('id' => $qrid), 'ticket'); |
|||
if(!$ticket){ |
|||
$qrid = self::create_storeqr($sid); |
|||
$ticket = pdo_getcolumn('qrcode', array('id' => $qrid), 'ticket'); |
|||
} |
|||
|
|||
$url = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=' . urlencode($ticket); |
|||
return $url; |
|||
} |
|||
|
|||
static function create_storeqr($sid) { |
|||
global $_W; |
|||
Weixinqrcode::createkeywords('商户关注二维码:Storeqr', 'weliam_merchant_storeqr'); |
|||
$qrid = Weixinqrcode::createqrcode('商户关注二维码:Storeqr', 'weliam_merchant_storeqr', 0, 2, -1, '商户关注二维码'); |
|||
if (!is_error($qrid)) { |
|||
$qrcode = pdo_get(PDO_NAME . 'qrcode', array('uniacid' => $_W['uniacid'], 'qrid' => $qrid)); |
|||
pdo_update(PDO_NAME . 'qrcode', array('sid' => $sid, 'status' => 2), array('id' => $qrcode['id'])); |
|||
pdo_update(PDO_NAME . 'merchantdata', array('cardsn' => $qrcode['cardsn']), array('id' => $sid)); |
|||
} |
|||
return $qrid; |
|||
} |
|||
|
|||
static function Processor($message) { |
|||
global $_W; |
|||
if (strtolower($message['msgtype']) == 'event') { |
|||
//获取数据 |
|||
$returnmess = array(); |
|||
$qrid = Weixinqrcode::get_qrid($message); |
|||
$data = self::get_member($message, $qrid); |
|||
$card = $data['card']; |
|||
$storedata = $data['store']; |
|||
$aid = $storedata['aid']; |
|||
$member = $data['member']; |
|||
$base = Setting::wlsetting_read('storeqr'); |
|||
//判断是否为二次请求 |
|||
$onlyKey = md5(serialize($message)); |
|||
$caCheOnlyKey = Cache::getCache('Processor','storeqr'); |
|||
if($onlyKey == $caCheOnlyKey) return false;//阻断重复请求 |
|||
Cache::setCache('Processor','storeqr',$onlyKey);//记录请求信息 |
|||
|
|||
//二维码未绑定 |
|||
if ($card['status'] == 1) { |
|||
$returnmess[] = array('title' => urlencode('店铺快速入驻'), 'description' => '', 'picurl' => tomedia($base['enterfast']), 'url' => h5_url('pages/mainPages/Settled/Settled')); |
|||
Weixinqrcode::send_news($returnmess, $message); |
|||
} |
|||
//二维码已绑定 |
|||
if ($card['status'] == 2) { |
|||
//商家信息 |
|||
if($_W['wlsetting']['diyposter']['replytype'] == 1){ |
|||
$path = 'pages/mainPages/store/index?sid='.$storedata['id']; |
|||
$returnmess = array('title' => urlencode($storedata['storename']), 'appid' => $_W['wlsetting']['wxapp_config']['appid'], 'path' => tomedia($storedata['logo']), 'pagepath' => $path); |
|||
Weixinqrcode::send_wxapp($returnmess, $message); |
|||
}else{ |
|||
$returnmess[] = array('title' => urlencode($storedata['storename']), 'description' => urlencode($storedata['address']), 'picurl' => tomedia($storedata['logo']), 'url' => h5_url('pages/mainPages/store/index', ['sid' => $storedata['id']])); |
|||
Weixinqrcode::send_news($returnmess, $message); |
|||
} |
|||
} |
|||
//二维码已禁止 |
|||
if ($card['status'] == 3) { |
|||
Weixinqrcode::send_text('抱歉,此二维码已失效!', $message); |
|||
} |
|||
} |
|||
} |
|||
|
|||
private static function get_member($message, $qrid) { |
|||
global $_W; |
|||
$card = pdo_get(PDO_NAME . 'qrcode', array('uniacid' => $_W['uniacid'], 'qrid' => $qrid)); |
|||
$_W['aid'] = $card['aid']; |
|||
$member = pdo_get(PDO_NAME . 'member', array('uniacid' => $_W['uniacid'], 'openid' => $message['from']), array('id')); |
|||
if (empty($member['id'])) { |
|||
$member = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'openid' => $message['from'], |
|||
'createtime' => time() |
|||
); |
|||
pdo_insert(PDO_NAME . 'member', $member); |
|||
$member['id'] = pdo_insertid(); |
|||
} |
|||
$member['storeid'] = pdo_getcolumn(PDO_NAME . 'merchantuser', array('uniacid' => $_W['uniacid'], 'mid' => $member['id'], 'status' => 2, 'enabled' => 1), 'storeid'); |
|||
if ($card['sid']) { |
|||
$storedata = pdo_get(PDO_NAME . 'merchantdata', array('uniacid' => $_W['uniacid'], 'id' => $card['sid']), array('id', 'storename', 'aid', 'logo', 'address', 'payonline')); |
|||
//给店铺增加客户 |
|||
Store::addFans($storedata['id'], $member['id'], 3); |
|||
//给店长增加下线 |
|||
if (p('distribution')) { |
|||
$adminmid = pdo_getcolumn(PDO_NAME . 'merchantuser', array('uniacid' => $_W['uniacid'], 'storeid' => $card['sid'], 'ismain' => 1), 'mid'); |
|||
if ($adminmid) { |
|||
Distribution::addJunior($adminmid, $member['id']); |
|||
} |
|||
} |
|||
} |
|||
return array('card' => $card, 'store' => $storedata, 'member' => $member); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[商户二维码]]></name> |
|||
<identifie><![CDATA[storeqr]]></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="false" /> |
|||
<task embed="false" /> |
|||
</setting> |
|||
<agentmenu> |
|||
<menu title="概况" font="fa-inbox"> |
|||
<entry title="二维码统计" ac="sqrcode" do="summary" /> |
|||
<entry title="二维码列表" ac="sqrcode" do="qrlist" iscover="true" /> |
|||
</menu> |
|||
<!--<menu title="二维码管理" font="fa-inbox"> |
|||
<entry title="申请列表" ac="sqrcode" do="apply" /> |
|||
<entry title="申请二维码" ac="sqrcode" do="applypost" /> |
|||
</menu>--> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="概况" font="fa-inbox"> |
|||
<entry title="二维码统计" ac="sqrcode" do="summary" /> |
|||
</menu> |
|||
<menu title="二维码管理" font="fa-inbox"> |
|||
<entry title="二维码列表" ac="sqrcode" do="qrlist" iscover="true" /> |
|||
<!--<entry title="申请列表" ac="sqrcode" do="apply" />--> |
|||
<entry title="生成二维码" ac="sqrcode" do="post" /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,269 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Sqrcode_WeliamController{ |
|||
|
|||
public function qrlist(){ |
|||
global $_W,$_GPC; |
|||
$wheresql = is_agent() ? " WHERE uniacid = :uniacid AND type = 0 AND aid = :aid" : " WHERE uniacid = :uniacid AND type = 0 "; |
|||
$param = is_agent() ? array(':uniacid' => $_W['uniacid'],':aid' => $_W['aid']) : array(':uniacid' => $_W['uniacid']); |
|||
$keyword = trim($_GPC['keyword']); |
|||
if(!empty($keyword)) { |
|||
$wheresql .= " AND (cardsn LIKE '%{$keyword}%' or remark LIKE '%{$keyword}%') "; |
|||
} |
|||
$starttime = empty($_GPC['time']['start']) ? TIMESTAMP - 86399 * 30 : strtotime($_GPC['time']['start']); |
|||
$endtime = empty($_GPC['time']['end']) ? TIMESTAMP: strtotime($_GPC['time']['end']); |
|||
if(!empty($_GPC['time']['start'])) { |
|||
$wheresql .= " AND createtime >= '{$starttime}' AND createtime <= '{$endtime}'"; |
|||
} |
|||
if (!empty($_GPC['status'])) { |
|||
$wheresql .= " AND status = {$_GPC['status']}"; |
|||
} |
|||
if (!empty($_GPC['model']) && $_GPC['model'] != -1) { |
|||
$wheresql .= " AND model = {$_GPC['model']}"; |
|||
} |
|||
|
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 20; |
|||
$list = pdo_fetchall("SELECT * FROM ".tablename(PDO_NAME.'qrcode'). $wheresql . ' ORDER BY `id` DESC LIMIT '.($pindex - 1) * $psize.','. $psize, $param); |
|||
if (!empty($list)) { |
|||
foreach ($list as $index => &$qrcode) { |
|||
if($qrcode['aid']){ |
|||
$qrcode['agentname'] = pdo_getcolumn(PDO_NAME.'agentusers', array('uniacid'=>$_W['uniacid'],'id'=>$qrcode['aid']),'agentname'); |
|||
}else{ |
|||
$qrcode['agentname'] = '系统管理员'; |
|||
} |
|||
$wq_qr = pdo_get('qrcode', array('id' => $qrcode['qrid']), array('ticket', 'scene_str', 'qrcid', 'id','createtime')); |
|||
$qrcode['scene_str'] = $wq_qr['scene_str']; |
|||
$qrcode['qrcid'] = $wq_qr['qrcid']; |
|||
$qrcode['id'] = $wq_qr['id']; |
|||
$qrcode['endtime'] = $wq_qr['createtime'] + 2592000; |
|||
|
|||
if ($qrcode['model'] == 2) { |
|||
$qrcode['showurl'] = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=' . urlencode($wq_qr['ticket']); |
|||
$qrcode['modellabel']="含参"; |
|||
$qrcode['endtime'] = '<font color="green">永不</font>'; |
|||
} elseif($qrcode['model'] == 3) { |
|||
$qrcode['showurl'] = app_url('qr/qrcode/show',array('ncnumber' => $qrcode['cardsn'],'salt' => $qrcode['salt'])); |
|||
$qrcode['modellabel']="智能"; |
|||
$qrcode['endtime'] = '<font color="green">永不</font>'; |
|||
}else{ |
|||
$qrcode['modellabel']="临时"; |
|||
$qrcode['showurl'] = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=' . urlencode($wq_qr['ticket']); |
|||
if (TIMESTAMP > $qrcode['endtime']) { |
|||
$qrcode['endtime'] = '<font color="red">已过期</font>'; |
|||
}else{ |
|||
$qrcode['endtime'] = date('Y-m-d H:i:s',$qrcode['endtime']); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
$total = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME.'qrcode') . $wheresql, $param); |
|||
$pager = wl_pagination($total, $pindex, $psize); |
|||
if($_GPC['export'] != ''){ |
|||
$this->export($wheresql, $param); |
|||
} |
|||
|
|||
include wl_template('sqrcode/qr-list'); |
|||
} |
|||
|
|||
public function post(){ |
|||
global $_W,$_GPC; |
|||
$id = intval($_GPC['id']); |
|||
if($id){ |
|||
$apply = pdo_get(PDO_NAME.'qrcode_apply',array('uniacid'=>$_W['uniacid'],'id'=>$id)); |
|||
} |
|||
if(checksubmit('submit')){ |
|||
Storeqr::qr_createkeywords(); |
|||
$qrctype = intval($_GPC['qrc-model']); |
|||
$allnum = intval($_GPC['qr_num']); |
|||
$agentid = intval($_GPC['agentid']); |
|||
if($id){ |
|||
pdo_update(PDO_NAME.'qrcode_apply',array('status'=>2,'pnum'=>$allnum),array('id'=>$id)); |
|||
} |
|||
include wl_template('sqrcode/qr-process'); |
|||
exit; |
|||
} |
|||
$remark_arr = pdo_getall(PDO_NAME.'agentusers',array('uniacid'=>$_W['uniacid']),array('id','agentname')); |
|||
|
|||
include wl_template('sqrcode/qr-post'); |
|||
} |
|||
|
|||
public function get(){ |
|||
global $_W,$_GPC; |
|||
$qrctype = intval($_GPC['qrc-model']); |
|||
$agentid = intval($_GPC['agentid']); |
|||
$return = Storeqr::creatstoreqr($qrctype,$agentid,$_GPC['remark']); |
|||
die(json_encode($return)); |
|||
} |
|||
|
|||
public function export($wheresql,$param){ |
|||
if(empty($wheresql) || empty($param)) return FALSE; |
|||
set_time_limit(0); |
|||
$list = pdo_fetchall("SELECT * FROM ".tablename(PDO_NAME.'qrcode'). $wheresql . ' ORDER BY `id` DESC', $param); |
|||
/* 输入到CSV文件 */ |
|||
$html = "\xEF\xBB\xBF"; |
|||
/* 输出表头 */ |
|||
$filter = array( |
|||
'agentname' => '所属代理', |
|||
'showurl' => '二维码', |
|||
'cardsn' => '编号', |
|||
'status' => '使用状态', |
|||
'model' => '二维码类型', |
|||
'qrcid' => '场景ID', |
|||
'createtime' => '生成时间' |
|||
); |
|||
|
|||
foreach ($filter as $key => $title) { |
|||
$html .= $title . "\t,"; |
|||
} |
|||
$html .= "\n"; |
|||
foreach ($list as $k => $v) { |
|||
$wq_qr = pdo_get('qrcode', array('id' => $v['qrid']), array('ticket', 'scene_str', 'model', 'id','url')); |
|||
$v['scene_str'] = $wq_qr['scene_str']; |
|||
if($wq_qr['model'] == 3){ |
|||
$str1 = substr($wq_qr['url'],0,15); |
|||
if($str1 == 'http://w.url.cn'){ |
|||
$v['showurl'] = $wq_qr['url']; |
|||
}else{ |
|||
$v['showurl'] = app_url('qr/qrcode',array('ncnumber' => $v['cardsn'],'salt' => $v['salt'])); |
|||
} |
|||
}else{ |
|||
$v['showurl'] = $wq_qr['url']; |
|||
} |
|||
if($v['aid']){ |
|||
$v['agentname'] = pdo_getcolumn(PDO_NAME.'agentusers', array('id'=>$v['aid']),'agentname'); |
|||
}else{ |
|||
$v['agentname'] = '系统管理员'; |
|||
} |
|||
foreach ($filter as $key => $title) { |
|||
if ($key == 'createtime') { |
|||
$html .= date('Y-m-d H:i:s', $v[$key]) . "\t, "; |
|||
}elseif($key == 'status'){ |
|||
switch ($v[$key]) { |
|||
case '1': |
|||
$html .= '未绑定' . "\t, "; |
|||
break; |
|||
case '2': |
|||
$html .= '已绑定' . "\t, "; |
|||
break; |
|||
default: |
|||
$html .= '已失效' . "\t, "; |
|||
break; |
|||
} |
|||
}elseif($key == 'model'){ |
|||
switch ($v[$key]) { |
|||
case '1': |
|||
$html .= '临时' . "\t, "; |
|||
break; |
|||
case '2': |
|||
$html .= '含参' . "\t, "; |
|||
break; |
|||
default: |
|||
$html .= '智能' . "\t, "; |
|||
break; |
|||
} |
|||
}elseif($key == 'qrcid'){ |
|||
if(!empty($v['qrcid'])){ |
|||
$html .= $v['qrcid'] . "\t, "; |
|||
}else{ |
|||
$html .= $v['scene_str'] . "\t, "; |
|||
} |
|||
}else { |
|||
$html .= $v[$key] . "\t, "; |
|||
} |
|||
} |
|||
$html .= "\n"; |
|||
} |
|||
/* 输出CSV文件 */ |
|||
header("Content-type:text/csv"); |
|||
header("Content-Disposition:attachment; filename=全部数据.csv"); |
|||
echo $html; |
|||
exit(); |
|||
} |
|||
|
|||
public function summary(){ |
|||
global $_W,$_GPC; |
|||
$where = is_agent() ? "uniacid = '{$_W['uniacid']}' and aid = '{$_W['aid']}'" : "uniacid = '{$_W['uniacid']}'"; |
|||
|
|||
//饼状图1 |
|||
$usednum = pdo_fetchcolumn("SELECT COUNT(id) FROM " . tablename(PDO_NAME.'qrcode') . " WHERE {$where} and type = 0 and status = 2"); |
|||
$invalidnum = pdo_fetchcolumn("SELECT COUNT(id) FROM " . tablename(PDO_NAME.'qrcode') . " WHERE {$where} and type = 0 and status = 3"); |
|||
$notusenum = pdo_fetchcolumn("SELECT COUNT(id) FROM " . tablename(PDO_NAME.'qrcode') . " WHERE {$where} and type = 0 and status = 1"); |
|||
//饼状图2 |
|||
$remark_arr = pdo_fetchall('SELECT distinct remark FROM ' . tablename(PDO_NAME.'qrcode') . "WHERE {$where} and type = 0"); |
|||
$remark_arr = Util::i_array_column($remark_arr,'remark'); |
|||
|
|||
//柱状图 |
|||
foreach ($remark_arr as $key => $item) { |
|||
$arr2[] = pdo_fetchcolumn("SELECT COUNT(id) FROM " . tablename(PDO_NAME.'qrcode') . " WHERE {$where} and type = 0 and remark = '{$item}' "); |
|||
$arr3[] = pdo_fetchcolumn("SELECT COUNT(id) FROM " . tablename(PDO_NAME.'qrcode') . " WHERE {$where} and type = 0 and remark = '{$item}' and status = 2 "); |
|||
} |
|||
|
|||
//将数据转化为json格式 让插件读入 |
|||
$data = json_encode($remark_arr); |
|||
for ($i=0; $i < count($remark_arr); $i++) { |
|||
$data2[$i]['value'] = $arr2[$i]; |
|||
$data2[$i]['name'] = $remark_arr[$i]; |
|||
} |
|||
|
|||
$data2 = json_encode($data2); |
|||
$arr2 = json_encode($arr2); |
|||
$arr3 = json_encode($arr3); |
|||
include wl_template('sqrcode/qr-summary'); |
|||
} |
|||
|
|||
public function apply(){ |
|||
global $_W,$_GPC; |
|||
$pindex = max(1,$_GPC['page']); |
|||
$psize = 10; |
|||
$where = is_agent() ? array('uniacid'=>$_W['uniacid'], 'aid'=>$_W['aid']) : array('uniacid'=>$_W['uniacid']); |
|||
$list = pdo_getslice(PDO_NAME.'qrcode_apply', $where, array($pindex,$psize) , $total , array() , '' , array()); |
|||
$pager = wl_pagination($total,$pindex,$psize); |
|||
foreach ($list as $key => &$qrcode) { |
|||
if ($qrcode['type'] == 2) { |
|||
$qrcode['modellabel']="含参"; |
|||
} elseif($qrcode['type'] == 3) { |
|||
$qrcode['modellabel']="智能"; |
|||
}else{ |
|||
$qrcode['modellabel']="临时"; |
|||
} |
|||
$qrcode['agentname'] = pdo_getcolumn(PDO_NAME.'agentusers', array('uniacid'=>$_W['uniacid'],'id'=>$qrcode['aid']),'agentname'); |
|||
} |
|||
include wl_template('sqrcode/qr-apply'); |
|||
} |
|||
|
|||
public function applyno(){ |
|||
global $_W,$_GPC; |
|||
$id = intval($_GPC['id']); |
|||
if(empty($id)) wl_message('缺少重要参数'); |
|||
$re = pdo_update(PDO_NAME.'qrcode_apply',array('status'=>1),array('id'=>$id)); |
|||
if($re){ |
|||
wl_message('拒绝代理的申请成功'); |
|||
}else{ |
|||
wl_message('拒绝代理的申请失败'); |
|||
} |
|||
} |
|||
|
|||
public function applydel(){ |
|||
global $_W,$_GPC; |
|||
$id = intval($_GPC['id']); |
|||
if(empty($id)) wl_message('缺少重要参数'); |
|||
$re = pdo_delete(PDO_NAME.'qrcode_apply',array('id'=>$id)); |
|||
if($re){ |
|||
wl_message('删除申请成功'); |
|||
}else{ |
|||
wl_message('删除申请失败'); |
|||
} |
|||
} |
|||
|
|||
public function applypost(){ |
|||
global $_W,$_GPC; |
|||
if(checksubmit('submit')){ |
|||
$data = array('uniacid'=>$_W['uniacid'],'aid'=>$_W['aid'],'status'=>0,'type'=>intval($_GPC['qrc-model']),'num'=>intval($_GPC['qr_num']),'remark'=>trim($_GPC['remark']),'createtime'=>time()); |
|||
pdo_insert(PDO_NAME.'qrcode_apply',$data); |
|||
wl_message('申请成功,管理员等待审核!',web_url('storeqr/sqrcode/apply'),'success'); |
|||
} |
|||
include wl_template('sqrcode/qr-applypost'); |
|||
} |
|||
} |
|||
@ -0,0 +1,60 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="{php echo web_url('storeqr/sqrcode/apply');}">申请列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th style="width:80px;">状态</th> |
|||
<th style="width:80px;">代理名称</th> |
|||
<th style="width:80px;">场景备注</th> |
|||
<th style="width:60px;">二维码类型</th> |
|||
<th style="width:60px;">申请数量</th> |
|||
<th style="width:60px;">通过数量</th> |
|||
<th style="width:100px;">申请时间</th> |
|||
<th style="width:200px; text-align:center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $row} |
|||
<tr> |
|||
<td><span class="label label-{if $row['status'] == 1}danger{elseif $row['status'] == 0}warning{else}primary{/if}">{if $row['status'] == 1}未通过{elseif $row['status'] == 0}待审核{else}已生成{/if}</span></td> |
|||
<td>{$row['agentname']}</td> |
|||
<td>{$row['remark']}</td> |
|||
<td><span class="label label-{if $row['modellabel'] == '含参'}danger{elseif $row['modellabel'] == '智能'}warning{else}primary{/if}">{$row['modellabel']}</span></td> |
|||
<td>{$row['num']}</td> |
|||
<td> |
|||
{if !empty($row['pnum'])} |
|||
{$row['pnum']} |
|||
{else} |
|||
—— |
|||
{/if} |
|||
</td> |
|||
<td style="font-size:12px; color:#666;"> |
|||
{php echo date('Y-m-d <br /> H:i:s', $row[createtime]);} |
|||
</td> |
|||
<td class="text-center" style="text-align: center;"> |
|||
{if $row['status'] == 0} |
|||
<a class="btn btn-default" href="{php echo web_url('storeqr/sqrcode/applyno', array('id' => $row['id']));}" title="编辑">不通过</a> - |
|||
<a class="btn btn-primary" href="{php echo web_url('storeqr/sqrcode/post', array('id' => $row['id']));}" target="_blank" title="管理">去生成</a> - {/if} |
|||
<a class="btn btn-default" href="{php echo web_url('storeqr/sqrcode/applydel', array('id' => $row['id']));}" title="删除">删除</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,67 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="{php echo web_url('storeqr/sqrcode/applypost');}">申请二维码</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form class="form-horizontal form" action="" method="post" id="form1"> |
|||
<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">二维码类型</label> |
|||
<div class="col-sm-9"> |
|||
<!--<label for="radio_1" class="radio-inline"><input type="radio" name="qrc-model" id="radio_1" value="1" {if empty($row['model']) || $row['model'] == 1}checked="checked"{/if} /> 临时</label>--> |
|||
<label for="radio_0" class="radio-inline"><input type="radio" name="qrc-model" id="radio_0" value="2" checked="checked"> 含参</label> |
|||
<!--<label for="radio_0" class="radio-inline"><input type="radio" name="qrc-model" id="radio_0" value="3"> 智能</label>--> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">申请数量</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" placeholder="" name="qr_num" value="" /> |
|||
<span class="help-block">单次申请数量最大为1万个</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">场景备注</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" placeholder="" name="remark" value="" /> |
|||
<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="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"> |
|||
$("#form1").submit(function(){ |
|||
if($(":text[name='qr_num']").val() == '') { |
|||
tip.msgbox.err('请填写二维码生成数量!'); |
|||
return false; |
|||
} |
|||
if($(":text[name='remark']").val() == '') { |
|||
tip.msgbox.err('请填写场景备注!'); |
|||
return false; |
|||
} |
|||
if($(":text[name='qr_num']").val() <= 0) { |
|||
tip.msgbox.err('二维码生成数量必须大于0!'); |
|||
return false; |
|||
} |
|||
if($(":text[name='qr_num']").val() > 10000) { |
|||
tip.msgbox.err('二维码单次生成数量最大1万个!'); |
|||
return false; |
|||
} |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,50 @@ |
|||
{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="tab-pane active" id="tab_basic"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">快速入驻后商户状态</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inlineRadio1" name="status" value="1" {if intval($settings['status']) == 1}checked="checked"{/if}> |
|||
<label for="inlineRadio1">待入驻 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inlineRadio2" name="status" value="2" {if intval($settings['status']) == 2}checked="checked"{/if}> |
|||
<label for="inlineRadio2"> 入驻中 </label> |
|||
</div> |
|||
<span class="help-block">默认待入驻</span> |
|||
</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> |
|||
$(function () { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function (e) { |
|||
e.preventDefault();//阻止a链接的跳转行为 |
|||
$(this).tab('show');//显示当前选中的链接及关联的content |
|||
}) |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||