main
yangsai@163.com 7 days ago
parent d40ef01d8a
commit af135f5064
  1. 16
      addons/wanlshop/config.php
  2. 6
      addons/wanlshop/library/WanlPay/WanlPay.php
  3. 62
      application/admin/view/wanlshop/client/config.html
  4. 4
      application/api/controller/wanlshop/Active.php
  5. 1
      application/api/controller/wanlshop/Pay.php
  6. 22
      application/api/controller/wanlshop/Product.php

@ -523,6 +523,22 @@ return [
'tip' => '观看公益课堂比例配置', 'tip' => '观看公益课堂比例配置',
'ok' => '', 'ok' => '',
'extend' => '', 'extend' => '',
],
[
'name' => 'vippayconfig',
'title' => '观看公益课堂比例配置',
'type' => 'array',
'value' => [
'money' => 0.01,
'givered' => 1,
],
'rule' => '',
'msg' => '',
'tip' => '观看公益课堂比例配置',
'ok' => '',
'extend' => '',
], ],
[ [
'name' => '__tips__', 'name' => '__tips__',

@ -308,6 +308,12 @@ class WanlPay
} else if($this->type == 'apple'){ } else if($this->type == 'apple'){
try{ try{
} catch (\Exception $e) {
return ['code' => 10006 ,'msg' => $this->type.':'.$e->getMessage()];
}
} else if($this->type == 'dinpay'){
try{
} catch (\Exception $e) { } catch (\Exception $e) {
return ['code' => 10006 ,'msg' => $this->type.':'.$e->getMessage()]; return ['code' => 10006 ,'msg' => $this->type.':'.$e->getMessage()];
} }

@ -20,7 +20,7 @@
<li class="{:$Think.get.use === 'tuiguang' ? 'active' : ''}"><a href="#tuiguang" data-toggle="tab">推广活动配置</a></li> <li class="{:$Think.get.use === 'tuiguang' ? 'active' : ''}"><a href="#tuiguang" data-toggle="tab">推广活动配置</a></li>
<li class="{:$Think.get.use === 'fapiao' ? 'active' : ''}"><a href="#fapiao" data-toggle="tab">发票兑换比例</a></li> <li class="{:$Think.get.use === 'fapiao' ? 'active' : ''}"><a href="#fapiao" data-toggle="tab">发票兑换比例</a></li>
<li class="{:$Think.get.use === 'watchvideo' ? 'active' : ''}"><a href="#watchvideo" data-toggle="tab">观看公益课堂比例配置</a></li> <li class="{:$Think.get.use === 'watchvideo' ? 'active' : ''}"><a href="#watchvideo" data-toggle="tab">观看公益课堂比例配置</a></li>
<li class="{:$Think.get.use === 'vippayconfig' ? 'active' : ''}"><a href="#vippayconfig" data-toggle="tab">会员卡金额设置</a></li>
</ul> </ul>
</div> </div>
<div class="panel-body"> <div class="panel-body">
@ -1977,7 +1977,65 @@
</form> </form>
</div> </div>
</div> </div>
<div class="tab-pane fade {:$Think.get.use === 'vippayconfig' ? 'active in' : ''}" id="vippayconfig">
<div class="widget-body no-padding">
<form id="chat-form" class="edit-form form-horizontal" role="form" data-toggle="validator"
method="POST" action="{:url('wanlshop.client/edit')}">
{:token()}
<table class="table table-striped">
<thead>
<tr>
<th width="15%">配置项</th>
<th width="85%">参数</th>
</tr>
</thead>
<tbody>
<tr>
<td>观看公益课堂比例配置</td>
<td>
<div class="row">
<div class="col-sm-8 col-xs-12">
{:Form::text('row[vippayconfig][money]', $wanlshop.vippayconfig.money, ['data-tip'=>'请填写会员卡价格','placeholder'=>'请填写会员卡价格'])}
<div style="margin-top:5px;">
<a href="#" target="_blank">
会员卡价格(元)
</a>
</div>
</div>
<div class="col-sm-4"></div>
</div>
</td>
</tr>
<tr>
<td>办理会员赠送红包数量</td>
<td>
<div class="row">
<div class="col-sm-8 col-xs-12">
{:Form::text('row[vippayconfig][givered]', $wanlshop.vippayconfig.givered, ['data-tip'=>'请填写办理会员赠送红包数量','placeholder'=>'请填写办理会员赠送红包数量'])}
<div style="margin-top:5px;">
<a href="#" target="_blank">
请填写办理会员赠送红包数量
</a>
</div>
</div>
<div class="col-sm-4"></div>
</div>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<th></th>
<th>
<button type="submit" class="btn btn-success btn-embossed">确定</button>
<button type="reset" class="btn btn-default btn-embossed">重置</button>
</th>
</tr>
</tfoot>
</table>
</form>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

@ -19,4 +19,8 @@ class Active extends Api
$list = $this->model->select(); $list = $this->model->select();
return $this->success('ok',$list); return $this->success('ok',$list);
} }
public function getVipConfig(){
$config = get_addon_config('wanlshop');
$this->success("获取成功",$config['vippayconfig']);
}
} }

@ -3,6 +3,7 @@ namespace app\api\controller\wanlshop;
use addons\wanlshop\library\WanlPay\WanlPay; use addons\wanlshop\library\WanlPay\WanlPay;
use addons\wanlshop\library\WanlSdk\Common; use addons\wanlshop\library\WanlSdk\Common;
use addons\wanlshop\library\ZhiPay;
use app\common\controller\Api; use app\common\controller\Api;
use think\Cache; use think\Cache;
use think\Db; use think\Db;

@ -13,7 +13,7 @@ use think\Db;
*/ */
class Product extends Api 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 $noNeedRight = ['*'];
protected $excludeFields = ""; protected $excludeFields = "";
@ -104,7 +104,7 @@ class Product extends Api
//记录去除红包之后的价格 //记录去除红包之后的价格
$priceinfo['price'] = round($price*(100-$bili)/100,2); $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; return $priceinfo;
} }
public function getbili($uid=0){ public function getbili($uid=0){
@ -178,7 +178,14 @@ class Product extends Api
->select() ->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') ->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(); ->find();
// 浏览+1 & 报错 // 浏览+1 & 报错
$config = get_addon_config('wanlshop');
$vipbili = $config['vipbili']['vipuser'];
$freebili = $config['vipbili']['freeuser'];
if($goods && $goods['status'] == 'normal'){ 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']); $goods->category->visible(['id','pid','name']);
// 查询优惠券 // 查询优惠券

Loading…
Cancel
Save