|
@@ -10,6 +10,18 @@ class Manage extends Auth
|
|
return Dever::db('info', 'seller')->select(array('status' => 1));
|
|
return Dever::db('info', 'seller')->select(array('status' => 1));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ public function getList()
|
|
|
|
+ {
|
|
|
|
+ $data[0] = array
|
|
|
|
+ (
|
|
|
|
+ 'id' => -1,
|
|
|
|
+ 'name' => '--通用卡密--',
|
|
|
|
+ );
|
|
|
|
+ $data = array_merge($data, $this->getInfo());
|
|
|
|
+ return $data;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
public function createAppKey($data)
|
|
public function createAppKey($data)
|
|
{
|
|
{
|
|
@@ -49,8 +61,8 @@ class Manage extends Auth
|
|
if (!$data['data']) {
|
|
if (!$data['data']) {
|
|
Dever::error('未输入充值数据');
|
|
Dever::error('未输入充值数据');
|
|
}
|
|
}
|
|
- $goods = explode(',', $data['goods']);
|
|
+
|
|
- $goods_id = end($goods);
|
|
+ $goods_id = $data['goods_id'];
|
|
$sku_id = $data['sku_id'];
|
|
$sku_id = $data['sku_id'];
|
|
$seller_id = $data['seller_id'];
|
|
$seller_id = $data['seller_id'];
|
|
$seller = Dever::db('info', 'seller')->find($seller_id);
|
|
$seller = Dever::db('info', 'seller')->find($seller_id);
|
|
@@ -184,6 +196,15 @@ class Manage extends Auth
|
|
return $result;
|
|
return $result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ public function showOrderAccount($account)
|
|
|
|
+ {
|
|
|
|
+ if (strstr($account, 'km_')) {
|
|
|
|
+ return '<a>提取卡密</a>';
|
|
|
|
+ }
|
|
|
|
+ return $account;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
public function showOrderCash($cate_id, $goods_id, $sku_id, $cash, $price, $num)
|
|
public function showOrderCash($cate_id, $goods_id, $sku_id, $cash, $price, $num)
|
|
@@ -327,6 +348,22 @@ class Manage extends Auth
|
|
$value = $this->showOrderStatus($data['status']);
|
|
$value = $this->showOrderStatus($data['status']);
|
|
$goods = $this->showOrderCash($data['cate_id'], $data['goods_id'], $data['sku_id'], $data['cash'], $data['price'], $data['num']);
|
|
$goods = $this->showOrderCash($data['cate_id'], $data['goods_id'], $data['sku_id'], $data['cash'], $data['price'], $data['num']);
|
|
$result['type'] = 'desc';
|
|
$result['type'] = 'desc';
|
|
|
|
+ if (strstr($data['account'], 'km_')) {
|
|
|
|
+ $code = $this->kmPwd($data['id'], $data['cdate']);
|
|
|
|
+ $result['content'][] = array
|
|
|
|
+ (
|
|
|
|
+ 'title' => '卡密信息',
|
|
|
|
+ 'border' => true,
|
|
|
|
+ 'direction' => 'horizontal',
|
|
|
|
+ 'size' => 'small',
|
|
|
|
+ 'column' => 1,
|
|
|
|
+ 'content' => array
|
|
|
|
+ (
|
|
|
|
+ array('提取密码', '<font style="color:red">' . $code . '</font>'),
|
|
|
|
+ ),
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
$result['content'][] = array
|
|
$result['content'][] = array
|
|
(
|
|
(
|
|
'title' => '商户发起请求',
|
|
'title' => '商户发起请求',
|
|
@@ -412,20 +449,74 @@ class Manage extends Auth
|
|
return $result;
|
|
return $result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ public function showOrderExpandKm($data)
|
|
|
|
+ {
|
|
|
|
+ if ($data && strstr($data['account'], 'km_')) {
|
|
|
|
+ $result['type'] = 'desc';
|
|
|
|
+ $result['content'][] = array
|
|
|
|
+ (
|
|
|
|
+ 'title' => '提取卡密',
|
|
|
|
+ 'border' => true,
|
|
|
|
+ 'direction' => 'horizontal',
|
|
|
|
+ 'size' => 'small',
|
|
|
|
+ 'column' => 1,
|
|
|
|
+ 'content' => array
|
|
|
|
+ (
|
|
|
|
+ array('提取密码', array
|
|
|
|
+ (
|
|
|
|
+ 'input' => '请输入密码',
|
|
|
|
+ 'value' => '',
|
|
|
|
+ 'button' => '提取',
|
|
|
|
+ 'remote' => Dever::url('seller/manage.tqKm', array('order_id' => $data['id'])),
|
|
|
|
+ )),
|
|
|
|
+ ),
|
|
|
|
+ );
|
|
|
|
+ $log = Dever::db('order_km', 'seller')->select(array('order_id' => $data['id']));
|
|
|
|
+ $content = array();
|
|
|
|
+ if ($log) {
|
|
|
|
+ foreach ($log as $v) {
|
|
|
|
+ $content[] = array(date('Y-m-d H:i:s', $v['cdate']), '操作人:' . $v['admin_name']);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $result['content'][] = array
|
|
|
|
+ (
|
|
|
|
+ 'title' => '提取记录',
|
|
|
|
+ 'border' => true,
|
|
|
|
+ 'direction' => 'horizontal',
|
|
|
|
+ 'size' => 'small',
|
|
|
|
+ 'column' => 1,
|
|
|
|
+ 'content' => $content,
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ $result['type'] = 'string';
|
|
|
|
+ $result['content'] = '暂无信息';
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return $result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
public function outKm($data)
|
|
public function outKm($data)
|
|
{
|
|
{
|
|
$result = array();
|
|
$result = array();
|
|
- $result['head'] = array('订单id', '订单号', '面值', '卡号', '密码');
|
|
+ $result['head'] = array('订单id', '订单号', '面值', '卡号', '密码', '导出时间');
|
|
$result['body'] = array();
|
|
$result['body'] = array();
|
|
foreach ($data['body'] as $k => $v) {
|
|
foreach ($data['body'] as $k => $v) {
|
|
$card = Dever::db('card', 'channel')->select(array('order_id' => $v['id']));
|
|
$card = Dever::db('card', 'channel')->select(array('order_id' => $v['id']));
|
|
if ($card) {
|
|
if ($card) {
|
|
foreach ($card as $k1 => $v1) {
|
|
foreach ($card as $k1 => $v1) {
|
|
- $result['body'][] = array($v['id'], $v['order_num'], $v['cash'], $v1['number'], $v1['pwd']);
|
|
+ $result['body'][] = array($v['id'], $v['order_num'], $v['cash'], $v1['number'], $v1['pwd'], date('Y-m-d H:i:s'));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return $result;
|
|
return $result;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public function kmPwd($id, $cdate)
|
|
|
|
+ {
|
|
|
|
+ $num = $id * $cdate * 10000000;
|
|
|
|
+ return \Dever\Helper\Str::idtostr($num);
|
|
|
|
+ }
|
|
}
|
|
}
|