WokerTask/app/common/logic/ShopRequestLogic.php

247 lines
8.1 KiB
PHP
Raw Normal View History

2023-12-27 14:06:33 +08:00
<?php
namespace app\common\logic;
use Symfony\Component\HttpClient\HttpClient;
use think\Exception;
class ShopRequestLogic extends BaseLogic
{
/**
* 查询时间范围内,某一农科公司下的 供应链商户入驻统计
*/
public static function getSupplyChainMerchantCount($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/supply_chain_mer_count', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
/**
* 查询供应链商户入驻5天内是否完成商品上架
*/
public static function getProductListing($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/supply_chain_product_count', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
/**
* 供应链商户入驻20天后是否完成库存更新
*/
public static function getStockUpdate($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/supply_chain_product_stock_count', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
/**
* 查询商城商品列表 供任务,模板中指定商品
*/
public static function getProductList($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/product_list', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
/**
* 查询供应链商户指定商品采购金额
*/
public static function getPurchaseAmount($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/supply_chain_product_price_count', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
/**
* 查询供应链商户指定商品销售金额
*/
public static function getTradeAmount($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/supply_chain_product_price_count', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
/**
* 查询镇农科公司区域 指定时间范围内入驻的一般商户数量
*/
public static function getGeneralMerchantCount($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/supply_chain_mer_count', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
/**
* 查询一般商户入驻5天内是否完成商品上架
*/
public static function getGeneralMerchantProductListing($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/supply_chain_product_count', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
/**
* 查询一般商户入驻5天内是否完成库存更新
*/
public static function getGeneralMerchantStockUpdate($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/supply_chain_product_stock_count', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
/**
* 查询一般商户指定商品采购金额
*/
public static function getGeneralMerchantPurchaseAmount($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/supply_chain_street_product_price_count', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
/**
* 查询一般商户指定商品销售金额
*/
public static function getGeneralMerchantTradeAmount($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/supply_chain_street_product_price_count', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
/**
* 查询村管理公司负责片区内的种养殖商户交易额
*/
public static function getPlantingAndBreedingMerchantTradeAmount($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/supply_chain_village_breeding_price_count', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
/**
* 查询镇农科公司负责片区内的种养殖商户和供应链商户交易额 todo 商城还需确认种养殖商户是何种类型
*/
public static function getTownTradeAmount($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/supply_chain_breeding_street_product_count', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
/**
* 查询手机号用户的交易金额
*/
public static function getUserTradeAmount($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/store_order_user_trade_amount', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
2024-01-12 11:26:20 +08:00
public static function getInviteUserInfo($param)
{
try {
$requestResponse = HttpClient::create()->request('GET', env('url.shop_prefix'). '/api/statistics/invite_user_statistics', [
'query' => $param
]);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
}
2023-12-27 14:06:33 +08:00
}