| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace App\Http\Controllers\Api\v1;
- use App\Http\Controllers\Api\webApp;
- use App\Services\Api\GoodsCategoryService;
- use App\Services\Api\GoodsService;
- /**
- * 商品分类管理
- * @package App\Http\Controllers\Api
- */
- class GoodsCategoryController extends webApp
- {
- /**
- * 列表
- * @return array
- */
- public function index()
- {
- $params =request()->post();
- $pageSize = request()->post('pageSize', 12);
- $datas = GoodsCategoryService::make()->getDataList($params, $pageSize);
- return message(1010, true, $datas);
- }
- /**
- * 历史
- * @return array
- */
- public function history()
- {
- $datas = GoodsCategoryService::make()->getHistoryCateList($this->userId);
- return message(1010, true, $datas);
- }
- /**
- * 详情
- */
- public function info()
- {
- $params = request()->all();
- $id = isset($params['id'])? intval($params['id']) : 0;
- if(empty($id)){
- return message(1036, false);
- }
- if($info = GoodsService::make()->getInfo($id)){
- return message(1010, true, $info);
- }else{
- return message(1009, false);
- }
- }
- }
|