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
f174124c
Commit
f174124c
authored
Nov 23, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
database
parent
4eddc134
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
4 deletions
+41
-4
TAgentTotalModel.php
application/model/TAgentTotalModel.php
+16
-4
ResultsSummaryNewTask.php
application/task/controller/ResultsSummaryNewTask.php
+25
-0
No files found.
application/model/TAgentTotalModel.php
View file @
f174124c
...
@@ -34,8 +34,6 @@ class TAgentTotalModel extends Model
...
@@ -34,8 +34,6 @@ class TAgentTotalModel extends Model
Db
::
commit
();
Db
::
commit
();
return
1
;
return
1
;
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
print_r
(
$e
);
Db
::
rollback
();
Db
::
rollback
();
return
0
;
return
0
;
}
}
...
@@ -52,12 +50,26 @@ class TAgentTotalModel extends Model
...
@@ -52,12 +50,26 @@ class TAgentTotalModel extends Model
foreach
(
$params
as
$k
=>
$v
)
{
foreach
(
$params
as
$k
=>
$v
)
{
$this
->
db_
->
table
(
$this
->
table
)
->
update
(
$v
);
$this
->
db_
->
table
(
$this
->
table
)
->
update
(
$v
);
}
}
// $this->saveAll($params);
Db
::
commit
();
Db
::
commit
();
return
1
;
return
1
;
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
0
;
}
}
print_r
(
$e
);
/**
* @param $params
* @return int
*/
public
function
updateTotal
(
$params
,
$where
)
{
Db
::
startTrans
();
try
{
$this
->
db_
->
where
(
$where
)
->
update
(
$params
);
Db
::
commit
();
return
1
;
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
Db
::
rollback
();
return
0
;
return
0
;
}
}
...
...
application/task/controller/ResultsSummaryNewTask.php
View file @
f174124c
...
@@ -133,6 +133,31 @@ class ResultsSummaryNewTask
...
@@ -133,6 +133,31 @@ class ResultsSummaryNewTask
}
}
/**
*同城调门店转业绩
* @param $agent_id
* @param $store_id
* @param $district_id
* @param $start_time
* @param $end_time
* @return bool
*/
public
function
updateStoreByAgentId
(
$agent_id
,
$store_id
,
$district_id
,
$start_time
,
$end_time
){
$date
=
floor
((
strtotime
(
$end_time
)
-
strtotime
(
$start_time
))
/
86400
);
if
(
$date
>
31
)
{
return
false
;
}
$params
[
"district_id"
]
=
$district_id
;
$params
[
"store_id"
]
=
$store_id
;
$where
[
"agent_id"
]
=
$agent_id
;
$where
[
"total_time"
]
=
array
(
"between"
,
array
(
$start_time
,
$end_time
));
$is_ok
=
$this
->
tAgentTotalModel
->
updateTotal
(
$params
,
$where
);
if
(
$is_ok
>
0
){
return
true
;
}
return
false
;
}
/**
/**
* @param $agent_id
* @param $agent_id
* @param $store_id
* @param $store_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