1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace app\api\controller;
- use app\common\controller\Api;
- use app\common\model\ProductEcmall;
- use app\common\model\ProductGeneral;
- use app\common\model\ProductPro;
- use app\admin\model\Goods;
- /**
- * 产品接口
- */
- class Product extends Api
- {
- protected $noNeedLogin = ['Ecmall','Pro','General'];
- /**
- * 多商户列表
- */
- public function Ecmall(){
- $res = ProductEcmall::all(function ($query){
- $query->field('id,name,content,image');
- });
- $this->success('请求成功',$res);
- }
- /**
- * 单商户列表
- */
- public function Pro(){
- $res = ProductPro::all(function ($query){
- $query->field('id,name,content,image');
- });
- array_push($res,Goods::get(['id'=>7]));
- $this->success('请求成功',$res);
- }
- /**
- * 普通商户列表
- */
- public function General(){
- $res = ProductGeneral::all(function ($query){
- $query->field('id,name,content,image');
- });
- $this->success('请求成功',$res);
- }
- }
|