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
e0bd2dde
Commit
e0bd2dde
authored
Apr 08, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据转换
parent
d0369116
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
138 additions
and
53 deletions
+138
-53
ConvertOrder.php
application/api/controller/ConvertOrder.php
+119
-52
Basic.php
application/api/extend/Basic.php
+1
-0
JournalAccounts.php
application/model/JournalAccounts.php
+17
-1
route.php
application/route.php
+1
-0
No files found.
application/api/controller/ConvertOrder.php
View file @
e0bd2dde
...
...
@@ -5,7 +5,9 @@ namespace app\api\controller;
use
app\api\extend\Basic
;
use
app\model\Applies
;
use
app\model\GHouses
;
use
app\model\JournalAccounts
;
use
app\model\OMarchInModel
;
use
app\model\OPayLogModel
;
use
app\model\OrderModel
;
use
app\model\OReportModel
;
use
app\model\RefundTables
;
...
...
@@ -31,16 +33,18 @@ class ConvertOrder extends Basic
private
$remarksModel
;
private
$marchInModel
;
private
$refundModel
;
private
$journalaccountsModel
;
public
function
__construct
(
$request
=
null
)
{
$this
->
appliesModel
=
new
Applies
();
$this
->
userModel
=
new
Users
();
$this
->
reportModel
=
new
OReportModel
();
$this
->
orderModel
=
new
OrderModel
();
$this
->
remarksModel
=
new
Remarks
();
$this
->
marchInModel
=
new
OMarchInModel
();
$this
->
refundModel
=
new
RefundTables
();
$this
->
appliesModel
=
new
Applies
();
$this
->
userModel
=
new
Users
();
$this
->
reportModel
=
new
OReportModel
();
$this
->
orderModel
=
new
OrderModel
();
$this
->
remarksModel
=
new
Remarks
();
$this
->
marchInModel
=
new
OMarchInModel
();
$this
->
refundModel
=
new
RefundTables
();
$this
->
journalaccountsModel
=
new
JournalAccounts
();
parent
::
__construct
(
$request
);
}
...
...
@@ -106,38 +110,124 @@ class ConvertOrder extends Basic
ob_flush
();
}
public
function
convertCollectingBill
()
{
$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
);
$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"
],
$item
[
"remarks"
],
""
,
$item
[
"created"
],
$item
[
"modified"
]);
array_push
(
$collectingBillArr
,
$collectingBillParams
);
}
$payLogModel
=
new
OPayLogModel
();
$payLogModel
->
addPayLog
(
$collectingBillArr
);
ob_flush
();
}
//收款
private
function
collectingBillBin
(
$father_id
,
$type
,
$pay_type
,
$money
,
$agent_id
,
$report_id
,
$order_id
,
$order_no
,
$house_number
,
$industry_type
,
$remark
,
$transfer_img
,
$created
,
$modified
)
{
//付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他'
$types
=
80
;
switch
(
$type
)
{
case
1
:
$types
=
10
;
break
;
case
2
:
$types
=
20
;
break
;
case
3
:
$types
=
30
;
break
;
case
4
:
$types
=
40
;
break
;
case
5
:
$types
=
50
;
break
;
case
6
:
$types
=
60
;
break
;
case
7
:
$types
=
70
;
break
;
}
//0表示pos(扫码) ,1表示pos,2表示现金,3表示转账,4表示其他',
//支付方式 10支付宝 20 微信 30pos机器 40转账 50现金 60 其他
$pay_types
=
60
;
switch
(
$pay_type
)
{
case
0
:
$pay_types
=
30
;
break
;
case
1
:
$pay_types
=
30
;
break
;
case
2
:
$pay_types
=
50
;
break
;
case
3
:
$pay_types
=
40
;
break
;
case
4
:
$pay_types
=
60
;
break
;
}
$arr
[
"father_id"
]
=
$father_id
;
$arr
[
"type"
]
=
$types
;
$arr
[
"pay_type"
]
=
$pay_types
;
$arr
[
"money"
]
=
$money
;
$arr
[
"agent_id"
]
=
$agent_id
;
$arr
[
"report_id"
]
=
$report_id
;
$arr
[
"order_no"
]
=
$order_no
;
$arr
[
"order_id"
]
=
$order_id
;
$arr
[
"house_number"
]
=
$house_number
;
$arr
[
"industry_type"
]
=
$industry_type
;
$arr
[
"remark"
]
=
$remark
;
$arr
[
"transfer_img"
]
=
$transfer_img
;
$arr
[
"create_time"
]
=
$created
;
$arr
[
"update_time"
]
=
$modified
;
return
$arr
;
}
/**
* 退款
*/
public
function
convertRefund
()
{
/* $field = "a.apply_id,a.tui_money,a.name,a.bank,a.bank_card,a.content,a.transaction_status,a.time,a.admin,
b.id as report_id,c.id as order_id,c.order_no";
$refundList = $this->refundModel->getRefundList($field);
foreach ($refundList as $item) {
$this->refundBin();
}*/
/* $field = "a.apply_id,a.tui_money,a.name,a.bank,a.bank_card,a.content,a.transaction_status,a.time,a.admin,
b.id as report_id,c.id as order_id,c.order_no";
$refundList = $this->refundModel->getRefundList($field);
foreach ($refundList as $item) {
$this->refundBin();
}*/
}
//退款
private
function
refundBin
()
{
/* $arr["agent_id"] = $report_id;
$arr["report_id"] = $father_id;
$arr["order_id"] = $order_no;
$arr["order_no"] = $order_id;
$arr["refund_money"] = $agent_id;
$arr["name"] = $collecting_arr["type"];
$arr["bank"] = $collecting_arr["pay_type"];
$arr["card_no"] = $collecting_arr["money"];
$arr["remark"] = $house_number;
$arr["remark_img"] = $industry_type;
$arr["create_time"] = date("Y-m-d H:i:s", time());
$arr["update_time"] = date("Y-m-d H:i:s", time());
return $arr;
//todo 判断此单是否有付款
$is_ok = $this->o_refund_model->addRefund($params);*/
/* $arr["agent_id"] = $report_id;
$arr["report_id"] = $father_id;
$arr["order_id"] = $order_no;
$arr["order_no"] = $order_id;
$arr["refund_money"] = $agent_id;
$arr["name"] = $collecting_arr["type"];
$arr["bank"] = $collecting_arr["pay_type"];
$arr["card_no"] = $collecting_arr["money"];
$arr["remark"] = $house_number;
$arr["remark_img"] = $industry_type;
$arr["create_time"] = date("Y-m-d H:i:s", time());
$arr["update_time"] = date("Y-m-d H:i:s", time());
return $arr;
//todo 判断此单是否有付款
$is_ok = $this->o_refund_model->addRefund($params);*/
}
private
function
reportBin
(
$id
,
$report_agent_id
,
$report_agent_phone
,
$report_agent_name
,
$report_store_id
,
$user_id
,
$user_phone
,
$user_name
,
...
...
@@ -197,7 +287,7 @@ class ConvertOrder extends Basic
}
//成交报告
//成交报告
产品沟通之前线上没有
private
function
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
)
{
$arr
[
"report_id"
]
=
$report_id
;
...
...
@@ -240,29 +330,6 @@ class ConvertOrder extends Basic
$is_ok
=
$this
->
fulModel
->
addFollowUpLog
(
$params
);
}
//收款
private
function
collectingBillBin
(
$father_id
,
$collecting_arr
,
$agent_id
,
$report_id
,
$order_id
,
$order_no
,
$house_number
,
$industry_type
,
$remark
,
$transfer_img
)
{
$arr
[
"report_id"
]
=
$report_id
;
$arr
[
"father_id"
]
=
$father_id
;
$arr
[
"order_no"
]
=
$order_no
;
$arr
[
"order_id"
]
=
$order_id
;
$arr
[
"agent_id"
]
=
$agent_id
;
$arr
[
"type"
]
=
$collecting_arr
[
"type"
];
$arr
[
"pay_type"
]
=
$collecting_arr
[
"pay_type"
];
$arr
[
"money"
]
=
$collecting_arr
[
"money"
];
$arr
[
"house_number"
]
=
$house_number
;
$arr
[
"industry_type"
]
=
$industry_type
;
$arr
[
"remark"
]
=
$remark
;
$arr
[
"transfer_img"
]
=
$transfer_img
;
$arr
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
return
$arr
;
}
private
function
marchInBin
(
$reception_id
,
$report_id
,
$order_id
,
$order_no
,
$march_in_remark
,
$march_in_img
,
$march_in_area
,
$create_time
,
$update_time
)
{
...
...
application/api/extend/Basic.php
View file @
e0bd2dde
...
...
@@ -50,6 +50,7 @@ class Basic extends Controller
"api/commentAndDeal"
,
"api/check_code"
,
"api/convertOrderByTime"
,
"api/convertCollectingBill"
,
);
/**
...
...
application/model/JournalAccounts.php
View file @
e0bd2dde
...
...
@@ -7,7 +7,7 @@ use think\helper\Time;
class
JournalAccounts
extends
Model
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'
J
ournalaccounts'
;
protected
$table
=
'
j
ournalaccounts'
;
protected
$db
;
function
__construct
()
...
...
@@ -108,4 +108,20 @@ class JournalAccounts extends Model
->
page
(
$pageNo
)
->
select
();
}
public
function
getJournalAccountsListByStatus
(
$pageNo
=
1
,
$pageSize
=
15
,
$field
)
{
$params
[
"a.transaction_status"
]
=
array
(
"in"
,
"2,3"
);
return
$this
->
db
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
'o_report b'
,
'a.apply_id = b.id'
,
'LEFT'
)
->
join
(
'o_order c'
,
'b.id = c.f_id'
,
'LEFT'
)
->
join
(
'agents d'
,
'a.operaaccount = d.realname'
,
'LEFT'
)
->
where
(
$params
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
}
application/route.php
View file @
e0bd2dde
...
...
@@ -279,6 +279,7 @@ Route::group('api', [
'convertOrderByTime'
=>
[
'api/ConvertOrder/convertOrderByTime'
,
[
'method'
=>
'post|get'
]
],
'convertCollectingBill'
=>
[
'api/ConvertOrder/convertCollectingBill'
,
[
'method'
=>
'post|get'
]
],
'houseTable'
=>
[
'api/TransferHouseInfo/table'
,
[
'method'
=>
'post|get'
]
],
//转商铺表
'houseImgTable'
=>
[
'api/TransferHouseInfo/houseImg'
,
[
'method'
=>
'post|get'
]
],
//转楼盘表
]);
...
...
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