Commit 7c6f336c authored by zhuwei's avatar zhuwei

客户浏览记录 验证

parent dc4ab00a
......@@ -168,11 +168,16 @@ class LookShop extends Basic
public function getLookShopList()
{
$params = $this->params;
$checkResult = $this->validate($params, "UserLookShopValidate.getLookShopList");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$s_look_Shop = new LookShopService();
$field = 'a.source,a.create_time,b.buyer_nick,b.buyer_img,c.id as user_id';
$conditions['a.source'] = 1;
$conditions['a.house_id'] = $params['house_id'];
$result = $s_look_Shop->getLookShopList($conditions,$field,$pageNo, $pageSize);
if($result){
return $this->response("200", "success", $result);
......
<?php
namespace app\api_broker\validate;
use think\Validate;
/**
* Created by PhpStorm.
* User : zhuwei
* Date : 2019-08-29
* Time : 17:47:05
* Intro:
*/
class UserLookShopValidate extends Validate
{
protected $rule = [
'house_id' => 'require|number|gt:0',
];
protected $message = [
'house_id.require' => 'house_id必传字段',
'house_id.number' => 'house_id必须为数字',
'house_id.gt' => 'house_id必须大于0',
];
protected $scene = [
'getLookShopList' => ['house_id'],
];
}
\ 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