diff --git a/application/routine/controller/AuthApi.php b/application/routine/controller/AuthApi.php index 165944bc..318d6305 100644 --- a/application/routine/controller/AuthApi.php +++ b/application/routine/controller/AuthApi.php @@ -235,10 +235,11 @@ class AuthApi extends AuthController{ if($news!=0) $model->where('is_new',1); $baseOrder = ''; if($priceOrder) $baseOrder = $priceOrder == 'desc' ? 'price DESC' : 'price ASC'; - if($salesOrder) $baseOrder = $salesOrder == 'desc' ? 'sales DESC' : 'sales ASC'; +// if($salesOrder) $baseOrder = $salesOrder == 'desc' ? 'sales DESC' : 'sales ASC';//真实销量 + if($salesOrder) $baseOrder = $salesOrder == 'desc' ? 'ficti DESC' : 'ficti ASC';//虚拟销量 if($baseOrder) $baseOrder .= ', '; $model->order($baseOrder.'sort DESC, add_time DESC'); - $list = $model->limit($first,$limit)->field('id,store_name,cate_id,image,sales,price,stock')->select()->toArray(); + $list = $model->limit($first,$limit)->field('id,store_name,cate_id,image,sales,ficti,price,stock')->select()->toArray(); return JsonService::successful($list); } /** @@ -268,7 +269,7 @@ class AuthApi extends AuthController{ } } $data['storeInfo'] = $storeInfo; - $data['similarity'] = StoreProduct::cateIdBySimilarityProduct($storeInfo['cate_id'],'id,store_name,image,price,sales',4); + $data['similarity'] = StoreProduct::cateIdBySimilarityProduct($storeInfo['cate_id'],'id,store_name,image,price,sales,ficti',4); $data['productAttr'] = $productAttr; $data['productValue'] = $productValue; $data['reply'] = StoreProductReply::getRecProductReply($storeInfo['id']); diff --git a/application/wap/controller/AuthApi.php b/application/wap/controller/AuthApi.php index 336888f6..ab036566 100644 --- a/application/wap/controller/AuthApi.php +++ b/application/wap/controller/AuthApi.php @@ -307,6 +307,7 @@ class AuthApi extends AuthController public function get_user_order_list($type = '',$first = 0, $limit = 8,$search = '') { // StoreOrder::delCombination();//删除拼团未支付订单 + $type=='null' && $type=''; if($search){ $order = StoreOrder::searchUserOrder($this->userInfo['uid'],$search)?:[]; $list = $order == false ? [] : [$order]; @@ -496,10 +497,11 @@ class AuthApi extends AuthController if($news) $model->where('is_new',1); $baseOrder = ''; if($priceOrder) $baseOrder = $priceOrder == 'desc' ? 'price DESC' : 'price ASC'; - if($salesOrder) $baseOrder = $salesOrder == 'desc' ? 'sales DESC' : 'sales ASC'; +// if($salesOrder) $baseOrder = $salesOrder == 'desc' ? 'sales DESC' : 'sales ASC'; + if($salesOrder) $baseOrder = $salesOrder == 'desc' ? 'ficti DESC' : 'ficti ASC'; if($baseOrder) $baseOrder .= ', '; $model->order($baseOrder.'sort DESC, add_time DESC'); - $list = $model->limit($first,$limit)->field('id,store_name,image,sales,price,stock')->select()->toArray(); + $list = $model->limit($first,$limit)->field('id,store_name,image,sales,ficti,price,stock')->select()->toArray(); if($list) setView($this->uid,0,$sId,'search','product',$keyword); return JsonService::successful($list); } @@ -740,4 +742,14 @@ class AuthApi extends AuthController else return JsonService::status('ERROR','砍价失败,请稍后再帮助朋友砍价'); } + /** + * 砍价分享添加次数 + * @param int $bargainId + */ + public function add_bargain_share($bargainId = 0){ + if(!$bargainId) return JsonService::successful(); + StoreBargain::addBargainShare($bargainId); + return JsonService::successful(); + } + } \ No newline at end of file diff --git a/application/wap/controller/Index.php b/application/wap/controller/Index.php index bc7c9977..af02eae6 100644 --- a/application/wap/controller/Index.php +++ b/application/wap/controller/Index.php @@ -7,6 +7,7 @@ namespace app\wap\controller; +use app\wap\model\store\StoreCombination; use app\wap\model\store\StoreSeckill; use app\wap\model\store\StoreCategory; use app\wap\model\store\StoreOrder; @@ -47,7 +48,9 @@ class Index extends AuthController ->where('start_time','<',time())->where('stop_time','>',time()) ->limit($seckillnum)->order('sort desc')->select()->toArray(); foreach($storeSeckill as $key=>$value){ - $round=round($value['sales']/$value['stock'],2)*100; + if($value['stock']>0) + $round = round($value['sales']/$value['stock'],2)*100; + else $round = 100; if($round<100){ $storeSeckill[$key]['round']=$round; }else{ diff --git a/application/wap/controller/Store.php b/application/wap/controller/Store.php index f260c47a..488c7904 100644 --- a/application/wap/controller/Store.php +++ b/application/wap/controller/Store.php @@ -111,7 +111,7 @@ class Store extends AuthController $this->assign([ 'urlShare'=>$urlShare, 'storeInfo'=>$storeInfo, - 'similarity'=>StoreProduct::cateIdBySimilarityProduct($storeInfo['cate_id'],'id,store_name,image,price,sales',4), + 'similarity'=>StoreProduct::cateIdBySimilarityProduct($storeInfo['cate_id'],'id,store_name,image,price,sales,ficti',4), 'productAttr'=>$productAttr, 'productValue'=>$productValue, 'reply'=>StoreProductReply::getRecProductReply($storeInfo['id']), diff --git a/application/wap/view/first/store/detail.html b/application/wap/view/first/store/detail.html index 70bf73e4..f55f2da6 100644 --- a/application/wap/view/first/store/detail.html +++ b/application/wap/view/first/store/detail.html @@ -16,7 +16,7 @@