dever 3 years ago
parent
commit
d4a79e412d
2 changed files with 9 additions and 3 deletions
  1. 7 1
      app/shop/lib/Cron.php
  2. 2 2
      app/shop/src/Yspay.php

+ 7 - 1
app/shop/lib/Cron.php

@@ -9,10 +9,11 @@ class Cron
     # 获取7天后完成的订单 准备分账
     public function yspay_api()
     {
+        $day = Dever::input('day', 7);
         $time = time();
         $where['status'] = '5,6';
         $where['withdraw'] = 1;
-        $where['cdate'] = $time - 7*86400;
+        $where['cdate'] = $time - $day*86400;
         $order = Dever::db('shop/sell_order')->getDataByTime($where);
 
         if ($order) {
@@ -26,6 +27,11 @@ class Cron
     {
         $shop = Dever::db('shop/info')->find($v['shop_id']);
         if ($v['withdraw'] == 1 && $shop && $shop['mid'] && $shop['status'] == 1) {
+
+            if ($v['refund_cash']) {
+                $v['price'] -= $v['refund_cash'];
+                $v['price'] = round($v['price'], 2);
+            }
             $cash = $v['price'] * 100;//之后还要加上礼品卡的钱
             Dever::load('shop/yspay')->action($shop['mid'], $v['order_num'], 2, $cash);
         }

+ 2 - 2
app/shop/src/Yspay.php

@@ -13,7 +13,7 @@ class Yspay
 		$class = new Chinaums();
 
 		# 查看当前余额
-		$cash = $class->query('89810007372107A');
+		$cash = $class->query(false);
 
 		echo $cash;die;
 		return $cash;
@@ -23,7 +23,7 @@ class Yspay
 	{
 		$order = Dever::order();
 
-		$result = $this->action('89810007372107A', $order, 2, 1);
+		$result = $this->action(false, $order, 2, 10);
 
 		return $result;
 	}