* adjust code for task #1626.

This commit is contained in:
wyd621
2013-08-02 08:42:51 +08:00
parent 0a3be4a998
commit 40f30c489a
+7
View File
@@ -254,7 +254,10 @@ class webappModel extends model
public function update($webappID)
{
$webapp = $this->getLocalAppByID($webappID);
$data = fixer::input('post')->remove('files,customWidth,customHeight')->get();
$data->url = trim($data->url);
if(strpos($data->url, 'http://') !== 0) $data->url = 'http://' . $data->url;
if($data->size == 'custom') $data->size = (float)$this->post->customWidth . 'x' . (float)$this->post->customHeight;
@@ -292,12 +295,16 @@ class webappModel extends model
->add('addedDate', helper::now())
->add('author', $this->app->user->account)
->remove('files,customWidth,customHeight')->get();
$data->url = trim($data->url);
if(strpos($data->url, 'http://') !== 0) $data->url = 'http://' . $data->url;
if($data->size == 'custom') $data->size = (float)$this->post->customWidth . 'x' . (float)$this->post->customHeight;
$this->dao->insert(TABLE_WEBAPP)->data($data)
->autocheck()
->batchCheck($this->config->webapp->create->requiredFields, 'notempty')
->exec();
if(!dao::isError())
{
$webappID = $this->dao->lastInsertID();