微擎url模式解读_微擎常用开发文档

1.tpl_form_field_daterange() - 范围日期选择器

tpl_form_field_daterange($name, $value = array(), $time = false)

{php echo tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)),true);}

2. 城市选择

{php echo tpl_form_field_district('address',array('province' =>$item['province'],'city'=>$item['city'],'district'=>$item['district']))}

php获取 'province' => $_GPC['address']['province'],'city' => $_GPC['address']['city'],'district' => $_GPC['address']['district']

3.conmmon/herder 文件

/web/themes/default/common

4.获取input name的值

var buynumber = $('input[name^='buynumber']').map(function(){return this.value}).get();

$('input[name='nw']').val();

5. 循环覆盖

foreach($list as $key => &$value){

$bnumber= pdo_fetchcolumn('SELECT COUNT(*) FROM '.tablename('bc_party_payment').' WHERE status = 1 AND partyid = '.$value['id'] );

$value['bbnumber']=$bnumber;

//循环体

}

6.判断是否是管理员

{if $_W['role']== 'founder'}

7.人人弹窗:

t.confirm('确认要支付吗?', function () {

})

或者是

tip.confirm('确认要支付吗?', function () {

})

8.小程序数组赋值

'member.realname': e.detail.value

9.excel导入模板

文件

导入

隐藏上传文件

PHP:::::

$url = $this->createWebUrl('eggManage',array());

$file = $_FILES['file'];

if(!$file['size']){

message('文件上传不能为空!', '', 'error');

}

if( $file['name'] && $file['error'] == 0){

$type = @end( explode('.', $file['name']));

$type = strtolower($type);

if( !in_array($type, array('xls','xlsx')) ){

message('文件类型错误!', '', 'error');

}

set_time_limit(0);

include_once IA_ROOT . '/framework/library/phpexcel/PHPExcel.php';

include_once IA_ROOT . '/framework/library/phpexcel/PHPExcel/IOFactory.php';

if( $type == 'xls' ){

$inputFileType = 'Excel5'; //这个是读 xls的

}else{

$inputFileType = 'Excel2007';//这个是计xlsx的

}

$objReader = PHPExcel_IOFactory::createReader($inputFileType);

$objPHPExcel = $objReader->load($file['tmp_name']);

$sheet = $objPHPExcel->getSheet(0);

//获取行数与列数,注意列数需要转换

$highestRow = $sheet->getHighestRow();

$highestColumn = $sheet->getHighestColumn();

$highestColumnNum = PHPExcel_Cell::columnIndexFromString($highestColumn);

$usefullColumnNum = $highestColumnNum;

for ($row = 2;$row <= $highestRow;$row++){

$tel = $sheet->getCellByColumnAndRow(0, $row)->getValue();//身份证

$data = array(

'tel' => $tel,

);

pdo_insert('mon_egg_success',$data);

}

message('导入成功', $url,'success');

}else{

message('导入失败', '','error');

}

10..$_W['member']

array(9) {

['uid']=>

string(1) '5'

['realname']=>

string(0) ''

['mobile']=>

string(0) ''

['email']=>

string(39) '[406ccc5616a09420b75252e3db50a05b@we7.cc](mailto:406ccc5616a09420b75252e3db50a05b@we7.cc)'

['groupid']=>

string(1) '1'

['credit1']=>

string(4) '0.00'

['credit2']=>

string(4) '0.00'

['credit6']=>

string(4) '0.00'

['groupname']=>

string(15) '默认会员组'

}

11.$_W['fans']

array(19) {

['fanid']=>

string(1) '5'

['acid']=>

string(1) '1'

['uniacid']=>

string(1) '1'

['uid']=>

string(1) '5'

['openid']=>

string(28) 'o3f7twP_3Qdnj1ntcR9ChzHGyrIY'

['nickname']=>

string(23) 'A0松石网络~蛋蛋'

['groupid']=>

string(0) ''

['salt']=>

string(8) 'JYY3nY5o'

['follow']=>

string(1) '0'

['followtime']=>

string(1) '0'

['unfollowtime']=>

string(1) '0'

['tag']=>

array(9) {

['openid']=>

string(28) 'o3f7twP_3Qdnj1ntcR9ChzHGyrIY'

['nickname']=>

string(23) 'A0松石网络~蛋蛋'

['sex']=>

int(1)

['language']=>

string(5) 'zh_CN'

['city']=>

string(6) '临沂'

['province']=>

string(6) '山东'

['country']=>

string(6) '中国'

['privilege']=>

array(0) {

}

['avatar']=>

string(128) '[http://thirdwx.qlogo.cn/mmopen/vi_32/p83UpvULG4E9MbCfmia1Ocfpfv86L8yVEMtEF8QJMjOasrfsXFvfazdV5aPo20E6J7aQbA1xOlZsCMsXcpcwRug/132](http://thirdwx.qlogo.cn/mmopen/vi_32/p83UpvULG4E9MbCfmia1Ocfpfv86L8yVEMtEF8QJMjOasrfsXFvfazdV5aPo20E6J7aQbA1xOlZsCMsXcpcwRug/132)'

}

['updatetime']=>

string(10) '1534752827'

['unionid']=>

string(0) ''

['sex']=>

int(1)

['gender']=>

int(1)

['headimgurl']=>

string(128) '[http://thirdwx.qlogo.cn/mmopen/vi_32/p83UpvULG4E9MbCfmia1Ocfpfv86L8yVEMtEF8QJMjOasrfsXFvfazdV5aPo20E6J7aQbA1xOlZsCMsXcpcwRug/132](http://thirdwx.qlogo.cn/mmopen/vi_32/p83UpvULG4E9MbCfmia1Ocfpfv86L8yVEMtEF8QJMjOasrfsXFvfazdV5aPo20E6J7aQbA1xOlZsCMsXcpcwRug/132)'

['avatar']=>

string(128) '[http://thirdwx.qlogo.cn/mmopen/vi_32/p83UpvULG4E9MbCfmia1Ocfpfv86L8yVEMtEF8QJMjOasrfsXFvfazdV5aPo20E6J7aQbA1xOlZsCMsXcpcwRug/132](http://thirdwx.qlogo.cn/mmopen/vi_32/p83UpvULG4E9MbCfmia1Ocfpfv86L8yVEMtEF8QJMjOasrfsXFvfazdV5aPo20E6J7aQbA1xOlZsCMsXcpcwRug/132)'

['from_user']=>

string(28) 'o3f7twP_3Qdnj1ntcR9ChzHGyrIY'

}

12.JS 地区获取

var province = $('input[name='address[province]']').val();

var city = $('input[name='address[city]']').val();

var district = $('input[name='address[district]']').val();

13.获取数据库最后一个id

$member=pdo_fetch('select * from ims_bc_party_member order by mid desc LIMIT 1');

14.支付返回数据

调用payResult文件目录 payment/wechat/pay.php

array(14) { ['weid']=> string(1) '1' ['uniacid']=> string(1) '1' ['result']=> string(7) 'success' ['type']=> string(6) 'wechat' ['from']=> string(6) 'return' ['tid']=> string(14) '20181537167703' ['uniontid']=> string(28) '2018091715014600001344588486' ['user']=> string(28) 'o5OgN00jIN9BH1u6-M2q69CRvOg0' ['fee']=> string(4) '0.01' ['tag']=> array(3) { ['acid']=> string(1) '1' ['uid']=> string(2) '14' ['transaction_id']=> string(28) '4200000162201809176669855405' } ['is_usecard']=> string(1) '0' ['card_type']=> string(1) '0' ['card_fee']=> string(4) '0.01' ['card_id']=> string(1) '0' } 1

15.app端手机上传多图片删除功能

{php echo tpl_app_form_field_image('multi-image');}

{if $images}

{loop $images $pic}

×

{/loop}

16.微擎公众号首次关注发送信息代码

数据库:ims_wechat_news

ims_uni_settings 修改触发关键字的内容

添加或者删除

ims_core_cache(太复杂)

image.png

17.微擎JSDK

var jssdkconfig = {php echo json_encode($_W['account']['jssdkconfig']);} || { jsApiList:[] };

jssdkconfig.jsApiList = ['getLocation']

wx.config(jssdkconfig);

wx.ready(function () {

wx.checkJsApi({

jsApiList: [

'getLocation'

],

success: function (res) {

// alert(JSON.stringify(res));

// alert(JSON.stringify(res.checkResult.getLocation));

if (res.checkResult.getLocation == false) {

alert('你的微信版本太低,不支持微信JS接口,请升级到最新的微信版本!');

return;

}

}

});

wx.error(function(res){

alert("接口调取失败")

});

wx.getLocation({

success: function (res) {

$.post()

// 创建地理编码实例

var myGeo = new BMap.Geocoder();

// 根据坐标得到地址描述

$.post("demo_ajax_gethint.html",{suggest:txt},function(result){

$("span").html(result);

});

},

cancel: function (res) {

alert('用户拒绝授权获取地理位置');

}

});

});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值