diff --git a/app/common/model/community/Community.php b/app/common/model/community/Community.php index 26a3c46a..b5aaf962 100644 --- a/app/common/model/community/Community.php +++ b/app/common/model/community/Community.php @@ -171,4 +171,10 @@ class Community extends BaseModel $query->where('community_id', '<>',$value); } + public function resale() + { + return $this->hasMany(Relevance::class, 'left_id','community_id') + ->where('type',RelevanceRepository::TYPE_COMMUNITY_PRODUCT); + } + } diff --git a/app/common/model/store/order/StoreOrderInterest.php b/app/common/model/store/order/StoreOrderInterest.php index 7027a4e1..fd715c88 100644 --- a/app/common/model/store/order/StoreOrderInterest.php +++ b/app/common/model/store/order/StoreOrderInterest.php @@ -29,7 +29,7 @@ class StoreOrderInterest extends BaseModel { $days = ceil((time() - strtotime($this->start_time)) / 86400); $days = max($days ,0); - $money = bcmul($this->total_price, ($this->rate / 100), 2); + $money = bcmul($this->total_price, ($this->rate / 100), 3); return bcmul($days, $money, 2); } diff --git a/app/common/repositories/community/CommunityRepository.php b/app/common/repositories/community/CommunityRepository.php index 18456de9..f7b6c549 100644 --- a/app/common/repositories/community/CommunityRepository.php +++ b/app/common/repositories/community/CommunityRepository.php @@ -40,6 +40,8 @@ class CommunityRepository extends BaseRepository public const COMMUNIT_TYPE_FONT = '1'; public const COMMUNIT_TYPE_VIDEO = '2'; + public const COMMUNITY_TYPE_RESALE = 3; //转售贴 + public const COMMUNITY_TYPE_ENTRUST = 4; //委托销售贴 /** * CommunityRepository constructor. diff --git a/app/common/repositories/system/RelevanceRepository.php b/app/common/repositories/system/RelevanceRepository.php index 6efa2575..a4aaab9f 100644 --- a/app/common/repositories/system/RelevanceRepository.php +++ b/app/common/repositories/system/RelevanceRepository.php @@ -35,6 +35,8 @@ class RelevanceRepository extends BaseRepository const TYPE_COMMUNITY_REPLY_START = 'community_reply_start'; //商户权限 const TYPE_MERCHANT_AUTH = 'mer_auth'; + //转售商品 + const TYPE_COMMUNITY_RESALE = 'community_resale'; //转售贴关联 //指定范围类型 //0全部商品 diff --git a/app/controller/api/community/Community.php b/app/controller/api/community/Community.php index 04be94f1..a743761b 100644 --- a/app/controller/api/community/Community.php +++ b/app/controller/api/community/Community.php @@ -18,12 +18,14 @@ use app\common\repositories\system\RelevanceRepository; use app\common\repositories\user\UserHistoryRepository; use app\common\repositories\user\UserRelationRepository; use app\common\repositories\user\UserRepository; +use app\common\service\JgPush; use app\validate\api\CommunityValidate; use crmeb\basic\BaseController; use crmeb\services\MiniProgramService; use think\App; use app\common\repositories\community\CommunityRepository as repository; use think\exception\ValidateException; +use think\facade\Log; class Community extends BaseController { @@ -54,7 +56,7 @@ class Community extends BaseController */ public function lst() { - $where = $this->request->params(['keyword','topic_id','is_hot','category_id','spu_id']); + $where = $this->request->params(['keyword','topic_id','is_hot','category_id','spu_id', 'is_type']); if (!$where['category_id']) { unset($where['category_id']); } else if ($where['category_id'] == -1) {