Commit 109c1779 authored by hujun's avatar hujun

Merge remote-tracking branch 'origin/test' into test

parents c22a206e 10db1cae
......@@ -57,14 +57,16 @@ class ConvertOrder extends Basic
set_time_limit(0);
//todo old num convert new table. first select page report num.
//$params = $this->params;
$time_ = array( 'between', array( "2016-04-18 23:59:59", "2018-04-17 23:59:59" ) );
$total = $this->appliesModel->getAppliesCount();
$total = $this->appliesModel->getAppliesCount([ "a.created" => $time_ ]);
$pageSize = 200;
$pageTotal = ceil($total / $pageSize);
$field = "a.id,a.phpone,a.agent_id,a.agent_shop_id,a.receptiontime ,a.house_id,a.customer,a.sex,a.vehicle,a.created,a.modified,
b.title as house_title,b.room_num_left,c.phone,c.realname";
for ($pageNo = 1; $pageNo <= $pageTotal; $pageNo++) {
$appliesList = $this->appliesModel->getApplies($pageNo, $pageSize, $field);
$appliesList = $this->appliesModel->getApplies($pageNo, $pageSize, $field, [ "a.created" => $time_ ]);
if (count($appliesList) > 0) {
$orderArr = [];
foreach ($appliesList as $item) {
......@@ -75,7 +77,7 @@ class ConvertOrder extends Basic
, $userInfo["user_name"], $item["vehicle"], $item["agent_shop_id"], $item["receptiontime"], $item["created"], $item["modified"]);
$f_id = $this->reportModel->addReport($reportParam);
if ($f_id > 0) {
$orderParam = $this->orderBin($this->createOrderNumber(), $f_id, $item["house_id"],$item["created"], $item["modified"]);
$orderParam = $this->orderBin($this->createOrderNumber(), $f_id, $item["house_id"], $item["created"], $item["modified"]);
array_push($orderArr, $orderParam);
}
}
......@@ -94,13 +96,15 @@ class ConvertOrder extends Basic
public function convertMarchIn()
{
set_time_limit(0);
$total = $this->remarksModel->getRemarksCount();
$time_ = array( 'between', array( "2016-04-18 23:59:59", "2018-04-17 23:59:59" ) );
$total = $this->remarksModel->getRemarksCount([ "a.created" => $time_ ]);
$pageSize = 200;
$pageTotal = ceil($total / $pageSize);
$field = "a.shopuser_id,b.id as report_id,c.id as order_id,c.order_no,a.content,d.imagename,a.content_area,a.created,a.modified";
$marchInArr = [];
for ($pageNo = 1; $pageNo <= $pageTotal; $pageNo++) {
$marchInList = $this->remarksModel->getRemarksList($pageNo, $pageSize, $field);
$marchInList = $this->remarksModel->getRemarksList($pageNo, $pageSize, $field, [ "a.created" => $time_ ]);
foreach ($marchInList as $key => $item) {
$marchInParams = $this->marchInBin($item["shopuser_id"], $item["report_id"], $item["order_id"], $item["order_no"],
$item["content"], $item["imagename"], $item["content_area"], $item["created"], $item["modified"]);
......@@ -115,10 +119,10 @@ class ConvertOrder extends Basic
public function convertCollectingBill()
{
set_time_limit(0);
$time_ = array( 'between', array( "2016-04-18 23:59:59", "2018-01-18 23:59:59" ) );
$field = "a.type,a.moneytype,a.money,a.trademark,a.remarks,a.created,a.modified,d.id as agent_id,b.id as report_id,c.id as order_id,c.order_no";
$collectingBillList = $this->journalaccountsModel->getJournalAccountsListByStatus(1, 2000, $field);
dump($collectingBillList);exit;
$collectingBillArr = [];
$collectingBillList = $this->journalaccountsModel->getJournalAccountsListByStatus(1, 2000, $field, [ "a.created" => $time_ ]);
$collectingBillArr = [];
foreach ($collectingBillList as $key => $item) {
$collectingBillParams = $this->collectingBillBin(0, $item["moneytype"], $item["type"], $item["money"],
$item["agent_id"], $item["report_id"], $item["order_id"], $item["order_no"], "---", $item["trademark"],
......@@ -277,7 +281,7 @@ class ConvertOrder extends Basic
* @param $update_time
* @return mixed
*/
private function orderBin($order_no, $f_id, $house_id,$create_time,$update_time)
private function orderBin($order_no, $f_id, $house_id, $create_time, $update_time)
{
$houseModel = new GHouses();
$houseResult = $houseModel->getHouseDetail("id,internal_title", [ "id" => $house_id ]);
......
{layout name="global/frame_tpl" /}
<input type="hidden" class="page-load" id="getCollection" />
<!-- 提示成功模态框(Modal) -->
<div class="successModel">
<div class="successModel-center">
<p>
<!--提交成功!-->
</p>
</div>
</div>
<!--<script>-->
<!--$(document).ready(function(),2000);//2秒后执行该方法-->
<!--});-->
<!--</script>-->
<!-- -->
<!-- 收款记录页面 -->
<input type="hidden" class="page-load" id="getCollection">
<style>
.modal-body{
height: 600px;
......@@ -32,6 +16,17 @@
list-style: none;
line-height: 30px;
}
.money_total_two{
font-weight: bold;
font-size: 15px;
}
#search{
float: left;
}
#reset{
float: left;
}
</style>
<div id="page-content-wrapper">
<div class="container">
......@@ -56,16 +51,17 @@
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date" type="date">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="shop_name" placeholder="商铺名称" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="shop_num" placeholder="铺号" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="payment_time" placeholder="收款时间" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="customer_phone" placeholder="客户手机号" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="customer_name" placeholder="客户姓名" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="store_name" placeholder="门店" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="applicant_phone" placeholder="报备手机号" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="applicant_name" placeholder="报备人姓名" type="text" value="">
<span class="btn btn-default btn3 ld-Marheight" id="search" style="visibility: hidden;">搜索</span>
<span class="btn btn-default btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-default btn3 ld-Marheight" id="reset">重置</span>
<span>总额:</span><span>349999元</span>
<span class=" btn btn-info btn3 ld-Marheight" style="visibility: hidden;">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
<span class="money_total_two fore-span ld-Marheight ">总额:</span><span id="money_total" class="money_total_two fore-span ld-Marheight"></span>
<span class="btn btn-info btn3 ld-Marheight" id="exporting_report">导出报表</span>
</form>
</form>
</td>
</tr>
......@@ -78,10 +74,11 @@
<th class="text-center">入账方式</th>
<th class="text-center">商铺地址</th>
<th class="text-center">商铺名称</th>
<th class="text-center">操作</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="text-center" id="follow_list"></tbody></table>
<tbody class="text-center" id="follow_list">
</table>
</div>
<!-- /#page-content-wrapper -->
<div class="text-right" id="pagediv">
......@@ -94,5 +91,12 @@
</div>
</div>
</div>
<script src="/resource/lib/js/require.min.js" data-main="/resource/js/main?version=123" charset="utf-8"></script>
</div>
\ No newline at end of file
\ No newline at end of file
......@@ -17,7 +17,7 @@
<tr>
<td colspan="9">
<a class="btn btn-info liudan_pic_btn">专员审核</a>
<a class="btn btn-default liudan_pic_btn">经理审核</a>
<a class="btn btn-default liudan_pic_btn" href="1">经理审核</a>
<a class="btn btn-default liudan_pic_btn">总监审核</a>
<a class="btn btn-default liudan_pic_btn">出纳审核</a>
......
......@@ -24,8 +24,9 @@ class Applies extends Model
->select();
}
public function getApplies($pageNo, $pageSize, $field)
public function getApplies($pageNo, $pageSize, $field, $params)
{
$where_ = $params;
$where_["transaction_status"] = 0;
return Db::table($this->table)
->field($field)
......@@ -37,9 +38,12 @@ class Applies extends Model
->page($pageNo)
->select();
}
public function getAppliesCount()
public function getAppliesCount($params)
{
$where_ = $params;
$where_["transaction_status"] = 0;
return $this
->field("a.id")
->alias("a")
......
......@@ -109,19 +109,21 @@ class JournalAccounts extends Model
->select();
}
public function getJournalAccountsListByStatus($pageNo = 1, $pageSize = 15, $field)
public function getJournalAccountsListByStatus($pageNo = 1, $pageSize = 15, $field,$params)
{
$params["a.transaction_status"] = array("in","2,3");
return $this->db
$result = $this->db
->field($field)
->alias("a")
->join('o_report b', 'a.apply_id = b.id', 'right')
->join('o_order c', 'b.id = c.f_id', 'right')
->join('agents d', 'a.operaaccount = d.realname', 'LEFT')
->join('a_agents d', 'a.operaaccount = d.name', 'LEFT')
->where($params)
->limit($pageSize)
->page($pageNo)
->select();
//echo $this->db->getLastSql();
return $result;
}
}
......@@ -4,9 +4,11 @@ namespace app\model;
use think\Model;
use think\Db;
class Remarks extends Model
{
protected $table = "remarks";
/**
* 成交记录列表
*
......@@ -21,7 +23,8 @@ class Remarks extends Model
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getJournalHouseInfo($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params, $agent_id = '') {
public function getJournalHouseInfo($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params, $agent_id = '')
{
$result = $this->field($field)
->where('shopuser_id', $agent_id)
......@@ -36,18 +39,18 @@ class Remarks extends Model
//查找商铺或街铺的名字和图片
foreach ($result as $key => $value) {
$data[$key] = Db::table('houseinfos')
->field($fields_houinfo)->where('id',$value['house_id'])->find();
->field($fields_houinfo)->where('id', $value['house_id'])->find();
$data[$key]['singntime'] = $value['created'] ? date('Y-m-d',strtotime($value['created'])) : "";
$data[$key]['shangpu_tags'] = explode(',',$data[$key]['shangpu_tags']);
$data[$key]['singntime'] = $value['created'] ? date('Y-m-d', strtotime($value['created'])) : "";
$data[$key]['shangpu_tags'] = explode(',', $data[$key]['shangpu_tags']);
$img = Db::table('houseimgs')->field('imagename')
->where('house_id', $value['house_id'])->where('imgtype',1)->find();
->where('house_id', $value['house_id'])->where('imgtype', 1)->find();
if ($img['imagename']) {
$data[$key]['img'] = ADMIN_URL_TL.'/houseImg/'.$img['imagename'];
$data[$key]['img'] = ADMIN_URL_TL . '/houseImg/' . $img['imagename'];
} else {
$data[$key]['img'] = ADMIN_URL_TL.'/resource/image/pzz_.jpg';
$data[$key]['img'] = ADMIN_URL_TL . '/resource/image/pzz_.jpg';
}
}
......@@ -64,7 +67,8 @@ class Remarks extends Model
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getJournalHouseInfoId($fields = '', $params) {
public function getJournalHouseInfoId($fields = '', $params)
{
$result = $this->field($fields)
->where($params)
->group('apply_id')
......@@ -77,9 +81,9 @@ class Remarks extends Model
* @param $params
* @return int|string
*/
public function getTotal2($join,$params)
public function getTotal2($join, $params)
{
return $this->alias('r')
return $this->alias('r')
->join($join)
->where($params)->count();
}
......@@ -96,7 +100,7 @@ class Remarks extends Model
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getListJoin($p = 1, $pageSize = 15, $order_ = 'id desc', $field = '',$join='', $where = '')
public function getListJoin($p = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $join = '', $where = '')
{
$data = $this->field($field)
->alias('r')
......@@ -107,13 +111,13 @@ class Remarks extends Model
->page($p)
->select();
//echo $this->getLastSql();
if(!$data){
if (!$data) {
return $data;
}
/****************************处理客户电话****************************************/
foreach($data as $k=> $li) {
$phonestr = htmlentities(trim($li["phpone"]));
$phonearr = explode('|', $phonestr);
foreach ($data as $k => $li) {
$phonestr = htmlentities(trim($li["phpone"]));
$phonearr = explode('|', $phonestr);
$customer_phone = '';
foreach ($phonearr as $v) {
if ($v) {
......@@ -126,8 +130,9 @@ class Remarks extends Model
return $data;
}
public function getRemarksList($pageNo, $pageSize, $field)
public function getRemarksList($pageNo, $pageSize, $field, $params)
{
$where_ = $params;
$where_["a.isinstatus"] = 1;
return Db::table($this->table)
->field($field)
......@@ -140,8 +145,10 @@ class Remarks extends Model
->page($pageNo)
->select();
}
public function getRemarksCount()
public function getRemarksCount($params)
{
$where_ = $params;
$where_["a.isinstatus"] = 1;
return Db::table($this->table)
->field("a.id")
......
This diff is collapsed.
......@@ -6,6 +6,7 @@ require.config ({
'paths': {
'app': 'js',
'jquery': 'lib/js/jquery-2.0.3.min',
'axios': 'lib/js/axios.min',
'temp': (location.origin || location.protocol + '//' + location.hostname + (location.port == 80 ? '' : ':' + location.port)) + '/resource/template',
'style': 'css',
'doT': 'lib/js/doT',
......
......@@ -109,4 +109,12 @@ function check_auth(auth_rule) {
}
return result;
}
\ No newline at end of file
}
//分页插件封装
function PaginationX(obj){
obj.dom.html('wrgwg');
var _preHtml = '<div class="ui-page-x"><span class="ui-page ui-page-prev"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><path d="M85.876,100.5l49.537-50.526c4.089-4.215,4.089-11.049,0-15.262 c-4.089-4.218-10.719-4.218-14.808,0L63.586,92.868c-4.089,4.215-4.089,11.049,0,15.264l57.018,58.156 c4.089,4.215,10.719,4.215,14.808,0c4.089-4.215,4.089-11.049,0-15.262L85.876,100.5z"></path></svg></span>';
var _aftHtml = '';
};
......@@ -2,57 +2,97 @@
* Created by 刘丹 on 2017/12/11.
*/
define (['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css','ckfinder','ckfinderStart','pagination','bootstrapJs'], function (doT, template) {
reportList = {
pageNo: 1, /*第几页*/
pageSize: 10, /*每页显示多少条*/
id : '',
house_id:'',
type:'',
valueCurrent:'',
ajaxObj:'',
stopstatus:true,
ldHtml: $('.phone_list'),
boxphoto:'',
init: function () {
//初始化dot
$ ("body").append (template);
reportList.getList ();
reportList.event ();
},
event: function () {
},
getList: function (pageNo) {
reportList.pageNo = pageNo;
var params = {};
params.pageNo = reportList.pageNo;
params.pageSize = reportList.pageSize;
$.ajax ({
url: '/index/reportListAttache/0',//获取列表
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function (data) {
var temp = document.getElementById ('reportList_list_tpl').innerHTML;
var doTtmpl = doT.template (temp);
$ ("#reportList_list").html (doTtmpl (data.data.list));
/*分页代码*/
$ ("#pagediv").pagination ({
length: data.data.total,
current: pageNo,
every: reportList.pageSize,
onClick: function (el) {
reportList.getList (el.num.current);
}
});
}
});
}
};
return reportList;
define(['axios', 'doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', 'pagination', 'bootstrapJs'], function(axios, doT, template) {
console.log(axios);
reportList = {
pageNo: 1,
/*第几页*/
pageSize: 10,
/*每页显示多少条*/
id: '',
house_id: '',
type: '',
valueCurrent: '',
ajaxObj: '',
stopstatus: true,
ldHtml: $('.phone_list'),
boxphoto: '',
init: function() {
//初始化dot
$("body").append(template);
reportList.getList(1);
reportList.event();
},
event: function() {
},
getList: function(pageNo) {
reportList.pageNo = pageNo;
var params = {};
params.pageNo = reportList.pageNo;
params.pageSize = reportList.pageSize;
axios({
method:'get',
url:'/index/reportListAttache/0',
responseType:'json',
params: params,
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
}
})
.then(function(response) {
console.log(response);
var temp = document.getElementById('reportList_list_tpl').innerHTML;
var doTtmpl = doT.template(temp);
$("#reportList_list").html(doTtmpl(response.data.data.list));
/*分页代码*/
// PaginationX({
// 'dom': $("#pagediv")
// });
$("#pagediv").pagination({
length: response.data.data.total,
current: pageNo,
every: reportList.pageSize,
onClick: function(el) {
console.log(el);
reportList.getList(el.num.current);
}
});
})
.catch(function(error) {
console.log(error);
});
// $.ajax({
// url: '/index/reportListAttache/0', //获取列表
// type: 'GET',
// async: true,
// data: params,
// dataType: 'json',
// success: function(data) {
// var temp = document.getElementById('reportList_list_tpl').innerHTML;
// var doTtmpl = doT.template(temp);
// $("#reportList_list").html(doTtmpl(data.data.list));
//
// /*分页代码*/
// $("#pagediv").pagination({
// length: data.data.total,
// current: pageNo,
// every: reportList.pageSize,
// onClick: function(el) {
// reportList.getList(el.num.current);
// }
// });
// }
// });
}
};
return reportList;
});
\ No newline at end of file
This diff is collapsed.
......@@ -2,26 +2,18 @@
[% if(it) { %]
[% for(var item in it){ %]
<tr class="text-center">
<td>[%= it[item]['start_time'] %]</td>
<td>[%= it[item]['create_time'] %]</td>
<td>[%= it[item]['user_name'] %]</td>
<td>[%= it[item]['user_phone'] %]</td>
<td>[%= it[item]['money'] %]</td>
<td class="pay_type">[%= it[item]['pay_type'] %]</td>
<td>[%= it[item]['type'] %]</td>
<td>[%= it[item]['internal_address'] %]</td>
<td>[%= it[item]['internal_title'] %]</td>
<td>
[% if(it[item]['label_name']) { %]
[%= it[item]['label_name'] %]
[% }else{ %]
【】
[% } %]
[%= it[item]['content'] %]
<a class="btn1 btn-info caozuo" href="#modal-record" data-toggle="modal" data-id='[%= it[item]["id"] %]'>时间轴</a>
<a class="btn1 btn-info caozuo" href="#modal-record" data-toggle="modal" data-id='[%= it[item]["id"] %]'>编辑</a>
</td>
<td>[%= it[item]['end_time'] %]</td>
<td>[%= it[item]['internal_title'] %]</td>
<td>[%= it[item]['user_name'] %]</td>
<td>[%= it[item]['user_phone'] %]</td>
<td>[%= it[item]['id'] %]</td>
<td>[%= it[item]['store_name'] %]</td>
<td>[%= it[item]['report_phone'] %]</td>
<!-- <td>
<a class="btn1 btn-success caozuo" href="#modal-record" data-toggle="modal" data-id='[%= it[item]["id"] %]'>详细信息</a>
</td> -->
</tr>
[% } %]
[% }else{ %]
......@@ -44,17 +36,3 @@
<!-- start_time 开始时间
end_time 开始时间
internal_title 楼盘名
user_name 客户姓名
user_phone 客户手机号
id false 商铺id
store_name 门店名
report_phone 报备人手机号
report_name 报备人姓名 -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div class="text-right" id="pagediv">
<div class="ui-page-x">
<span class="ui-page ui-page-prev">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200">
<path d="M85.876,100.5l49.537-50.526c4.089-4.215,4.089-11.049,0-15.262 c-4.089-4.218-10.719-4.218-14.808,0L63.586,92.868c-4.089,4.215-4.089,11.049,0,15.264l57.018,58.156 c4.089,4.215,10.719,4.215,14.808,0c4.089-4.215,4.089-11.049,0-15.262L85.876,100.5z"></path>
</svg>
</span>
<span class="ui-page ui-page-current" aria-label="第1页,共200页" aria-selected="true" role="option">1</span>
<a href="javascript:" class="ui-page" data-page="2" aria-label="第2页,共200页">2</a>
<a href="javascript:" class="ui-page" data-page="3" aria-label="第3页,共200页">3</a>
<a href="javascript:" class="ui-page" data-page="4" aria-label="第4页,共200页">4</a>
<a href="javascript:" class="ui-page" data-page="5" aria-label="第5页,共200页">5</a><span class="ui-page ui-page-ellipsis">...</span>
<a href="javascript:" class="ui-page" data-page="200" aria-label="第200页,共200页">200</a>
<a href="javascript:" class="ui-page ui-page-next" data-page="2" aria-label="下一页,当前第1页">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200">
<path d="M85.876,100.5l49.537-50.526c4.089-4.215,4.089-11.049,0-15.262 c-4.089-4.218-10.719-4.218-14.808,0L63.586,92.868c-4.089,4.215-4.089,11.049,0,15.264l57.018,58.156 c4.089,4.215,10.719,4.215,14.808,0c4.089-4.215,4.089-11.049,0-15.262L85.876,100.5z"></path>
</svg>
</a>
</div>
</div>
</body>
</html>
\ No newline at end of file
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