|
@@ -59,68 +59,51 @@ class Merchant
|
|
|
|
|
|
public function getInfo($account_id, $project_id, $id, $parent)
|
|
|
{
|
|
|
- $table = array();
|
|
|
- $table['head'] = array('银联商户号', '操作');
|
|
|
- $table['body'] = array();
|
|
|
-
|
|
|
$where = array();
|
|
|
$where['account_id'] = $account_id;
|
|
|
$where['project_id'] = $project_id;
|
|
|
$where['relate_id'] = $id;
|
|
|
- $data = Dever::db('pay/yspay_merchant')->select($where);
|
|
|
+ $data = Dever::db('pay/yspay_merchant')->find($where);
|
|
|
|
|
|
+ $html = '';
|
|
|
if ($data) {
|
|
|
- foreach ($data as $k => $v) {
|
|
|
- $status_name = '已签约';
|
|
|
- $step = false;
|
|
|
- if ($v['status'] == 2) {
|
|
|
- $status_name = '未签约';
|
|
|
- $sign = Dever::db('pay/yspay_sign')->one(array('merchant_id' => $v['id']));
|
|
|
- if ($sign && $sign['step']) {
|
|
|
- $step = $sign['step'];
|
|
|
- }
|
|
|
- }
|
|
|
- $url = Dever::url('project/database/update?project=pay&table=yspay_merchant&set=1&where_id='.$v['id'], 'manage');
|
|
|
- $oper = '<a class="layui-btn" onclick="fastEdit($(this),\''.$url.'\',\'编辑信息\', \'\')">编辑</a>';
|
|
|
+ $url = Dever::url('project/database/update?project=pay&table=yspay_merchant&set=1&where_id='.$data['id'], 'manage');
|
|
|
+ $html .= '<a style="cursor:pointer" onclick="fastEdit($(this),\''.$url.'\',\'编辑信息\', \'\')">'.$data['mid'].'</a>';
|
|
|
|
|
|
- if ($v['status'] == 1) {
|
|
|
- $url = Dever::url('project/database/list?project=pay&table=yspay_cash&search_option_merchant_id='.$v['id'].'&search_option_account_id='.$v['account_id'].'&parent='.$parent, 'manage');
|
|
|
- $oper .= '<a class="layui-btn" href="'.$url.'">资金流水</a>';
|
|
|
+ $step = false;
|
|
|
+ if ($data['status'] == 2) {
|
|
|
+ $sign = Dever::db('pay/yspay_sign')->one(array('merchant_id' => $data['id']));
|
|
|
+ if ($sign && $sign['step']) {
|
|
|
+ $step = $sign['step'];
|
|
|
}
|
|
|
- if ($v['status'] == 2) {
|
|
|
- $url = Dever::url('project/database/update?project=pay&table=yspay_sign&search_option_merchant_id='.$v['id'].'&search_option_account_id='.$v['account_id'].'&where_id='.$v['id'].'&parent='.$parent, 'manage');
|
|
|
- $oper .= '<a class="layui-btn" onclick="fastEdit($(this),\''.$url.'\',\'签约资料\', \'\')">签约资料</a>';
|
|
|
-
|
|
|
- if ($step == -1) {
|
|
|
- $content = '';
|
|
|
- $title = '';
|
|
|
- $url = Dever::url('pay/yspay/sign.handle?sign_id=' . $v['id']);
|
|
|
- $oper .= '<a class="layui-btn"href="javascript:;" onclick="load(\'' . $url . '\', \'' . $content . '\', \'' . $title . '\')">签约提审</a>';
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($data['status'] == 1) {
|
|
|
+ $url = Dever::url('project/database/list?project=pay&table=yspay_cash&search_option_merchant_id='.$data['id'].'&search_option_account_id='.$data['account_id'].'&parent='.$parent, 'manage');
|
|
|
+ $html .= ' <a style="cursor:pointer" href="'.$url.'">资金流水</a>';
|
|
|
+ }
|
|
|
+ if ($data['status'] == 2) {
|
|
|
+ $url = Dever::url('project/database/update?project=pay&table=yspay_sign&search_option_merchant_id='.$data['id'].'&search_option_account_id='.$data['account_id'].'&where_id='.$data['id'].'&parent='.$parent, 'manage');
|
|
|
+ $html .= ' <a style="cursor:pointer" onclick="fastEdit($(this),\''.$url.'\',\'签约资料\', \'\')">签约资料</a>';
|
|
|
|
|
|
- if ($step == 2) {
|
|
|
- $url = Dever::url('project/database/update?project=pay&table=yspay_sign&col=cashwhere_id='.$v['id'], 'manage');
|
|
|
- $oper = '<a class="layui-btn" onclick="fastEdit($(this),\''.$url.'\',\'签约打款\', \'\')">签约打款</a>';
|
|
|
- }
|
|
|
+ if ($step == -1) {
|
|
|
+ $content = '';
|
|
|
+ $title = '';
|
|
|
+ $url = Dever::url('pay/yspay/sign.handle?sign_id=' . $data['id']);
|
|
|
+ $html .= ' <a style="cursor:pointer" href="javascript:;" onclick="load(\'' . $url . '\', \'' . $content . '\', \'' . $title . '\')">签约提审</a>';
|
|
|
+ }
|
|
|
|
|
|
- if ($step == 4) {
|
|
|
- $url = Dever::load('pay/yspay/sign.getAgreement', $v['id']);
|
|
|
- $oper .= '<a style="cursor:pointer" data-clipboard-text="'.$url.'" class="clipboard"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 ">签约合同</button></a>';
|
|
|
- }
|
|
|
+ if ($step == 2) {
|
|
|
+ $url = Dever::url('project/database/update?project=pay&table=yspay_sign&col=cashwhere_id='.$data['id'], 'manage');
|
|
|
+ $html .= ' <a style="cursor:pointer" onclick="fastEdit($(this),\''.$url.'\',\'签约打款\', \'\')">签约打款</a>';
|
|
|
}
|
|
|
|
|
|
- $table['body'][$k][] = $v['mid'];
|
|
|
- $table['body'][$k][] = $oper;
|
|
|
+ if ($step == 4) {
|
|
|
+ $url = Dever::load('pay/yspay/sign.getAgreement', $data['id']);
|
|
|
+ $html .= ' <a style="cursor:pointer" data-clipboard-text="'.$url.'" class="clipboard"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 ">签约合同</button></a>';
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- $body[''] = array
|
|
|
- (
|
|
|
- 'type' => 'table',
|
|
|
- 'content' => $table,
|
|
|
- );
|
|
|
-
|
|
|
- if ($table['body']) {
|
|
|
- return Dever::show('', $body);
|
|
|
+ return $html;
|
|
|
} else {
|
|
|
return '暂无';
|
|
|
}
|