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
5d259fbb
Commit
5d259fbb
authored
Apr 16, 2018
by
clone
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' of
https://gitee.com/zwyjjc/tl_estate
into test
parents
c43cd989
c94a9337
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
259 additions
and
30 deletions
+259
-30
TransferHouseInfo.php
application/api/controller/TransferHouseInfo.php
+6
-2
Basic.php
application/api/extend/Basic.php
+1
-1
Broker.php
application/api_broker/controller/Broker.php
+10
-4
OrderLogService.php
application/api_broker/service/OrderLogService.php
+3
-2
PushMessageService.php
application/api_broker/service/PushMessageService.php
+1
-1
Auth.php
application/index/controller/Auth.php
+15
-10
Collection.php
application/index/controller/Collection.php
+88
-0
Basic.php
application/index/extend/Basic.php
+1
-3
getCollection.html
application/index/view/collection/getCollection.html
+3
-0
AuthGroup.php
application/model/AuthGroup.php
+46
-7
OPayLogModel.php
application/model/OPayLogModel.php
+84
-0
route.php
application/route.php
+1
-0
No files found.
application/api/controller/TransferHouseInfo.php
View file @
5d259fbb
...
...
@@ -49,8 +49,7 @@ class TransferHouseInfo extends Controller
}
$g_house_data
[
'market_area'
]
=
$house_info_data
[
'business_area'
];
$g_house_data
[
'shop_area_start'
]
=
$house_info_data
[
'room_area'
];
$g_house_data
[
'shop_area_end'
]
=
$house_info_data
[
'room_area2'
];
$g_house_data
[
'rent_type'
]
=
$house_info_data
[
'rent_type'
];
$g_house_data
[
'rent_price'
]
=
$house_info_data
[
'price'
];
$g_house_data
[
'industry_type'
]
=
$house_info_data
[
'yetai'
];
...
...
@@ -59,10 +58,15 @@ class TransferHouseInfo extends Controller
//状态 0待审批 1上架 2下架 3回收
if
(
$g_house_data
[
'room_num_left'
]
==
0
)
{
$g_house_data
[
'status'
]
=
2
;
$g_house_data
[
'shop_area_start'
]
=
$house_info_data
[
'room_area'
];
$g_house_data
[
'shop_area_end'
]
=
$house_info_data
[
'room_area2'
];
}
else
{
$g_house_data
[
'status'
]
=
1
;
$g_house_data
[
'shop_area_start'
]
=
$house_info_data
[
'room_area'
];
$g_house_data
[
'shop_area_end'
]
=
$house_info_data
[
'room_area'
];
}
$g_house_data
[
'home_page_sort'
]
=
empty
(
$house_info_data
[
'home_page_sort'
])
?
0
:
$house_info_data
[
'home_page_sort'
];
$g_house_data
[
'shop_type'
]
=
$house_info_data
[
'shangpu_type'
];
$g_house_data
[
'shop_sign'
]
=
$house_info_data
[
'shangpu_tags'
];
...
...
application/api/extend/Basic.php
View file @
5d259fbb
...
...
@@ -75,7 +75,7 @@ class Basic extends Controller
$result
=
$jwt
->
decode
(
$this
->
authToken
,
config
(
'jwt_key'
),
array
(
'HS256'
));
//解码token
$this
->
userId
=
$result
->
data
->
id
;
$this
->
phone
=
$result
->
data
->
phone
;
$this
->
userNick
=
$result
->
data
->
userNick
;
$this
->
userNick
=
isset
(
$result
->
data
->
userNick
)
?
$result
->
data
->
userNick
:
""
;
$this
->
timeStamp_
=
$result
->
timeStamp_
;
}
...
...
application/api_broker/controller/Broker.php
View file @
5d259fbb
...
...
@@ -17,10 +17,8 @@ use app\api_broker\service\OrderLogService;
use
app\model\AAgents
;
use
app\model\GOperatingRecords
;
use
app\model\NoteLog
;
use
app\model\ULabels
;
use
app\model\UPhoneFollowPp
;
use
app\model\Users
;
use
app\model\Agents
;
use
think\Request
;
class
Broker
extends
Basic
...
...
@@ -48,14 +46,22 @@ class Broker extends Basic
}
$field
=
'id,device_id,store_id,auth_group_id,district_id,level,name,phone,password,sex,img,inviter_id,status'
;
$where
[
'phone'
]
=
$this
->
params
[
'phone'
];
$where
[
'id'
]
=
[
'<>'
,
1
];
$where
[
'phone'
]
=
$this
->
params
[
'phone'
];
$where
[
'id'
]
=
[
'<>'
,
1
];
$agents_data
=
$this
->
a_agents
->
getAgentInfo
(
$field
,
''
,
$where
);
if
(
empty
(
$agents_data
))
{
return
$this
->
response
(
101
,
'没有该用户'
,
$data
[
'data'
]);
}
if
(
$agents_data
[
'status'
]
==
2
)
{
return
$this
->
response
(
101
,
'您已离职'
,
$data
[
'data'
]);
}
if
(
$agents_data
[
'status'
]
==
1
)
{
return
$this
->
response
(
101
,
'账号已冻结'
,
$data
[
'data'
]);
}
if
(
$agents_data
[
'password'
]
!=
md5
(
$this
->
params
[
'pwd'
]))
{
return
$this
->
response
(
101
,
'密码错误'
,
$data
[
'data'
]);
}
...
...
application/api_broker/service/OrderLogService.php
View file @
5d259fbb
...
...
@@ -132,11 +132,12 @@ class OrderLogService
array_push
(
$agent_arr
,[
$commission_val
[
"agent_id"
]]);
}
if
(
$father_id
>
0
)
{
//修改楼盘
$houseNumUpdateService
=
new
HouseNumUpdateService
();
$houseNumUpdateService
->
updateHouseNumByBargain
(
$order_id
);
$push_message
=
new
PushMessageService
();
$push_message
->
pushBargainMessage
(
$agent_arr
,
$report_id
);
//推送
$houseNumUpdateService
=
new
HouseNumUpdateService
();
$houseNumUpdateService
->
updateHouseNumByBargain
(
$order_id
);
}
//todo if bill_arr not null, save database table
if
(
!
empty
(
$bargain_arr
))
{
...
...
application/api_broker/service/PushMessageService.php
View file @
5d259fbb
...
...
@@ -102,7 +102,7 @@ class PushMessageService
$report_data
=
$report
->
getReportOrder
(
$field
,
[
'a.id'
=>
$report_id
]);
$store
=
new
AStore
();
$store_name
=
$store
->
getStoreKeyById
(
'store_name'
);
$store_name
=
$store
->
getStoreKeyById
(
'store_name'
,
$report_data
[
'report_store_id'
]
);
$content
=
"恭喜【
{
$store_name
}
】店【
{
$report_data
[
'report_agent_name'
]
}
】成交【
{
$report_data
[
'house_title'
]
}
】商铺一套"
;
...
...
application/index/controller/Auth.php
View file @
5d259fbb
...
...
@@ -253,22 +253,27 @@ class Auth extends Basic
}
return
$this
->
response
(
200
,
'可以查看'
,
$data
);
}
//编辑角色权限
/**
* 编辑角色权限
*
* @return \think\Response
*/
public
function
updateAccess
(){
$table
=
New
AuthGroup
;
$auth
=
new
AuthGroup
();
$this
->
params
[
'rules'
]
=
trim
(
$this
->
params
[
'rules'
],
','
);
$rules
=
$auth
->
getValue
(
'rules'
,[
'id'
=>
$this
->
params
[
'id'
]]);
$data
=
input
(
'post.'
);
// prt($data
);
$data
[
'rules'
]
=
trim
(
$data
[
'rules'
],
','
);
//提交数据
if
(
$table
->
editData
(
$data
,
$data
[
'id'
]))
{
if
(
$rules
==
$this
->
params
[
'rules'
])
{
return
$this
->
response
(
100
,
'无更新内容'
);
}
if
(
$auth
->
saveStatus
(
'rules'
,
$this
->
params
[
'rules'
],
$this
->
params
[
'id'
]))
{
return
$this
->
response
(
200
,
'成功'
);
}
else
{
return
$this
->
response
(
100
,
'失败'
);
}
}
/**
...
...
application/index/controller/Collection.php
0 → 100644
View file @
5d259fbb
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/4/16
* Time: 10:02
*/
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\model\OPayLogModel
;
class
Collection
extends
Basic
{
/**
* 收款记录
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getCollection
()
{
if
(
$this
->
request
->
isGet
())
{
$order
=
new
OPayLogModel
();
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$where
=
[];
if
(
!
empty
(
$this
->
params
[
'start_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
$where
[
'a.create_time'
]
=
[
'> time'
,
$this
->
params
[
'start_time'
]];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
empty
(
$this
->
params
[
'start_time'
]))
{
$where
[
'a.create_time'
]
=
[
'< time'
,
$this
->
params
[
'start_time'
]];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'start_time'
]))
{
$where
[
'a.create_time'
]
=
[
'between time'
,
[
$this
->
params
[
'end_time'
],
$this
->
params
[
'start_time'
]
]];
}
if
(
!
empty
(
$this
->
params
[
'internal_title'
]))
{
$where
[
'd.internal_title'
]
=
[
'like'
,
'%'
.
$where
[
'internal_title'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'user_name'
]))
{
$where
[
'c.user_name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'user_name'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'user_phone'
]))
{
$where
[
'c.user_phone'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'user_phone'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'id'
]))
{
$where
[
'd.id'
]
=
$this
->
params
[
'id'
];
}
if
(
!
empty
(
$this
->
params
[
'store_name'
]))
{
$where
[
'f.store_name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'store_name'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'report_phone'
]))
{
$where
[
'e.phone'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'report_phone'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'report_name'
]))
{
$where
[
'e.name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'report_name'
]
.
'%'
];
}
$field
=
'a.id,a.create_time,c.user_name,c.user_phone,a.money,a.pay_type,a.type,d.internal_title,d.internal_address'
;
$data
[
'data'
][
'list'
]
=
$order
->
getAddPayLogOrderListLmit
(
$pageNo
,
$pageSize
,
$order_
=
'a.id desc'
,
$field
,
$where
);
$data
[
'data'
][
'total'
]
=
$order
->
getAddPayLogOrderListLmitTotal
(
$where
);
$data
[
'data'
][
'money_total'
]
=
$order
->
getMoneyTotal
();
//总额
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
elseif
(
$this
->
request
->
isAjax
())
{
return
view
(
'getCollection'
);
}
}
}
\ No newline at end of file
application/index/extend/Basic.php
View file @
5d259fbb
...
...
@@ -119,12 +119,10 @@ class Basic extends Controller
'index/addHousesAgentsExclusive'
,
'index/houseEdit'
,
];
$is_auth
=
1
;
if
(
in_array
(
$requestPath
,
$exclude_auth
))
{
if
(
empty
(
$this
->
params
[
'upload_id'
])
||
(
$this
->
params
[
'upload_id'
]
!=
$this
->
userId
))
{
$is_auth
=
0
;
}
else
{
$is_auth
=
1
;
}
}
...
...
application/index/view/collection/getCollection.html
0 → 100644
View file @
5d259fbb
{layout name="global/frame_tpl" /}
收款记录
\ No newline at end of file
application/model/AuthGroup.php
View file @
5d259fbb
...
...
@@ -120,7 +120,8 @@ class AuthGroup extends BaseModel
/**
* 获取某个用户组的用户列表
*
* @param int $group_id 用户组id
* @param $group_id 用户组id
* @return mixed
*/
static
public
function
userInGroup
(
$group_id
){
$prefix
=
config
(
'database.prefix'
);
...
...
@@ -136,7 +137,11 @@ class AuthGroup extends BaseModel
/**
* 检查id是否全部存在
* @param array|string $gid 用户组id列表
*
* @param $modelname
* @param $mid
* @param string $msg
* @return bool
*/
public
function
checkId
(
$modelname
,
$mid
,
$msg
=
'以下id不存在:'
){
if
(
is_array
(
$mid
)){
...
...
@@ -160,21 +165,39 @@ class AuthGroup extends BaseModel
/**
* 检查用户组是否全部存在
* @param array|string $gid 用户组id列表
*
* @param $gid
* @return bool
*/
public
function
checkGroupId
(
$gid
){
return
$this
->
checkId
(
'AuthGroup'
,
$gid
,
'以下用户组id不存在:'
);
}
/**
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getList2
(
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
return
$this
->
field
(
$field
)
->
where
(
$params
)
->
order
(
$order_
)
->
select
();
}
/**
*检查重复
*
检查重复
*
* @param $key
* @param $name
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
repetition
(
$key
,
$name
){
$r
=
$this
->
field
(
$name
)
...
...
@@ -185,12 +208,28 @@ class AuthGroup extends BaseModel
}
else
{
return
false
;
}
}
}
//更新数据
/**
* 更新数据
*
* @param $name
* @param $key
* @param $ids
* @return $this
*/
public
function
saveStatus
(
$name
,
$key
,
$ids
){
$r
=
$this
->
where
(
"id"
,
'in'
,
$ids
)
->
update
([
$name
=>
$key
]);
return
$r
;
}
/**
* @param $key
* @param $where
* @return mixed
*/
public
function
getValue
(
$key
,
$where
)
{
return
$this
->
where
(
$where
)
->
value
(
$key
);
}
}
application/model/OPayLogModel.php
View file @
5d259fbb
...
...
@@ -173,4 +173,87 @@ class OPayLogModel extends Model
->
where
(
$where_
)
->
select
();
}
/**
* 收款记录
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAddPayLogOrderListLmit
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
){
if
(
isset
(
$params
[
'e.name'
])
||
isset
(
$params
[
'f.store_name'
])
||
isset
(
$params
[
'e.phone'
]))
{
$data
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
"o_report c"
,
"b.f_id = c.id"
,
"left"
)
->
join
(
'g_houses d'
,
'b.house_id = d.id'
,
'left'
)
->
join
(
'a_agents e'
,
'a.agent_id=e.id'
,
'left'
)
->
join
(
'a_store f'
,
'e.store_id=f.id'
,
'left'
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
$order_
)
->
where
(
$params
)
->
select
();
}
else
{
$data
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
"o_report c"
,
"b.f_id = c.id"
,
"left"
)
->
join
(
'g_houses d'
,
'b.house_id = d.id'
,
'left'
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
$order_
)
->
where
(
$params
)
->
select
();
}
return
$data
;
}
/**
* 收款记录总数
*
* @param string $params
* @return int|string
*/
public
function
getAddPayLogOrderListLmitTotal
(
$params
=
''
){
if
(
isset
(
$params
[
'e.name'
])
||
isset
(
$params
[
'f.store_name'
])
||
isset
(
$params
[
'e.phone'
]))
{
$data
=
Db
::
table
(
$this
->
table
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
"o_report c"
,
"b.f_id = c.id"
,
"left"
)
->
join
(
'g_houses d'
,
'b.house_id = d.id'
,
'left'
)
->
join
(
'a_agents e'
,
'a.agent_id=e.id'
,
'left'
)
->
join
(
'a_store f'
,
'e.store_id=f.id'
,
'left'
)
->
where
(
$params
)
->
count
();
}
else
{
$data
=
Db
::
table
(
$this
->
table
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
"o_report c"
,
"b.f_id = c.id"
,
"left"
)
->
join
(
'g_houses d'
,
'b.house_id = d.id'
,
'left'
)
->
where
(
$params
)
->
count
();
}
return
$data
;
}
/**
* 订单总额
*
* @return float|int
*/
public
function
getMoneyTotal
()
{
return
$this
->
sum
(
'money'
);
}
}
\ No newline at end of file
application/route.php
View file @
5d259fbb
...
...
@@ -208,6 +208,7 @@ Route::group('index', [
'test123'
=>
[
'index/WatchShop/test123'
,
[
'method'
=>
'get|post'
]
],
//时间轴
'agent_zhuan_aagent'
=>
[
'index/agent/agent_zhuan_aagent'
,
[
'method'
=>
'post|get'
]
],
//经纪人
'shop_a_store'
=>
[
'index/agent/shop_a_store'
,
[
'method'
=>
'post|get'
]
],
//经纪人
'getCollection'
=>
[
'index/Collection/getCollection'
,
[
'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