Where possible begins

希望你喜欢这里。有问题,请提问,或搜索现有帖子。

真诚、友善、团结、专业,共建你我引以为荣之社区。《常见问题解答》

子枫
子枫 [Rainy] 10-10 16:50

php 导入表格去除样式,代码仅供参考

子枫cmsX2

``` public function import_demo(){ // 设置PHP默认字符集为UTF-8 ini_set('default_charset', 'UTF-8'); //获取表格的大小,限制上传表格的大小5M $file_size = $_FILES['file']['size']; if ($file_size > 5 * 1024 * 1024) { $this->error('文件大小不能超过5M'); exit(); } // dd($file_size); //限制上传表格类型 $fileExtendName = substr(strrchr($_FILES['file']["name"], '.'), 1); //application/vnd.ms-excel 为xls文件类型 if ($fileE

43

子枫
子枫 [Rainy] 09-27 16:37

widget_st样式引用

子枫cmsX2

``` {:widget_st('layui','css')} {:widget_st('admin','css')} {:widget_st('tailwind','css')} {:widget_st('jq','js')} {:widget_st('laydate','js')} {:widget_st('layui','js')} {:widget_st('layer','js')} {:widget_st('common','js')} {:widget_st('webuploader')} {:widget_st('ueditor')} {:widget_st('bootstrap')} {:widget_st('input-tag')} {:widget_st('viewer')} {:widget_st('tinymce')} {:widget_st('meditor')} {:widget_st('wangEditor')} {:widget_st('vditor')} {:widget_

47

子枫
子枫 [Rainy] 09-26 13:48

get_post_list_v2参考

子枫cmsX2

``` $_append_list = get_post_list_v2(['child'=>1,'cid'=>2,'where'=>[['p.status','=',1],['p.id','in',$v['append']]]]); ```

40

子枫
子枫 [Rainy] 09-26 11:30

常用的form_widget 写法

子枫cmsX2

常用的form_widget 写法 ``` add {$form_widget->form_input(['title'=>'标题','name'=>'title','data'=>'','theme'=>1])|raw} {$form_widget->form_textarea(['title'=>'描述','name'=>'summary','data'=>'','theme'=>1])|raw} {$form_widget->form_input_tag(['title'=>'Tag','name'=>'tags','data'=>'','theme'=>1])|raw} {$form_widget->filesystem_album(['title'=>'图集','name'=>'album','data'=>'','theme'=>1])|raw} {$form_widget->form_ueditor(['title'=>'内容详情','name'=>'content','data'=>'','theme'=>1])|raw} {$form_widget

45

子枫
子枫 [Rainy] 09-26 10:08

常用内容模型

子枫cmsX2

标题-描述-排序 ``` [{"position":1,"name":"\u6807\u9898","key":"title","value":"","type":"form_input","status":1,"readonly":0,"hidden":0,"sort":0,"is_multi":0,"token":"","theme":1,"append1":null,"append2":null,"append3":null,"lang":"","lang_pid":0,"notes":null},{"position":1,"name":"\u5185\u5bb9","key":"summary","value":"","type":"form_textarea","status":1,"readonly":0,"hidden":0,"sort":0,"is_multi":0,"token":"","theme":1,"append1":"","append2":"","append3":"","lang":"","lang_pid":0,"notes":""},{"pos

46

子枫
子枫 [Rainy] 09-23 13:53

zfcmsX2 前台模板参考

子枫cmsX2

待添加

53

子枫
子枫 [Rainy] 07-01 15:38

PhpSpreadsheet 导入报错Trying to access array offset on value of type int

子枫cmsX2

之前一直用的如下代码,一直没问题 ``` ini_set('default_charset', 'UTF-8'); // $upload_file = $_FILES['file']['tmp_name']; //文件类型 //$ext = strtolower(pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION)); $upload_file = $_FILES['file']['tmp_name']; //自动获取文件类型 (xlsx,xls,csv) $spreadsheet = IOFactory::load($upload_file); //直接转为数组,避免上一种方法取值会出现表格内数据格式错误的问题 $data = $spreadsheet->getSheet(0)->toArray(); ``` 最近突然就报错了Trying to access array o

174

子枫
子枫 [Rainy] 05-24 12:06

宝塔http使用307跳转https换成301

子枫cmsX2

方法如下图 ![](//storage-x1.90ckm.com/uploads/beb8b8cc89e739e44c1421a8a6c6b064/20240524_608652.png) ``` server { listen 80; server_name www.aa.com aa.com; return 301 https://www.aa.com$request_uri; } ``` 修改完需要清除下浏览器缓存 ![](//storage-x1.90ckm.com/uploads/beb8b8cc89e739e44c1421a8a6c6b064/20240524_209733.png)

180

子枫
子枫 [Rainy] 05-24 11:37

修改thinkphp5.1 500状态码

子枫cmsX2

修改路径如下 ![](//storage-x1.90ckm.com/uploads/beb8b8cc89e739e44c1421a8a6c6b064/20240524_857751.png) 将500修改成其他即可

189

子枫
子枫 [Rainy] 04-22 10:48

zfcms模板开发demo

子枫cmsX2

theme_demo

218

子枫
子枫 [Rainy] 04-18 15:03

ZFCMS支付配置

子枫cmsX2

## 易支付: 推荐使用码支付: http://pay.jianshe2.com/

262

子枫
子枫 [Rainy] 04-10 12:18

zfcms弹窗选择文件新增一种方式

子枫cmsX2

在版本v0.240410可用 ``` $('.up_img').on('click',function(){ var url = "{:url('common/Fileupload/upload')}?ttttt=1" var that = $(this) window.selectedPicInfo = null; layer.open({ type: 2, area: ['90%', '90%'], fixed: true, maxmin: true, content: url+"&cid=0&t=return_url&zf_class=", end: function(){ var selectedPicInfo = window.selectedPicInfo; if(selectedPicInfo){ that.parent().fi

191

子枫
子枫 [Rainy] 04-01 21:05

ZFCMS使用mysql5.7 groupby问题

子枫cmsX2

![](//storage-x1.90ckm.com/uploads/beb8b8cc89e739e44c1421a8a6c6b064/20240401_70521iShot_2024-04-01_20.19.46.png) 报错 ``` SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'devzfcmsx2local.zf_post.ctime' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by ``` ## 解决方案 直接运行下面的sql即可 ![](//storage-x1.90ckm.com/uploads/beb

202

子枫
子枫 [Rainy] 03-29 11:39

zfcms更新系统sql新增多种方式

子枫cmsX2

格式是一样的,只是调用方法不同 1.直接调用(不推荐使用) ``` 'v0.0.3'=>$this->v0_0_3(), ``` 2.方法(新增) 在文件/application/common/controller/updateSql.php中方法__construct新增 ``` 'v0.240315'=>['type'=>'function','name'=>'v0_240315'], ``` 然后写对应的方法 3.文件(新增)(推荐使用) ![](//storage-x1.90ckm.com/uploads/beb8b8cc89e739e44c1421a8a6c6b064/20240329_40288微信截图_20240329113141.png) 这种方式不需要调用,直接写文件即可

202

子枫
子枫 [Rainy] 03-08 17:25

ZFCMS插件中的使用记录240308

子枫cmsX2

插件中的静态默认路径 : {$plug_static} 保存当前的链接: session('zf_login_tap_url',request()->url()); 获取插件保存在数据库中数据: $plugin_data = $this->Yun->get_plugin_config_db('addons','','zf_store_softclientv2'); 获取模板保存在数据库中数据: $theme_data = $this->Yun->get_plugin_config_db($this->zf_tpl_suffix,'theme','');

193