Commit 61d311ef authored by clone's avatar clone

login

parent 1537fff0
......@@ -188,6 +188,7 @@ class AppointmentTime extends Basic
}
//todo 是否评价
return $result;
}
......
......@@ -50,15 +50,16 @@ class TradeLog extends Basic
$order_ = 'a.created desc';
$field = "a.id,a.tradecode,a.singntime,b.phpone,b.house_id";
$field = "a.id,a.tradecode,a.singntime,b.phpone,b.house_id,b.agent_id";
$result = $this->journalAccountsMode->getJournalAccountsList($pageNo, $pageSize, $order_, $field, $param);
if (count($result) <= 0) {
return $this->response("200", "请求数据为空");
}
foreach ($result as $key => $val) {
$houseInfo = $this->houseInfoModel->getHouseDetail("room_num_left", array("id"=>$val["house_id"]));
$houseInfo = $this->houseInfoModel->getHouseDetail("room_num_left,title", array("id"=>$val["house_id"]));
$result[$key]["room_num_left"] = $houseInfo["room_num_left"];
$result[$key]["title"] = $houseInfo["title"];
$result[$key]["api_path"] = IMG_PATH;
$imgParam["house_id"] = $val["house_id"];
$imgParam["imgtype"] = 1; //默认主图
......
<?php
namespace app\index\controller;
use app\index\extend\Basic;
use app\model\AdminModel;
use think\Request;
/**
* Created by PhpStorm.
* User : zw
* Date : 2017/12/20
* Time : 13:52
* Intro:
* Intro:c端后台登录
*/
class Login extends Basic
{
class Login {
protected $loginDb;
public function __construct($request = null)
{
parent::__construct($request);
$this->loginDb = new AdminModel();
}
public function login(){
public function login()
{
return view("login/login");
}
public function loginVerify()
{
$name = $_POST["username"];
$passwd = $_POST["passwd"];
if (!isset($name) || !isset($passwd)) {
return view("login/login", [ "msg" => "用户名或密码不能为空" ]);
}
$params["name"] = $name;
$params["pswd"] = md5(md5($passwd));
$result = $this->loginDb->verifyUser($params);
//todo 更新登录信息
if (count($result) > 0) {
$this->redirect('banner/banner');
} else {
return view("login/login", [ "msg" => "用户名或密码错误" ]);
}
}
}
\ No newline at end of file
......@@ -18,7 +18,7 @@
<div class="pull-right">
<ul class="bread_btn">
<li>
<a href="#modal-add-do" data-toggle="modal" class="btn btn-default"><i class="icon-plus"></i>
<a href="#modal-add-do" data-toggle="modal" id="add_banner" class="btn btn-default"><i class="icon-plus"></i>
新增广告</a>
</li>
</ul>
......
......@@ -5,9 +5,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>同联地产管理后台</title>
<link rel="stylesheet" href="/resource/css/login.css" type="text/css" />
<link rel="stylesheet" href="/resource/css/login.css" type="text/css"/>
</head>
<body >
<body>
<div class="main-container">
<div class="main-content">
<div class="login-container">
......@@ -19,15 +19,18 @@
</h1>
</div>
<div class="loginbox">
<form action="" method="post">
<form action="/admin.php/index/loginVerify" method="post">
<div class="input-icon">
<input class="input-block" type="text" id="username" name="username" autofocus placeholder="请输入用户名" maxlength="16" required>
<input class="input-block" type="text" id="username" name="username" autofocus
placeholder="请输入用户名" maxlength="16" required>
</div>
<div class="input-icon">
<input class="input-block" type="password" id="passwd" name="passwd" placeholder="请输入登录密码" maxlength="16" required>
<input class="input-block" type="password" id="passwd" name="passwd" placeholder="请输入登录密码"
maxlength="16" required>
<span style="color: #fff;display: block;text-align: center;font-size: 12px">{$msg}</span>
</div>
<div class="center">
<button type="submit" style="background: #87b1ff;">立即登陆</button>
<div class="center" style="margin-top: 15px">
<button type="submit" style="background: #87b1ff;">立即登陆</button>
</div>
</form>
</div>
......
<?php
/**
* Created by PhpStorm.
* User : zw
* Date : 2017/12/21
* Time : 13:58
* Intro:
*/
namespace app\model;
use think\Db;
use think\Model;
class AdminModel extends Model
{
// 设置当前模型对应的完整数据表名称
protected $table = 'u_admin';
protected $db ;
public function __construct()
{
$this->db = Db::table($this->table);
}
public function verifyUser($params)
{
return $this->db->field("id")
->where($params)
->select();
}
}
\ No newline at end of file
......@@ -75,6 +75,7 @@ Route::group('index', [
//login
'login' => ['index/login/login',['method'=>'get']],
'loginVerify' => ['index/login/loginVerify',['method'=>'post|get']],
]);
......@@ -128,4 +129,4 @@ Route::group('api', [
'attentionList' => [ 'api/AttentionShop/attentionList', [ 'method' => 'post | get' ] ],
]);
Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
//Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
......@@ -18,9 +18,17 @@ define (['doT', 'text!temp/banner_template_tpl.html', 'ckfinder', 'ckfinderStart
BrowseServer ('cover_image');
});
$ ('#modal-add-do').on ('show.bs.modal', function () {
/* $ ('#modal-add-do').on ('show.bs.modal', function () {
$ ("#editor_modal_title").html ("编辑广告");
});
});*/
$("#add_banner").on("click",function(){
$ ("#editor_modal_title").html ("添加广告");
$ ("#id").val ("");
$ ("#title").val ("");
$ ("#url").val ("");
$ ("#cover_image").val ("");
$ ("#sort").val ("");
})
$ ("#save_banner").click (function () {
var params = {};
......@@ -144,6 +152,7 @@ define (['doT', 'text!temp/banner_template_tpl.html', 'ckfinder', 'ckfinderStart
});
function confirms (obj) {
$ ("#editor_modal_title").html ("编辑广告");
var item = $ (obj).parents ("tr").find ("td");
$ ("#id").val ($ (obj).attr ("data-id"));
$ ("#title").val (item.eq (0).html ());
......
......@@ -80,21 +80,22 @@
<div class="form-group">
<label class="col-sm-3 control-label">链接:</label>
<div class="col-sm-9">
<input type="text" class="form-control btn6" name="title" id="url" autocomplete="off">
<input type="text" class="form-control btn6" name="title" id="url" autocomplete="off" placeholder="请输入链接">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">图片:</label>
<div class="col-sm-9">
<input readonly="readonly" type="text" name="cover_image" id="cover_image" class="require"/>
<button class="button6 banner_img" type="button">选择图片</button>
<input readonly="readonly" type="text" name="cover_image" class="form-control" style="width: 150px !important;display: inline-block"
id="cover_image" class="require" placeholder="请选择图片"/>
<button class="banner_img btn btn-default" type="button">选择图片</button>
<span class="tip">建议尺寸288x320</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">排序:</label>
<div class="col-sm-9">
<input type="text" class="form-control btn6" name="title" id="sort" autocomplete="off">
<input type="text" class="form-control btn6" name="title" id="sort" autocomplete="off" placeholder="请输入排序">
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment