rabin 1 рік тому
батько
коміт
4115e6b0e9
2 змінених файлів з 24 додано та 0 видалено
  1. 3 0
      yspay/Cash.php
  2. 21 0
      yspay/Merchant.php

+ 3 - 0
yspay/Cash.php

@@ -34,6 +34,9 @@ class Cash
     # 修改状态
     public function up($id, $status = 2, $amount = false)
     {
+    	if ($amount) {
+    		$amount = $amount * 100;
+    	}
     	if (is_numeric($id)) {
     		$where['id'] = $id;
     	} else {

+ 21 - 0
yspay/Merchant.php

@@ -57,6 +57,27 @@ class Merchant
         return false;
     }
 
+    public function getOther($account_id, $table, $relate_id, $order_num, $cash)
+    {
+        $result = array();
+        $yspay = Dever::db('pay/yspay')->find(array('account_id' => $account_id));
+        if ($cash && $cash > 0 && $yspay && $yspay['type'] == 2) {
+            # 分账拆单
+            $project = Dever::db('pay/yspay_project')->find(array('table' => $table));
+            if ($project) {
+                $merchant = Dever::db('pay/yspay_merchant')->find(array('account_id' => $account_id, 'project_id' => $project['id'], 'relate_id' => $relate_id));
+                if ($merchant && $merchant['mid']) {
+                    $result = array(
+                        'mid' => $merchant['mid'],
+                        'order_id' => $order_num,
+                        'amount' => $cash,
+                    );
+                }
+            }
+        }
+        return $result;
+    }
+
     public function getInfo($account_id, $project_id, $id, $parent)
     {
         list($project, $table) = explode('/', $parent);