增加接口

This commit is contained in:
liaofei 2023-06-16 15:36:46 +08:00
parent 84eaead334
commit fb4622cd53
6 changed files with 58 additions and 14 deletions

View File

@ -309,6 +309,27 @@ class StoreOrder extends AuthController
return app('json')->success(100010);
}
/**
* 获取寄件预扣金额
* @param ServeServices $services
* @return \think\Response
* @author 等风来
* @email 136327134@qq.com
* @date 2023/6/16
*/
public function getPrice(ServeServices $services)
{
$data = $this->request->postMore([
['kuaidicom', ''],
['send_address', ''],
['address', ''],
['weight', ''],
['service_type', ''],
]);
return app('json')->success($services->express()->getPrice($data));
}
/**
* 获取订单可拆分发货商品列表
* @param $id

View File

@ -79,19 +79,11 @@ class SystemStorage extends AuthController
}
/**
* @param SystemConfigServices $services
* @return mixed
*/
public function saveConfig(SystemConfigServices $services)
public function saveConfig( )
{
$type = (int)$this->request->post('type', 0);
// $services->update('upload_type', ['value' => json_encode($type)], 'menu_name');
// if (1 === $type) {
// $this->services->transaction(function () {
// $this->services->update(['status' => 1, 'is_delete' => 0], ['status' => 0]);
// });
// }
// \crmeb\services\CacheService::clear();
$data = $this->request->postMore([
['accessKey', ''],

View File

@ -36,6 +36,8 @@ Route::group('order', function () {
Route::put('take/:id', 'v1.order.StoreOrder/take_delivery')->name('StoreOrderTakeDelivery')->option(['real_name' => '确认收货']);
//发送货
Route::put('delivery/:id', 'v1.order.StoreOrder/update_delivery')->name('StoreOrderUpdateDelivery')->option(['real_name' => '订单发送货']);
//获取商家寄件金额
Route::post('price', 'v1.order.StoreOrder/getPrice')->name('getPrice')->option(['real_name' => '获取商家寄件金额']);
//获取订单可拆分商品列表
Route::get('split_cart_info/:id', 'v1.order.StoreOrder/split_cart_info')->name('StoreOrderSplitCartInfo')->option(['real_name' => '获取订单可拆分商品列表']);
//拆单发送货

View File

@ -545,10 +545,6 @@ class SystemCrudServices extends BaseServices
}
}
//读取字段
//读取数据库字段信息
$tableInfo = $this->getTableInfo($tableName);
//获取主键
foreach ($tableField as $value) {
if ($value['primaryKey']) {

View File

@ -12,6 +12,7 @@
namespace crmeb\services\express\storage;
use app\services\shipping\ExpressServices;
use crmeb\exceptions\ApiException;
use crmeb\services\express\BaseExpress;
use crmeb\exceptions\AdminException;
@ -54,6 +55,8 @@ class Express extends BaseExpress
const SHIPMENT_CANCEL_ORDER = 'v2/shipment/cancel_order';
//获取商家寄件订单列表
const SHIPMENT_INDEX = 'v2/shipment/index';
//获取商家寄件订单预扣金额
const SHIPMENT_PRICE = 'v2/shipment/price';
/** 初始化
* @param array $config
@ -158,6 +161,35 @@ class Express extends BaseExpress
return $this->accessToken->httpRequest(self::SHIPMENT_INDEX, $param, 'GET');
}
/**
* @param array $data
* @return array|mixed
* @author 等风来
* @email 136327134@qq.com
* @date 2023/6/16
*/
public function getPrice(array $data)
{
if (!empty($data['kuaidicom'])) {
throw new ApiException('快递编码必须填写');
}
if (!empty($data['send_address'])) {
throw new ApiException('寄件地址必须填写');
}
if (!empty($data['address'])) {
throw new ApiException('收件地址必须填写');
}
$param = [
'kuaidi_num' => $data['kuaidicom'],
'send_address' => $data['send_address'],
'address' => $data['address'] ?? '',
'weight' => $data['weight'] ?? '',
'service_type' => $data['service_type'] ?? '',
];
return $this->accessToken->httpRequest(self::SHIPMENT_PRICE, $param);
}
/**
* 开通物流服务
* @return bool|mixed
@ -184,7 +216,7 @@ class Express extends BaseExpress
if (!sys_config('config_export_siid')) {
$header = ['version:v1.1'];
}
return $this->accessToken->httpRequest(self::EXPRESS_TEMP, $param, 'POST', true, $header);
return $this->accessToken->httpRequest(self::EXPRESS_TEMP, $param, 'GET', true, $header);
}
/**

View File

@ -215,6 +215,7 @@ class Obs extends BaseUpload
return [];
}
public function bindDomian(string $name, string $domain, string $region = null)
{
$parseDomin = parse_url($domain);