|
@@ -392,6 +392,11 @@ class Order
|
|
|
),
|
|
|
);
|
|
|
|
|
|
+ $soft = '';
|
|
|
+ if ($role['soft'] && $role['soft'] > 0) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
$result['支付信息'] = array
|
|
|
(
|
|
|
'type' => 'info',
|
|
@@ -400,13 +405,13 @@ class Order
|
|
|
array
|
|
|
(
|
|
|
array('支付方式', $config['pay_type'][$info['pay_type']]),
|
|
|
- array('支付金额', '¥' . $info['price'] . '元'),
|
|
|
- array('支付状态', $config['pay_status'][$info['pay_status']]),
|
|
|
+ array('支付金额', '¥' . $info['price'] . '元' . $soft),
|
|
|
),
|
|
|
|
|
|
array
|
|
|
(
|
|
|
array('付款备注', $info['desc']),
|
|
|
+ array('支付状态', $config['pay_status'][$info['pay_status']]),
|
|
|
array('支付凭证', $pay_pic),
|
|
|
),
|
|
|
),
|
|
@@ -425,19 +430,28 @@ class Order
|
|
|
$button[] = array
|
|
|
(
|
|
|
'type' => 'edit',
|
|
|
- 'link' => Dever::url('project/database/update?project=agent&table=order_process&order_id='.$info['id'].'&status=2&col=order_id,status,audit,desc', 'manage'),
|
|
|
+ 'link' => Dever::url('project/database/update?project=agent&table=order_process&order_id='.$info['id'].'&status=2&col=order_id,status,audit,get_type,desc', 'manage'),
|
|
|
'name' => '财务终审',
|
|
|
);
|
|
|
} elseif ($info['status'] == 3) {
|
|
|
+ $purl = Dever::url('project/database/update?project=agent&table=order_process&order_id='.$info['id'].'&status=3&col=order_id,status,type', 'manage');
|
|
|
+ if (isset($process[3]) && $process[3]) {
|
|
|
+ $purl .= '&where_id=' . $process[3]['id'];
|
|
|
+ }
|
|
|
$button[] = array
|
|
|
(
|
|
|
'type' => 'edit',
|
|
|
- 'link' => Dever::url('project/database/update?project=agent&table=order_process&order_id='.$info['id'].'&status=3&col=order_id,status,type', 'manage'),
|
|
|
+ 'link' => $purl,
|
|
|
'name' => '确认完成',
|
|
|
);
|
|
|
}
|
|
|
|
|
|
if ($info['status'] == 3 || $info['status'] == 4) {
|
|
|
+
|
|
|
+ if (isset($process[3]) && $process[3]) {
|
|
|
+ $process[3]['type'] = explode(',', $process[3]['type']);
|
|
|
+ }
|
|
|
+
|
|
|
if ($parent_member) {
|
|
|
|
|
|
$table['head'] = array('名称', '角色', '级别', '分润(元)');
|
|
@@ -460,78 +474,99 @@ class Order
|
|
|
}
|
|
|
$cash = 0;
|
|
|
|
|
|
-
|
|
|
- if (!$parent_info['sell']) {
|
|
|
- $parent_info['sell'] = 0;
|
|
|
- }
|
|
|
- $sell = $parent_info['sell'] + $info['price'];
|
|
|
-
|
|
|
- $level = Dever::db('setting/level')->getOne(array('target' => $sell));
|
|
|
- if ($level && $level['level'] > $parent_level['level']) {
|
|
|
-
|
|
|
- $old = $parent_level;
|
|
|
- $parent_info['level_id'] = $level['id'];
|
|
|
- $parent_level = $level;
|
|
|
- $parent_level['name'] = $old['name'] . '->' . $level['name'];
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- $parent_num = Dever::load('invite/api')->getChildNum($v['uid'], 1) + 1;
|
|
|
+ $order_cash = Dever::db('agent/order_cash')->getData(array('order_id' => $info['id'], 'parent_mid' => $v['uid'], 'type' => 2));
|
|
|
|
|
|
- if ($parent_num >= $parent_level['num']) {
|
|
|
-
|
|
|
- if ($parent_per > 0) {
|
|
|
- $parent_level['value'] = $parent_level['value'] - $parent_per;
|
|
|
+ if ($order_cash) {
|
|
|
+ $cash = $order_cash['cash'];
|
|
|
+ } else {
|
|
|
+
|
|
|
+
|
|
|
+ if (!$parent_info['group_sell']) {
|
|
|
+ $parent_info['group_sell'] = 0;
|
|
|
+ }
|
|
|
+ $sell = $parent_info['group_sell'] + $info['price'];
|
|
|
+
|
|
|
+ $level = Dever::db('setting/level')->getOne(array('target' => $sell));
|
|
|
+ if ($level && $level['level'] > $parent_level['level']) {
|
|
|
+
|
|
|
+ $old = $parent_level;
|
|
|
+ $parent_info['level_id'] = $level['id'];
|
|
|
+ $parent_level = $level;
|
|
|
+ $parent_level['name'] = $old['name'] . '->' . $level['name'];
|
|
|
}
|
|
|
- if ($parent_level['value'] > 0) {
|
|
|
- $cash += $info['price'] * ($parent_level['value']/100);
|
|
|
- $parent_per = $parent_level['value'];
|
|
|
+
|
|
|
+
|
|
|
+ $parent_num = Dever::load('invite/api')->getChildNum($v['uid'], 1) + 1;
|
|
|
+
|
|
|
+ if ($parent_num >= $parent_level['num']) {
|
|
|
+
|
|
|
+ if ($parent_per > 0) {
|
|
|
+ $parent_level['value'] = $parent_level['value'] - $parent_per;
|
|
|
+ }
|
|
|
+ if ($parent_level['value'] > 0) {
|
|
|
+ $cash += $info['price'] * ($parent_level['value']/100);
|
|
|
+ $parent_per = $parent_level['value'];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ($k == 0) {
|
|
|
+ $order_cash = Dever::db('agent/order_cash')->getData(array('order_id' => $info['id'], 'parent_mid' => $v['uid'], 'type' => 1));
|
|
|
$parent_name .= $parent_role['name'] . '('.$parent_level['name'].')';
|
|
|
|
|
|
- $reward = Dever::db('setting/role_reward')->find(array('role_id' => $parent_info['role'], 't_role_id' => $info['role']));
|
|
|
- if ($reward) {
|
|
|
- if ($reward['num'] == 1) {
|
|
|
- if ($reward['value_type'] == 1) {
|
|
|
- $cash += $info['price'] * ($reward['value']/100);
|
|
|
- } else {
|
|
|
- $cash += $reward['value'];
|
|
|
+ if (!$order_cash) {
|
|
|
+ $reward = Dever::db('setting/role_reward')->find(array('role_id' => $parent_info['role'], 't_role_id' => $info['role']));
|
|
|
+ if ($reward) {
|
|
|
+ if ($reward['num'] == 1) {
|
|
|
+ if ($reward['value_type'] == 1) {
|
|
|
+ $zcash = $info['price'] * ($reward['value']/100);
|
|
|
+ } else {
|
|
|
+ $zcash = $reward['value'];
|
|
|
+ }
|
|
|
+
|
|
|
+ $parent_name .= ' 直推佣金:<a style="color:blue" class="set_cash" data-param="1-'.$info['id'].'-'.$parent_info['id'].'-'.$zcash.'-'.$parent_level['id'].'">' . $zcash . '</a>元';
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ $zcash = $order_cash['cash'];
|
|
|
+ $parent_name .= ' 直推佣金:<a style="color:blue">' . $zcash . '</a>元';
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ $cash = '<a style="color:blue" class="set_cash" data-param="2-'.$info['id'].'-'.$parent_info['id'].'-'.$cash.'-'.$parent_level['id'].'">' . $cash . '</a>';
|
|
|
|
|
|
$table['body'][] = array($parent_info['name'], $parent_role['name'], $parent_level['name'], $cash);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (isset($process[3]['type']) && is_array($process[3]['type']) && in_array(3, $process[3]['type'])) {
|
|
|
+ $parent_title = '(已发放分润)';
|
|
|
+ $parent_button = array();
|
|
|
+ } else {
|
|
|
+ $parent_title = '(未发放分润)';
|
|
|
+ $parent_button[] = array
|
|
|
+ (
|
|
|
+ 'type' => 'link',
|
|
|
+ 'link' => Dever::url('lib/order_set.home?order_id='.$info['id'].'&role_id=' . $info['role'], 'agent'),
|
|
|
+ 'name' => '修改分润金额'
|
|
|
+ );
|
|
|
+
|
|
|
+ $furl = Dever::url('lib/manage.set_commit?type=3&order_id='.$info['id'], 'agent');
|
|
|
+ $parent_button[] = array
|
|
|
+ (
|
|
|
+ 'type' => 'click',
|
|
|
+ 'content' => 'setCash()',
|
|
|
+ 'name' => '确认分润比例<script>function setCash(){layer.confirm(\'确定进行此项操作吗?\', function(){var cash = [];$(\'.set_cash\').each(function(){cash.push($(this).attr(\'data-param\'));});$.post(\''.$furl.'\',{param:cash.join(",")}, function(){})})}</script>'
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
- $parent_button[] = array(
|
|
|
- 'type' => 'link',
|
|
|
- 'link' => Dever::url('lib/order_set.home?order_id='.$info['id'].'&role_id=' . $info['role'], 'agent'),
|
|
|
- 'name' => '修改分润金额'
|
|
|
- );
|
|
|
- $parent_button[] = array(
|
|
|
- 'type' => 'link',
|
|
|
- 'link' => Dever::url('lib/manage.setGoods_commit?order_id='.$info['id'], 'agent'),
|
|
|
- 'name' => '确认分润比例'
|
|
|
- );
|
|
|
- $result['分润信息'] = array
|
|
|
+ $result['分润信息' . $parent_title] = array
|
|
|
(
|
|
|
'type' => 'table',
|
|
|
'content' => $table,
|
|
|
- 'head' => array('name' => $parent_name, 'btn' => $parent_button),
|
|
|
+ 'head' => array('name' => '<span>' . $parent_name . '</span>', 'btn' => $parent_button),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- if (isset($process[3]) && $process[3]) {
|
|
|
- $process[3]['type'] = explode(',', $process[3]['type']);
|
|
|
- }
|
|
|
-
|
|
|
$goods = Dever::db('agent/order_goods')->getData(array('order_id' => $info['id']));
|
|
|
if (!$goods) {
|
|
|
$goods = Dever::db('setting/role_goods')->getData(array('role_id' => $info['role'], 'give' => $info['order_type']));
|
|
@@ -539,11 +574,11 @@ class Order
|
|
|
|
|
|
if (isset($process[3]['type']) && is_array($process[3]['type']) && in_array(2, $process[3]['type'])) {
|
|
|
$process_status = 1;
|
|
|
- $process_name = '(已发放权益)';
|
|
|
+ $process_title = '(已发放权益)';
|
|
|
$process_button = array();
|
|
|
} else {
|
|
|
$process_status = 2;
|
|
|
- $process_name = '(未发放权益)';
|
|
|
+ $process_title = '(未发放权益)';
|
|
|
|
|
|
$process_button[] = array(
|
|
|
'type' => 'link',
|
|
@@ -552,7 +587,7 @@ class Order
|
|
|
);
|
|
|
$process_button[] = array(
|
|
|
'type' => 'action',
|
|
|
- 'link' => Dever::url('lib/manage.setGoods_commit?order_id='.$info['id'], 'agent'),
|
|
|
+ 'link' => Dever::url('lib/manage.set_commit?type=2&order_id='.$info['id'], 'agent'),
|
|
|
'name' => '发放权益'
|
|
|
);
|
|
|
}
|
|
@@ -607,7 +642,7 @@ class Order
|
|
|
$body[] = $d;
|
|
|
}
|
|
|
|
|
|
- $result['权益信息' . $process_name] = array
|
|
|
+ $result['权益信息' . $process_title] = array
|
|
|
(
|
|
|
'type' => 'list',
|
|
|
'head' => array('name' => '权益列表:', 'btn' => $process_button),
|