随笔分类 -  thinkphp

tp类型
摘要:thinkphp5示例: //子查询主要的在MAX(create_time) $subQuery = Db::table('fa_crm_record') ->field('customer_id,MAX(create_time) AS create_time') ->group('customer 阅读全文
posted @ 2023-10-24 17:55 亚索会代码 阅读(982) 评论(0) 推荐(0)
摘要:使用btn-addtabs新选项卡打开之后如何关闭或者返回 `返回上一层` <a onclick="window.top.location.href = '你返回的路径url,或者用js事件获取上层路径'" href="javascript:"><i class="fa fa-arrow-left" 阅读全文
posted @ 2023-09-14 10:31 亚索会代码 阅读(720) 评论(0) 推荐(0)
摘要:如果你的表是按年份命名的,例如 table_2021, table_2022, table_2023, table_2024, table_2025,你可以考虑使用分区查询来优化查询性能 SELECT * FROM table_2021 UNION ALL SELECT * FROM table_2 阅读全文
posted @ 2023-08-31 11:31 亚索会代码 阅读(101) 评论(0) 推荐(0)
摘要:<?php //根据日期来统计所消耗的点数 //模型的使用方法 $result = $model ->field("id,FROM_UNIXTIME(createtime,'%Y-%m-%d') as `createtime`,sum(price) as count_price") ->group( 阅读全文
posted @ 2023-08-29 17:14 亚索会代码 阅读(499) 评论(0) 推荐(0)
摘要:$arr = [ [ 'id' => 123, 'test' => ['id' => 2, 'title' => "测试",'test3'=>['list'=>123]] ] ]; $field = "test.test3.list"; foreach($arr as $k=>$v){ $resul 阅读全文
posted @ 2023-08-09 17:53 亚索会代码 阅读(60) 评论(0) 推荐(0)
摘要:thinkphp6 phpspreadsheet导入+导出xls包含多图**先在本项目里导入** `composer require phpoffice/phpspreadsheet` 点击查看代码公用类 ``` data;//导出的数据 if(!$arr){ return false; } //实例化 $objExcel = new Spreadsheet(); // 阅读全文
posted @ 2022-09-21 10:43 亚索会代码 阅读(688) 评论(0) 推荐(0)