|
|
@@ -41,7 +41,7 @@ class Home extends Api
|
|
|
];
|
|
|
// banner
|
|
|
$resp['banner_list'] = $announcement
|
|
|
- ->field('id,'.$this->lan.'_title,img_url,createtime')
|
|
|
+ ->field('id,'.$this->lan.'_title as title,img_url,createtime')
|
|
|
->where('type_id', $announcement::Banner)
|
|
|
->where('status', $announcement::NORMAL)
|
|
|
->limit(0,10)
|
|
|
@@ -50,7 +50,7 @@ class Home extends Api
|
|
|
|
|
|
// 最新公告
|
|
|
$resp['notice_list'] = $announcement
|
|
|
- ->field('id,'.$this->lan.'_title,img_url,createtime')
|
|
|
+ ->field('id,'.$this->lan.'_title as title,img_url,createtime')
|
|
|
->where('type_id', $announcement::Announ)
|
|
|
->where('status', $announcement::NORMAL)
|
|
|
->limit(0,10)
|
|
|
@@ -58,7 +58,7 @@ class Home extends Api
|
|
|
->select();
|
|
|
//分类
|
|
|
$resp['type_list'] = $productsModel->where('status', $productsModel::NORMAL)
|
|
|
- ->field('id,'.$this->lan.'_title')
|
|
|
+ ->field('id,'.$this->lan.'_title as title')
|
|
|
->order('sort desc')
|
|
|
->select();
|
|
|
$this->success('', $resp);
|
|
|
@@ -74,7 +74,7 @@ class Home extends Api
|
|
|
// 热销
|
|
|
$resp['product_list'] = $productPopular->alias('a')
|
|
|
->join("product_list b", "a.product_id = b.id", "left")
|
|
|
- ->field('a.id,'.'b.'.$this->lan.'_name,b.thum as img_url,price,cost_price,stock,num,start_time,end_time')
|
|
|
+ ->field('a.id,'.'b.'.$this->lan.'_name as name,b.thum as img_url,price,cost_price,stock,num,start_time,end_time')
|
|
|
->limit(2)
|
|
|
->where('a.status', '<', $productPopular::STOP)
|
|
|
->order('a.weigh desc')
|
|
|
@@ -85,7 +85,7 @@ class Home extends Api
|
|
|
->join("product_list b", "a.product_id = b.id", "left")
|
|
|
->join("user u", "a.user_id = u.id", "left")
|
|
|
->join("products d", "b.type_id = d.id", "left")
|
|
|
- ->field('a.id,'.'b.'.$this->lan.'_name,b.thum as img_url,price,u.nickname,d.'.$this->lan.'_title')
|
|
|
+ ->field('a.id,'.'b.'.$this->lan.'_name as name,b.thum as img_url,price,u.nickname,d.'.$this->lan.'_title as title')
|
|
|
->where('a.status', $productTransfer::NORMAL)
|
|
|
->limit(2)
|
|
|
->order('a.id DESC')
|
|
|
@@ -112,7 +112,7 @@ class Home extends Api
|
|
|
$order = array();
|
|
|
$info = $productPopular->alias('a')
|
|
|
->join("product_list b", "a.product_id = b.id", "left")
|
|
|
- ->field('a.id,a.product_id,'.'b.'.$this->lan.'_name,b.images as img_url,price,cost_price,stock,num,start_time,end_time')
|
|
|
+ ->field('a.id,a.product_id,'.'b.'.$this->lan.'_name as name,b.images as img_url,price,cost_price,stock,num,start_time,end_time')
|
|
|
->where('a.id', $ids)
|
|
|
->order('a.weigh desc')
|
|
|
->find();
|
|
|
@@ -149,7 +149,7 @@ class Home extends Api
|
|
|
|
|
|
$info = $productTransfer->alias('a')
|
|
|
->join("product_list b", "a.product_id = b.id", "left")
|
|
|
- ->field('a.id,a.product_id,a.area_id,'.'b.'.$this->lan.'_name,b.images as img_url,price,fees')
|
|
|
+ ->field('a.id,a.product_id,a.area_id,'.'b.'.$this->lan.'_name as name,b.images as img_url,price,fees')
|
|
|
->where('a.id', $ids)
|
|
|
->find();
|
|
|
|