Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SooonerHotel
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
吴贤德
SooonerHotel
Commits
d4d79d0a
Commit
d4d79d0a
authored
Jul 31, 2019
by
吴贤德
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
中心接口:增加媒资自动推送逻辑
parent
cf4e58ba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
CenterAction.class.php
SooonerHotel/App/Lib/Action/Api/CenterAction.class.php
+40
-0
No files found.
SooonerHotel/App/Lib/Action/Api/CenterAction.class.php
View file @
d4d79d0a
...
...
@@ -51,6 +51,8 @@ class CenterAction extends Action
/**
* 修改云端片库媒资信息
* 参数:
* spid
* push_mode : 是否转推:0不转推,1转推(写入酒店片库)
* url : 华数媒资详情url
*/
public
function
media_update
(){
...
...
@@ -110,12 +112,16 @@ class CenterAction extends Action
}
}
else
{
$id
=
$model
->
add
(
$data
);
$data
[
"id"
]
=
$id
;
if
(
$id
){
echo
'true'
;
}
else
{
echo
'false'
;
}
}
$this
->
media_auto_push
(
$data
);
exit
;
}
function
null2str
(
$str
){
...
...
@@ -124,6 +130,40 @@ class CenterAction extends Action
}
return
$str
;
}
/*
* 媒资自动转推函数
* 批量修改媒资状态
* 批量推送添加
*/
function
media_auto_push
(
&
$data
){
$sp_id
=
$data
[
"sp_id"
];
$media_id
=
$data
[
"id"
];
$status
=
$data
[
"status"
];
$updateSQL
=
"UPDATE sh_hotel_media_map_
$sp_id
SET status=
$status
WHERE media_id=
$media_id
;"
;
M
(
''
)
->
execute
(
$updateSQL
);
$sql
=
"SELECT h.id,hm.media_id FROM sh_hotel h"
.
" LEFT JOIN (SELECT media_id,hotel_id FROM sh_hotel_media_map_
$sp_id
WHERE media_id=
$media_id
) hm ON h.id=hm.hotel_id"
.
" WHERE media_id IS NULL;"
;
$arr
=
M
(
""
)
->
query
(
$sql
);
// var_dump($arr);
foreach
(
$arr
as
$item
){
$dataList
[]
=
array
(
"media_id"
=>
$media_id
,
"hotel_id"
=>
$item
[
"id"
],
"status"
=>
$status
,
"status_inject"
=>
0
);
}
if
(
!
empty
(
$dataList
)){
M
(
"
$sp_id
"
,
"sh_hotel_media_map_"
)
->
addAll
(
$dataList
);
}
}
public
function
test_auto_push
(){
$data
[
"sp_id"
]
=
1
;
$data
[
"id"
]
=
300
;
$data
[
"status"
]
=
2
;
$this
->
media_auto_push
(
$data
);
}
/**
* 增量媒资变更列表
...
...
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