作者 郭鑫

改了好多东西

@@ -146,4 +146,38 @@ class IndexController extends CommonController @@ -146,4 +146,38 @@ class IndexController extends CommonController
146 $this->apiResponse('1','成功',$find); 146 $this->apiResponse('1','成功',$find);
147 } 147 }
148 148
  149 +
  150 + /**
  151 + * @title 首页二维码
  152 + * @description 接口说明
  153 + * @author 开发者
  154 + * @url /api/portal/Index/code
  155 + * @method POST
  156 + */
  157 + public function code(){
  158 + $where_video['status'] = 1;
  159 + $find = Db::name('Qrcode')->where($where_video)->order('create_time desc')->select()->toArray();
  160 + if($find){
  161 + foreach ($find as $k=>$v){
  162 + $find[$k]['path'] = cmf_get_image_url($v['path']);
  163 + }
  164 + }
  165 + $this->apiResponse('1','成功',$find);
  166 + }
  167 +
  168 +
  169 + /**
  170 + * @title 首页推广
  171 + * @description 接口说明
  172 + * @author 开发者
  173 + * @url /api/portal/Index/share
  174 + * @method POST
  175 + */
  176 + public function share(){
  177 + $where_push['status'] = 1;
  178 + $list = Db::name('Push')->where($where_push)->find();
  179 + $final['content'] = $list;
  180 + $this->apiResponse('1','成功',$final);
  181 + }
  182 +
149 } 183 }
@@ -651,7 +651,7 @@ class IntermediaryController extends CommonController @@ -651,7 +651,7 @@ class IntermediaryController extends CommonController
651 $agency = Db::name('Agency')->alias('a') 651 $agency = Db::name('Agency')->alias('a')
652 ->join('Member m','m.id = a.agency_id') 652 ->join('Member m','m.id = a.agency_id')
653 ->where($where_agency) 653 ->where($where_agency)
654 - ->field('a.*,m.referee_id,m.name,m.tel') 654 + ->field('a.*,m.referee_id,m.name,m.tel,m.id as amid,m.money as amoney')
655 ->find(); 655 ->find();
656 if($agency){ 656 if($agency){
657 $where_need['id'] = $agency['need_id']; 657 $where_need['id'] = $agency['need_id'];
@@ -664,49 +664,80 @@ class IntermediaryController extends CommonController @@ -664,49 +664,80 @@ class IntermediaryController extends CommonController
664 $add_agency = Db::name('Agency')->alias('a')->where($where_agency)->update($update_agency); 664 $add_agency = Db::name('Agency')->alias('a')->where($where_agency)->update($update_agency);
665 $update_need['status'] = 10; 665 $update_need['status'] = 10;
666 $update_need['update_time'] = time(); 666 $update_need['update_time'] = time();
  667 + $update_need['sure_time'] = time();
667 $add_need = Db::name('UserNeed')->where($where_need)->update($update_need); 668 $add_need = Db::name('UserNeed')->where($where_need)->update($update_need);
668 if($add_agency && $add_need){ 669 if($add_agency && $add_need){
669 -// 判断是否已返  
670 - $where_findstatus['token'] = $data['token'];  
671 - $get_money = Db::name('Member')->where($where_findstatus)->value('is_getmoney');  
672 - if($get_money == 0){  
673 - // 增加推荐人返利金额  
674 - if($agency['referee_id']){  
675 - $where_parent['id'] = $agency['referee_id'];  
676 - $parent = Db::name('Member')->where($where_parent)->find(); 670 +// 分别查询用户,中介推荐人
  671 + $where_m['id'] = $need['user_id'];
  672 + $refereeFirst = Db::name('Member')->where($where_m)->field('referee_id,money')->find();
  673 + $need_referee = $refereeFirst['referee_id'];
  674 +
  675 + $agency_referee = $agency['referee_id'];
677 // 诚意金金额获取 676 // 诚意金金额获取
678 - $where_reward['type'] = 5;  
679 - $where_reward['status'] = 1;  
680 - $reward = Db::name('Reward')->where($where_reward)->find();  
681 - if($parent){  
682 - $add_detail['user_id'] = $agency['referee_id'];  
683 - $add_detail['user_type'] = $parent['type'];  
684 - $add_detail['title'] = '推荐'.$agency['user_id'];  
685 - $add_detail['money'] = $reward['number'];  
686 - $add_detail['order_type'] = 7;  
687 - $add_detail['type'] = 1;  
688 - $add_detail['status'] = 1;  
689 - $add_detail['create_time'] = time();  
690 - $add_detail['update_time'] = time();  
691 - $add_res = Db::name('MoneyDetail')->insertGetId($add_detail);  
692 - if($add_res){  
693 - $where_addParent['id'] = $agency['referee_id'];  
694 - $add_parent = Db::name('Member')->where($where_addParent)->setInc('money',$reward['number']);  
695 - if(!$add_parent){  
696 - Db::rollback();  
697 - $this->apiResponse('0','确认失败');  
698 - }  
699 - }else{ 677 + $where_reward['type'] = 5;
  678 + $where_reward['status'] = 1;
  679 + $reward = Db::name('Reward')->where($where_reward)->find();
  680 +// 查询推荐人是否已获得奖励
  681 +// 需求用户
  682 + $where_nref['id'] = $need_referee;
  683 + $is_needReferee = Db::name('Member')->where($where_nref)->field('is_getmoney')->find();
  684 + if($is_needReferee['is_getmoney'] == 0){
  685 + $add_detail['user_id'] = $need_referee;
  686 + $add_detail['title'] = '推荐'.$need['amid'];;
  687 + $add_detail['money'] = $reward['number'];
  688 + $add_detail['order_type'] = 7;
  689 + $add_detail['type'] = 1;
  690 + $add_detail['status'] = 1;
  691 + $add_detail['create_time'] = time();
  692 + $add_detail['update_time'] = time();
  693 + $add_res = Db::name('MoneyDetail')->insertGetId($add_detail);
  694 + if($add_res) {
  695 + $where_addParent['id'] = $need_referee;
  696 + $needReferee_add['money'] = $reward['number']+$need_referee['money'];
  697 + $needReferee_add['getmoney_id'] = $need['user_id'];
  698 + $add_parent = Db::name('Member')->where($where_addParent)->update($needReferee_add);
  699 + if (!$add_parent) {
700 Db::rollback(); 700 Db::rollback();
701 - $this->apiResponse('0','确认失败'); 701 + $this->apiResponse('0', '确认失败');
702 } 702 }
703 }else{ 703 }else{
704 Db::rollback(); 704 Db::rollback();
705 - $this->apiResponse('0','推荐人错误'); 705 + $this->apiResponse('0','确认失败');
706 } 706 }
707 - }  
708 } 707 }
709 708
  709 +
  710 +
  711 +
  712 +// 中介用户
  713 + $where_aref['id'] = $agency_referee;
  714 + $is_agencyReferee = Db::name('Member')->where($where_aref)->field('is_getmoney')->find();
  715 + if($is_agencyReferee['is_getmoney'] == 0){
  716 + $add_detailNext['user_id'] = $agency_referee;
  717 + $add_detailNext['title'] = '推荐'.$agency['amid'];;
  718 + $add_detailNext['money'] = $reward['number'];
  719 + $add_detailNext['order_type'] = 7;
  720 + $add_detailNext['type'] = 1;
  721 + $add_detailNext['status'] = 1;
  722 + $add_detailNext['create_time'] = time();
  723 + $add_detailNext['update_time'] = time();
  724 + $add_resNext = Db::name('MoneyDetail')->insertGetId($add_detailNext);
  725 + if($add_resNext) {
  726 + $where_addParentNext['id'] = $agency_referee;
  727 + $needReferee_addNext['money'] = $reward['number']+$agency['amoney'];
  728 + $needReferee_addNext['getmoney_id'] = $agency['amid'];
  729 + $add_parentNext = Db::name('Member')->where($needReferee_addNext)->update($needReferee_addNext);
  730 + if (!$add_parentNext) {
  731 + Db::rollback();
  732 + $this->apiResponse('0', '确认失败');
  733 + }
  734 + }else{
  735 + Db::rollback();
  736 + $this->apiResponse('0','确认失败');
  737 + }
  738 + }
  739 +
  740 +
710 // 退回需求用户保证金 741 // 退回需求用户保证金
711 $need['user_type'] = Db::name('Member')->where(['id'=>$need['user_id']])->value('type'); 742 $need['user_type'] = Db::name('Member')->where(['id'=>$need['user_id']])->value('type');
712 $thirdsend = controller('Thirdsend','controller'); 743 $thirdsend = controller('Thirdsend','controller');
@@ -139,6 +139,9 @@ class ThirdsendController extends HomeBaseController @@ -139,6 +139,9 @@ class ThirdsendController extends HomeBaseController
139 if($time < $userNeedList['pay_time']+1800){ 139 if($time < $userNeedList['pay_time']+1800){
140 $this->apiResponse('0','未到发布时间'); 140 $this->apiResponse('0','未到发布时间');
141 }else{ 141 }else{
  142 +// 查询父级
  143 +
  144 +
142 $where_save['id'] = $data['need_id']; 145 $where_save['id'] = $data['need_id'];
143 $save['status'] = 3; 146 $save['status'] = 3;
144 $save['update_time'] = time(); 147 $save['update_time'] = time();
@@ -1061,4 +1064,36 @@ class ThirdsendController extends HomeBaseController @@ -1061,4 +1064,36 @@ class ThirdsendController extends HomeBaseController
1061 $response = SmsDemo::sendBatchSms($tel,$code,$modelVal,$json_autograph); 1064 $response = SmsDemo::sendBatchSms($tel,$code,$modelVal,$json_autograph);
1062 return $response; 1065 return $response;
1063 } 1066 }
  1067 +
  1068 + /**
  1069 + * 人机验证接口
  1070 + */
  1071 + public function luosimao() {
  1072 + $data = $this->request->param();
  1073 + $return = $this->curl('129be932c145c773f436eeb263465339',$data['response']);
  1074 + $this->apiResponse(1,'成功',$return);
  1075 + }
  1076 +
  1077 + //人机验证提交curl
  1078 + public function curl($api_key,$response) {
  1079 + $ch = curl_init();
  1080 + curl_setopt($ch, CURLOPT_URL, "https://captcha.luosimao.com/api/site_verify");
  1081 +
  1082 + curl_setopt($ch, CURLOPT_HTTP_VERSION , CURL_HTTP_VERSION_1_0 );
  1083 + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 8);
  1084 + curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  1085 + curl_setopt($ch, CURLOPT_HEADER, FALSE);
  1086 +
  1087 + curl_setopt($ch, CURLOPT_HTTPAUTH , CURLAUTH_BASIC);
  1088 + curl_setopt($ch, CURLOPT_USERPWD , 'api:key-'.$api_key);
  1089 +
  1090 + curl_setopt($ch, CURLOPT_POST, TRUE);
  1091 + curl_setopt($ch, CURLOPT_POSTFIELDS, array('api_key' => $api_key,'response' => $response));
  1092 +
  1093 + $res = curl_exec( $ch );
  1094 + curl_close( $ch );
  1095 +//$res = curl_error( $ch );
  1096 +// var_dump($res);
  1097 + return $res;
  1098 + }
1064 } 1099 }
@@ -272,7 +272,8 @@ class UserController extends CommonController @@ -272,7 +272,8 @@ class UserController extends CommonController
272 } 272 }
273 } 273 }
274 // end 274 // end
275 - $url = $_SERVER['SERVER_ADDR'].'/public/api/portal/Index/index?uid='.$uid; 275 +// $url = $_SERVER['SERVER_ADDR'].'/public/api/portal/Index/index?uid='.$uid;
  276 + $url = 'http://bifangjia.cn?uid='.$uid;
276 $get_url = $this->shot($url); 277 $get_url = $this->shot($url);
277 $update_shot['link'] = $get_url; 278 $update_shot['link'] = $get_url;
278 $update_shot['id'] = $uid; 279 $update_shot['id'] = $uid;
@@ -841,7 +842,7 @@ class UserController extends CommonController @@ -841,7 +842,7 @@ class UserController extends CommonController
841 public function myleft($token){ 842 public function myleft($token){
842 $where_member['token'] = $token; 843 $where_member['token'] = $token;
843 $where_member['status'] = 1; 844 $where_member['status'] = 1;
844 - $member = Db::name('Member')->where($where_member)->field('tel,id,name,referee_tel,money,get_money')->find(); 845 + $member = Db::name('Member')->where($where_member)->field('tel,id,name,referee_tel,money,get_money,link,getmoney_id')->find();
845 if(!$member){ 846 if(!$member){
846 $this->apiResponse('0','用户信息错误'); 847 $this->apiResponse('0','用户信息错误');
847 } 848 }
@@ -1446,7 +1447,66 @@ class UserController extends CommonController @@ -1446,7 +1447,66 @@ class UserController extends CommonController
1446 } 1447 }
1447 1448
1448 1449
  1450 + /**
  1451 + * @title 我的推广(sure)
  1452 + * @description 接口说明
  1453 + * @author 开发者
  1454 + * @url /api/portal/User/share
  1455 + * @method POST
  1456 + * @param name:token type:int require:1 default: other: desc:token
  1457 + */
  1458 + public function share(){
  1459 + $data = $this->request->param();
  1460 + $final = array();
  1461 + $my = $this->myleft($data['token']);
  1462 + $where_re['referee'] = $my['id'];
  1463 + $where_re['status'] = 1;
  1464 + $share = Db::name('RewardLog')->where($where_re)->select();
  1465 +// 查询推荐人是当前用户
  1466 + $where_parent['referee_id'] = $my['id'];
  1467 + $where_parent['status'] = array('neq',9);
  1468 + $parent_list = Db::name('Member')->where($where_parent)->field('id,tel')->select()->toArray();
  1469 +
  1470 + if($share){
  1471 + foreach ($parent_list as $sharek=>$sharev){
  1472 + // 是否发布需求
  1473 + $where_need['status'] = array('neq','1,9');
  1474 + $where_need['user_id'] = $sharev['id'];
  1475 + $is = Db::name('UserNeed')->where($where_need)->find();
  1476 + if($is){
  1477 + $parent_list[$sharek]['is_need'] = 1;
  1478 + $parent_list[$sharek]['sure_time'] = date('Y-m-d H:i:s',$is['sure_time']);
  1479 + }else{
  1480 + $parent_list[$sharek]['is_need'] = 0;
  1481 + $parent_list[$sharek]['sure_time'] = 0;
  1482 + }
  1483 +// 奖励金是否获取
  1484 + if($my['getmoney_id'] == $sharev['id']){
  1485 + $parent_list[$sharek]['is_getmoney'] = 1;
  1486 + }else{
  1487 + $parent_list[$sharek]['is_getmoney'] = 0;
  1488 + }
  1489 + }
  1490 + }
1449 1491
  1492 + $final['list'] = $parent_list;
  1493 +// $final['share'] = $share;
  1494 + $final['user'] = $my;
  1495 + $where_share['status'] = 1;
  1496 + $share = Db::name('Share')->where($where_share)->select();
  1497 + if($share){
  1498 + foreach ($share as $k=>$v){
  1499 + if($v['type'] == 1){
  1500 + $final['content'] = $v;
  1501 + }else if($v['type'] == 2){
  1502 + $final['box'] = $v;
  1503 + }else if($v['type'] == 3){
  1504 + $final['pic'] = cmf_get_image_url($v['content']);
  1505 + }
  1506 + }
  1507 + }
  1508 + $this->apiResponse('1','成功',$final);
  1509 + }
1450 1510
1451 1511
1452 } 1512 }
@@ -303,54 +303,7 @@ class UserneedController extends CommonController @@ -303,54 +303,7 @@ class UserneedController extends CommonController
303 303
304 304
305 305
306 -// 发布需求支付  
307 - public function needPay(Request $request){  
308 -// 添加订单  
309 - Db::startTrans();  
310 - $data = $request->param();  
311 - if(!$data['need_id']){  
312 - $this->apiResponse('0','需求不能为空');  
313 - }  
314 -// 查询金额  
315 - $where_need['id'] = $data['need_id'];  
316 - $where_need['status'] = 1;  
317 - $should_pay = Db::name('UserNeed')->where($where_need)->field('pay_money')->find();  
318 - if(!$should_pay){  
319 - $this->apiResponse('0','需求错误');  
320 - }else{  
321 - if(!$should_pay['pay_money']){  
322 - $this->apiResponse('0','诚意金金额有误');  
323 - }  
324 - }  
325 -// 拼字度  
326 - $add['need_id'] = $data['need_id'];  
327 - $add['money'] = $should_pay['pay_money'];  
328 - $add['name'] = '诚意金缴纳';  
329 - $add['type'] = 1;  
330 - $add['is_get'] = 2;  
331 - $add['status'] = 1;  
332 -// 加入数据库  
333 - $model = new OrderModel();  
334 - $save = $model->save($add);  
335 - if($save){  
336 - Db::commit();  
337 - }else{  
338 - Db::rollback();  
339 - }  
340 -// 支付(未完)  
341 - echo "<pre/>";  
342 - print_r('3333');  
343 - die;  
344 -// 更改订单状态  
345 -// 成功  
346 - $update['pay_time'] = time();  
347 - $update['status'] = time();  
348 - $update = $model->isUpdate(true)->allowField(true)->save($update);  
349 - if($update){  
350 - $this->apiResponse('1','支付成功');  
351 - }  
352 306
353 - }  
354 307
355 308
356 309
@@ -184,4 +184,43 @@ class CooperationController extends AdminBaseController @@ -184,4 +184,43 @@ class CooperationController extends AdminBaseController
184 } 184 }
185 185
186 186
  187 +// 网站配置
  188 + public function conf(){
  189 + $data = $this->request->param();
  190 + if($this->request->post()){
  191 +
  192 + }
  193 + $this->assign('list',array());
  194 + return $this->fetch();
  195 + }
  196 +
  197 + // 推广内容
  198 + public function push(){
  199 + $data = $this->request->param();
  200 + if($this->request->post()){
  201 + $add['title'] = $data['title'];
  202 + $add['content'] = $data['content'];
  203 + $add['update_time'] = time();
  204 + if(empty($data['id'])){
  205 + $add['create_time'] = time();
  206 + $res = Db::name('Push')->insertGetId($add);
  207 + }else{
  208 + $where_id['id'] = $data['id'];
  209 + $res = Db::name('Push')->where($where_id)->update($add);
  210 + }
  211 + if($res){
  212 + $this->success('修改成功');
  213 + }else{
  214 + $this->error('修改失败');
  215 + }
  216 +
  217 +
  218 + }else{
  219 + $where_push['status'] = 1;
  220 + $list = Db::name('Push')->where($where_push)->find();
  221 + }
  222 + $this->assign('list',$list);
  223 + return $this->fetch();
  224 + }
  225 +
187 } 226 }
@@ -136,4 +136,67 @@ class NewController extends AdminBaseController @@ -136,4 +136,67 @@ class NewController extends AdminBaseController
136 } 136 }
137 } 137 }
138 138
  139 + public function code(Request $request){
  140 + $where_coo['status'] = 1;
  141 + if($request->post()){
  142 + $search = $request->post();
  143 + if($search['start_time']){
  144 + $start = strtotime($search['start_time']);
  145 + if($search['end_time']){
  146 + $end = strtotime($search['end_time']);
  147 + }else{
  148 + $end = time();
  149 + }
  150 + $where_coo['update_time'] = array('between',"$start,$end");
  151 + $this->assign('start_time',date('Y-m-d H:i',$start));
  152 + $this->assign('end_time',date('Y-m-d H:i',$end));
  153 + }
  154 + }
  155 + $coo_list = Db::name('Qrcode')->where($where_coo)->field('path as pic,id,create_time,type,status,update_time')->order('create_time desc')
  156 + ->select()->toArray();
  157 +// $page = $coo_list->render();
  158 +// $this->assign('page',$page);
  159 + $this->assign('list',$coo_list);
  160 + return $this->fetch();
  161 + }
  162 +
  163 + public function addcode(Request $request)
  164 + {
  165 + if($request->post()){
  166 +// 添加数据
  167 + $data = $request->post();
  168 + if(empty($data['pic'])){
  169 + $this->error('图片错误');
  170 + }
  171 + if(empty($data['type'])){
  172 + $this->error('类型不能为空');
  173 + }
  174 + $add['path'] = $data['pic'];
  175 +// $add['score'] = $data['score'];
  176 + $add['type'] = $data['type'];
  177 + $add['update_time'] = time();
  178 + if($request->Post('id')){
  179 +// 修改
  180 + $where_add['id'] = $request->Post('id');
  181 + $final = Db::name('Qrcode')->where($where_add)->update($add);
  182 + }else{
  183 +// 添加
  184 + $add['create_time'] = time();
  185 + $final = Db::name('Qrcode')->insertGetId($add);
  186 + }
  187 + if($final){
  188 + $this->success('成功',url('New/code'));
  189 + }else{
  190 + $this->error('失败');
  191 + }
  192 + }else{
  193 + $where_find['id'] = $request->param('id');
  194 + $list = Db::name('Qrcode')->where($where_find)->field('path as pic,id,create_time,type,status,update_time')->find();
  195 +// $list['content'] = htmlspecialchars_decode($list['content']);
  196 + $this->assign('list',$list);
  197 + return $this->fetch();
  198 + }
  199 + }
  200 +
  201 +
139 } 202 }
@@ -159,10 +159,13 @@ return array ( @@ -159,10 +159,13 @@ return array (
159 'PORTAL_CODE_DEFAULT' => '短信验证码管理', 159 'PORTAL_CODE_DEFAULT' => '短信验证码管理',
160 'PORTAL_CODE_INDEX' => '短信验证码列表', 160 'PORTAL_CODE_INDEX' => '短信验证码列表',
161 'PORTAL_COMPLAINT_INDEX' => '投诉管理', 161 'PORTAL_COMPLAINT_INDEX' => '投诉管理',
  162 + 'PORTAL_COOPERATION_CONF' => '网站配置',
162 'PORTAL_COOPERATION_DEFAULT' => '首页内容管理', 163 'PORTAL_COOPERATION_DEFAULT' => '首页内容管理',
163 'PORTAL_COOPERATION_INDEX' => '合作企业列表', 164 'PORTAL_COOPERATION_INDEX' => '合作企业列表',
  165 + 'PORTAL_COOPERATION_PUSH' => '推广内容',
164 'PORTAL_COOPERATION_VIDEO' => '两分钟视频', 166 'PORTAL_COOPERATION_VIDEO' => '两分钟视频',
165 'PORTAL_NEED_INDEX' => '需求管理', 167 'PORTAL_NEED_INDEX' => '需求管理',
  168 + 'PORTAL_NEW_CODE' => '二维码',
166 'PORTAL_NEW_INDEX' => '最新成交公布', 169 'PORTAL_NEW_INDEX' => '最新成交公布',
167 'PORTAL_PROCESS_INDEX' => '交易流程', 170 'PORTAL_PROCESS_INDEX' => '交易流程',
168 'PORTAL_REFUND_INDEX' => '退款管理', 171 'PORTAL_REFUND_INDEX' => '退款管理',
  1 +<include file="public@header"/>
  2 +<style type="text/css">
  3 + .pic-list li {
  4 + margin-bottom: 5px;
  5 + }
  6 +</style>
  7 +</head>
  8 +<body>
  9 +<div class="wrap js-check-wrap">
  10 + <ul class="nav nav-tabs">
  11 + <li><a href="">网站配置</a></li>
  12 + <!--<li class="active"><a href="{:url('Reward/add')}">添加信誉奖励</a></li>-->
  13 + </ul>
  14 + <form action="{:url('Reward/add')}" method="post" class="form-horizontal js-ajax-form margin-top-20" enctype="multipart/form-data" >
  15 + <div class="row">
  16 + <div class="col-md-9">
  17 + <table class="table table-bordered">
  18 + <input class="form-control" type="hidden" name="id"
  19 + value=""/>
  20 +
  21 + <tr>
  22 + <th width="10%">咨询电话</th>
  23 + <td><input class="form-control" type="text" name="content"
  24 + value="" placeholder="请输入咨询电话"/>
  25 +
  26 + </td>
  27 + </tr>
  28 + <tr>
  29 + <th width="10%">微信公众号</th>
  30 + <td><input class="form-control" type="text" name="content"
  31 + value="" placeholder="请输入微信公众号"/>
  32 +
  33 + </td>
  34 + </tr>
  35 + <tr>
  36 + <th width="10%">微信客服</th>
  37 + <td><input class="form-control" type="text" name="content"
  38 + value="" placeholder="请输入微信客服"/>
  39 +
  40 + </td>
  41 + </tr>
  42 + <tr>
  43 + <th width="10%">分享</th>
  44 + <td><input class="form-control" type="text" name="content"
  45 + value="" placeholder="请输入分享"/>
  46 +
  47 + </td>
  48 + </tr>
  49 + <tr>
  50 + <th width="10%">电话</th>
  51 + <td><input class="form-control" type="text" name="content"
  52 + value="" placeholder="请输入电话"/>
  53 +
  54 + </td>
  55 + </tr>
  56 + </table>
  57 + <div class="form-group">
  58 + <div class="col-sm-offset-2 col-sm-10">
  59 + <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
  60 + <a class="btn btn-default" href="{:url('Reward/index')}">{:lang('BACK')}</a>
  61 + </div>
  62 + </div>
  63 + </div>
  64 + </div>
  65 + </form>
  66 +</div>
  67 +<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
  68 +<script type="text/javascript">
  69 + //编辑器路径定义
  70 + var editorURL = GV.WEB_ROOT;
  71 +</script>
  72 +<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
  73 +<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
  74 +<script type="text/javascript">
  75 + $(function () {
  76 +
  77 + editorcontent = new baidu.editor.ui.Editor();
  78 + editorcontent.render('content');
  79 + try {
  80 + editorcontent.sync();
  81 + } catch (err) {
  82 + }
  83 +
  84 + $('.btn-cancel-thumbnail').click(function () {
  85 + $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
  86 + $('#thumbnail').val('');
  87 + });
  88 +
  89 + });
  90 +
  91 +</script>
  92 +</body>
  93 +</html>
  1 +<include file="public@header"/>
  2 +<style type="text/css">
  3 + .pic-list li {
  4 + margin-bottom: 5px;
  5 + }
  6 +</style>
  7 +<script type="text/html" id="photos-item-tpl">
  8 + <li id="saved-image{id}">
  9 + <input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">
  10 + <input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"
  11 + style="width: 200px;" title="图片名称">
  12 + <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
  13 + onclick="imagePreviewDialog(this.src);">
  14 + <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
  15 + <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
  16 + </li>
  17 +</script>
  18 +<script type="text/html" id="files-item-tpl">
  19 + <li id="saved-file{id}">
  20 + <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}">
  21 + <input class="form-control" id="file-{id}-name" type="text" name="file_names[]" value="{name}"
  22 + style="width: 200px;" title="文件名称">
  23 + <a id="file-{id}-preview" href="{preview_url}" target="_blank">下载</a>
  24 + <a href="javascript:uploadOne('图片上传','#file-{id}','file');">替换</a>
  25 + <a href="javascript:(function(){$('#saved-file{id}').remove();})();">移除</a>
  26 + </li>
  27 +</script>
  28 +</head>
  29 +<body>
  30 +<div class="wrap js-check-wrap">
  31 + <ul class="nav nav-tabs">
  32 + <li class="active"><a href="{:url('Cooperation/push')}">推广内容</a></li>
  33 + </ul>
  34 + <form action="{:url('Cooperation/push')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
  35 + <div class="row">
  36 + <div class="col-md-9">
  37 + <table class="table table-bordered">
  38 + <input class="form-control" type="hidden" name="id"
  39 + value="{$list['id']}"/>
  40 +
  41 + <tr>
  42 + <th>标题<span class="form-required">*</span></th>
  43 + <td>
  44 + <input class="form-control" type="text" name="title"
  45 + id="title" required value="{$list['title']}" placeholder="请输入标题"/>
  46 + </td>
  47 + </tr>
  48 +
  49 + <tr>
  50 + <th></th>
  51 + <td>
  52 + <script type="text/plain" id="content" name="content" ><php>echo htmlspecialchars_decode($list['content']);</php></script>
  53 + </td>
  54 + </tr>
  55 +
  56 + </table>
  57 + <div class="form-group">
  58 + <div class="col-sm-offset-2 col-sm-10">
  59 + <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
  60 + <a class="btn btn-default" href="{:url('Cooperation/push')}">{:lang('BACK')}</a>
  61 + </div>
  62 + </div>
  63 + </div>
  64 +
  65 + </div>
  66 + </form>
  67 +</div>
  68 +<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
  69 +<script type="text/javascript">
  70 + //编辑器路径定义
  71 + var editorURL = GV.WEB_ROOT;
  72 +</script>
  73 +<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
  74 +<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
  75 +<script type="text/javascript">
  76 + $(function () {
  77 + editorcontent = new baidu.editor.ui.Editor();
  78 + editorcontent.render('content');
  79 + try {
  80 + editorcontent.sync();
  81 + } catch (err) {
  82 + }
  83 + $('.btn-cancel-thumbnail').click(function () {
  84 + $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
  85 + $('#thumbnail').val("{$list['content']}");
  86 + });
  87 + });
  88 +
  89 +</script>
  90 +</body>
  91 +</html>
  1 +<include file="public@header"/>
  2 +<style type="text/css">
  3 + .pic-list li {
  4 + margin-bottom: 5px;
  5 + }
  6 +</style>
  7 +</head>
  8 +<body>
  9 +<div class="wrap js-check-wrap">
  10 + <ul class="nav nav-tabs">
  11 + <li><a href="{:url('New/code')}">轮播图列表</a></li>
  12 + <li class="active"><a href="{:url('New/addcode')}">添加轮播图</a></li>
  13 + </ul>
  14 + <form action="{:url('New/addcode')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
  15 + <div class="row">
  16 + <div class="col-md-9">
  17 + <table class="table table-bordered">
  18 + <input class="form-control" type="hidden" name="id"
  19 + value="{$list['id']}"/>
  20 + <tr>
  21 + <th width="10%">类型</th>
  22 + <td>
  23 + <select name="type" style="border: 1px solid #dce4ec; width: 15%;">
  24 + <option name="type" value="1" <eq name="list.type" value="1">selected</eq>>APP二维码</option>
  25 + <option name="type" value="2" <eq name="list.type" value="2">selected</eq>>公众号二维码</option>
  26 + <option name="type" value="3" <eq name="list.type" value="3">selected</eq>>客服二维码</option>
  27 + </select>
  28 + </td>
  29 + </tr>
  30 + <tr>
  31 + <th>轮播图<span class="form-required">*</span></th>
  32 + <td>
  33 + <div style="text-align: center;">
  34 + <input type="hidden" name="pic" id="thumbnail" value="{$list.pic}" >
  35 + <a href="javascript:uploadOneImage('图片上传','#thumbnail');">
  36 + <empty name="list['pic']">
  37 + <img src="__TMPL__/public/assets/images/default-thumbnail.png"
  38 + id="thumbnail-preview"
  39 + width="135" style="cursor: pointer"/>
  40 + <else/>
  41 + <img src="{:cmf_get_image_preview_url($list.pic)}"
  42 + id="thumbnail-preview"
  43 + width="135" style="cursor: pointer"/>
  44 + </empty>
  45 + </a>
  46 + <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
  47 + </div>
  48 + </td>
  49 + </tr>
  50 +
  51 + </table>
  52 + <div class="form-group">
  53 + <div class="col-sm-offset-2 col-sm-10">
  54 + <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
  55 + <a class="btn btn-default" href="{:url('New/code')}">{:lang('BACK')}</a>
  56 + </div>
  57 + </div>
  58 + </div>
  59 + </div>
  60 + </form>
  61 +</div>
  62 +<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
  63 +<script type="text/javascript">
  64 + //编辑器路径定义
  65 + var editorURL = GV.WEB_ROOT;
  66 +</script>
  67 +<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
  68 +<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
  69 +<script type="text/javascript">
  70 + $(function () {
  71 +
  72 + // editorcontent = new baidu.editor.ui.Editor();
  73 + // editorcontent.render('content');
  74 + // try {
  75 + // editorcontent.sync();
  76 + // } catch (err) {
  77 + // }
  78 +
  79 + $('.btn-cancel-thumbnail').click(function () {
  80 + $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
  81 + $('#thumbnail').val('');
  82 + });
  83 +
  84 + });
  85 +
  86 + // function doSelectCategory() {
  87 + // var selectedCategoriesId = $('#js-categories-id-input').val();
  88 + // openIframeLayer("{:url('AdminCategory/select')}?ids=" + selectedCategoriesId, '请选择分类', {
  89 + // area: ['700px', '400px'],
  90 + // btn: ['确定', '取消'],
  91 + // yes: function (index, layero) {
  92 + // //do something
  93 + //
  94 + // var iframeWin = window[layero.find('iframe')[0]['name']];
  95 + // var selectedCategories = iframeWin.confirm();
  96 + // if (selectedCategories.selectedCategoriesId.length == 0) {
  97 + // layer.msg('请选择分类');
  98 + // return;
  99 + // }
  100 + // $('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));
  101 + // $('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(' '));
  102 + // //console.log(layer.getFrameIndex(index));
  103 + // layer.close(index); //如果设定了yes回调,需进行手工关闭
  104 + // }
  105 + // });
  106 + // }
  107 +</script>
  108 +</body>
  109 +</html>
  1 +<include file="public@header"/>
  2 +</head>
  3 +<body>
  4 +<div class="wrap js-check-wrap">
  5 + <ul class="nav nav-tabs">
  6 + <li class="active"><a href="javascript:;">轮播图列表</a></li>
  7 + <li><a href="{:url('New/addcode')}">添加轮播图123</a></li>
  8 + </ul>
  9 + <form class="well form-inline margin-top-20" method="post" action="{:url('Banner/index')}">
  10 + <!--分类:-->
  11 + <!--<select class="form-control" name="category" style="width: 140px;">-->
  12 + <!--<option value='0'>全部</option>-->
  13 + <!--{$category_tree|default=''}-->
  14 + <!--</select> &nbsp;&nbsp;-->
  15 + 时间:
  16 + <input type="text" class="form-control js-bootstrap-datetime" name="start_time"
  17 + value="{$start_time|default=''}"
  18 + style="width: 140px;" autocomplete="off">-
  19 + <input type="text" class="form-control js-bootstrap-datetime" name="end_time"
  20 + value="{$end_time|default=''}"
  21 + style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
  22 + <!--关键字:-->
  23 + <!--<input type="text" class="form-control" name="keyword" style="width: 200px;"-->
  24 + <!--value="{$keyword|default=''}" placeholder="请输入企业名称">-->
  25 + <input type="submit" class="btn btn-primary" value="搜索"/>
  26 + <a class="btn btn-danger" href="{:url('Banner/index')}">清空</a>
  27 + </form>
  28 + <form class="js-ajax-form" action="" method="post">
  29 + <div class="table-actions">
  30 + <!--<notempty name="category">-->
  31 + <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
  32 + <!--data-action="{:url('AdminArticle/listOrder')}">{:lang('SORT')}-->
  33 + <!--</button>-->
  34 + <!--</notempty>-->
  35 + <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
  36 + <!--data-action="{:url('AdminArticle/publish',array('yes'=>1))}" data-subcheck="true">发布-->
  37 + <!--</button>-->
  38 + <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
  39 + <!--data-action="{:url('AdminArticle/publish',array('no'=>1))}" data-subcheck="true">取消发布-->
  40 + <!--</button>-->
  41 + <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
  42 + <!--data-action="{:url('AdminArticle/top',array('yes'=>1))}" data-subcheck="true">置顶-->
  43 + <!--</button>-->
  44 + <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
  45 + <!--data-action="{:url('AdminArticle/top',array('no'=>1))}" data-subcheck="true">取消置顶-->
  46 + <!--</button>-->
  47 + <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
  48 + <!--data-action="{:url('AdminArticle/recommend',array('yes'=>1))}" data-subcheck="true">推荐-->
  49 + <!--</button>-->
  50 + <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
  51 + <!--data-action="{:url('AdminArticle/recommend',array('no'=>1))}" data-subcheck="true">取消推荐-->
  52 + <!--</button>-->
  53 + <!--
  54 + <notempty name="category">
  55 + <button class="btn btn-primary btn-sm js-articles-move" type="button">批量移动</button>
  56 + </notempty>
  57 + <button class="btn btn-primary btn-sm js-articles-copy" type="button">批量复制</button>
  58 + -->
  59 + <!--<button class="btn btn-danger btn-sm js-ajax-submit" type="submit"-->
  60 + <!--data-action="{:url('Banner/del')}" data-subcheck="true" data-msg="您确定删除吗?">-->
  61 + <!--&lt;!&ndash;{:lang('DELETE')}&ndash;&gt;-->
  62 + <!--</button>-->
  63 + </div>
  64 + <table class="table table-hover table-bordered table-list">
  65 + <thead>
  66 + <tr>
  67 + <th width="15">
  68 + <label>
  69 + <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
  70 + </label>
  71 + </th>
  72 + <notempty name="category">
  73 + <th width="50">{:lang('SORT')}</th>
  74 + </notempty>
  75 + <th width="50">ID</th>
  76 + <th>轮播图</th>
  77 + <th>类型</th>
  78 + <th width="130">更新时间</th>
  79 + <th width="130">发布时间</th>
  80 + <!--<th width="70">状态</th>-->
  81 + <th width="90">操作</th>
  82 + </tr>
  83 + </thead>
  84 + <foreach name="list" item="list">
  85 + <tr>
  86 + <td>
  87 + <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
  88 + value="{$list.id}" title="ID:{$list.id}">
  89 + </td>
  90 +
  91 + <td>{$list.id}</td>
  92 + <td>
  93 + <eq name="list.type" value="1">
  94 + APP二维码
  95 + </eq>
  96 + <eq name="list.type" value="2">
  97 + 公众号二维码
  98 + </eq>
  99 + <eq name="list.type" value="3">
  100 + 客服二维码
  101 + </eq>
  102 + </td>
  103 + <td>
  104 + <img src="{:cmf_get_image_preview_url($list.pic)}" style="height: 100px;">
  105 + <!--<a href="javascript:parent.imagePreviewDialog('{:cmf_get_image_preview_url($list.pic)}');">-->
  106 + <!--<i class="fa fa-photo fa-fw"></i>-->
  107 + <!--</a>-->
  108 + </td>
  109 + <td>
  110 + {:date('Y-m-d H:i',$list['update_time'])}
  111 + </td>
  112 + <td>
  113 + {:date('Y-m-d H:i',$list['create_time'])}
  114 + <!--<empty name="vo.published_time">-->
  115 + <!--未发布-->
  116 + <!--<else/>-->
  117 + <!--{:date('Y-m-d H:i',$list['published_time'])}-->
  118 + <!--</empty>-->
  119 +
  120 + </td>
  121 +
  122 + <td>
  123 + <a href="{:url('New/addcode',array('id'=>$list['id']))}">{:lang('EDIT')}</a>
  124 + <!--<a href="{:url('Banner/del',array('id'=>$list['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>-->
  125 + </td>
  126 + </tr>
  127 + </foreach>
  128 +
  129 + </table>
  130 +
  131 + <ul class="pagination">{$page|default=''}</ul>
  132 + </form>
  133 +</div>
  134 +<script src="__STATIC__/js/admin.js"></script>
  135 +<script>
  136 +
  137 + function reloadPage(win) {
  138 + win.location.reload();
  139 + }
  140 +
  141 + $(function () {
  142 + setCookie("refersh_time", 0);
  143 + Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
  144 + //批量复制
  145 + $('.js-articles-copy').click(function (e) {
  146 + var ids = [];
  147 + $("input[name='ids[]']").each(function () {
  148 + if ($(this).is(':checked')) {
  149 + ids.push($(this).val());
  150 + }
  151 + });
  152 +
  153 + if (ids.length == 0) {
  154 + art.dialog.through({
  155 + id: 'error',
  156 + icon: 'error',
  157 + content: '您没有勾选信息,无法进行操作!',
  158 + cancelVal: '关闭',
  159 + cancel: true
  160 + });
  161 + return false;
  162 + }
  163 +
  164 + ids = ids.join(',');
  165 + art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=copy&ids=" + ids, {
  166 + title: "批量复制",
  167 + width: "300px"
  168 + });
  169 + });
  170 + //批量移动
  171 + $('.js-articles-move').click(function (e) {
  172 + var ids = [];
  173 + $("input[name='ids[]']").each(function () {
  174 + if ($(this).is(':checked')) {
  175 + ids.push($(this).val());
  176 + }
  177 + });
  178 +
  179 + if (ids.length == 0) {
  180 + art.dialog.through({
  181 + id: 'error',
  182 + icon: 'error',
  183 + content: '您没有勾选信息,无法进行操作!',
  184 + cancelVal: '关闭',
  185 + cancel: true
  186 + });
  187 + return false;
  188 + }
  189 +
  190 + ids = ids.join(',');
  191 + art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=move&old_term_id={$term.term_id|default=0}&ids=" + ids, {
  192 + title: "批量移动",
  193 + width: "300px"
  194 + });
  195 + });
  196 + });
  197 + });
  198 +</script>
  199 +</body>
  200 +</html>