feat(StoreOrderLogic): 修改折扣率计算方式及退款方式
This commit is contained in:
parent
d26d9c97d4
commit
ee66715667
@ -81,7 +81,7 @@ class StoreOrderLogic extends BaseLogic
|
|||||||
$pay_price = bcdiv(bcmul($pay_price, $discountRate, 4), '1', 2);
|
$pay_price = bcdiv(bcmul($pay_price, $discountRate, 4), '1', 2);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$discountRate = bcdiv(1, '100', 2);
|
$discountRate = bcdiv(100, '100', 2);
|
||||||
$pay_price = bcdiv(bcmul($pay_price, $discountRate, 4), '1', 2);
|
$pay_price = bcdiv(bcmul($pay_price, $discountRate, 4), '1', 2);
|
||||||
}
|
}
|
||||||
if (!empty(self::$total) && !empty($pay_price)) {
|
if (!empty(self::$total) && !empty($pay_price)) {
|
||||||
@ -235,13 +235,6 @@ class StoreOrderLogic extends BaseLogic
|
|||||||
'total' => $total,
|
'total' => $total,
|
||||||
'currency' => 'CNY',
|
'currency' => 'CNY',
|
||||||
],
|
],
|
||||||
// '_action' => 'jsapi', // jsapi 退款,默认
|
|
||||||
// '_action' => 'app', // app 退款
|
|
||||||
// '_action' => 'combine', // 合单退款
|
|
||||||
// '_action' => 'h5', // h5 退款
|
|
||||||
// '_action' => 'miniapp', // 小程序退款
|
|
||||||
// '_action' => 'native', // native 退款
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$res = $wechat->wechat->refund($order);
|
$res = $wechat->wechat->refund($order);
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
namespace app\store\controller\store_order;
|
namespace app\store\controller\store_order;
|
||||||
|
|
||||||
|
use app\api\logic\order\OrderLogic;
|
||||||
|
use app\api\validate\OrderValidate;
|
||||||
use app\store\lists\store_order\StoreOrderLists;
|
use app\store\lists\store_order\StoreOrderLists;
|
||||||
use app\common\controller\Definitions;
|
use app\common\controller\Definitions;
|
||||||
use app\common\enum\PayEnum;
|
use app\common\enum\PayEnum;
|
||||||
@ -11,6 +12,7 @@ use app\common\logic\PayNotifyLogic;
|
|||||||
use app\common\logic\SystemStoreStaffLogic;
|
use app\common\logic\SystemStoreStaffLogic;
|
||||||
use app\store\controller\BaseAdminController;
|
use app\store\controller\BaseAdminController;
|
||||||
use app\common\logic\store_order\StoreOrderLogic;
|
use app\common\logic\store_order\StoreOrderLogic;
|
||||||
|
use app\common\model\store_order\StoreOrder;
|
||||||
use app\store\validate\store_order\StoreOrderValidate;
|
use app\store\validate\store_order\StoreOrderValidate;
|
||||||
use hg\apidoc\annotation as ApiDoc;
|
use hg\apidoc\annotation as ApiDoc;
|
||||||
use Webman\RedisQueue\Redis;
|
use Webman\RedisQueue\Redis;
|
||||||
@ -173,4 +175,18 @@ class StoreOrderController extends BaseAdminController
|
|||||||
return $this->fail(StoreOrderLogic::getError());
|
return $this->fail(StoreOrderLogic::getError());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function writeoff_order()
|
||||||
|
{
|
||||||
|
$params = (new OrderValidate())->post()->goCheck('check');
|
||||||
|
$count = StoreOrder::where('verify_code',$params['verify_code'])->count();
|
||||||
|
if(empty($count)){
|
||||||
|
return $this->fail('无该核销码请检查');
|
||||||
|
}
|
||||||
|
$res = OrderLogic::writeOff($params);
|
||||||
|
if ($res) {
|
||||||
|
return $this->success('核销成功');
|
||||||
|
}
|
||||||
|
return $this->fail('核销失败'.OrderLogic::getError());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,8 +43,8 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists
|
|||||||
*/
|
*/
|
||||||
public function lists($where = []): array
|
public function lists($where = []): array
|
||||||
{
|
{
|
||||||
$this->searchWhere[]=['staff_id'=>$this->adminId];
|
$this->searchWhere[]=['staff_id','=',$this->adminId];
|
||||||
$this->searchWhere[]=['is_pay'=>0];
|
$this->searchWhere[]=['is_pay','=',0];
|
||||||
$list = Cart::where($this->searchWhere)
|
$list = Cart::where($this->searchWhere)
|
||||||
->field('id,product_id,cart_num,store_id')
|
->field('id,product_id,cart_num,store_id')
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
@ -27,7 +27,7 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
public function setSearch(): array
|
public function setSearch(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'=' => ['pay_type'],
|
'=' => ['pay_type','paid'],
|
||||||
'%like%' => ['order_id'],
|
'%like%' => ['order_id'],
|
||||||
'between_time' => 'create_time',
|
'between_time' => 'create_time',
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user