diff --git a/addons/wanlshop/config.php b/addons/wanlshop/config.php
index 5fb2f0d..8da9e21 100644
--- a/addons/wanlshop/config.php
+++ b/addons/wanlshop/config.php
@@ -523,6 +523,22 @@ return [
'tip' => '观看公益课堂比例配置',
'ok' => '',
'extend' => '',
+
+ ],
+ [
+ 'name' => 'vippayconfig',
+ 'title' => '观看公益课堂比例配置',
+ 'type' => 'array',
+ 'value' => [
+ 'money' => 0.01,
+ 'givered' => 1,
+ ],
+ 'rule' => '',
+ 'msg' => '',
+ 'tip' => '观看公益课堂比例配置',
+ 'ok' => '',
+ 'extend' => '',
+
],
[
'name' => '__tips__',
diff --git a/addons/wanlshop/library/WanlPay/WanlPay.php b/addons/wanlshop/library/WanlPay/WanlPay.php
index ee39b1b..d8e5552 100644
--- a/addons/wanlshop/library/WanlPay/WanlPay.php
+++ b/addons/wanlshop/library/WanlPay/WanlPay.php
@@ -311,7 +311,13 @@ class WanlPay
} catch (\Exception $e) {
return ['code' => 10006 ,'msg' => $this->type.':'.$e->getMessage()];
}
- } else {
+ } else if($this->type == 'dinpay'){
+ try{
+
+ } catch (\Exception $e) {
+ return ['code' => 10006 ,'msg' => $this->type.':'.$e->getMessage()];
+ }
+ } else {
return ['code' => 10010 ,'msg' => '未找到任何有效支付'];
}
}
diff --git a/application/admin/view/wanlshop/client/config.html b/application/admin/view/wanlshop/client/config.html
index d8a6dcc..4dd874c 100644
--- a/application/admin/view/wanlshop/client/config.html
+++ b/application/admin/view/wanlshop/client/config.html
@@ -20,7 +20,7 @@
推广活动配置
发票兑换比例
观看公益课堂比例配置
-
+ 会员卡金额设置
@@ -1977,7 +1977,65 @@
-
+
diff --git a/application/api/controller/wanlshop/Active.php b/application/api/controller/wanlshop/Active.php
index 38e8dc6..4a35b83 100644
--- a/application/api/controller/wanlshop/Active.php
+++ b/application/api/controller/wanlshop/Active.php
@@ -19,4 +19,8 @@ class Active extends Api
$list = $this->model->select();
return $this->success('ok',$list);
}
+ public function getVipConfig(){
+ $config = get_addon_config('wanlshop');
+ $this->success("获取成功",$config['vippayconfig']);
+ }
}
\ No newline at end of file
diff --git a/application/api/controller/wanlshop/Pay.php b/application/api/controller/wanlshop/Pay.php
index 7de8f52..2114517 100644
--- a/application/api/controller/wanlshop/Pay.php
+++ b/application/api/controller/wanlshop/Pay.php
@@ -3,6 +3,7 @@ namespace app\api\controller\wanlshop;
use addons\wanlshop\library\WanlPay\WanlPay;
use addons\wanlshop\library\WanlSdk\Common;
+use addons\wanlshop\library\ZhiPay;
use app\common\controller\Api;
use think\Cache;
use think\Db;
diff --git a/application/api/controller/wanlshop/Product.php b/application/api/controller/wanlshop/Product.php
index 991abcb..897de68 100644
--- a/application/api/controller/wanlshop/Product.php
+++ b/application/api/controller/wanlshop/Product.php
@@ -13,7 +13,7 @@ use think\Db;
*/
class Product extends Api
{
- protected $noNeedLogin = ['lists', 'goods', 'drawer', 'comment', 'likes', 'stock','activelists'];
+ protected $noNeedLogin = ['lists', 'goods', 'drawer', 'comment', 'likes', 'stock','activelists','getbrand'];
protected $noNeedRight = ['*'];
protected $excludeFields = "";
@@ -104,7 +104,7 @@ class Product extends Api
//记录去除红包之后的价格
$priceinfo['price'] = round($price*(100-$bili)/100,2);
//计算红包数量
- $priceinfo['redpocket'] = ($price-$priceinfo['price'])/$config['moneyRedpocket']['money']*$config['moneyRedpocket']['redpocket'];
+ $priceinfo['redpocket'] = round(($price-$priceinfo['price'])/$config['moneyRedpocket']['money']*$config['moneyRedpocket']['redpocket'],2);
return $priceinfo;
}
public function getbili($uid=0){
@@ -178,7 +178,14 @@ class Product extends Api
->select()
]);
}
-
+ public function getbrand(){
+ $brandModel = model('app\api\model\wanlshop\Brand');
+ $brandInfo = $brandModel
+ ->where('status','normal')
+ ->field('id,name,image')
+ ->select();
+ $this->success('返回成功',$brandInfo);
+ }
/**
* 猜你喜欢
*
@@ -293,7 +300,16 @@ class Product extends Api
->field('id,category_id,shop_category_id,brand_id,freight_id,shop_id,title,image,images,flag,content,category_attribute,activity_type,price,sales,payment,comment,praise,moderate,negative,like,views,status')
->find();
// 浏览+1 & 报错
+ $config = get_addon_config('wanlshop');
+ $vipbili = $config['vipbili']['vipuser'];
+ $freebili = $config['vipbili']['freeuser'];
if($goods && $goods['status'] == 'normal'){
+ //免费会员商品价格+红包
+ $priceinfo = $this->pricejisuan($goods['price'],$freebili,0);
+ $goods['freepriceInfo'] = $priceinfo;
+ //vip会员价格+红包
+ $priceinfo = $this->pricejisuan($goods['price'],$vipbili,0);
+ $goods['vippriceInfo'] = $priceinfo;
// 查询类目
$goods->category->visible(['id','pid','name']);
// 查询优惠券