- 博客(28)
- 收藏
- 关注
原创 Crmeb多商户商城增加微信模板消息发送
首先后台添加模板消息然后打开config/template.php 文件,增加模板消息的配置打开crmeb\services\WechatTemplateMessageService.php文件在需要发送的地方,加入到队列任务里,即可tempCode 是template.php 里新增的配置,需要对应id 可以传一个参数,在WechatTemplateMessageService.php中可以获取该id 并根据该id查询自己需要的内容,例如传订单id,查询订单信...
2021-07-13 15:55:24 361 2
原创 php 压缩文件到服务器
function create_zip($files = array(),$destination = '',$overwrite = false) { //if the zip file already exists and overwrite is false, return false //如果zip文件已经存在并且设置为不重写返回false if(file_exists($destination) && !$overwrite) { retu.
2020-08-19 14:40:38 377
原创 微擎上传远程附件
微擎上传远程附件 注:需要 load->func('file');elseif($operation=='wxupload'){load()->func('file');$account_api=WeAccount::create();$data=array('err'=>0,'msg'=>'','imgUrl'=>'');//access_token$sAccessToken=$a...
2020-08-17 20:47:44 973
原创 mysql FIND_IN_SET 函数使用
FIND_IN_SET有些文章存储标签使用 以下形式 1,2,3,4 可以使用改函数查询select * from `test` where FIND_IN_SET('2',`字段名`);
2020-08-17 20:45:43 128
原创 phpOffice/PhpSpreadsheet 使用记录
<?php//先自行使用composer下载phpoffice到项目文件夹//官网地址:https://phpspreadsheet.readthedocs.io/en/latest///安装命令:composerrequirephpoffice/phpspreadsheet//引入自动加载require"./vendor/autoload.php";//运行命名空间usePhpOffice\PhpSpreadsheet;//文件名$inputFileName="1...
2020-08-17 20:44:53 969
原创 php计算两个位置之间的距离 根据经纬度
/***求两个已知经纬度之间的距离,单位为米**@paramlng1$,lng2经度*@paramlat1$,lat2纬度*@returnfloat距离,单位米*@authorwww.Alixixi.com*/functiongetdistance($lng1,$lat1,$lng2,$lat2){//将角度转为狐度$radLat1=deg2rad($lat1);//deg2rad()函数将角度转换为弧...
2020-08-17 20:43:52 443
原创 mysql 根据经纬度计算距离并排序
$lat=39.950273;$lng=116.550167;$sql="SELECT*,ROUND(6378.138*2*ASIN(SQRT(POW(SIN((...
2020-08-17 20:42:47 736
原创 上传base64 图片
上传base64 图片function b64toBlob(b64Data, contentType='', sliceSize=512) { const byteCharacters = atob(b64Data); const byteArrays = []; for (let offset = 0; offset < byteCharacters.
2017-09-28 15:01:23 671
原创 thinkphp5 配置验证码
//确保'auto_start' => true, 'url_route_on' => true,//验证码配置'captcha' => [ // 验证码字符集合 'codeSet' => '2345678abcdefhijkmnpqrstuvwxyzABCDEFGHJKLMNPQRTUVWXY',
2017-08-27 22:04:51 2407 1
原创 win nginx thinkphp5 配置
#START-SITEserver {listen 80; server_name xxx.xxx.com; access_log logs/xxx.xxx.com.access.log; set $root D:/wwwroot/thinkphp5/public; location ~ .*\.
2017-08-27 21:53:16 1744
原创 nginx php 配置
在 /etc/nginx/conf.d 目录中新建一个名为 php.conf 的文件,并配置 Nginx 端口server { listen 8000; # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ .php$ { root
2017-08-04 17:09:13 312
原创 MYSQL 临时表
SQL 处理group by order by 使用临时表$sql="SELECT * FROM (SELECT r.id as rid,h.name as name,m.addtime as maddtime ,h.img as img,h.id as homesiteid FROM ".tablename('xx')." as u ". " LEFT JOIN ".t
2017-07-18 17:50:04 397
原创 PHP 常用数组
1.ceil() 函数向上舍入为最接近的整数。(例:获取总页数)2.strtolower(): 该函数将传入的字符串参数所有的字符都转换成小写,并以小定形式放回这个字3.strtoupper(): 该函数的作用同strtolower函数相反,是将传入的字符参数的字符全部转换成大4.trim($h,','):移除字符串两侧的字符
2017-07-06 18:02:30 344
原创 Linux 安装PHP NGINX 等所需依赖
yum -y install opensslyum -y install openssl-develyum -y install curlyum -y install curl-develyum -y install libjpegyum -y install libjpeg-develyum -y install libpngyum -y install libpng-devely
2017-06-19 17:32:43 1831
原创 Linux 学习经验
分区挂载 boot启动分区分配至少200MB空间Swap交换空间4G以内的物理内存,SWAP 设置为内存的2倍。4-8G的物理内存,SWAP 等于内存大小。8-64G 的物理内存,SWAP 设置为8G。64-256G物理内存,SWAP 设置为16G。常用命令1.mkdir 创建目录 -p 创建目录,若无父目录,则创建父目录 例: mkdir -p test/de
2017-06-02 17:12:35 916
原创 php 文件写入数组
file_put_contents(file,data,mode,context)参数 描述 file 必需。规定要写入数据的文件。如果文件不存在,则创建一个新文件。 data 可选。规定要写入文件的数据。可以是字符串、数组或数据流。 mode 可选。规定如何打开/写入文件。可能的值: FILE_USE_INCLUDE_PATH FILE_APPEND LOCK_EX
2017-05-23 12:03:27 716
原创 PHP __set(),__get(),__isset(),__unset()四个方法的应用
__set()、__get()、__isset()、__unset() 这四个方法都是我们添加到对象里面的,在需要时自动调用的,来完成在对象外部对对象内部私有属性的操作。<?php// __get()方法用来获取私有属性function __get($property_name) { if (isset($this->$property_name)) { return (
2017-05-23 09:31:42 761
原创 THINKPHP5整理
1.使用composer安装composer create-project topthink/think tp5 --prefer-dist2.新增模块php think build --module demo3.函数变更
2017-05-22 12:18:41 350
原创 Iframe 嵌套网站
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head> <meta charset="utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>tetu</title>
2017-05-17 10:14:22 1194
原创 HTML 文字过多隐藏演示省略号
<span style="width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;display:block;">内容</span>
2017-05-12 15:40:17 1501
原创 PHP 日期相关处理,例如:获取本月第一天及最后一天等
直接贴代码了//时间相关 public function timeinfo(){ //获取今天0点-24点时间戳 $today = strtotime(date('Y-m-d', time())); $todayend = $today + 24 * 60 * 60; //获取本周第一天及最后一天 $weekfir
2017-05-12 11:55:39 1039
原创 Thinkphp3.2图片上传服务器端接收
Thinkphp3.2图片上传服务器端接收服务器端代码代码块语法遵循标准markdown代码,例如:$upload = new \Think\Upload();// 实例化上传类$upload->maxSize = 3145728 ;// 设置附件上传大小$upload->exts = array('jpg', 'gif', 'png', 'jpeg');// 设置
2017-05-11 09:01:15 1677
原创 php get post 请求
public function http_get_json($url){$ch = curl_init();curl_setopt($ch, CURLOPT_URL,$url);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);curl_
2017-05-06 21:19:55 776
转载 Windows2008 R2服务器配置TLS1.2方法
把下面的代码复制到PowerShell里运行一下,然后重启服务器。# Enables TLS 1.2 on windows Server 2008 R2 and Windows 7# These keys do not exist so they need to be created prior to setting values.md "HKL
2017-05-06 21:16:32 4884 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人