Your Name 2 年 前
コミット
7dfe7da8f9

+ 27 - 0
service/agent/assets/manage/html/option_account.html

@@ -0,0 +1,27 @@
+
+<form class="layui-form form10" action="" target="f10" method="post">
+<iframe id="f10" name="f10" style="display:none;"></iframe>
+<div class="layui-form-item" id="show">
+    <table class="layui-table">
+      <thead>
+        <tr>
+          <th>昵称</th>
+          <th>加入时间</th>
+          <th>签名</th>
+        </tr> 
+      </thead>
+      <tbody>
+        <tr>
+          <td>贤心</td>
+          <td>2016-11-29</td>
+          <td>人生就像是一场修行</td>
+        </tr>
+        <tr>
+          <td>许闲心</td>
+          <td>2016-11-28</td>
+          <td>于千万人之中遇见你所遇见的人,于千万年之中,时间的无涯的荒野里…</td>
+        </tr>
+      </tbody>
+    </table>
+</div>
+</form>

+ 3 - 6
service/agent/database/dh_order.php

@@ -16,7 +16,7 @@ $dh_type = array
 	1 => '兑换',
 	2 => '自动发放',
 );
-
+$excel = false;
 $mid = Dever::input('search_option_mid');
 $button = array();
 if ($mid) {
@@ -26,10 +26,7 @@ if ($mid) {
     );
 }else{
     if(Dever::load('manage/auth')->checkFunc('agent.dh_order', 'editQorderout', '数据导出')){
-        $button = array
-        (
-            '数据导出' => array('excel', 'agent/lib/dhorder.out_dhorder'),
-        );
+        $excel[] = array('数据导出', '权益订单','agent/lib/dhorder.out_dhorder');
     }
     
 }
@@ -390,7 +387,7 @@ return array
         'delete' => false,
         'edit' => false,
         'insert' => false,
-
+        'excel' => $excel,
         'button' => $button,
 
         'list_button' => array

+ 10 - 0
service/agent/database/member.php

@@ -632,6 +632,16 @@ return array
             'search'    => $search_auth == 2 ? 'date' : false,
         ),
 
+        'idcard_path'      => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '身份证信息',
+            'default'   => '',
+            'desc'      => '身份证信息',
+            'match'     => 'is_string',
+            'update'    => 'text',
+        ),
+
         'reorder'       => array
         (
             'type'      => 'int-11',

+ 3 - 1
service/agent/database/member_goods.php

@@ -47,8 +47,9 @@ if ($search_api_mid) {
         // $info = Dever::load('agent/lib/member')->getInfoString($mid);
     }
 }
+$excel = false;
 if(Dever::load('manage/auth')->checkFunc('agent.member_goods', 'editMout', '数据导出')){
-    $button['数据导出'] = array('excel', 'agent/lib/dhorder.out_member_goods');
+    $excel[] = array('数据导出','权益管理', 'agent/lib/dhorder.out_member_goods');
 }
 return array
 (
@@ -283,6 +284,7 @@ return array
         'insert' => false,
         'delete' => false,
         'button' => $button,
+        'excel' => $excel,
     ),
 
     'request' => array

+ 393 - 0
service/agent/database/option_account.php

@@ -0,0 +1,393 @@
+<?php
+
+$type = array
+(
+    1 => '零售店',
+    // 2 => '已签署',
+    // 3 => '已作废',
+);
+$status = array
+(
+    1 => '待交付',
+    2 => '已交付',
+    // 3 => '已作废',
+);
+$manage_audit = array
+(
+    1 => '待财务终审',
+    2 => '交付确认',
+    3 => '已完成',
+    4 => '驳回',
+);
+$audit = array
+(
+    1 => '审核通过',
+    2 => '拒绝',
+);
+$col = Dever::input('col');
+
+return array
+(
+    # 表名
+    'name' => 'option_account',
+    # 显示给用户看的名称
+    'lang' => '期权账户管理',
+    'menu' => true,
+    // 'config_type' => $type,
+    'config_status' => $status,
+
+    'end' => array
+    (
+        'update' => 'agent/lib/option_account.updateAccount',
+    ),
+    # 数据结构
+    'struct' => array
+    (
+    
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '受益人姓名/电话',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'search'    => array
+            (
+                'api' => 'agent/option_account-getSearch',
+                'col' => 'col',
+                'result' => 'id',
+                'search' => 'id',
+            ),
+            'update'    => 'hidden',
+            //'list'        => true,
+        ),
+
+        'name'      => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '受益人姓名',
+            'default'   => '',
+            'desc'      => '姓名',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'list_name' => '受益人',
+            'list'      => 'Dever::load("agent/lib/option_account.show#list",{id})',
+        ),
+
+         'mobile'      => array
+        (
+            'type'      => 'bigint-11',
+            'name'      => '受益人电话',
+            'default'   => '',
+            'desc'      => '请输入受益人电话',
+            'match'     => Dever::rule('mobile'),
+            'update'    => 'text',
+            // 'search'    => 'fulltext',
+            // 'list'      => true,
+        ),
+     	
+       'idcard'      => array
+        (
+            'type'      => 'varchar-32',
+            'name'      => '身份证号码',
+            'default'   => '',
+            'desc'      => '身份证号码',
+            'match'     => Dever::rule('idcard'),
+            'search'    => 'fulltext',
+            'update'    => 'text',
+        ),
+
+        'area'       => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '门店地址',
+            'default'   => '',
+            'desc'      => '门店地址',
+            'match'     => 'option',
+            'search'    => 'linkage',
+            'update'    => 'linkage',
+            'option'    => Dever::url('api.get?level_total=4', 'area'),
+        ),
+
+        'address'      => array
+        (
+            'type'      => 'varchar-200',
+            'name'      => '详细地址',
+            'default'   => '',
+            'desc'      => '地址',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            // 'list'      => true,
+        ),
+
+        'title'      => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '期权记录标题',
+            'default'   => '',
+            'desc'      => '期权记录标题',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'list'      => true,
+        ),
+
+        'desc'      => array
+        (
+            'type'      => 'varchar-600',
+            'name'      => '说明',
+            'default'   => '',
+            'desc'      => '记录说明',
+            'match'     => 'option',
+            'update'    => 'textarea',
+            'list'      => true,
+        ),
+        
+        'type'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '记录类型',
+            'default'   => '1',
+            'desc'      => '记录类型',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $type,
+            // 'search'    => 'select',
+            // 'list'      => true,
+        ),
+
+        'price'      => array
+        (
+            'type'      => 'decimal-11,2',
+            'name'      => '设备费用-单位:万元',
+            'default'   => '0',
+            'desc'      => '设备费用',
+            'match'     => 'option',
+            'update'    => 'text',
+            'list_name' => '资金记录明细',
+            'list'      => 'Dever::load("agent/lib/option_account.show#price",{id})',
+        ),
+
+        'zh_price'      => array
+        (
+            'type'      => 'decimal-11,2',
+            'name'      => '装修费用-单位:万元',
+            'default'   => '0',
+            'desc'      => '装修费用',
+            'match'     => 'option',
+            'update'    => 'text',
+            // 'list'      => true,
+        ),
+
+        'zj_price'      => array
+        (
+            'type'      => 'decimal-11,2',
+            'name'      => '租金费用-单位:万元',
+            'default'   => '0',
+            'desc'      => '租金费用',
+            'match'     => 'option',
+            'update'    => 'text',
+            // 'list'      => true,
+        ),
+
+        'other_price'      => array
+        (
+            'type'      => 'decimal-11,2',
+            'name'      => '其他费用-单位:万元',
+            'default'   => '0',
+            'desc'      => '其他费用',
+            'match'     => 'option',
+            'update'    => 'text',
+            // 'list'      => true,
+        ),
+
+        'pic'       => array
+        (
+            'type'      => 'text-255',
+            'name'      => '上传凭证-门店租赁合同,支付凭证等',
+            'default'   => '',
+            'desc'      => '多张图片',
+            'match'     => 'is_string',
+            'update'    => 'images',
+            'key'       => '1',
+            // 'place'     => '759*562',
+        ),
+
+        'annex'       => array
+        (
+            'type'      => 'text-800',
+            'name'      => '上传附件',
+            'default'   => '',
+            'desc'      => '上传附件',
+            'match'     => 'is_string',
+            'update'    => 'upload',
+            'key'       => '1',
+            // 'place'     => '759*562',
+        ),
+
+        'status'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '交付状态',
+            'default'   => '1',
+            'desc'      => '交付状态',
+            'match'     => 'is_numeric',
+            // 'update'    => 'select',
+            'option'    => $status,
+            'search'    => 'select',
+            'list_name' => '交付状态<br/>交付时间',
+            'list'      => 'Dever::load("agent/lib/option_account.show#date",{id})',
+        ),
+
+        'jf_date'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '交付时间',
+            'match'     => 'option',
+            'default'   => '0',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            // 'update'    => 'day',
+            'search'    => 'date',
+            'callback'  => 'maketime',
+            // 'list'        => '{buy_date} > 0 ? date("Y-m-d H:i", {buy_date}) : "无"',
+        ),
+
+        'audit_type'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '审核状态',
+            'default'   => '1',
+            'desc'      => '审核状态',
+            'match'     => 'is_numeric',
+            // 'update'    => 'select',
+            'option'    => $manage_audit,
+            'search'    => 'select',
+            'list_name' => '审核状态<br/>审核时间',
+            'list'      => 'Dever::load("agent/lib/option_account.show#audit",{id})',
+        ),
+
+       	'audit_date'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '审核时间',
+            'match'     => 'option',
+            'default'   => '0',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            // 'update'    => 'day',
+            'search'    => 'date',
+            'callback'  => 'maketime',
+            // 'list'        => '{buy_date} > 0 ? date("Y-m-d H:i", {buy_date}) : "无"',
+        ),
+
+        'audit'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '审核状态',
+            'default'   => '1',
+            'desc'      => '审核状态',
+            'match'     => 'is_numeric',
+            'update'    => $col ? 'radio' : false,
+            'option'    => $audit,
+            'search'    => 'select',
+            'mul'       => true,
+            'control'   => 'audit',
+        ),
+        'remark'      => array
+        (
+            'type'      => 'varchar-600',
+            'name'      => '备注',
+            'default'   => '',
+            'desc'      => '备注',
+            'match'     => 'option',
+            'update'    => 'textarea',
+            // 'list'      => '"{audit_desc}" ? "{audit_desc}" : "-"',
+            // 'list_order'  => 9,
+            'show'      => 'audit=2',
+        ),
+
+        'audit_desc'      => array
+        (
+            'type'      => 'varchar-600',
+            'name'      => '审核说明',
+            'default'   => '',
+            'desc'      => '审核说明',
+            'match'     => 'is_string',
+            'update'    => $col ? 'textarea' : false,
+            // 'list'      => '"{audit_desc}" ? "{audit_desc}" : "-"',
+            // 'list_order'  => 9,
+            'show'      => 'audit=2',
+        ),
+        'num'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '确认期权数',
+            'default'   => '',
+            'desc'      => '姓名',
+            'match'     => 'is_number',
+            'update'    => $col ? 'text' : false, 
+            'show'      => 'audit=1', 
+        ),
+        'audit_admin'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '添加人',
+            'default'   => '',
+            'match'     => 'is_numeric',
+            'desc'      => '操作人',
+            'list'      => '"{audit_admin}" > 0 ? Dever::load("manage/admin-find#username", {audit_admin}) : "-"',
+            'list_order'  => 10,
+        ),
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '添加时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            // 'search'    => 'date',
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+            'list_order'  => 11,
+        ),
+    ),
+
+    'manage' => array
+    (
+    	// 'insert' => $insert,
+    	'delete' => false,
+    	'edit'   => false,
+    	'page_list' => 'option_account',
+        // 'button' => $button,
+    	'list_button' => array
+        (
+        	 'list' => array('查看详情', '"option_account&project=agent&id={id}&page_type=1&[refer]"'),
+        	 // 'list' => array('查看详情', 'Dever::load("agent/lib/option_account.list",{id})'),
+        ),
+    ),
+
+    'request' => array
+    (
+        'getSearch' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'col' => array('yes-mobile,name', 'like'),
+            ),
+            'type' => 'all',
+            'col' => '*|id',
+        ),
+
+    ),
+);

+ 4 - 3
service/agent/database/order.php

@@ -115,7 +115,7 @@ if ($parent_mid) {
 if ($mid) {
    $pmid = $mid; 
 }
-
+$excel = false;
 if ($pmid) {
     $button = array
     (
@@ -124,7 +124,7 @@ if ($pmid) {
 
 }else{
     if(Dever::load('manage/auth')->checkFunc('agent.order', 'editorderout', '数据导出')){
-        $button['数据导出'] = array('excel', 'agent/lib/order.out_order');
+        $excel[] = array('数据导出', '代理商订单','agent/lib/order.out_order');
     } 
 }
 # 权限设置 1是查看详情、2是城市数据统计
@@ -133,7 +133,7 @@ $list_button = array();
 if($search_auth == 1){
     $list_button['list'] = array('查看详情', '"order_process&project=agent&order_id={id}&page_type=1&[refer]"');
     if(Dever::load('manage/auth')->checkFunc('agent.order', 'editSoftorderout', '软件服务费数据导出')){
-        $button['软件服务费数据导出'] = array('excel', 'agent/lib/order.out_softorder');
+        $excel[] = array('软件服务费数据导出','软件服务费数据导出', 'agent/lib/order.out_softorder');
     }
 }
 
@@ -746,6 +746,7 @@ return array
         'insert' => false,
         'delete' => false,
         'edit' => false,
+        'excel' => $excel,
         'button' => $button,
         'list_button' => $list_button,
         // (

+ 3 - 4
service/agent/database/soft_cash.php

@@ -37,11 +37,9 @@ if (Dever::load('manage/auth')->checkFunc('agent.soft_cash', 'editnew', '新增'
 	$insert = true;
 }
 $button = array();
+$excel = false;
 if(Dever::load('manage/auth')->checkFunc('agent.soft_cash', 'editSoftcash', '数据导出')){
-        $button = array
-        (
-            '数据导出' => array('excel', 'agent/lib/soft_cash.out_soft_cash'),
-        );
+        $excel[] = array('数据导出','软件服务费', 'agent/lib/soft_cash.out_soft_cash');
     }
 return array
 (
@@ -315,6 +313,7 @@ return array
     	'insert' => $insert,
     	'delete' => false,
     	'edit'   => false,
+        'excel' => $excel,
         'button' => $button,
     	'list_button' => array
         (

+ 4 - 29
service/agent/lib/Dhorder.php

@@ -1161,19 +1161,8 @@ class Dhorder
     }
     */
    #权益订单导出
-    public function out_dhorder_api(){
-        $start = Dever::input('search_option_start_cdate');
-        $end = Dever::input('search_option_end_cdate');
-        $where = array();
-        $where['state'] = 1;
-        if($start){
-            $where['start']=strtotime($start);
-        }
-        if($end){
-            $where['end']=strtotime($end);
-        }
+    public function out_dhorder_api($data){
         $header = array('订单编号', '会员姓名', '会员等级', '会员手机号', '收货姓名(或自提人)', '联系电话', '收货地址', '商品名称', '商品数量', '商品原价','订单状态','下单时间', '付款时间','完成时间','卖家订单备注','权益发放时间','代理商终审时间');
-        $data = Dever::db('agent/dh_order')->getExcelAll($where);
         $body = array();
         foreach($data as $k => $v){
             $member = Dever::db('agent/member')->find(array('id'=>$v['mid']));
@@ -1221,25 +1210,11 @@ class Dhorder
             );
             $body[] = $d;
         }
-        $file = '权益订单';
+        $file = Dever::input('excel_name');
         Dever::excelExport($body, $header, $file);
     }
     #权益管理导出
-    public function out_member_goods_api(){
-        $status = Dever::input('search_option_status');
-        $type = Dever::input('search_option_type');
-        $name = Dever::input('search_fulltext_name');
-        $where = array();
-        $where['state'] = 1;
-        $where['status'] = $status;
-        if ($type) {
-            $where['type'] = $type;
-        }
-        if ($name) {
-            $where['name'] = $name;
-        }
-        
-        $data = Dever::db('agent/member_goods')->getExcelAll($where);
+    public function out_member_goods_api($data){
         $header = array('权益名称', '会员等级', '姓名', '手机号', '剩余数量', '获取方式', '获取时间');
         $body = array();
         foreach($data as $k => $v){
@@ -1258,7 +1233,7 @@ class Dhorder
             );
             $body[] = $d;
         }
-        $file = '权益管理';
+        $file = Dever::input('excel_name');
         Dever::excelExport($body, $header, $file);
     }
 }

+ 243 - 0
service/agent/lib/Option_account.php

@@ -0,0 +1,243 @@
+<?php
+
+namespace Agent\Lib;
+
+use Dever;
+
+Class Option_account{
+	#列表展示
+	public function show($id){
+		$info = Dever::db('agent/option_account')->find($id);
+		$data =array();
+		$data['list'] = $info['name'].'<br/>'.$info['mobile'].'<br/>'.$info['idcard'];
+		$count = $info['price']+$info['zh_price']+$info['zj_price']+$info['other_price'];
+		$data['price'] = '设备费:'.$info['price'].'<br/>装修费:'.$info['zh_price'].'<br/>租金费:'.$info['zj_price'].'<br/>其他:'.$info['other_price'].'<br/>总计:'.$count;
+		$config = Dever::db('agent/option_account')->config['config_status'];
+		$status = Dever::status($config,$info['status']);
+		if($info['jf_date']){
+			$jf_date = date('Y-m-d H:i',$info['jf_date']);
+		}else{
+			$jf_date = '-';
+		}
+		$data['date'] = $status.'<br/>'.$jf_date;
+		// $audit = Dever::db('agent/option_account')->config['config_audit_type'];
+		// $type = Dever::status($audit,$info['audit_type']);
+		if($info['audit_type'] == 1){
+			$type = '待审核';
+		}elseif($info['audit_type'] == 2 || $info['audit_type'] == 3){
+			$type = '审核通过';
+		}else{
+			$type = '审核不通过';
+		}
+		if($info['audit_date']){
+			$audit_date = date('Y-m-d H:i',$info['audit_date']);
+		}else{
+			$audit_date = '-';
+		}
+		$data['audit'] = $type.'<br/>'.$audit_date;
+		return $data;
+	}
+	#详情页
+	public function list(){
+		$id = Dever::input('id');
+		$info = Dever::db('agent/option_account')->find($id);
+		$type_name = '';
+		if($info['type'] == 1){
+			$type_name = '零售店';
+		}
+		// if($info['other_price']>0){
+		// 	$info['other_price'] = $info['other_price'].'万元;';
+		// }else{
+		// 	$info['other_price'] = $info['other_price'];
+		// }
+		$count = $info['price']+$info['zh_price']+$info['zj_price']+$info['other_price'];
+		$info_price = '设备费:'.$info['price'].'万元;装修费:'.$info['zh_price'].'万元;租金费:'.$info['zj_price'].'万元;其他:'.$info['other_price'].'万元;总计:'.$count.'万元';
+		$area = Dever::load("area/api.string", $info['area']);
+		$image = explode(',',$info['pic']);
+		$pic = '';
+		foreach($image as $k => $v){
+			$pic .= '<a href="'.$v.'" target="_blank"><img src="'.$v.'" width="100" /></a>';
+		}
+		if($info['annex']){
+			$pic .= '<a href="'.$info['annex'].'" target="_blank">点此查看</a>';
+		}
+		// $audit = Dever::db('agent/option_account')->config['config_audit_type'];
+		// $audit_type = Dever::status($audit,$info['audit_type']);
+		if($info['audit_type'] == 1){
+			$audit_type = '待审核';
+		}elseif($info['audit_type'] == 2 || $info['audit_type'] == 3){
+			$audit_type = '审核通过';
+		}else{
+			$audit_type = '审核不通过';
+		}
+        $config = Dever::db('agent/option_account')->config['config_status'];
+		$status = Dever::status($config,$info['status']);
+		$result = array();
+
+        $result['期权记录详情'] = array
+        (
+            'type' => 'info',
+            'content' => array
+            (
+            	array
+            	(
+            		array('期权记录标题', $info['title']),
+	                array('记录说明', $info['desc']),
+	                array('备注', $info['remark']),
+            	),
+                array
+            	(
+            		array('记录类型', $type_name),
+	                array('资金记录明细', $info_price),
+	                array('行权说明', '行权3年期。自门店注册日期开始计算。满一年30%,满两年35%,满三年35%'),
+            	),
+            ),
+        );
+        $result['受益人资料'] = array
+        (
+            'type' => 'info',
+            'content' => array
+            (
+            	array
+            	(
+            		array('受益人姓名', $info['name']),
+	                array('受益人电话', $info['mobile']),
+	                array('受益人身份证号', $info['idcard']),
+            	),
+                array
+            	(
+            		array('门店地址', $area.$info['address']),
+            	),
+            ),
+        );
+        $result['凭证照片/附件'] = array
+        (
+            'type' => 'info',
+            'content' => array
+            (
+            	array
+            	(
+            		array('', $pic),
+            	),
+            ),
+        );
+        if($info['audit_type'] == 1){
+        	$result['审核结果'] = array
+	        (
+	            'type' => 'info',
+	            'content' => array
+	            (
+	            	array
+	            	(
+	            		array('审核状态', $audit_type),
+	            		array('交付状态', $status),
+	            	),
+	            ),
+	        );
+        }else{
+        	$result['审核结果'] = array
+	        (
+	            'type' => 'info',
+	            'content' => array
+	            (
+	            	array
+	            	(
+	            		array('审核状态', $audit_type),
+	            		array('确认期权数', $info['num']),
+	            		array('审核备注', $info['audit_desc']),
+	            	),
+	            	array
+	            	(
+	            		array('交付状态', $status),
+	            	),
+	            ),
+	        );
+        }
+        
+
+        if (Dever::load('manage/auth')->checkFunc('agent.option_account', 'edit', '备注')) {
+            $purl = Dever::url('project/database/update?project=agent&table=option_account&where_id='.$info['id'].'&col=remark', 'manage');
+            $button[] = array
+            (
+                'type' => 'edit',
+                'link' => $purl,
+                'name' => '备注',
+            );
+        }
+        if (Dever::load('manage/auth')->checkFunc('agent.option_account', 'edit1', '修改资料')) {
+            $purl = Dever::url('project/database/update?project=agent&table=option_account&where_id='.$info['id'].'&audit='.$info['audit'].'&col=name,mobile,idcard,area,address,title,remark,type,price,zh_price,zj_price,other_price','manage');
+
+            $button[] = array
+            (
+                'type' => 'edit',
+                'link' => $purl,
+                'name' => '修改资料',
+            );
+        }
+        if (Dever::load('manage/auth')->checkFunc('agent.option_account', 'edit2', '财务终审')) {
+        	if($info['audit_type'] == 1 && $info['audit'] == 1){
+        		$purl = Dever::url('project/database/update?project=agent&table=option_account&where_id='.$info['id'].'&col=id,audit_type,audit,audit_desc,num', 'manage');
+	            $button[] = array
+	                (
+	                    'type' => 'edit',
+	                    'link' => $purl,
+	                    'name' => '财务终审',
+	                );
+        	}
+            
+        }
+        if (Dever::load('manage/auth')->checkFunc('agent.option_account', 'edit3', '交付确认')) {
+        	if($info['audit_type'] == 2){
+        		$purl = Dever::url('project/database/update?project=agent&table=option_account&where_id='.$info['id'].'&audit_type=2&col=id', 'manage');
+	            $button[] = array
+	                (
+	                    'type' => 'action',
+	                    'link' => Dever::url('lib/option_account.setStatus?id=' . $info['id'] . '&value=2', 'agent'),
+	                    'name' => '交付确认',
+	                );
+        	}
+            
+        }
+        $head = array
+        (
+            'name' => '基本资料',
+            'btn' => $button,
+        );
+        $foot = $button;
+        $html = Dever::show($head, $result, $foot);
+
+        return $html;
+	}
+	 public function setStatus_api()
+    {
+        $where['where_id'] = Dever::input('id');
+        $where['set_audit_type'] = 3;
+		$where['set_status'] = 2;
+		$where['set_jf_date'] = time();
+		Dever::db('agent/option_account')->update($where);
+
+        return 'reload';
+    }
+	public function updateAccount($id,$name,$data){
+		$audit = Dever::param('audit',$data);
+		$id = Dever::param('id',$data);
+		// $area = Dever::param('area', $data);
+		$info = Dever::db('agent/option_account')->find($id);
+		if($audit){
+			if ($audit == 1) {
+				$where['where_id'] = $id;
+				$where['set_audit_date'] = time();
+				$where['set_audit_type'] = 2;
+				Dever::db('agent/option_account')->update($where);
+			}
+			
+		}
+		if(!$audit){
+			if($info['audit'] ==2){
+				$update['where_id'] = $id;
+	            $update['audit'] = 1;
+	            Dever::db('agent/option_account')->update($update);
+			}
+		}
+	}
+}

+ 8 - 55
service/agent/lib/Order.php

@@ -104,6 +104,10 @@ class Order
                 Dever::alert('您不满足申请条件,请联系客服');
              }
         }
+        $idcard_path = Dever::input('idcard_path');
+        if($idcard_path){
+            $data['idcard_path'] = $idcard_path;
+        }
         if ($data['source_id'] && $data['source_id'] > 0) {
             $data['invite_type'] = 2;
         } else {
@@ -1480,33 +1484,8 @@ class Order
         return $html;
     }
     #订单导出
-    public function out_order_api(){
-        $status = Dever::input('search_option_status');
-        $start = Dever::input('search_option_start_cdate');
-        $end = Dever::input('search_option_end_cdate');
-        $fstart = Dever::input('search_option_start_fdate');
-        $fend = Dever::input('search_option_end_fdate');
-        $where = array();
-        $where['state'] = 1;
-        if($start){
-            $where['start'] = strtotime($start);
-        }
-        if($end){
-            $where['end'] = strtotime($end);
-        }
-        if($fstart){
-            $where['fstart'] = strtotime($fstart);
-        }
-        if($fend){
-            $where['fend'] = strtotime($fend);
-        }
-        if(!$fstart || !$fend){
-            Dever::alert('请选择时间');
-        }
-        $where['status'] = $status;
+    public function out_order($data){
         $header = array('邀请码', '姓名', '手机号', '身份证号', '会员角色', '代理商区域', '注册金额', '代理费', '直推业绩', '团队业绩', '申请类型','公司名称','申请时间', '初审时间','初审人','终审时间','终审人','审核状态','分润发放时间','分润发放人','权益发放时间','权益发放人','管理员备注','推荐人姓名','推荐人电话','推荐人等级','推荐人代理地区');
-
-        $data = Dever::db('agent/order')->getExcelAll($where);
         
         $body = array();
         foreach($data as $k => $v){
@@ -1644,7 +1623,7 @@ class Order
             );
             $body[] = $d;
         }
-        $file = '代理商订单';
+        $file = Dever::input('excel_name');;
         Dever::excelExport($body, $header, $file);
         
     }
@@ -1658,34 +1637,9 @@ class Order
         return $area;
     }
     #软件服务费导出
-    public function out_softorder_api(){
-        $status = Dever::input('search_option_status');
-        $start = Dever::input('search_option_start_cdate');
-        $end = Dever::input('search_option_end_cdate');
-        $fstart = Dever::input('search_option_start_fdate');
-        $fend = Dever::input('search_option_end_fdate');
-        $where = array();
-        $where['state'] = 1;
-        if($start){
-            $where['start'] = strtotime($start);
-        }
-        if($end){
-            $where['end'] = strtotime($end);
-        }
-        if($fstart){
-            $where['fstart'] = strtotime($fstart);
-        }
-        if($fend){
-            $where['fend'] = strtotime($fend);
-        }
-        if(!$fstart || !$fend){
-            Dever::alert('请选择时间');
-        }
-        $where['status'] = $status;
-
+    public function out_softorder($data){
         $header = array('合同乙方', '手机号码', '合同总期数(年)', '合同类型', '签订日期', '合同金额', '购买日期', '录入日期', '终审日期');
 
-        $data = Dever::db('agent/order')->getExcelAll($where);
         $body = array();
         foreach($data as $k => $v){
             if($v['soft_cash'] && $v['soft_cash']>0){
@@ -1761,9 +1715,8 @@ class Order
 
                $body[] = $d;
             }
-        
         }
-        $file = '代理商软件服务费';
+        $file = Dever::input('excel_name');
         Dever::excelExport($body, $header, $file);
     }
 }

+ 2 - 40
service/agent/lib/Soft_cash.php

@@ -356,40 +356,8 @@ Class Soft_cash
     }
 
     #数据导出
-    public function out_soft_cash_api(){
-        $type = Dever::input('search_option_type');
-        $status = Dever::input('search_option_status');
-        $start = Dever::input('search_option_start_zdate');
-        $end = Dever::input('search_option_end_zdate');
-        $bstart = Dever::input('search_option_start_buy_date');
-        $bend = Dever::input('search_option_end_buy_date');
-        $fstart = Dever::input('search_option_start_fdate');
-        $fend = Dever::input('search_option_end_fdate');
-        $where = array();
-        $where['state'] = 1;
-        if($start){
-            $where['start'] = strtotime($start);
-        }
-        if($end){
-            $where['end'] = strtotime($end);
-        }
-        if($bstart){
-            $where['bstart'] = strtotime($bstart);
-        }
-        if($bend){
-            $where['bend'] = strtotime($bend);
-        }
-        if($fstart){
-            $where['fstart'] = strtotime($fstart);
-        }
-        if($fend){
-            $where['fend'] = strtotime($fend);
-        }
-        $where['status'] = $status;
-        $where['type'] = $type;
+    public function out_soft_cash_api($data){
         $header = array('合同乙方', '手机号码', '合同总期数(年)', '合同类型', '签订日期', '合同金额', '购买日期', '录入日期', '终审日期');
-        $info = Dever::db('agent/soft_cash')->getExcelAll($where);
-        // print_R($info);die;
         $body = array();
         $agreement_name = '';
         foreach($info as $k => $v){
@@ -401,13 +369,7 @@ Class Soft_cash
                 $config_type= Dever::db('setting/agreement')->config['config_type'];
                 $agreement_name = Dever::status($config_type,$name['type']);
             }
-            // print_R($v);
             $type = 2;
-
-            // if (!isset($info['soft_cash'])) {
-            //     $info['soft_cash'] = $v['cash'];
-            // }
-
             # 这里加判断
             if ($role['type'] == 2 && $role['area'] == 1) {
                 $type = 1;   
@@ -478,7 +440,7 @@ Class Soft_cash
             );
             $body[] = $d;
         }
-        $file = '软件服务费';
+        $file = Dever::input('excel_name');
         Dever::excelExport($body, $header, $file);
     }
 

+ 2 - 0
service/agent/src/My.php

@@ -419,6 +419,8 @@ class My extends Core
                 Dever::alert('请上传身份证反面');
             }
 
+            $update['idcard_path'] = Dever::input('idcard_path');
+
             if ($info['type'] == 2) {
                 $update['company_name'] = Dever::input('company_name');
                 $update['company_pic'] = Dever::input('company_pic');

+ 5 - 0
service/agent/template/manage/option_account.php

@@ -0,0 +1,5 @@
+<?php
+
+$view
+->fetch('#show', 'agent/lib/option_account.list')
+->display();

+ 3 - 1
service/bill/database/cash.php

@@ -51,8 +51,9 @@ if ($mid) {
     //     '发放资金' => array('fast', '', 'push_cash&search_option_mid=' . $mid),
     // );
 }
+$excel = false;
 if(Dever::load('manage/auth')->checkFunc('menu_244.menu_245', 'editCout', '数据导出')){
-    $button['数据导出'] = array('excel', 'bill/lib/cash.out_cash');
+    $excel[] = array('数据导出','代理商分润', 'bill/lib/cash.out_cash');
 }
 
 $list_button = array();
@@ -319,6 +320,7 @@ return array
         'insert' => false,
         'delete' => false,
         'edit' => false,
+        'excel' => $excel,
         'button' => $button,
         'mul' => $mul,
         'list_button' => $list_button,

+ 3 - 2
service/bill/database/shop_stat.php

@@ -1,7 +1,8 @@
 <?php
 $button = array();
+$excel = false;
 if (Dever::load('manage/auth')->checkFunc('bill.shop_stat', 'editSout', '导出数据')) {
-    $button['数据导出'] = array('excel','bill/lib/manage.out_shop_stat');
+    $excel[] = array('数据导出','归店数据统计','bill/lib/manage.out_shop_stat');
 }
 $shop = function()
 {
@@ -216,7 +217,7 @@ $config = array
         'insert' => false,
         'edit' => false,
         'delete' => false,
-        // 'excel' => $excel,
+        'excel' => $excel,
         'button' => $button,
         'list_button' => $list_button,
             // (

+ 2 - 2
service/bill/database/tixian.php

@@ -303,9 +303,9 @@ return array
         'edit' => false,
         'mul' => $mul,
         'list_button' => $list_button,
-        'button' => array
+        'excel' => array
         (
-            '数据导出' => array('excel', 'bill/lib/manage.tixian_out'),
+            array('数据导出','提现数据导出', 'bill/lib/manage.tixian_out'),
         ),
     ),
 

+ 2 - 13
service/bill/lib/Cash.php

@@ -260,19 +260,8 @@ class Cash
         return $html;
     }
     #钱包管理数据导出
-    public function out_cash_api(){
-        $start = Dever::input('search_option_start_cdate');
-        $end = Dever::input('search_option_end_cdate');
-        $where = array();
-        $where['state'] = 1;
-        if($start){
-            $where['start']=strtotime($start);
-        }
-        if($end){
-            $where['end']=strtotime($end);
-        }
+    public function out_cash_api($data){
         $header = array('邀请码', '姓名', '手机号', '身份证号', '代理角色', '代理商区域', '代理费', '审核时间', '直推收入', '团队收入', '管理员备注');
-       $data = Dever::db('bill/cash')->getExcelAll($where);
         $body = array();
         foreach($data as $k =>$v){
             $arr[] = Dever::db('agent/member')->find(array('id'=>$v['mid']));
@@ -329,7 +318,7 @@ class Cash
             );
             $body[] = $d;
         }
-        $file = '代理商分润';
+        $file = Dever::input('excel_name');
         Dever::excelExport($body, $header, $file);
     }
 

+ 5 - 31
service/bill/lib/Manage.php

@@ -210,23 +210,8 @@ class Manage
     }
 
     #提现导出
-    public function tixian_out_api(){
-        $status = Dever::input('search_option_status');
-        $start = Dever::input('search_option_start_cdate');
-        $end = Dever::input('search_option_end_cdate');
-        $where = array();
-        $where['state'] = 1;
-        if($start){
-            $where['start']=strtotime($start);
-        }
-        if($end){
-            $where['end']=strtotime($end);
-        }
-        $where['status'] = $status;
-        $header = array('提现单号', '姓名', '手机号', '身份证号', '会员角色', '提现金额', '到账金额', '手续费金额', '申请时间', '审核时间', '审核状态', '发放时间','发放状态','审核人', '来源');
-
-        $data = Dever::db('bill/tixian')->getExcelAll($where);
-        
+    public function tixian_out($data){
+        $header = array('提现单号', '姓名', '手机号', '身份证号', '会员角色', '提现金额', '到账金额', '手续费金额', '申请时间', '审核时间', '审核状态', '发放时间','发放状态','审核人', '来源');    
         $body = array();
         foreach($data as $k => $v){
             $member = Dever::db('agent/member')->find(array('id'=>$v['mid']));
@@ -296,23 +281,12 @@ class Manage
             );
              $body[] = $d;
         }
-        $file = '每日提现';
+        $file = Dever::input('excel_name');
         Dever::excelExport($body, $header, $file);
     }
 
     #归店统计导出
-    public function out_shop_stat_api(){
-        $start = Dever::input('search_option_start_month');
-        $end = Dever::input('search_option_end_month');
-        $where = array();
-        $where['state'] = 1;
-        if($start){
-            $where['start'] = strtotime($start);
-        }
-        if($end){
-            $where['end'] = strtotime($end);
-        }
-        $data = Dever::db('bill/shop_stat')->getExcelAll($where);
+    public function out_shop_stat($data){
         $header = array('月份', '门店名称','门店编号','所属代理商', '采购金额','归店业绩(除创V外)','创客数','创V数','名额外创V','名额外创V业绩');
         $body = array();
         foreach($data as $k => $v){
@@ -343,7 +317,7 @@ class Manage
             );
             $body[] = $d;
         }
-        $file = '归店统计';
+        $file = Dever::input('excel_name');
         Dever::excelExport($body, $header, $file);
     }
     #归店列表显示

+ 124 - 0
service/setting/lib/Idcard.php

@@ -0,0 +1,124 @@
+<?php
+
+namespace Setting\Lib;
+
+use Dever;
+
+class Idcard
+{
+	static $AccessKeyId     = 'LTAI5t5k4M2gK6kctX6iq8CT';
+    static $AccessKeySecret = 'hfFy8smTc9CKEThpqFTG32zJuHd3dS';
+    static $AliHost         = 'http://ocr-api.cn-hangzhou.aliyuncs.com/?';
+
+    //查询域名
+    public function getIdcard_api(){
+        $param = self::getCommonParams();
+        $param['Action']  = 'RecognizeIdcard';
+        $param['OutputFigure'] = 'false';
+        $param['Url'] = Dever::input('url');
+        $name = Dever::input('name');
+        $idcard = Dever::input('idcard');
+        $type = Dever::input('type');#1=正面,2=反面
+        $param['Signature']  = self::getSignature($param); 
+        $url = 'https://ocr-api.cn-hangzhou.aliyuncs.com/?';
+        foreach ($param as $k => $v) {
+            $url .= '&' . $k . '=' . $v;
+        }
+        $data = Dever::load('setting/lib/idcard')->callInterface($url,$name,$idcard,$type);
+        return $data;
+    }
+    // http://guanli.uat.churenyiliao.com/data/upload/8/2022/06/09/71698f0e0b574317363c8a61409585cd_w1.jpg
+    // http%3A%2F%2Fguanli.uat.churenyiliao.com%2Fdata%2Fupload%2F9%2F2022%2F06%2F08%2Ffe5f8b472eb2fd76d144f926c0e2b725.jpg
+     public function callInterface($url,$name,$idcard,$type){
+        $ch = curl_init();
+        curl_setopt($ch, CURLOPT_URL, $url);
+        curl_setopt($ch, CURLOPT_HEADER, 0);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+        $res = curl_exec($ch);
+        curl_close($ch);
+        $res =(array)(json_decode($res));
+        if($res && isset($res['Data']) && $res['Data']){
+            $data = (array)(json_decode($res['Data'],true));
+            $rest = (array)($data['data']);
+            if($type == 1){
+            	if(isset($rest['face']) && $rest['face']){
+            		foreach($rest as $k => $v){
+            			return $v['data'];
+            		}
+            	}else{
+            		Dever::alert('身份证正面有误');
+            	}
+            }elseif($type == 2){
+            	if(isset($rest['back']) && $rest['back']){
+            		foreach($rest as $k =>$v){
+            			return $v['data'];
+            		}
+            	}else{
+            		Dever::alert('身份证背面已过期');
+            	}
+            }
+           //  if(isset($rest['face']) && $rest['face']){
+           //      foreach($rest as $k=>$v){
+           //          if($name != $v['data']['name'] || $idcard != $v['data']['idNumber']){
+           //              Dever::alert('姓名或身份证号不匹配');
+           //          }
+           //     }
+           // }elseif(isset($rest['back']) && $rest['back']){
+           //      foreach($rest as $k => $v){
+           //          $date = explode('-',$v['data']['validPeriod']);
+           //          $cdate = strtotime(str_replace('.','-',$date[1]));
+           //          if(time()>=$cdate){
+           //              Dever::alert('身份证背面已过期');
+           //          }
+           //      }
+           // }
+            // return $rest;
+        }else{
+             Dever::alert('身份证图片有误');
+        } 
+    }
+    private static function getCommonParams(){
+        date_default_timezone_set("GMT");
+        $data = [
+            'Format'           => 'JSON',
+            'Version'          => '2021-07-07',
+            'AccessKeyId'      => self::$AccessKeyId,
+            'SignatureMethod'  => 'HMAC-SHA1',
+            'Timestamp'        => date('Y-m-d') . 'T' . date('H:i:s') . 'Z',//'2021-08-09T08:27:00Z',//,
+            'SignatureVersion' => '1.0',
+            'SignatureNonce'   =>  uniqid(),//microtime(),//
+            'Action'           => 'DescribeRegions',
+        ];
+        
+        return $data;
+    }
+
+    private static function percentEncode($str)
+    {
+        // 使用urlencode编码后,将"+","*","%7E"做替换即满足ECS API规定的编码规范
+        $res = urlencode($str);
+        $res = preg_replace('/\+/', '%20', $res);
+        $res = preg_replace('/\*/', '%2A', $res);
+        $res = preg_replace('/%7E/', '~', $res);
+        return $res;
+    }
+
+    //生成签名
+    private function getSignature($parameters)
+    {
+        // 将参数Key按字典顺序排序
+        ksort($parameters);
+        // 生成规范化请求字符串
+        $canonicalizedQueryString = '';
+        foreach($parameters as $key => $value)
+        {
+            $canonicalizedQueryString .= '&' .self::percentEncode($key)
+                . '=' . self::percentEncode($value);
+        }
+        // 生成用于计算签名的字符串 stringToSign
+        $stringToSign = 'GET&%2F&' . self::percentEncode(substr($canonicalizedQueryString, 1));
+        // 计算签名,注意accessKeySecret后面要加上字符'&'
+        $signature = self::percentEncode(base64_encode(hash_hmac('sha1', $stringToSign, self::$AccessKeySecret . '&', true)));
+        return $signature;
+    }
+}