更新商户接口

This commit is contained in:
yaooo 2023-12-04 15:30:15 +08:00
parent 956eb7abb6
commit a7d48d31c1
1 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,69 @@
<?php
namespace app\adminapi\controller\shop;
use app\adminapi\controller\BaseAdminController;
use think\response\Json;
/**
* 商城控制器
* Class ProductController
* @package app\adminapi\controller\finance
*/
class MerchantController extends BaseAdminController
{
protected $shopUrl = 'http://127.0.0.1:8324';
public function cityGetArea(): Json
{
$params=$this->request->get();
$result = curl_post($this->shopUrl . '/middle/merchant/city/get_area',$params,$this->reqHeader);
if(($result['status'] ?? 500) != 200){
return $this->fail($result['message'] ?? '非法请求');
}
return json($result);
}
public function count(): Json
{
$params=$this->request->get();
$result = curl_post($this->shopUrl . '/middle/merchant/count',$params,$this->reqHeader);
if(($result['status'] ?? 500) != 200){
return $this->fail($result['message'] ?? '非法请求');
}
return json($result);
}
public function categoryOptions(): Json
{
$params=$this->request->get();
$result = curl_post($this->shopUrl . '/middle/merchant/category/options',$params,$this->reqHeader);
if(($result['status'] ?? 500) != 200){
return $this->fail($result['message'] ?? '非法请求');
}
return json($result);
}
public function typeOptions(): Json
{
$params=$this->request->get();
$result = curl_post($this->shopUrl . '/middle/merchant/type/options',$params,$this->reqHeader);
if(($result['status'] ?? 500) != 200){
return $this->fail($result['message'] ?? '非法请求');
}
return json($result);
}
public function lst(): Json
{
$params = $this->request->get(['keyword', 'date', 'status', 'statusTag', 'is_trader', 'category_id', 'type_id', 'area_id', 'street_id']);
$result = curl_post($this->shopUrl . '/middle/merchant/lst',$params,$this->reqHeader);
if(($result['status'] ?? 500) != 200){
return $this->fail($result['message'] ?? '非法请求');
}
return json($result);
}
}