|
@@ -237,20 +237,25 @@ class Cash
|
|
|
$cash = Dever::param('cash', $data);
|
|
|
$merchant = Dever::db('pay/yspay_merchant')->one($merchant_id);
|
|
|
if ($merchant) {
|
|
|
- $cash = $cash*$this->num;
|
|
|
- $yue = $merchant['hf_cash'] - $merchant['hf_tx_cash'] - $this->num*$this->bfj;
|
|
|
- if ($yue < $cash) {
|
|
|
- Dever::alert('余额不足');
|
|
|
- }
|
|
|
-
|
|
|
- $info['merchant_id'] = $merchant_id;
|
|
|
- $info['hf_cash'] = $cash;
|
|
|
- $info['order_num'] = Dever::order('TX');
|
|
|
- $status = $this->huafu_act($info);
|
|
|
- if ($status == 1) {
|
|
|
- Dever::db('pay/yspay_merchant')->updateTxCash(array('where_id' => $merchant_id, 'hf_tx_cash' => $cash));
|
|
|
- }
|
|
|
+ $this->tixian_act();
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ public function tixian_act($merchant, $cash)
|
|
|
+ {
|
|
|
+ $cash = $cash*$this->num;
|
|
|
+ $yue = $merchant['hf_cash'] - $merchant['hf_tx_cash'] - $this->num*$this->bfj;
|
|
|
+ if ($yue < $cash) {
|
|
|
+ Dever::alert('余额不足');
|
|
|
+ }
|
|
|
+
|
|
|
+ $info['merchant_id'] = $merchant_id;
|
|
|
+ $info['hf_cash'] = $cash;
|
|
|
+ $info['order_num'] = Dever::order('TX');
|
|
|
+ $status = $this->huafu_act($info);
|
|
|
+ if ($status == 1) {
|
|
|
+ Dever::db('pay/yspay_merchant')->updateTxCash(array('where_id' => $merchant_id, 'hf_tx_cash' => $cash));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|