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
d5a80fd7
Commit
d5a80fd7
authored
Mar 19, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除图片 获取江浙沪城市
parent
1efdd842
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
34 deletions
+78
-34
Shop.php
application/api_broker/controller/Shop.php
+23
-8
Finance.php
application/index/controller/Finance.php
+41
-21
Regions.php
application/model/Regions.php
+10
-3
route.php
application/route.php
+4
-2
No files found.
application/api_broker/controller/Shop.php
View file @
d5a80fd7
...
@@ -6,6 +6,7 @@ use app\api_broker\extend\Basic;
...
@@ -6,6 +6,7 @@ use app\api_broker\extend\Basic;
use
app\model\AttentionModel
;
use
app\model\AttentionModel
;
use
app\model\GHouses
;
use
app\model\GHouses
;
use
app\model\GHousesImgs
;
use
app\model\GHousesImgs
;
use
app\model\Regions
;
/**
/**
* Created by PhpStorm.
* Created by PhpStorm.
...
@@ -332,25 +333,39 @@ class Shop extends Basic
...
@@ -332,25 +333,39 @@ class Shop extends Basic
$data
[
'msg'
]
=
''
;
$data
[
'msg'
]
=
''
;
$data
[
'data'
]
=
''
;
$data
[
'data'
]
=
''
;
if
(
empty
(
$this
->
params
[
'file_name'
])
||
empty
(
$this
->
params
[
'house_id'
])){
if
(
isset
(
$this
->
params
[
'house_id'
]))
{
$data
[
'msg'
]
=
'File_name or id house_id null'
;
}
else
{
$img
=
new
GHousesImgs
();
$img
=
new
GHousesImgs
();
$id
=
$img
->
getHouseImagesInfo
(
'id'
,[
$id
=
$img
->
getHouseImagesInfo
(
'id'
,[
'house_id'
=>
$this
->
params
[
'house_id'
],
'house_id'
=>
$this
->
params
[
'house_id'
],
'img_name'
=>
$this
->
params
[
'
file_name
'
]
'img_name'
=>
$this
->
params
[
'
save_path
'
]
]);
]);
if
(
empty
(
$id
[
'id'
]))
{
if
(
empty
(
$id
[
'id'
]))
{
$data
[
'msg'
]
=
'没有该文件'
;
$data
[
'status'
]
=
200
;
}
else
{
$path
=
ROOT_PATH
.
'public'
.
DS
.
'resource'
.
DS
.
'lib'
.
DS
.
'Attachments'
.
DS
.
'Images/'
;
@
unlink
(
$path
.
$this
->
params
[
'file_name'
]);
$img
->
editData
([
'img_status'
=>
1
],
$this
->
params
[
'house_id'
],
'id'
);
$img
->
editData
([
'img_status'
=>
1
],
$this
->
params
[
'house_id'
],
'id'
);
}
if
(
isset
(
$this
->
params
[
'save_path'
]))
{
$path
=
ROOT_PATH
.
'public'
.
DS
.
'resource'
.
DS
.
'lib'
.
DS
.
'Attachments'
.
DS
.
'Images/'
;
@
unlink
(
$path
.
$this
->
params
[
'save_path'
]);
$data
[
'status'
]
=
200
;
$data
[
'status'
]
=
200
;
}
}
}
}
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
}
/**
* 获取省市区数据
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAddress
()
{
$regions
=
new
Regions
();
$data
=
$regions
->
getRegionsCity
();
return
$this
->
response
(
200
,
''
,
$data
);
}
}
}
application/index/controller/Finance.php
View file @
d5a80fd7
...
@@ -11,7 +11,6 @@ namespace app\index\controller;
...
@@ -11,7 +11,6 @@ namespace app\index\controller;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\AAgentsPhone
;
use
app\model\OBargainModel
;
use
app\model\OBargainModel
;
use
app\model\OPayLogModel
;
use
app\model\OPayLogModel
;
...
@@ -79,7 +78,7 @@ class Finance extends Basic
...
@@ -79,7 +78,7 @@ class Finance extends Basic
$bargain
=
new
OBargainModel
();
$bargain
=
new
OBargainModel
();
if
(
empty
(
$this
->
params
[
'id'
])
||
empty
(
$this
->
params
[
'check_status'
]))
{
if
(
empty
(
$this
->
params
[
'id'
])
||
empty
(
$this
->
params
[
'check_status'
]))
{
$data
[
'code'
]
=
101
;
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'
id
is null'
;
$data
[
'msg'
]
=
'
Id or check_status
is null'
;
}
else
{
}
else
{
$status
=
$bargain
->
addCheckBargain
(
$this
->
params
[
'id'
],
$this
->
params
[
'check_status'
]);
$status
=
$bargain
->
addCheckBargain
(
$this
->
params
[
'id'
],
$this
->
params
[
'check_status'
]);
if
(
empty
(
$status
))
{
if
(
empty
(
$status
))
{
...
@@ -215,27 +214,33 @@ class Finance extends Basic
...
@@ -215,27 +214,33 @@ class Finance extends Basic
}
else
{
}
else
{
$bargain
=
new
OBargainModel
();
$bargain
=
new
OBargainModel
();
$bargain_data
=
$bargain
->
get
(
$this
->
params
[
'id'
]);
$bargain_data
=
$bargain
->
get
(
$this
->
params
[
'id'
]);
$insert_data
[
'report_id'
]
=
$bargain_data
[
'report_id'
];
if
(
empty
(
$bargain_data
))
{
$insert_data
[
'order_id'
]
=
$bargain_data
[
'order_id'
];
$insert_data
[
'order_no'
]
=
$bargain_data
[
'order_no'
];
$insert_data
[
'trade_type'
]
=
$bargain_data
[
'trade_type'
];
$insert_data
[
'submit_agent_id'
]
=
$bargain_data
[
'submit_agent_id'
];
$insert_data
[
'price'
]
=
$bargain_data
[
'price'
];
$insert_data
[
'commission'
]
=
$bargain_data
[
'commission'
];
$insert_data
[
'check_status'
]
=
$bargain_data
[
'check_status'
];
$insert_data
[
'status'
]
=
$bargain_data
[
'status'
];
$insert_data
[
'source'
]
=
1
;
$insert_data
[
'role'
]
=
empty
(
$this
->
params
[
'role'
])
?
0
:
$this
->
params
[
'role'
];
$insert_data
[
'scale_fee'
]
=
empty
(
$this
->
params
[
'commission'
])
?
0
:
$this
->
params
[
'scale_fee'
];
$insert_data
[
'practical_fee'
]
=
empty
(
$this
->
params
[
'practical_fee'
])
?
0
:
$this
->
params
[
'practical_fee'
];
$insert_data
[
'father_id'
]
=
empty
(
$this
->
params
[
'id'
])
?
0
:
$this
->
params
[
'id'
];
$insert_data
[
'scale'
]
=
empty
(
$this
->
params
[
'scale'
])
?
0
:
$this
->
params
[
'scale'
];
$data
[
'data'
]
=
$bargain
->
insertBargain
(
$insert_data
);
if
(
$data
[
'data'
]
==
0
)
{
$data
[
'code'
]
=
101
;
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'Add the failure.'
;
$data
[
'msg'
]
=
'Don\'t have info.'
;
}
else
{
$insert_data
[
'report_id'
]
=
$bargain_data
[
'report_id'
];
$insert_data
[
'order_id'
]
=
$bargain_data
[
'order_id'
];
$insert_data
[
'order_no'
]
=
$bargain_data
[
'order_no'
];
$insert_data
[
'trade_type'
]
=
$bargain_data
[
'trade_type'
];
$insert_data
[
'submit_agent_id'
]
=
$bargain_data
[
'submit_agent_id'
];
$insert_data
[
'price'
]
=
$bargain_data
[
'price'
];
$insert_data
[
'commission'
]
=
$bargain_data
[
'commission'
];
$insert_data
[
'check_status'
]
=
$bargain_data
[
'check_status'
];
$insert_data
[
'status'
]
=
$bargain_data
[
'status'
];
$insert_data
[
'source'
]
=
1
;
$insert_data
[
'role'
]
=
empty
(
$this
->
params
[
'role'
])
?
0
:
$this
->
params
[
'role'
];
$insert_data
[
'scale_fee'
]
=
empty
(
$this
->
params
[
'scale_fee'
])
?
0
:
$this
->
params
[
'scale_fee'
];
$insert_data
[
'practical_fee'
]
=
empty
(
$this
->
params
[
'practical_fee'
])
?
0
:
$this
->
params
[
'practical_fee'
];
$insert_data
[
'father_id'
]
=
empty
(
$this
->
params
[
'id'
])
?
0
:
$this
->
params
[
'id'
];
$insert_data
[
'scale'
]
=
empty
(
$this
->
params
[
'scale'
])
?
0
:
$this
->
params
[
'scale'
];
$data
[
'data'
][
'id'
]
=
$bargain
->
insertBargain
(
$insert_data
);
if
(
$data
[
'data'
]
==
0
)
{
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'Add the failure.'
;
}
}
}
}
}
return
$this
->
response
(
$data
[
'code'
],
$data
[
'msg'
],
$data
[
'data'
]);
return
$this
->
response
(
$data
[
'code'
],
$data
[
'msg'
],
$data
[
'data'
]);
...
@@ -268,6 +273,21 @@ class Finance extends Basic
...
@@ -268,6 +273,21 @@ class Finance extends Basic
$agent_store
=
$agent
->
getAgentsStoreById
([
'a.id'
=>
$v
[
'agent_id'
]],
$fields_a
);
$agent_store
=
$agent
->
getAgentsStoreById
([
'a.id'
=>
$v
[
'agent_id'
]],
$fields_a
);
$data
[
'data'
][
$k
][
'agent_name'
]
=
$agent_store
[
'name'
];
$data
[
'data'
][
$k
][
'agent_name'
]
=
$agent_store
[
'name'
];
$data
[
'data'
][
$k
][
'store_name'
]
=
$agent_store
[
'store_name'
];
$data
[
'data'
][
$k
][
'store_name'
]
=
$agent_store
[
'store_name'
];
switch
(
$v
[
'role'
])
{
case
1
:
$data
[
'data'
][
$k
][
'role_name'
]
=
'盘方'
;
break
;
case
2
:
$data
[
'data'
][
$k
][
'role_name'
]
=
'客方'
;
break
;
case
3
:
$data
[
'data'
][
$k
][
'role_name'
]
=
'反签'
;
break
;
case
4
:
$data
[
'data'
][
$k
][
'role_name'
]
=
'独家'
;
break
;
case
5
:
$data
[
'data'
][
$k
][
'role_name'
]
=
'合作方'
;
break
;
default
:
$data
[
'data'
][
$k
][
'role_name'
]
=
'无'
;
}
}
}
}
}
...
...
application/model/Regions.php
View file @
d5a80fd7
...
@@ -64,8 +64,15 @@ class Regions extends Model
...
@@ -64,8 +64,15 @@ class Regions extends Model
return
$result
;
return
$result
;
}
}
public
function
getCity
()
{
/**
$city
=
$this
->
where
(
'type'
,
2
)
->
select
();
* 获取江浙沪城市
return
$city
;
*
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getRegionsCity
()
{
return
$this
->
field
(
'fullName'
)
->
where
(
'parentCode in (310000, 320000, 330000)'
)
->
select
();
}
}
}
}
application/route.php
View file @
d5a80fd7
...
@@ -175,10 +175,10 @@ Route::group('index', [
...
@@ -175,10 +175,10 @@ Route::group('index', [
'reportListUndone/:status'
=>
[
'index/Finance/reportList'
,
[
'method'
=>
'get'
]
,[
'status'
=>
21
]],
//财务 成交报告-已撤销
'reportListUndone/:status'
=>
[
'index/Finance/reportList'
,
[
'method'
=>
'get'
]
,[
'status'
=>
21
]],
//财务 成交报告-已撤销
'refundList'
=>
[
'index/Finance/refundList'
,
[
'method'
=>
'get|post'
]
],
//财务 退款
'refundList'
=>
[
'index/Finance/refundList'
,
[
'method'
=>
'get|post'
]
],
//财务 退款
'accountList'
=>
[
'index/Finance/accountList'
,
[
'method'
=>
'get|post'
]
],
//财务 账户列表
'accountList'
=>
[
'index/Finance/accountList'
,
[
'method'
=>
'get|post'
]
],
//财务 账户列表
'checkReport'
=>
[
'index/Finance/checkReport'
,
[
'method'
=>
'post'
]
],
//
财务
审核成交报告
'checkReport'
=>
[
'index/Finance/checkReport'
,
[
'method'
=>
'post'
]
],
//审核成交报告
'bargainInfo'
=>
[
'index/Finance/bargainInfo'
,
[
'method'
=>
'get'
]
],
//获取成交报告详情
'bargainInfo'
=>
[
'index/Finance/bargainInfo'
,
[
'method'
=>
'get'
]
],
//获取成交报告详情
'editBargainInfo'
=>
[
'index/Finance/editBargainInfo'
,
[
'method'
=>
'post'
]
],
//修改成交报告佣金
'editBargainInfo'
=>
[
'index/Finance/editBargainInfo'
,
[
'method'
=>
'post'
]
],
//修改成交报告佣金
'addBargain'
=>
[
'index/Finance/addBargain'
,
[
'method'
=>
'post'
]
],
//新增成交报告佣金
'addBargain'
=>
[
'index/Finance/addBargain'
,
[
'method'
=>
'post'
]
],
//新增成交报告佣金
(分佣提成)
'commissionList'
=>
[
'index/Finance/commissionList'
,
[
'method'
=>
'get'
]
],
//分佣提成
'commissionList'
=>
[
'index/Finance/commissionList'
,
[
'method'
=>
'get'
]
],
//分佣提成
'payLogList'
=>
[
'index/Finance/payLogList'
,
[
'method'
=>
'get'
]
],
//收款记录
'payLogList'
=>
[
'index/Finance/payLogList'
,
[
'method'
=>
'get'
]
],
//收款记录
]);
]);
...
@@ -332,6 +332,7 @@ Route::group('broker', [
...
@@ -332,6 +332,7 @@ Route::group('broker', [
'getLabelsShopList'
=>
[
'api_broker/label/getLabelsShopList'
,
[
'method'
=>
'get'
]],
//编辑商铺
'getLabelsShopList'
=>
[
'api_broker/label/getLabelsShopList'
,
[
'method'
=>
'get'
]],
//编辑商铺
'uploadHouseFile'
=>
[
'api_broker/shop/uploadHouseFile'
,
[
'method'
=>
'post'
]],
//商铺上传文件
'uploadHouseFile'
=>
[
'api_broker/shop/uploadHouseFile'
,
[
'method'
=>
'post'
]],
//商铺上传文件
'delHouseFile'
=>
[
'api_broker/shop/delHouseFile'
,
[
'method'
=>
'post'
]],
//商铺文件删除
'delHouseFile'
=>
[
'api_broker/shop/delHouseFile'
,
[
'method'
=>
'post'
]],
//商铺文件删除
'getAddress'
=>
[
'api_broker/shop/getAddress'
,
[
'method'
=>
'get'
]],
//获取江浙沪城市
]);
]);
//Route::miss('api/index/miss');//处理错误的url
//Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
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