Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
7a596b09
Commit
7a596b09
authored
Apr 18, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据转换
parent
febf23e7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
31 deletions
+48
-31
ConvertOrder.php
application/api/controller/ConvertOrder.php
+13
-9
Applies.php
application/model/Applies.php
+6
-2
JournalAccounts.php
application/model/JournalAccounts.php
+5
-3
Remarks.php
application/model/Remarks.php
+24
-17
No files found.
application/api/controller/ConvertOrder.php
View file @
7a596b09
...
...
@@ -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
]);
...
...
application/model/Applies.php
View file @
7a596b09
...
...
@@ -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"
)
...
...
application/model/JournalAccounts.php
View file @
7a596b09
...
...
@@ -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
(
'a
gents d'
,
'a.operaaccount = d.real
name'
,
'LEFT'
)
->
join
(
'a
_agents d'
,
'a.operaaccount = d.
name'
,
'LEFT'
)
->
where
(
$params
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
//echo $this->db->getLastSql();
return
$result
;
}
}
application/model/Remarks.php
View file @
7a596b09
...
...
@@ -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"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment