pagination

Laravel join queries AS

你离开我真会死。 提交于 2020-11-30 06:15:04
问题 Any way of defining an AS for a query?? I have tried the following: $data = News::order_by('news.id', 'desc') ->join('categories', 'news.category_id', '=', 'categories.id') ->left_join('users', 'news.user_id', '=', 'users.id') // ['created_by'] ->left_join('users', 'news.modified_by', '=', 'users.id') // ['modified_by'] ->paginate(30, array('news.title', 'categories.name as categories', 'users.name as username')); The problem is that ['name'] from categories will be replaces with the one from

bootstrap editable有默认值

送分小仙女□ 提交于 2020-11-27 04:30:32
function listEditor(data,productCode) { $( '#tab1' ).bootstrapTable( 'load' , data); $( '#tab1' ).bootstrapTable({ method : 'POST' , dataType : 'json' , contentType : "application/x-www-form-urlencoded" , cache : false , striped : true , //是否显示行间隔色 sidePagination : "client" , //分页方式:client客户端分页,server服务端分页(*) showColumns : true , pagination : true , minimumCountColumns :2, search : true , pageNumber :1, //初始化加载第一页,默认第一页 pageSize : 10, //每页的记录行数(*) idField : "productCode" , pageList : [10, 15, 20, 25], //可供选择的每页的行数(*) uniqueId : "id" , //每一行的唯一标识,一般为主键列 showExport : true , singleSelect : true ,

ant-design-vue a-table的分页

这一生的挚爱 提交于 2020-11-10 02:47:40
<a-table :columns="columns" //列 :dataSource="tableDatas" //数据 :loading="loading" :pagination="pagination" //分页属性 @change="handleTableChange"//点击分页中数字时触发的方法 :rowKey="tableDatas => tableDatas.id" //每一行的标识 > <span slot="action" slot-scope="text, record"> //放表格中操作的按钮 <div class="tabBtn" > <a-popover placement="bottomRight" overlayClassName="tableBtn"> <template slot="title"> <a href="javascript:;" @click="handleAdd(record)" > <i class="iconfont icon-table-edit" />编辑 </a> <a href="javascript:;" @click="deleHostData(record)"> <i class="iconfont icon-tableEmpty" />删除 </a> </template> <span> <i class=

平台项目 ~ element-vue-table

别等时光非礼了梦想. 提交于 2020-11-03 16:25:11
平台项目~element-table与vue 一简介:前端两大基本功能之一,table的展示 二 目的 后端传递数据到前端,这里有两种用法 1 表单仅仅是展示作用,不对每列做任何操作修饰 2 表单的一些列作格外处理 我们将分别说明 三 第一种场景 表单仅仅展示,不对每列做任何操作修饰 核心思想 动态生成列 <el-table v-if=xianshi2 ref="multipleTable" :data="(data || []).slice((currentPage-1)*pagesize,currentPage*pagesize)" style="width: 100%" > <el-table-column v-for="(item,index) in data2" :key="index" :label="item.ziduan" :width="item.width"> <template slot-scope="scope"> <span>{{scope.row[item.key]}}</span> </template> </el-table-column> </el-table> 说明 1 :data代表展示的表单数据 :data2 代表展示的动态列,通过循环读取 2 scope用法代表插槽,属于vue用法 特点 1 节省大量的代码,仅仅需要几行就能展示大量列 2

vue-awesome-swiper

拈花ヽ惹草 提交于 2020-10-29 14:21:56
1.下载插件 npm install vue-awesome-swiper --save 2.应用main.js import VAS from 'vue-awesome-swiper' import 'vue-awesome-swiper.min.css' 3.遇到的坑 ! css和代码分离,要引入 ‘vue-awesome-swiper.min.css’ ! 配置时 autoplay:3000打死出不来,改成了autoplay:true !分页器和前进后退按钮无效 4.具体代码 <template> <div id="home"> <swiper :options="swiperOption" ref="mySwiper"> <!-- slides --> <swiper-slide><img src="../assets/image/ban1.jpg" alt="" ></swiper-slide> <swiper-slide><img src="../assets/image/ban2.jpg" alt=""></swiper-slide> <swiper-slide><img src="../assets/image/ban3.jpg" alt=""></swiper-slide> <swiper-slide><img src="../assets/image/ban4

轮播图

烈酒焚心 提交于 2020-10-29 01:25:21
最近沉迷于做轮播图无法自拔!!! 前端小沫沫推荐一个很好用的网站, swiper 里面有很多模板,经过我这几天的摸索,沉迷于成功后的喜悦无法自拔,怀着激动的心情跟大家分享一下。 查看演示以后我们下载源码后把需要的js和css引入。 特别注意的是,在html中最后写的script 要放到js文件中靠后的位置。 控制轮播图自动播放的js也可以这样写: var mySwiper = new Swiper('.swiper-container', { autoplay:{ delay:3000, stopOnLastSlide:false }, // 如果需要分页器 pagination: { el: '.swiper-pagination', }, }); 来源: oschina 链接: https://my.oschina.net/u/3883702/blog/1858096

一步步操作mongoDB,增删改查,分页查询 C#

≡放荡痞女 提交于 2020-10-25 12:48:02
十年河东,十年河西,莫欺少年穷 学无止境,精益求精 传统的关系数据库一般由数据库(database)、表(table)、记录(record)三个层次概念组成,MongoDB是由数据库(database)、集合(collection)、文档对象(document)三个层次组成。MongoDB对于关系型数据库里的表,但是集合中没有列、行和关系概念,这体现了模式自由的特点。 那么在c#如何使用呢?下面看个例子,你会发现上手非常简单。 1、新建一个NetCore控制台应用程序 然后Nuget引用,如下: Install-Package MongoDB.Driver -Version 2.11 . 0 Install-Package MongoDB.Bson -Version 2.11.0 然后,新建一个MongoDb的操作类【此操作类用于创建数据库、表,批量插入,查询全部数据等】 using MongoDB.Driver; using System; using System.Collections.Generic; using System.Text; namespace ConsoleMongoDb.Helper { /// <summary> /// 这里的T 代表数据表的Model /// </summary> /// <typeparam name="T"></typeparam

Golang学习系列第六天:操作MongoDB

▼魔方 西西 提交于 2020-10-21 15:52:53
0. ssh连接linux(我用的centos7),略 1. 安装MongoDB 可以直接到MongoDB官网 https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat-tarball/ 根据样板安装:,可根据自己的电脑操作系统下载对应的版本,我下载的是 mongodb-linux-x86_64-4.0.0.tgz 安装包,不过也可以直接点击下面这个链接直接下载 https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.0.0.tgz ,即 wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.0.0.tgz 下载完毕后解压缩 [root@master dgm] # tar -zxf mongodb-linux-x86_64-4.0.0.tgz 名字那么长,可以进行重命名: [root@master dgm] # mv mongodb-linux-x86_64-4.0.0 mongodb 进入到mongodb主目录下: cd mongodb 分别建配置文件、数据目录、日志文件 建立配置文件 vim mongodb.conf 键入以下内容 #端口号 port=27017 #db目录