projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
78dad3b
)
UpdateCurrencyRate.php
author
Edward
<edward@roojs.com>
Mon, 20 Oct 2014 08:23:51 +0000
(16:23 +0800)
committer
Edward
<edward@roojs.com>
Mon, 20 Oct 2014 08:23:51 +0000
(16:23 +0800)
UpdateCurrencyRate.php
patch
|
blob
|
history
diff --git
a/UpdateCurrencyRate.php
b/UpdateCurrencyRate.php
index
56decfd
..
d6213e0
100644
(file)
--- a/
UpdateCurrencyRate.php
+++ b/
UpdateCurrencyRate.php
@@
-55,12
+55,15
@@
class Pman_Core_UpdateCurrencyRate extends Pman
die('no any currency');
}
die('no any currency');
}
+ $fromDate = date('m/d/y', strtotime("-6 MONTH"));
+ $toDate = date('m/d/y');
+
foreach ($currency as $c){
$params = array(
'lang' => 'en',
'result' => 1,
foreach ($currency as $c){
$params = array(
'lang' => 'en',
'result' => 1,
- 'date1' =>
date('m/d/y', strtotime("-6 MONTH"))
,
- 'date'=>
date('m/d/y')
,
+ 'date1' =>
$fromDate
,
+ 'date'=>
$toDate
,
'date_fmt' => 'us',
'exch' => $c,
'expr' => 'USD',
'date_fmt' => 'us',
'exch' => $c,
'expr' => 'USD',
@@
-85,7
+88,17
@@
class Pman_Core_UpdateCurrencyRate extends Pman
$curr = DB_DataObject::factory('core_curr_rate');
$curr = DB_DataObject::factory('core_curr_rate');
- $curr->setFrom(array(
+ $curr->curr = $c;
+
+ $o = false;
+
+ if($curr->find(true)){
+ $o = clone($curr);
+ }
+
+ $curr->setForm(array(
+ 'rate' => $rate,
+ 'from' =>
));
));