更新中台商品

This commit is contained in:
yaooo 2023-12-04 10:51:06 +08:00
parent 043ba8e5be
commit 5668887a5c
1 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,68 @@
<?php
namespace app\adminapi\controller\shop;
use app\adminapi\controller\BaseAdminController;
use think\response\Json;
/**
* 商城控制器
* Class ProductController
* @package app\adminapi\controller\finance
*/
class ProductController extends BaseAdminController
{
protected $shopUrl = 'http://127.0.0.1:8324';
public function productLstFilter(): Json
{
$params=$this->request->get();
$result = curl_post($this->shopUrl . '/middle/store/product/lst_filter',$params,$this->reqHeader);
if(($result['status'] ?? 500) != 200){
return $this->fail($result['message'] ?? '非法请求');
}
return json($result);
}
public function categoryLlist(): Json
{
$params=$this->request->get();
$result = curl_post($this->shopUrl . '/middle/store/category/list',$params,$this->reqHeader);
if(($result['status'] ?? 500) != 200){
return $this->fail($result['message'] ?? '非法请求');
}
return json($result);
}
public function productMerSelect(): Json
{
$params=$this->request->get();
$result = curl_post($this->shopUrl . '/middle/store/product/mer_select',$params,$this->reqHeader);
if(($result['status'] ?? 500) != 200){
return $this->fail($result['message'] ?? '非法请求');
}
return json($result);
}
public function labelLoption(): Json
{
$params=$this->request->get();
$result = curl_post($this->shopUrl . '/middle/product/label/option',$params,$this->reqHeader);
if(($result['status'] ?? 500) != 200){
return $this->fail($result['message'] ?? '非法请求');
}
return json($result);
}
public function productLst(): Json
{
$params=$this->request->get(['type', 'star', 'svip_price_type', 'us_status', 'hot_type', 'keyword', 'is_trader', 'mer_id', 'page', 'limit', 'pid']);
$result = curl_post($this->shopUrl . '/middle/store/product/lst',$params,$this->reqHeader);
if(($result['status'] ?? 500) != 200){
return $this->fail($result['message'] ?? '非法请求');
}
return json($result);
}
}