增加商户经纬度
This commit is contained in:
parent
4a3ea8e9ae
commit
0e47065080
@ -43,53 +43,6 @@ class LogisticsController extends BaseAdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @notes 添加
|
|
||||||
* @return \think\response\Json
|
|
||||||
* @author likeadmin
|
|
||||||
* @date 2023/08/07 15:00
|
|
||||||
*/
|
|
||||||
public function add()
|
|
||||||
{
|
|
||||||
$params = (new LogisticsValidate())->post()->goCheck('add');
|
|
||||||
$result = LogisticsLogic::add($params);
|
|
||||||
if (true === $result) {
|
|
||||||
return $this->success('添加成功', [], 1, 1);
|
|
||||||
}
|
|
||||||
return $this->fail(LogisticsLogic::getError());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @notes 编辑
|
|
||||||
* @return \think\response\Json
|
|
||||||
* @author likeadmin
|
|
||||||
* @date 2023/08/07 15:00
|
|
||||||
*/
|
|
||||||
public function edit()
|
|
||||||
{
|
|
||||||
$params = (new LogisticsValidate())->post()->goCheck('edit');
|
|
||||||
$result = LogisticsLogic::edit($params);
|
|
||||||
if (true === $result) {
|
|
||||||
return $this->success('编辑成功', [], 1, 1);
|
|
||||||
}
|
|
||||||
return $this->fail(LogisticsLogic::getError());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @notes 删除
|
|
||||||
* @return \think\response\Json
|
|
||||||
* @author likeadmin
|
|
||||||
* @date 2023/08/07 15:00
|
|
||||||
*/
|
|
||||||
public function delete()
|
|
||||||
{
|
|
||||||
$params = (new LogisticsValidate())->post()->goCheck('delete');
|
|
||||||
LogisticsLogic::delete($params);
|
|
||||||
return $this->success('删除成功', [], 1, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @notes 获取详情
|
* @notes 获取详情
|
||||||
|
@ -52,7 +52,7 @@ class LogisticsLogic extends BaseLogic
|
|||||||
$lst_item['status_name'] = $lst_item->status_name;
|
$lst_item['status_name'] = $lst_item->status_name;
|
||||||
$product_count = 0;
|
$product_count = 0;
|
||||||
//获取产品信息
|
//获取产品信息
|
||||||
$lst_item['products'] = Product::field('product_num,cart_info')->where('order_id', $lst_item['order_id'])->select()->each( function($pro_item) use(&$product_count){
|
$lst_item['products'] = Product::field('product_num,cart_info')->where('order_id', $lst_item['order_id'])->select()->each(function($pro_item) use(&$product_count){
|
||||||
$pro_item['cart_info'] = json_decode($pro_item['cart_info'], true);
|
$pro_item['cart_info'] = json_decode($pro_item['cart_info'], true);
|
||||||
$pro_item['goods_name'] = $pro_item['cart_info']['product']['store_name'];
|
$pro_item['goods_name'] = $pro_item['cart_info']['product']['store_name'];
|
||||||
$pro_item['goods_unit'] = $pro_item['cart_info']['product']['unit_name'];
|
$pro_item['goods_unit'] = $pro_item['cart_info']['product']['unit_name'];
|
||||||
@ -74,7 +74,7 @@ class LogisticsLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
public static function cDetail($id):array {
|
public static function cDetail($id):array {
|
||||||
//获取物流信息
|
//获取物流信息
|
||||||
$logistics = Logistics::field('id,order_id,order_sn,shop_name,shop_phone,shop_address,user_name,user_address,status,create_time')
|
$logistics = Logistics::field('id,order_id,order_sn,shop_name,shop_phone,shop_address,user_name,user_address,shop_long,shop_lat,status,create_time')
|
||||||
->where('id', $id)->find();
|
->where('id', $id)->find();
|
||||||
//获取商品信息
|
//获取商品信息
|
||||||
$product_count = 0;
|
$product_count = 0;
|
||||||
@ -164,7 +164,7 @@ class LogisticsLogic extends BaseLogic
|
|||||||
//查找订单信息
|
//查找订单信息
|
||||||
$order = Order::alias('s')
|
$order = Order::alias('s')
|
||||||
->leftjoin('eb_merchant m', 'm.mer_id = s.mer_id')
|
->leftjoin('eb_merchant m', 'm.mer_id = s.mer_id')
|
||||||
->field('s.real_name, s.user_phone,s.uid, s.user_address,s.user_address_code,m.mer_name, m.mer_phone, m.mer_address')
|
->field('s.real_name, s.user_phone,s.uid, s.user_address,s.user_address_code,m.mer_id,m.mer_name,m.mer_phone,m.mer_address,m.long,m.lat')
|
||||||
->where('order_id', $params['order_id'])->where('order_sn', $params['order_sn'])->find();
|
->where('order_id', $params['order_id'])->where('order_sn', $params['order_sn'])->find();
|
||||||
if(empty($order['user_address_code'])) return ['code'=>1, 'msg'=>'用户地址信息错误'];
|
if(empty($order['user_address_code'])) return ['code'=>1, 'msg'=>'用户地址信息错误'];
|
||||||
//匹配配送员
|
//匹配配送员
|
||||||
@ -183,9 +183,12 @@ class LogisticsLogic extends BaseLogic
|
|||||||
'order_id' => $params['order_id'],
|
'order_id' => $params['order_id'],
|
||||||
'order_sn' => $params['order_sn'],
|
'order_sn' => $params['order_sn'],
|
||||||
'courier_id' => $courier,
|
'courier_id' => $courier,
|
||||||
|
'shop_id' => $order['mer_id'],
|
||||||
'shop_name' => $order['mer_name'],
|
'shop_name' => $order['mer_name'],
|
||||||
'shop_phone' => $order['mer_phone'],
|
'shop_phone' => $order['mer_phone'],
|
||||||
'shop_address' => $order['mer_address'],
|
'shop_address' => $order['mer_address'],
|
||||||
|
'shop_long' => $order['long'],
|
||||||
|
'shop_lat' => $order['lat'],
|
||||||
'user_id' => $order['uid'],
|
'user_id' => $order['uid'],
|
||||||
'user_name' => $order['real_name'],
|
'user_name' => $order['real_name'],
|
||||||
'user_phone' => $order['user_phone'],
|
'user_phone' => $order['user_phone'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user