12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace app\api\controller;
- use app\common\exception\BaseException;
- use think\facade\Request;
- use app\api\service\Products as ProductsService;
- class Products extends Base {
-
- public function hot(){
- try{
- return $this->returnAjax("ok",1,ProductsService::getList(Request::param(),[
- ["g.status","=",0],
- ["e.attribute","=","hot"]
- ]));
- }catch (BaseException $ex){
- return $this->returnAjax($ex->getMessage(),$ex->getCode(),$ex->getRaw());
- }
- }
-
- public function recommend(){
- try{
- return $this->returnAjax("ok",1,ProductsService::getList(Request::param(),[
- ["g.status","=",0],
- ["e.attribute","=","recommend"]
- ]));
- }catch (BaseException $ex){
- return $this->returnAjax($ex->getMessage(),$ex->getCode(),$ex->getRaw());
- }
- }
- }
|