master
wangxinglong 2021-12-16 13:37:55 +08:00
parent 1ede9fad50
commit c445c5fcc2
3 changed files with 25 additions and 19 deletions

View File

@ -32,15 +32,16 @@ class Consumer extends Base
public function home() public function home()
{ {
$params = [ $params = [
'businessType' => $this->request->param('businessType/d', 0), // 商家类型 'businessType' => $this->request->param('businessType/d', 0), // 商家类型
'couponType' => $this->request->param('couponType/d', 0), // 优惠卷类型 'couponType' => $this->request->param('couponType/d', 0), // 优惠卷类型
'businessCode' => $this->request->param('businessCode/s'), // 商家code 'businessCode' => $this->request->param('businessCode/s'), // 商家code
'dis' => $this->request->param('dis/d', -1), // 距离,单位为km 'businessCircleId' => $this->request->param('businessCircle/d',0), // 商圈id
'lng' => $this->request->param('lng/f', 0), // 经度 104.752890 'dis' => $this->request->param('dis/d', -1), // 距离,单位为km
'lat' => $this->request->param('lat/f', 0), // 纬度 31.465040 'lng' => $this->request->param('lng/f', 0), // 经度 104.752890
'keyword' => $this->request->param('key/s', ''), // 关键词查询 'lat' => $this->request->param('lat/f', 0), // 纬度 31.465040
'page' => $this->request->param('page/d', 1), 'keyword' => $this->request->param('key/s', ''), // 关键词查询
'size' => $this->request->param('size/d', 10), 'page' => $this->request->param('page/d', 1),
'size' => $this->request->param('size/d', 10),
]; ];
@ -72,7 +73,10 @@ class Consumer extends Base
if (!empty($params['businessCode'])) { if (!empty($params['businessCode'])) {
$whereMap[] = ['business_code', '=', $params['businessCode']]; $whereMap[] = ['business_code', '=', $params['businessCode']];
} }
if (($params['businessCircleId']) > 0 ) {
$whereMap[] = ['business_circle_id', '=', $params['businessCircleId']];
}
if ($params['dis'] > 0) { if ($params['dis'] > 0) {
$pointList = getEarthSquareRangePoint($params['lat'],$params['lng'], $params['dis']); $pointList = getEarthSquareRangePoint($params['lat'],$params['lng'], $params['dis']);
$latRange[] = ['lat', 'BETWEEN', [$pointList['lat_min'], $pointList['lat_max']]]; $latRange[] = ['lat', 'BETWEEN', [$pointList['lat_min'], $pointList['lat_max']]];

View File

@ -523,11 +523,12 @@ class Coupon extends Base
} }
//验证通过 //验证通过
$couponMain['business_type'] = $account->business['type']; $couponMain['business_type'] = $account->business['type'];
$couponMain['business_name'] = $account->business['business_name']; $couponMain['business_name'] = $account->business['business_name'];
$couponMain['lng'] = $account->business['lng']; $couponMain['lng'] = $account->business['lng'];
$couponMain['lat'] = $account->business['lat']; $couponMain['lat'] = $account->business['lat'];
$couponMain['create_time'] = date("Y-m-d H:i:s"); $couponMain['business_circle_id'] = $account->business['business_circle_id'];
$couponMain['create_time'] = date("Y-m-d H:i:s");
//保留两位小数 //保留两位小数
$couponMain['money'] = floor($couponMain['money'] * 100) / 100; $couponMain['money'] = floor($couponMain['money'] * 100) / 100;

View File

@ -218,10 +218,11 @@ class Coupon extends Base
$data['business_type'] = $business['type']; $data['business_type'] = $business['type'];
$data['business_name'] = $business['business_name']; $data['business_name'] = $business['business_name'];
$data['lng'] = $business['lng']; $data['lng'] = $business['lng'];
$data['lat'] = $business['lat']; $data['lat'] = $business['lat'];
$data['business_circle_id'] = $business['business_circle_id'];
$type = CouponRepository::getInstance()->getCouponTypeAll(); $type = CouponRepository::getInstance()->getCouponTypeAll();