|
@@ -41,10 +41,11 @@ class Merchant
|
|
|
return Dever::search($project['table'], $where);
|
|
|
}
|
|
|
|
|
|
- public function up($account_id, $project_id, $id, $name)
|
|
|
+ public function up($account_id, $yspay_main_id, $project_id, $id, $name)
|
|
|
{
|
|
|
$data = array();
|
|
|
$data['account_id'] = $account_id;
|
|
|
+ $data['yspay_main_id'] = $yspay_main_id;
|
|
|
$data['project_id'] = $project_id;
|
|
|
$data['relate_id'] = $id;
|
|
|
$info = Dever::db('pay/yspay_merchant')->find($data);
|
|
@@ -57,28 +58,29 @@ class Merchant
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- public function getOther($account_id, $table, $relate_id, $order_num, $cash, $fenzhang = 0)
|
|
|
+ public function getOther($account_id, $yspay_main_id, $relate, $relate_id, $order_num, $cash, $fenzhang = 0)
|
|
|
{
|
|
|
$result = array();
|
|
|
$yspay = Dever::db('pay/yspay')->find(array('account_id' => $account_id));
|
|
|
if ($cash && $cash > 0 && $yspay && $yspay['type'] == 2) {
|
|
|
# 分账拆单
|
|
|
$merchant = array();
|
|
|
- if ($table == 2) {
|
|
|
- $merchant = Dever::db('pay/yspay_merchant')->find(array('account_id' => $account_id, 'type' => 2));
|
|
|
+ if ($relate == 2) {
|
|
|
+ $merchant = Dever::db('pay/yspay_merchant')->find(array('account_id' => $account_id, 'yspay_main_id' => $yspay_main_id, 'type' => 2));
|
|
|
if (strstr($order_num, '_')) {
|
|
|
$temp = explode('_', $order_num);
|
|
|
$order_num = $temp[0];
|
|
|
}
|
|
|
$order_num .= '_O';
|
|
|
} else {
|
|
|
- $project = Dever::db('pay/yspay_project')->find(array('table' => $table));
|
|
|
+ $project = Dever::db('pay/yspay_project')->find(array('table' => $relate));
|
|
|
if ($project) {
|
|
|
- $merchant = Dever::db('pay/yspay_merchant')->find(array('account_id' => $account_id, 'project_id' => $project['id'], 'relate_id' => $relate_id));
|
|
|
+ $merchant = Dever::db('pay/yspay_merchant')->find(array('account_id' => $account_id, 'yspay_main_id' => $yspay_main_id, 'project_id' => $project['id'], 'relate_id' => $relate_id));
|
|
|
}
|
|
|
}
|
|
|
if ($merchant && $merchant['mid']) {
|
|
|
$result = array(
|
|
|
+ 'yspay_main_id' => $merchant['yspay_main_id'],
|
|
|
'merchant_id' => $merchant['id'],
|
|
|
'mid' => $merchant['mid'],
|
|
|
'order_id' => $order_num,
|
|
@@ -91,11 +93,12 @@ class Merchant
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
- public function getInfo($account_id, $project_id, $id, $parent, $array = false)
|
|
|
+ public function getInfo($account_id, $yspay_main_id, $project_id, $id, $parent, $array = false)
|
|
|
{
|
|
|
list($project, $table) = explode('/', $parent);
|
|
|
$where = array();
|
|
|
$where['account_id'] = $account_id;
|
|
|
+ $data['yspay_main_id'] = $yspay_main_id;
|
|
|
$where['project_id'] = $project_id;
|
|
|
$where['relate_id'] = $id;
|
|
|
$data = Dever::db('pay/yspay_merchant')->find($where);
|