From 1be984c228884ce454b3d7fc49ec175a836323d3 Mon Sep 17 00:00:00 2001 From: heyuntao <heyuntao@LAPTOP-MP4HD5NS> Date: 星期一, 17 七月 2023 10:49:52 +0800 Subject: [PATCH] no message --- application/api/logic/taoke/Parser.php | 52 +++++++++++++++++++++++----------------------------- 1 files changed, 23 insertions(+), 29 deletions(-) diff --git a/application/api/logic/taoke/Parser.php b/application/api/logic/taoke/Parser.php index 8b5aff3..2e90422 100644 --- a/application/api/logic/taoke/Parser.php +++ b/application/api/logic/taoke/Parser.php @@ -7,7 +7,7 @@ use app\api\logic\UserCollect; use app\api\logic\User as LogicUser; use app\common\model\UserLevel as ModelUserLevel; - +use \app\common\model\UserExtend as ModelUserExtend; class Parser extends BasicLogic { //TODO 妫�鏌ユ墍鏈夋帴鍙f槸涓嶆槸鏈夎皟鏁寸殑锛岄渶瑕佷紶浠g悊鐨勭浉搴斿瓧娈� @@ -26,6 +26,10 @@ protected static $topLevelName = ""; //椤剁骇绛夌骇鍚嶇О + protected static $buyCount=-1;//璐拱娆℃暟 + + protected static $returnLimit=1;//浣i噾鍏ㄨ繑鐨勮喘涔版鏁伴檺鍒� + public function __construct(){ $level = 1; @@ -42,6 +46,17 @@ self::$userRate = $leveInfo['own_commission_rate'] * 0.01; $topLevelInfo = $ModelUserLevel->where(['level'=>3])->find(); if(empty($topLevelInfo)) fault('浠g悊閰嶇疆澶辫触'); + //鑾峰彇璐拱娆℃暟 + $ModelUserExtend=new ModelUserExtend(); + $userBuy= $ModelUserExtend->where(['id'=>USERID])->find(); + if(!empty($userBuy)) + { + self::$buyCount=$userBuy['tradecount']; + } + if(self::$buyCount>=0&&self::$buyCount<self::$returnLimit) + {//绗﹀悎鍏ㄨ繑瑙勫垯 + self::$userRate =1; + } self::$topFanliRate = $topLevelInfo['own_commission_rate'] * 0.01; self::$topLevelName = $topLevelInfo['level_name']; } @@ -80,6 +95,7 @@ 'url_type' => "3", //鍟嗗搧璇︽儏, 'isCollect' => 0, //鏄惁鏀惰棌 'topLevelName' => self::$topLevelName, //椤剁骇绛夌骇鍚嶇О + 'predictPromotionRate'=>0,//姣斾环琛屼负棰勫垽瀹氫剑閲戯紝闇�瑕佺敤鎴峰妗�-鎷煎澶氫笓鐢� ]; } @@ -92,7 +108,9 @@ return [ 'dtitle' => '', //鍟嗗搧title 'goodsSign' => '', - 'goodsid' => '', + 'goods_sign'=>'', + 'goodsid' => '', + 'goodsId'=>'', 'huodongType' => '', 'id' => '', 'jiage' => '', @@ -110,31 +128,7 @@ 'yuanjia' => '', 'fanli' => '', 'topFanli' => '', - - 'id' => '', //鍟嗗搧id,鑻ユ煡璇㈢粨鏋渋d=-1锛屽垯璇存槑璇ュ晢鍝侀潪澶ф窐瀹㈠钩鍙板晢鍝侊紝鏁版嵁涓烘窐瀹濈洿鎺ヨ繑鍥炵殑鏁版嵁锛岀敱浜庢窐瀹濇暟鎹殑缂撳瓨鏃堕棿鐩稿杈冮暱锛屼細鍑虹幇鍟嗗搧淇℃伅鍜岃鎯呬俊鎭笉涓�鑷寸殑鎯呭喌 - 'goodsId' => '', //娣樺疂鍟嗗搧id - 'itemLink' => '', //鍟嗗搧閾炬帴 - 'title' => '', //鍟嗗搧鏍囬 - "actualPrice"=> "", //鍒稿悗浠� - "originalPrice"=> "", //鍟嗗搧鍘熶环 - "shopName"=> "", //搴楅摵鍚嶇О - "couponPrice"=> "", //浼樻儬鍒搁噾棰� - "monthSales"=> "", //30澶╅攢閲� - "mainPic" => "", //鍟嗗搧涓诲浘 - "imgs" => [], //鍟嗗搧杞挱鍥� - "detailPics" => [], //鍟嗗搧璇︽儏鍥� - "reimgs" => [], //鐩稿叧鍟嗗搧鍥� - "video"=> '', //鍟嗗搧瑙嗛 - 'couponLink' => '', //浼樻儬鍒搁摼鎺� - 'couponEndTime' => '', //浼樻儬鍒哥粨鏉熸椂闂� - 'couponStartTime' =>'', //浼樻儬鍒稿紑濮嬫椂闂� - 'shopType' => '', //搴楅摵绫诲瀷, - 'couponInfo' => '', //鍟嗗搧鎶樻墸淇℃伅 - 'sourceType' => '', //鍟嗗搧鏉ユ簮 - 'faction' => 't', //娲剧郴锛岄粯璁ゆ窐绯� - 'url_type' => "3", //鍟嗗搧璇︽儏, - 'isCollect' => 0, //鏄惁鏀惰棌 - 'topLevelName' => self::$topLevelName, //椤剁骇绛夌骇鍚嶇О + 'sourceType'=>'' ]; } @@ -205,8 +199,8 @@ /** * 璁$畻鍟嗗搧灞曠ず杩斿埄閲戦 * - * @param [type] $price - * @param [type] $commissionRate + * @param [type] $price 鍒稿悗浠� + * @param [type] $commissionRate 鍒嗕剑姣斾緥 * @return void */ public static function rebate($price,$commissionRate,$otherRate = "") -- Gitblit v1.9.3