添加:商品已兑换数量
This commit is contained in:
parent
6f4ea70d2a
commit
ab020a93d9
|
|
@ -4,6 +4,7 @@ namespace Yunshop\CulturalSpace\models;
|
|||
|
||||
use app\common\facades\Setting;
|
||||
use app\common\models\BaseModel;
|
||||
use app\common\models\OrderGoods;
|
||||
use app\frontend\models\Goods;
|
||||
|
||||
class GoodsCulturalSpace extends BaseModel{
|
||||
|
|
@ -82,6 +83,9 @@ class GoodsCulturalSpace extends BaseModel{
|
|||
// 使用的文创豆
|
||||
$useLegumes = ceil($item['legumes_exchange_price'] / $currentFee);
|
||||
$useLegumes = $useLegumes <= 1 ? 1 : $useLegumes;
|
||||
// 获取已兑换数量
|
||||
$exchangeNum = OrderGoods::uniacid()->where('goods_id',$item['goods_id'])->where('is_legumes_exchange',1)->count();
|
||||
|
||||
return [
|
||||
'id' => $item['id'],
|
||||
'goods_id' => $item['goods_id'],
|
||||
|
|
@ -91,6 +95,7 @@ class GoodsCulturalSpace extends BaseModel{
|
|||
'goods_price' => $item['belongs_to_goods']['price'],
|
||||
'use_legumes' => $useLegumes,
|
||||
'is_allow_exchange' => (int)$holdExchangeLegumesMoney >= $item['legumes_exchange_price'],
|
||||
'exchange_num' => (int)$exchangeNum,
|
||||
];
|
||||
},$data['data']);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ class ExternalApi extends BaseModel{
|
|||
|
||||
// 生产环境
|
||||
// private $apiLink = 'https://ms.xs-ygj.com/bwmsweb';// 生产地址
|
||||
// private $accessId = '';// 接入ID
|
||||
// private $accessSecret = '';// 请求密钥
|
||||
// private $groundAgentId = '';// 落地公司机构号
|
||||
// private $bmemberId = '';// 落地公司商户号
|
||||
// private $coreAgentId = '';// 核心企业机构号
|
||||
// private $memberId = '';// 核心企业商户号
|
||||
// private $accessId = 'ZLSS2023101015281525786620371101';// 接入ID
|
||||
// private $accessSecret = 'ZGnDgGDSXeusnZjIWwzstRi4JgjwOS9M';// 请求密钥
|
||||
// private $groundAgentId = 'L20230921161137004';// 落地公司机构号
|
||||
// private $bmemberId = '763071836462340781';// 落地公司商户号
|
||||
// private $coreAgentId = 'C20231130092957659';// 核心企业机构号
|
||||
// private $memberId = '906487975715084884';// 核心企业商户号
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue