Authored by whb

修改bug

... ... @@ -47,7 +47,7 @@ class Config_Defines
self::setRelease();
}
define('SITE_PUBLISH_NEWS_SECRET', 'yoho9646');
$dir = dirname(dirname(__FILE__));
... ... @@ -109,15 +109,16 @@ class Config_Defines
// 主域名
define('SITE_DOMAIN', '.test.yoho.cn');
// 静态资源目录
define('SITE_RES', 'http://res.test.yohood.yoho.cn');
define('SITE_RES', 'http://res.yohood.test.yoho.cn');
// 主站
define('SITE_MAIN', 'http://yohood.yohobuy.com');
define('SITE_MAIN', 'http://yohood.test.yoho.cn');
define('QINIU_UPLOAD_STATE', true);
define('QINIU_UPLOAD_CLASS', 'Lib_Utils_QiniuUpload');
define('QINIU_UPLOAD_ACCESSKEY', 'cY9B5ZgON_7McTS5zV5nTeRyQ98MOcVD7W4eGVbE');
define('QINIU_UPLOAD_SECRETKEY', 'RduqgmK7cAtaQvdIa1ax_zzmMsnv9ac-Ka0uF6wG');
define('SHOW_SITE_MAIN', 'http://show.test.yoho.cn/');
define('YOHOBUY_API','http://api.open.yohobuy.com/?');
define('SITE_PUBLISH_NEWS_SECRET', '123456');
self::setCache(false, false, false, false);
}
... ... @@ -139,6 +140,7 @@ class Config_Defines
define('QINIU_UPLOAD_ACCESSKEY', 'cY9B5ZgON_7McTS5zV5nTeRyQ98MOcVD7W4eGVbE');
define('QINIU_UPLOAD_SECRETKEY', 'RduqgmK7cAtaQvdIa1ax_zzmMsnv9ac-Ka0uF6wG');
define('YOHOBUY_API','http://api.open.yohobuy.com/?');
define('SITE_PUBLISH_NEWS_SECRET', 'yoho9646');
self::setCache(true, true, true, true);
}
... ...
... ... @@ -79,7 +79,7 @@ class Controller_News extends Controller_Abstract
$content = $this->_request->content;
$pics = $this->_request->pics;
$thumb = $this->_request->thumb;
if(empty($brand_ids)|| empty($title) || empty($content) || empty($pics) || empty($thumb))
if(empty($title) || empty($content) || empty($pics) || empty($thumb))
{
return $this->returnJson(false, 403, '','参数不能为空');
}
... ... @@ -94,7 +94,10 @@ class Controller_News extends Controller_Abstract
$id = Facade_News::setInfo($data);
foreach($brand_ids as $brandID)
{
Facade_Brand::setBrandNewsRela($id, $brandID);
if(Facade_Brand::getBrandByID($brandID))
{
Facade_Brand::setBrandNewsRela($id, $brandID);
}
}
return $this->returnJson(true, 200, '','发布成功');
}
... ... @@ -105,6 +108,21 @@ class Controller_News extends Controller_Abstract
}
/**
* 获取标签
*
* @return json
*/
public function gettagsAction()
{
$res = array();
foreach(Facade_News::$types as $key=> $name)
{
$res[] = array('id'=> $key, 'name'=> $name);
}
return $this->returnJson(true, 200, $res);
}
/**
* 详情页
*/
public function detailAction()
... ...
... ... @@ -95,9 +95,9 @@ class Facade_Brand
* @param unknown_type $id
* @return Ambigous <multitype:, Util_Dao_Db_PdoQuery>
*/
public static function getBrandbyID($id)
public static function getBrandByID($id)
{
return self::service()->getBrandbyID($id);
return self::service()->getBrandByID($id);
}
/**
... ...
... ... @@ -119,9 +119,9 @@ class Service_Brand extends Lib_Service
* @param string $id
* @return array
*/
public function getBrandbyID($id)
public function getBrandByID($id)
{
return self::service(self::ROUTER)->tag(self::$_tag)->fetchRow('getBrandbyID', array('id'=>$id));
return self::service(self::ROUTER)->tag(self::$_tag)->fetchRow('getBrandByID', array('id'=>$id));
}
/**
... ...
... ... @@ -9,7 +9,7 @@
<select id="getBrandTotal">
SELECT COUNT(*) FROM tbl_brand WHERE state = :state
</select>
<select id="getBrandbyID">
<select id="getBrandByID">
SELECT * FROM tbl_brand WHERE id = :id
</select>
<update id="updateBrand">
... ...