Commit bacdee3d authored by suntengda's avatar suntengda

update 自提点相关接口

parent 27b2575e
...@@ -21,7 +21,7 @@ class TakePlaceValidate extends \Validate\BaseValidate ...@@ -21,7 +21,7 @@ class TakePlaceValidate extends \Validate\BaseValidate
'city' => 'require', 'city' => 'require',
'area' => 'require', 'area' => 'require',
'offset' => 'egt:0', 'offset' => 'egt:0',
'limit' => 'elt:100', 'limit' => 'elt:1000',
]; ];
protected $message = [ protected $message = [
...@@ -35,7 +35,7 @@ class TakePlaceValidate extends \Validate\BaseValidate ...@@ -35,7 +35,7 @@ class TakePlaceValidate extends \Validate\BaseValidate
"city" => "市不能为空", "city" => "市不能为空",
"area" => "区不能为空", "area" => "区不能为空",
"offset" => "偏移量不能小于0", "offset" => "偏移量不能小于0",
"limit" => "单次不能大于100条", "limit" => "单次不能大于1000条",
]; ];
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
* Time : 11:12 上午 * Time : 11:12 上午
*/ */
use Api\PhpUtils\Log\DaemonLog;
use App\Base\Base; use App\Base\Base;
use App\Services\marketing\MarketingService;
use App\Services\marketing\TakePlaceService; use App\Services\marketing\TakePlaceService;
use Validate\TakePlaceValidate; use Validate\TakePlaceValidate;
...@@ -71,4 +73,35 @@ class TakePlaceController extends Base { ...@@ -71,4 +73,35 @@ class TakePlaceController extends Base {
$this->success(['result'=>$data]); $this->success(['result'=>$data]);
} }
public function test_noticeAction()
{
// if(date('H') != 16 || date('i')!= 40) {
// sleep(2);
// return false;
// }
//查询进行中的拼单活动
$params['marketing_type'] = 4;//1分销 2团购 3秒杀 4团餐
$params['online_status'] = 1;//状态 , 1启用,2关闭,3 到期
$params['activity_status'] = 2;//1 未开始,2进行中,3已结束
$list = MarketingService::marketingList($params);
if($list['result'] && is_array($list['result'])) {
foreach($list['result'] as $val) {
//看活动标题中是否有午餐
if (strpos($val['marketing_name'],'午餐')) {
}
}
}
//获取活动信息
//给订阅用户发送消息
DaemonLog::info('DaemonServiceInterface_pindan', json_encode($orderInfoList));
}
} }
\ No newline at end of file
...@@ -118,14 +118,16 @@ class TakePlaceService ...@@ -118,14 +118,16 @@ class TakePlaceService
$where['ORDER'] = ['marketing_take_place_id' => 'DESC']; $where['ORDER'] = ['marketing_take_place_id' => 'DESC'];
$where['LIMIT'] = [$offset, $limit]; $where['LIMIT'] = [$offset, $limit];
// $e = MarketingTakePlace::debug();
$relations = MarketingTakePlace::select('*', $where); $relations = MarketingTakePlace::select('*', $where);
$makePlaceIds = array_column($relations,'take_place_id'); $makePlaceIds = array_column($relations,'take_place_id');
$where = ['take_place_id'=>$makePlaceIds,'is_delete'=>TakePlace::STATUS_NORMAL]; $where = ['take_place_id'=>$makePlaceIds,'is_delete'=>TakePlace::STATUS_NORMAL];
$takePlaces = TakePlace::select('*',$where);
return $takePlaces ?: []; $res['list'] = TakePlace::select('*',$where);
unset($where['ORDER'],$where['LIMIT']);
$res['total'] = TakePlace::count('*', $where);
return $res;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment