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
46a75cf9
Commit
46a75cf9
authored
Aug 06, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
未提交财务日报的门店
parent
e9b5add1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
21 deletions
+90
-21
PushMessageService.php
application/api_broker/service/PushMessageService.php
+4
-0
DailyUncommitted.php
application/index/controller/DailyUncommitted.php
+68
-18
AStore.php
application/model/AStore.php
+14
-0
ODailyUncommittedModel.php
application/model/ODailyUncommittedModel.php
+3
-3
route.php
application/route.php
+1
-0
No files found.
application/api_broker/service/PushMessageService.php
View file @
46a75cf9
...
@@ -421,6 +421,10 @@ class PushMessageService
...
@@ -421,6 +421,10 @@ class PushMessageService
$title
=
'退款驳回'
;
$title
=
'退款驳回'
;
$type
=
''
;
$type
=
''
;
break
;
break
;
case
15
:
$title
=
'财务日报提醒'
;
$type
=
''
;
break
;
}
}
$this
->
pushAgentAllDeviceId
(
$v
[
'addressee_id'
],
$title
,
$v
[
'message'
],
$type
,
$id
,
$is_forbidden
,
$v
[
'house_id'
],
$v
[
'order_id'
]);
$this
->
pushAgentAllDeviceId
(
$v
[
'addressee_id'
],
$title
,
$v
[
'message'
],
$type
,
$id
,
$is_forbidden
,
$v
[
'house_id'
],
$v
[
'order_id'
]);
...
...
application/index/controller/DailyUncommitted.php
View file @
46a75cf9
...
@@ -3,9 +3,12 @@
...
@@ -3,9 +3,12 @@
namespace
app\index\controller
;
namespace
app\index\controller
;
use
app\api\service\AccountBalanceService
;
use
app\api\service\AccountBalanceService
;
use
app\api_broker\service\PushMessageService
;
use
app\api_broker\service\RedisCacheService
;
use
app\api_broker\service\RedisCacheService
;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\model\AStore
;
use
app\model\GReceiptOperatingRecords
;
use
app\model\GReceiptOperatingRecords
;
use
app\model\ODaily
;
use
app\model\ODailyUncommittedModel
;
use
app\model\ODailyUncommittedModel
;
use
think\Request
;
use
think\Request
;
...
@@ -21,27 +24,74 @@ class DailyUncommitted extends Basic
...
@@ -21,27 +24,74 @@ class DailyUncommitted extends Basic
}
}
/**
/**
* 新增记录
* 未提交财务日报的门店
* @param $agents_id
* @return \think\Response
* @param $type
*/
* @param $pay_log_id
public
function
selectDailyUncommitted
()
{
$time
=
date
(
"Y-m-d"
);
$m_store
=
new
AStore
();
$m_daily
=
new
ODaily
();
$s_push_msg
=
new
PushMessageService
();
//门店集合
$store_result
=
$m_store
->
selectDailyUncommitted
(
'a.id,a.district_id,b.id as agent_id,b.name'
,
[]);
foreach
(
$store_result
as
$k
=>
$v
)
{
$params_d
=
[];
$params_d
[
'store_id'
]
=
$v
[
'id'
];
$params_d
[
'daily_date'
]
=
$time
;
//查询门店当天是否提交日报
$daily_data
=
$m_daily
->
getDailyList
(
'id,site_id'
,
$params_d
,
1
,
1
);
if
(
empty
(
$daily_data
))
{
if
(
!
$v
[
'agent_id'
]){
continue
;
}
//没提交插入数据表
$params_add
=
[];
$params_add
[
"agent_id"
]
=
$v
[
'agent_id'
];
$params_add
[
"agent_name"
]
=
$v
[
'name'
];
$params_add
[
"store_id"
]
=
$v
[
'id'
];
$params_add
[
"district_id"
]
=
$v
[
'district_id'
];
$params_add
[
"daily_date"
]
=
$time
;
$this
->
addDailyUncommitted
(
$params_add
);
$agent_ids
[]
=
$v
[
'agent_id'
];
}
}
//推送
if
(
isset
(
$agent_ids
)){
$message
=
'辛苦了!记得提交今日的财务日报!'
;
$s_push_msg
->
record
(
15
,
0
,
$agent_ids
,
$this
->
userId
,[
'message'
=>
$message
]);
}
return
$this
->
response
(
"200"
,
"成功"
,
[]);
}
/**
* 新增
* @param $params
* @return bool
* @return bool
*/
*/
public
function
add
Operating
(
$agents_id
,
$type
,
$pay_log_id
)
public
function
add
DailyUncommitted
(
$params
)
{
{
// $data["agents_id"] = $agents_id;
$data
[
"agent_id"
]
=
$params
[
'agent_id'
];
// $data["type"] = $type;
$data
[
"agent_name"
]
=
$params
[
'agent_name'
];
// $data["remark"] = $type == 1 ? "删除收款ID:{$pay_log_id}" : "撤销调整收款ID:{$pay_log_id}";
$data
[
"store_id"
]
=
$params
[
'store_id'
];
// $data["pay_log_id"] = $pay_log_id;
$data
[
"district_id"
]
=
$params
[
'district_id'
];
//
$data
[
"daily_date"
]
=
$params
[
'daily_date'
];
// $result = $this->m_receipt_operating_records->saveOperating($data);//int(1)
$data
[
"status"
]
=
0
;
//
$data
[
"is_inform"
]
=
1
;
// if ($result) {
// return true;
// } else {
// return false;
// }
$result
=
$this
->
m_daily_uncommitted
->
saveDailyUncommitted
(
$data
);
//int(1)
if
(
$result
)
{
return
true
;
}
else
{
return
false
;
}
}
}
...
@@ -67,7 +117,7 @@ class DailyUncommitted extends Basic
...
@@ -67,7 +117,7 @@ class DailyUncommitted extends Basic
if
(
!
empty
(
$params
[
'store_id'
]))
{
if
(
!
empty
(
$params
[
'store_id'
]))
{
$conditions
[
'a.store_id'
]
=
$params
[
'store_id'
];
$conditions
[
'a.store_id'
]
=
$params
[
'store_id'
];
}
}
$conditions
[
'a.status'
]
=
1
;
$conditions
[
'a.status'
]
=
0
;
$field
=
'a.daily_date,b.store_name'
;
$field
=
'a.daily_date,b.store_name'
;
$result
=
$this
->
m_daily_uncommitted
->
getDailyUncommittedList
(
$field
,
$conditions
,
$pageNo
,
$pageSize
);
$result
=
$this
->
m_daily_uncommitted
->
getDailyUncommittedList
(
$field
,
$conditions
,
$pageNo
,
$pageSize
);
if
(
!
$result
)
if
(
!
$result
)
...
...
application/model/AStore.php
View file @
46a75cf9
...
@@ -468,4 +468,17 @@ class AStore extends BaseModel
...
@@ -468,4 +468,17 @@ class AStore extends BaseModel
return
$this
->
where
(
$where
)
return
$this
->
where
(
$where
)
->
column
(
$field
);
->
column
(
$field
);
}
}
public
function
selectDailyUncommitted
(
$field
,
$params
)
{
$params
[
"a.status"
]
=
0
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.id = b.store_id and (b.level = 20 or b.level = 40) '
,
'left'
)
->
where
(
$params
)
->
select
();
// big_log($this->getLastSql());
return
$result
;
}
}
}
\ No newline at end of file
application/model/ODailyUncommittedModel.php
View file @
46a75cf9
...
@@ -19,9 +19,9 @@ class ODailyUncommittedModel extends Model
...
@@ -19,9 +19,9 @@ class ODailyUncommittedModel extends Model
public
function
saveDailyUncommitted
(
$data
)
{
public
function
saveDailyUncommitted
(
$data
)
{
$time
=
date
(
"Y-m-d H:i:s"
,
time
());
$time
=
date
(
"Y-m-d H:i:s"
,
time
());
$data
[
'
a.
create_time'
]
=
$time
;
$data
[
'create_time'
]
=
$time
;
$data
[
'
a.
update_time'
]
=
$time
;
$data
[
'update_time'
]
=
$time
;
$data
[
'
a.
is_del'
]
=
0
;
$data
[
'is_del'
]
=
0
;
return
$this
->
db_
->
insert
(
$data
);
return
$this
->
db_
->
insert
(
$data
);
}
}
...
...
application/route.php
View file @
46a75cf9
...
@@ -570,6 +570,7 @@ Route::group('index', [
...
@@ -570,6 +570,7 @@ Route::group('index', [
'receiptOperatingRecordsList'
=>
[
'index/ReceiptOperatingRecords/receiptOperatingRecordsList'
,
[
'method'
=>
'POST|GET'
]],
'receiptOperatingRecordsList'
=>
[
'index/ReceiptOperatingRecords/receiptOperatingRecordsList'
,
[
'method'
=>
'POST|GET'
]],
'DailyUncommittedList'
=>
[
'index/DailyUncommitted/DailyUncommittedList'
,
[
'method'
=>
'POST|GET'
]],
'DailyUncommittedList'
=>
[
'index/DailyUncommitted/DailyUncommittedList'
,
[
'method'
=>
'POST|GET'
]],
'selectDailyUncommitted'
=>
[
'index/DailyUncommitted/selectDailyUncommitted'
,
[
'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