顺带件排序

This commit is contained in:
Jerry Yan 2020-08-31 09:47:58 +08:00
parent 59aacbb71b
commit e1630850b1
2 changed files with 23 additions and 1 deletions

View File

@ -315,7 +315,28 @@ class Orders extends Base{
return $rs;
}
public function shundaiList()
{
$page = input('page/d', 1);
$size = input('size/d', 10);
$lat = (float)input("lat",0);
$lng = (float)input("lng",0);
$m = new M();
$status=[0];
$rs = $m->alias('o')->join('__SHOPS__ s','o.shopId=s.shopId','left')
->field('o.userAddress, o.userName, o.userPhone, o.deliverMoney,
o.goodsMoney as feeMoney,o.payTime as deliverBefore,
s.lng as shopLng, s.lat as shopLat, s.shopAddress, s.phone as shopPhone,
ROUND(12756.276*ASIN(SQRT(POW(SIN(('.$lat.'*0.0174532925-s.lat*0.0174532925)/2),2)+
COS('.$lat.'*0.0174532925)*COS(s.lat*0.0174532925)*POW(SIN(('.$lng.'*0.0174532925-s.lng*0.0174532925)/2),2)))*1000) AS distance
')
->whereIn('o.orderStatus', $status)
->where('o.deliverType', '=', 2)
->order('distance', 'asc')
->limit(($page-1)*$size, $size)
->select();
exit(jsonReturn('',1,$rs));
}
/*********************************************** 商家操作订单 ************************************************************/

View File

@ -1337,6 +1337,7 @@ function WSTLangPayType($v){
*/
function WSTLangDeliverType($v){
switch ($v) {
case 2:return "顺带件";
case 1:return "自提";
case 0:return "送货上门";
}