亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

用戶信息數(shù)據(jù)表完成分頁(yè)顯示

asal 2019-06-28 01:04:24 288
abstrak:<?php /**  * Created by PhpStorm.  * User: 普通用戶  * Date: 2019/6/18  * Time: 22:27  */ namespace app\index\controller; use
<?php
/**
 * Created by PhpStorm.
 * User: 普通用戶
 * Date: 2019/6/18
 * Time: 22:27
 */

namespace app\index\controller;
use think\Controller;
use app\index\model\User as UserModel;

class User extends Controller
{
    public  function instance(UserModel $user)
    {
        dump($user->get(1));
    }

    public function demo1()
    {
        $user = UserModel::all(function($query){
            $query->field(['uid','name','phone','country','birthday','weight','height','add_time']);
        });
        $this->view->assign('user',$user);
        return $this->view->fetch();
    }

    public function page()
    {
        $num = 6;
        $isimple = false;
        $config=[
          'type'=>'bootstrap',
          'var_page'=>'page'
        ];

        $user = UserModel::paginate($num,$isimple,$config);

        $page=$user->render();

        $this->view->assign('user',$user);
        $this->view->assign('page',$page);
        return $this->view->fetch();
    }
}
{load href="/static/bootstrap/css/bootstrap.css"/}
<div class="content">
    <div class="row">
        <h2 class="text-center">人員信息登記表</h2>
        <div class="col-md-8 col-md-offset-2">

            <table class="table table-bordered table-hover text-center">
                <tr>
                    <td>工號(hào)</td>
                    <td>姓名</td>
                    <td>聯(lián)系電話</td>
                    <td>國(guó)籍</td>
                    <td>生日</td>
                    <td>體重</td>
                    <td>身高</td>
                    <td>入職日期</td>
                </tr>
                {volist name="user" id="use"}
                <tr>
                    <td>{$use.uid}</td>
                    <td>{$use.name}</td>
                    <td>{$use.phone}</td>
                    <td>{$use.country}</td>
                    <td>{$use.birthday}</td>
                    <td>{$use.weight}</td>
                    <td>{$use.height}</td>
                    <td>{$use.add_time}</td>
                </tr>
                {/volist}
            </table>
            <div class="text-center">{$page|raw}</div>
        </div>
    </div>
</div>
{load href="/static/jquery/jquery.js"}
{load href="/static/bootstrap/js/bootstrap.min.js"}

2019-06-28_005749.jpg

經(jīng)過(guò)相近一個(gè)月時(shí)間學(xué)習(xí)本章tp5.1基礎(chǔ)對(duì)tp5.1基本的mvc操作有了初步掌握,后續(xù)再不斷深入學(xué)習(xí)提升,爭(zhēng)取運(yùn)用到工作項(xiàng)目中

Guru membetulkan:天蓬老師Masa pembetulan:2019-06-28 09:27:23
Rumusan guru:寫(xiě)得不錯(cuò), 是不是很有成就感呢, 其實(shí)編程并不難的....

Nota Keluaran

Penyertaan Popular