-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplusad.model.php
More file actions
executable file
·114 lines (105 loc) · 2.13 KB
/
Copy pathplusad.model.php
File metadata and controls
executable file
·114 lines (105 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
/**
* @class plusadModel
* @brief PlusAd module model class
*/
class plusadModel extends plusad
{
/**
* @brief Initialization
*/
function init()
{
}
/**
* @brief Get module information
* @return object|void Module information
*/
function getplusadinfo()
{
$output = executeQuery('plusad.getplusadinfo');
if (!$output->data->module_srl)
{
return;
}
$module_info = moduleModel::getModuleInfoByModuleSrl($output->data->module_srl);
return $module_info;
}
/**
* @brief Get single ad by ad_srl
* @param int $ad_srl Ad serial number
* @return object|null Ad data
*/
function getad($ad_srl)
{
$args = new stdClass();
$args->ad_srl = $ad_srl;
$output = executeQuery('plusad.getad', $args);
if ($output->data)
{
return $output->data;
}
return null;
}
/**
* @brief Get valid ad list
* @param object $args Arguments
* @return Object Query result
*/
function getadlist($args = null)
{
if (!$args)
{
$args = new stdClass();
}
// Set current time for comparison with remaining time
$args->nowdate = date('Y-m-d H:i:s');
$output = executeQuery('plusad.getadlist', $args);
return $output;
}
/**
* @brief Delete ad
* @return Object Query result
*/
function deletead()
{
$args = new stdClass();
$args->ad_srl = Context::get('ad_srl');
// Execute delete
$output = executeQuery("plusad.deletead", $args);
return $output;
}
/**
* @brief Delete ad log (individual)
* @return Object Query result
*/
function deleteadponit()
{
$args = new stdClass();
$args->ad_srl = Context::get('ad_srl');
// Execute delete
$output = executeQuery('plusad.deletead', $args);
return $output;
}
/**
* @brief Delete all ad logs
* @return Object Query result
*/
function deleteadall()
{
$output = executeQuery('plusad.deleteadall');
return $output;
}
/**
* @brief Delete expired ad logs
* @return Object Query result
*/
function deleteadlast()
{
$args = new stdClass();
// Set current time for comparison with remaining time
$args->nowdate = date('Y-m-d H:i:s');
$output = executeQuery('plusad.deleteadlast', $args);
return $output;
}
}