Commit fdbea49d by xmy

Merge remote-tracking branch 'origin/master'

parents ab6a3029 ca20cab5
# 1.0.11
- 商品服务:修改服务参数
# 1.0.10
- 买家服务:增加获取上级信息接口
# 1.0.9 # 1.0.9
- 添加访客统计的RPC接口 - 添加访客统计的RPC接口
# 1.0.8 # 1.0.8
- 分表逻辑判断处理 - 分表逻辑判断处理
# 1.0.7 # 1.0.7
......
...@@ -16,6 +16,7 @@ class AuthEnum ...@@ -16,6 +16,7 @@ class AuthEnum
const SCOPE_SELLER = 3; //卖家 const SCOPE_SELLER = 3; //卖家
const SCOPE_ADMIN = 4;//管理员 const SCOPE_ADMIN = 4;//管理员
const SCOPE_SUPER_ADMIN = 5; //超级管理员
const AUTH_BACKEND = 100; const AUTH_BACKEND = 100;
......
...@@ -13,6 +13,7 @@ use Swoft\Core\ResultInterface; ...@@ -13,6 +13,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferGetUser(string $token) * @method ResultInterface deferGetUser(string $token)
* @method ResultInterface deferUpdateProfile(string $token, array $data) * @method ResultInterface deferUpdateProfile(string $token, array $data)
* @method ResultInterface deferSelectUser(int $storeId, array $buyerIds, array $fields= ['*']) * @method ResultInterface deferSelectUser(int $storeId, array $buyerIds, array $fields= ['*'])
* @method ResultInterface deferGetRefereeInfo($storeId,$buyerId)
* Interface BuyerInterface * Interface BuyerInterface
* @package App\Lib * @package App\Lib
*/ */
...@@ -80,4 +81,13 @@ interface BuyerInterface ...@@ -80,4 +81,13 @@ interface BuyerInterface
public function hasUser($storeId,$unionid); public function hasUser($storeId,$unionid);
public function selectUser(int $storeId, array $buyerIds, array $fields= ['*']); public function selectUser(int $storeId, array $buyerIds, array $fields= ['*']);
/**
* 根据买家id获取其上级信息
*
* @param $storeId
* @param $buyerId
* @return mixed
*/
public function getRefereeInfo($storeId,$buyerId);
} }
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Date: 2018/9/29 * Date: 2018/9/29
* Time: 11:35 * Time: 11:35
*/ */
namespace App\Models\Data; namespace App\Models\Data;
use App\Models\Dao\{daoName}; use App\Models\Dao\{daoName};
use Swoft\Bean\Annotation\Bean; use Swoft\Bean\Annotation\Bean;
...@@ -25,4 +25,88 @@ class {dataName} ...@@ -25,4 +25,88 @@ class {dataName}
*/ */
private ${varDaoName}; private ${varDaoName};
/**
* 查询一条数据
*
* @param array $condition
* @param array $option
* @return array|mixed
*/
public function getByCondition(array $condition, array $option)
{
$Info = $this->{varDaoName}->getInfoByCondition($condition, $option);
return empty($Info)?[]:$Info;
}
/**
* 查询多条数据
*
* @param array $condition
* @param array $option
* @return mixed
*/
public function selectByCondition(array $condition, array $option)
{
return $this->{varDaoName}->selectInfoByCondition($condition, $option);
}
/**
* 更新一条数据
*
* @param array $condition
* @param array $updateInfo
* @return mixed
*/
public function updateOne(array $condition, array $updateInfo)
{
return $this->{varDaoName}->updateOne($condition, $updateInfo);
}
/**
* 更新多条数据
*
* @param array $condition
* @param array $updateInfo
* @return mixed
*/
public function updateAll(array $condition, array $updateInfo)
{
return $this->{varDaoName}->updateByCondition($condition, $updateInfo);
}
/**
* 删除满足条件的一条信息
*
* @param array $condition
* @param bool $isReal
* @return mixed
*/
public function delOne(array $condition, $isReal = false)
{
if ( $isReal ) {
return $this->{varDaoName}->delOne($condition);
} else {
return $this->{varDaoName}->updateOne($condition, ['deleteTime' => time()]);
}
}
/**
* 删除满足条件的所有条目
*
* @param array $condition
* @param bool $isReal
* @return mixed
*/
public function delAll(array $condition, $isReal = false)
{
if ( $isReal ) {
return $this->{varDaoName}->delAll($condition);
} else {
return $this->{varDaoName}->updateByCondition($condition, ['deleteTime' => time()]);
}
}
} }
\ No newline at end of file
...@@ -14,8 +14,8 @@ use Swoft\Core\ResultInterface; ...@@ -14,8 +14,8 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferGet($storeId, $id) * @method ResultInterface deferGet($storeId, $id)
* @method ResultInterface deferIncSales($storeId, $goodsId) * @method ResultInterface deferIncSales($storeId, $goodsId)
* @method ResultInterface deferDecSales($storeId, $goodsId) * @method ResultInterface deferDecSales($storeId, $goodsId)
* @method ResultInterface deferGetServiceByGoodsId($storeId, $goodsId) * @method ResultInterface deferGetServiceByGoodsId($storeId, $goodsId,$type)
* @method ResultInterface deferGetReturnVisitByGoodsId($storeId, $goodsId) * @method ResultInterface deferGetReturnVisitByGoodsId($storeId, $goodsId,$type)
* @method ResultInterface deferListByIds($ids, $storeId) * @method ResultInterface deferListByIds($ids, $storeId)
* Interface GoodsInterface * Interface GoodsInterface
* @package Hdll\Services\Goods\Lib * @package Hdll\Services\Goods\Lib
...@@ -70,20 +70,22 @@ interface GoodsInterface ...@@ -70,20 +70,22 @@ interface GoodsInterface
* 获取商品服务 * 获取商品服务
* @param $storeId * @param $storeId
* @param $goodsId * @param $goodsId
* @param $type 1 之前 2 之后
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function getServiceByGoodsId($storeId,$goodsId); public function getServiceByGoodsId($storeId,$goodsId,$type);
/** /**
* 获取用户回访 * 获取用户回访
* @param $storeId * @param $storeId
* @param $goodsId * @param $goodsId
* @param $type 1 之前 2 之后
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function getReturnVisitByGoodsId($storeId, $goodsId); public function getReturnVisitByGoodsId($storeId, $goodsId,$type);
/** /**
* 获取商品列表 ids * 获取商品列表 ids
......
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