Your Name 3 年之前
父节点
当前提交
eb474c3d2d
共有 4 个文件被更改,包括 792 次插入1 次删除
  1. 4 1
      app/shop/database/info.php
  2. 420 0
      app/shop/database/sign.php
  3. 111 0
      app/shop/database/sign_pic.php
  4. 257 0
      app/shop/lib/Sign.php

+ 4 - 1
app/shop/database/info.php

@@ -72,6 +72,8 @@ $method = array
 );
 
 $stat_type = Dever::db('cash/shop')->config['config_type'];
+$add = array();
+$add = array('自主签约','"sign&search_option_shop_id={id}&oper_table=info&where_id={id}&oper_save_table=info"', '"{mid}" == ""');
 
 return array
 (
@@ -692,7 +694,8 @@ return array
         'list_button' => array
         (
             'delete' => '删除',
-
+            'br3' => array('<br /><br />'),
+            'add' => $add,
             'br11' => array('<br /><br />'),
 
             'location1' => array('分配工厂', Dever::url('lib/set.factory', 'shop')),

+ 420 - 0
app/shop/database/sign.php

@@ -0,0 +1,420 @@
+<?php
+$acct_type = array
+(
+    -1 => '个人账户',
+    1 => '公司账户',
+);
+$mer_type = array
+(
+    1 => '企业商户',
+    2 => '个人工商户',
+    3 => '小微商户',
+);
+$id = Dever::input('search_option_shop_id');
+$shop = array();
+if ($id) {
+	$shop = Dever::db('shop/info')->one($id);
+}
+
+return array
+(
+    # 表名
+    'name' => 'sign',
+    # 显示给用户看的名称
+    'lang' => '自主签约',
+    # 后台菜单排序
+    'order' => 99,
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            //'list'      => true,
+            'order'     => 'desc',
+        ),
+
+        'shop_id'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '店铺id',
+            'default'   => '0',
+            'desc'      => '请选择用户',
+            'match'     => 'is_numeric',
+            'update'    => 'hidden',
+            // 'search'  => 'select',
+            'value'     => $shop ? $shop['id'] : false,
+            //'list'      => '{uid} > 0 ? Dever::load("passport/user-find#username", {uid}) : "匿名用户"',
+        ),
+
+        // 'request_seq'      => array
+        // (
+        //     'type'      => 'varchar-100',
+        //     'name'      => '请求流水号',
+        //     'default'   => '',
+        //     'desc'      => '请求流水号',
+        //     'match'     => 'is_string',
+        //     // 'update'    => 'text',
+        //     'search'    => 'fulltext',
+        //     // 'list'      => true,
+        // ),
+
+        'name'      => array
+        (
+            'type'      => 'varchar-32',
+            'name'      => '法人姓名',
+            'default'   => '',
+            'desc'      => '请输入法人姓名',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'mobile'      => array
+        (
+            'type'      => 'bigint-11',
+            'name'      => '法人电话',
+            'default'   => '',
+            'desc'      => '请输入法人电话',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'idcard'      => array
+        (
+            'type'      => 'varchar-32',
+            'name'      => '身份证号码',
+            'default'   => '',
+            'desc'      => '身份证号码',
+            'match'     => Dever::rule('idcard'),
+            'update'    => 'text',
+        ),
+
+        'reg_mer_type'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '注册类型',
+            'default'   => '2',
+            'desc'      => '注册类型',
+            'match'     => 'option',
+            'update'    => 'select',
+            'option'    => $mer_type,
+        ),
+
+        'card_deadline'      => array
+        (
+            'type'      => 'varchar-32',
+            'name'      => '法人证件截止日期',
+            'default'   => '',
+            'desc'      => '法人证件截止日期',
+            'match'     => 'option',
+            'default'   => '0',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'update'    => 'day',
+            'search'    => 'date',
+            'callback'  => 'maketime',
+        ),
+
+        'back_no'      => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '开户行行号',
+            'default'   => '',
+            'desc'      => '开户行行号',
+            'match'     => 'option',
+            // 'update'    => 'text',
+        ),
+
+        'shop_addr_ext'      => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '开户行地址',
+            'default'   => '',
+            'desc'      => '开户行地址',
+            'match'     => 'option',
+            // 'update'    => 'text',
+        ),
+
+        'ums_reg_id'      => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '自助签约平台唯一标识',
+            'default'   => '',
+            'desc'      => '自助签约平台唯一标识',
+            'match'     => 'option',
+            // 'update'    => 'text',
+        ),
+
+        'bank_acct_type'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '账户类型',
+            'default'   => '-1',
+            'desc'      => '账户类型',
+            'match'     => 'option',
+            'update'    => 'select',
+            'option'    => $acct_type,
+        ),
+
+        'bank_acct_no'      => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '开户行账号',
+            'default'   => '',
+            'desc'      => '开户行账号',
+            'match'     => 'option',
+            'update'    => 'text',
+        ),
+
+        'bank_acct_name'      => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '开户账号名称',
+            'default'   => '',
+            'desc'      => '开户账号名称',
+            'match'     => 'option',
+            'update'    => 'text',
+        ),
+
+        'area'       => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '开户所在地',
+            'default'   => '',
+            'desc'      => '开户所在地',
+            'match'     => 'option',
+            'search'    => 'linkage',
+            'update'    => 'linkage',
+            'value'     => $shop ? $shop['area'] : false,
+            'option'    => Dever::url('api.get?level_total=2', 'area'),
+            //'list'      => 'Dever::load("area/api.string", "{area}")',
+        ),
+
+        'bank_acct_noname'      => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '开户行名称-银行名称和支行名称用/隔开,如:招商/天通苑',
+            'default'   => '',
+            'desc'      => '开户行名称',
+            'match'     => 'option',
+            'update'    => 'text',
+        ),
+
+        'legalmanHomeAddr'      => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '法人地址',
+            'default'   => '',
+            'desc'      => '法人地址',
+            'match'     => 'option',
+            'update'    => 'text',
+        ),
+
+        // 'province'      => array
+        // (
+        //     'type'      => 'int-11',
+        //     'name'      => '省份',
+        //     'default'   => '',
+        //     'desc'      => '省份',
+        //     'match'     => 'option',
+        //     //'update'  => 'text',
+        // ),
+
+        // 'city'      => array
+        // (
+        //     'type'      => 'int-11',
+        //     'name'      => '城市',
+        //     'default'   => '',
+        //     'desc'      => '城市',
+        //     'match'     => 'option',
+        //     //'update'  => 'text',
+        // ),
+
+        // 'county'      => array
+        // (
+        //     'type'      => 'int-11',
+        //     'name'      => '县区',
+        //     'default'   => '',
+        //     'desc'      => '县区',
+        //     'match'     => 'option',
+        //     //'update'  => 'text',
+        // ),
+
+        'license'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '营业执照',
+            'default'   => '',
+            'desc'      => '营业执照',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '8',
+            'value'     => $shop ? $shop['license'] : false,
+            'place'     => '660*660',
+        ),
+
+        'license_number'      => array
+        (
+            'type'      => 'varchar-200',
+            'name'      => '营业执照号码',
+            'default'   => '',
+            'desc'      => '营业执照号码',
+            'match'     => 'option',
+            'value'     => $shop ? $shop['license_number'] : false,
+            'update'    => 'text',
+        ),
+
+        'tax'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '税务登记证',
+            'default'   => '',
+            'desc'      => '税务登记证',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '8',
+            'place'     => '660*660',
+        ),
+
+        'door'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '门头照片',
+            'default'   => '',
+            'desc'      => '门头照片',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '8',
+            'place'     => '660*660',
+        ),
+
+        'open'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '开户许可证',
+            'default'   => '',
+            'desc'      => '开户许可证',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '8',
+            'place'     => '660*660',
+        ),
+
+        'hand_idcard'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '手持身份证自拍照',
+            'default'   => '',
+            'desc'      => '手持身份证自拍照',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '8',
+            'place'     => '660*660',
+        ),
+
+        'house_pic'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '室内照片',
+            'default'   => '',
+            'desc'      => '室内照片',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '8',
+            'place'     => '660*660',
+        ),
+
+        'bank_fount'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '银行卡正面照',
+            'default'   => '',
+            'desc'      => '银行卡正面照',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '8',
+            'place'     => '660*660',
+        ),
+
+        'bank_back'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '银行卡反面照',
+            'default'   => '',
+            'desc'      => '银行卡反面照',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '8',
+            'place'     => '660*660',
+        ),
+
+        'mccCode'      => array
+        (
+            'type'      => 'varchar-200',
+            'name'      => '行业类别编码',
+            'default'   => '5499',
+            'desc'      => '行业类别编码',
+            'match'     => 'option',
+            // 'update'    => 'text',
+        ),
+
+        'idcard_front'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '身份证正面',
+            'default'   => '',
+            'desc'      => '身份证正面',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '8',
+            'place'     => '660*660',
+            'value'     => $shop ? $shop['idcard_front'] : false,
+        ),
+
+        'idcard_back'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '身份证背面',
+            'default'   => '',
+            'desc'      => '身份证背面',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '8',
+            'place'     => '660*660',
+            'value'     => $shop ? $shop['idcard_back'] : false,
+        ),
+
+        '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,
+            //'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+	'manage' => array
+    (
+        //'list' => 'update',
+    ),
+);

+ 111 - 0
app/shop/database/sign_pic.php

@@ -0,0 +1,111 @@
+<?php
+$acct_type = array
+(
+    -1 => '个人账户',
+    1 => '公司账户',
+);
+$mer_type = array
+(
+    1 => '企业商户',
+    2 => '个人工商户',
+    3 => '小微商户',
+);
+return array
+(
+    # 表名
+    'name' => 'sign_pic',
+    # 显示给用户看的名称
+    'lang' => '自主签约图片',
+    # 后台菜单排序
+    'order' => 99,
+    'menu' => false,
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            //'list'      => true,
+            'order'     => 'desc',
+        ),
+
+        'shop_id'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '店铺id',
+            'default'   => '0',
+            'desc'      => '请选择用户',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            // 'search'  => 'select',
+            'value'     => Dever::input('search_option_shop_id'),
+            //'list'      => '{uid} > 0 ? Dever::load("passport/user-find#username", {uid}) : "匿名用户"',
+        ),
+
+
+        'document_name'      => array
+        (
+            'type'      => 'varchar-32',
+            'name'      => '图片名称',
+            'default'   => '',
+            'desc'      => '请输入姓名',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'document_type'      => array
+        (
+            'type'      => 'varchar-32',
+            'name'      => '图片类型',
+            'default'   => '',
+            'desc'      => '请输入姓名',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'path'      => array
+        (
+            'type'      => 'text-300',
+            'name'      => '图片内容',
+            'default'   => '',
+            'desc'      => '请输入姓名',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'text',
+            'list'      => true,
+        ),
+
+        '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,
+            //'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+	'manage' => array
+    (
+        // 'list' => 'update',
+    ),
+);

+ 257 - 0
app/shop/lib/Sign.php

@@ -0,0 +1,257 @@
+<?php
+namespace Shop\Lib;
+use Dever;
+header("Content-Type:text/html;charset=utf-8");
+Class Sign {
+	static $key = "udik876ehjde32dU61edsxsf";
+	static $accesser_id = 'zsma';
+	static $sign_type = 'SHA-256';
+    //加密
+	public function encrypt_api($data='', $key='', $use3des = true)
+    {
+    	$key = self::$key;
+    	$res = bin2hex(openssl_encrypt($data, 'DES-EDE3', $key, OPENSSL_RAW_DATA));
+		return $res;
+    }
+
+    public function decrypt_api($data='', $key='', $use3des = true)
+    {
+    	$key = self::$key;
+    	$data = '36df3aff8ecac519ca56f5d1141948211d85248a2886d95207f7af1e71c637a810bd349bfa9d009e6cf19a6a4fac559faf155026f397ea02c52b466c41ae5fb0a9a1af13ba2951f2';
+    	return openssl_decrypt(pack('H*',$data), 'DES-EDE3', $key, OPENSSL_RAW_DATA);
+    }
+
+    public function common($service,$data,$request_seq=false){
+    	$accesser_id = self::$accesser_id;
+    	$sign_type = self::$sign_type;
+    	$param = $data;
+    	$param['service'] = $service;
+    	$param['sign_type'] = $sign_type;
+    	$param['accesser_id'] = $accesser_id;
+    	$param['request_date'] = date('YmdHis');
+    	if($request_seq){
+    		$param['request_seq'] = $request_seq;
+    	}else{
+    		$param['request_seq'] = date('YmdHis');#mt_rand (10,100);#
+    	}
+    	$sign_data = json_encode($param, JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);;
+    	$send['json_data'] = $this->encrypt_api($sign_data);
+    	$send['sign_data'] = hash('sha256', $sign_data);
+    	
+    	$send['accesser_id'] = $accesser_id;
+    	$url = 'https://selfapply-test.chinaums.com/self-contract-nmrs/interface/autoReg/';
+    	if ($service == 'agreement_sign') {
+    		$url . '?' . http_build_query($send);
+    		$result = Dever::curl($url, $send, 'get');
+    	} else {
+    		$result = Dever::curl($url, $send, 'post');
+    	}
+    	return $result;
+    }
+    #查询支行
+    public function bank_list($areaCode,$key){
+    	$service = 'branch_bank_list';
+    	$data['areaCode'] = $areaCode;
+    	$data['key'] = $key;
+    	$url = $this->common($service,$data);
+    	return $url;
+    }
+    #生成图片3.1
+    public function pic($pic){
+    	$service = 'pic_upload';
+    	if($pic){
+    		$pic_base64 = file_get_contents($pic);
+    		$two = explode('?',$pic);
+    		if($two){
+    			$one = pathinfo($two[0]);
+    		}else{
+    			$one = pathinfo($pic);
+    		}
+	    	
+	    	if($pic_base64){
+		    	$data['pic_base64'] = "data:image/".$one['extension'].";base64,".base64_encode($pic_base64);
+		    	$url = $this->common($service,$data);
+		    	return $url;
+	    	}
+    	}
+    }
+    // public function shop_api(){
+    // 	$data = Dever::db('shop/info')->state();
+    // }
+    #3.2  详细采集档案资料上传接口
+    public function complex_api($shop_id){
+    	$shop_id = 59;
+    	$shop = Dever::db('shop/info')->find($shop_id);
+    	$sign = Dever::db('shop/sign')->find(array('shop_id'=>$shop_id));
+    	$service = 'complex_upload';
+    	$data['accesser_user_id'] = $shop_id;#店铺id
+    	if ($sign['reg_mer_type'] == 1) {
+    		$sign['reg_mer_type'] = '00';
+    	} elseif ($sign['reg_mer_type'] ==2) {
+    		$sign['reg_mer_type'] = '01';
+    	} elseif ($sign['reg_mer_type'] ==3) {
+    		$sign['reg_mer_type'] = '02';
+    	}
+    	$data['reg_mer_type'] = $sign['reg_mer_type'];#注册类型
+    	$data['legal_name'] = $sign['name'];#法人姓名
+    	$data['legal_idcard_no'] = $sign['idcard'];#法人身份证号
+    	$data['legal_mobile'] = $sign['mobile'];#法人手机号
+    	$data['legal_card_deadline'] = date('Y-m-d',$sign['card_deadline']);#证件截止代表日期
+    	$data['shop_name'] = $shop['name'];#店铺名称
+    	if($sign['bank_acct_type'] == -1){
+    		$sign['bank_acct_type'] = '0';
+    	}
+    	$data['bank_acct_type'] = $sign['bank_acct_type'];#账户类型
+
+    	$data['bank_acct_no'] = $sign['bank_acct_no'];#开户行账号
+    	$data['bank_acct_name'] = $sign['bank_acct_name'];#开户账号名称
+    	$data['mccCode'] = '5499';
+    	$area = explode(',',$shop['area']);
+    	$data['shop_province_id'] = $area[0]/10000;
+    	$data['shop_city_id'] = $area[1]/100;
+    	$data['shop_country_id'] = $area[2];
+    	$sign_area = explode(',',$shop['area']);
+    	$data['shop_lic'] = $shop['license_number'];#营业执照号
+    	if(isset($sign['bank_no']) && $sign['bank_no']){
+    		$data['bank_no'] = $sign['bank_no'];
+    		$data['shop_addr_ext'] = $sign['shop_addr_ext'];
+    	}else{
+    		$bank = (array)json_decode($this->bank_list($sign_area[0]/10000,$sign['bank_acct_noname']));
+	    	if($bank && isset($bank['branchBankList']) && $bank['branchBankList']){
+	    		foreach($bank['branchBankList'] as $k =>$v){
+		    		$bank['branchBankList'] = (array)$v;
+		    	}
+		    	$in['where_id'] = $sign['id'];
+		    	$in['bank_no'] = $bank['branchBankList']['code'];
+		    	$in['shop_addr_ext'] =  $bank['branchBankList']['bankBranchName'];
+		    	Dever::db('shop/sign')->update($in);
+		    	$data['bank_no'] = $bank['branchBankList']['code'];
+		    	$data['shop_addr_ext'] = $bank['branchBankList']['bankBranchName'];
+	    	} else {
+	    		Dever::alert('开户行行号不存在');
+	    	}
+    	}
+    	
+    	if ($sign['reg_mer_type'] == '00') {
+    		if ($sign['bank_acct_type'] != '1') {
+    			Dever::alert('账户类型不正确');
+    		}
+
+    	} elseif ($sign['reg_mer_type'] == '01') {
+    		if ($sign['bank_acct_type'] != '0') {
+    			Dever::alert('账户类型不正确');
+    		}
+    	}
+    	if ($sign['legalmanHomeAddr']) { 
+    			$data['legalmanHomeAddr'] = $sign['legalmanHomeAddr'];
+    		} 
+    	
+    	$sign_pic = Dever::db('shop/sign_pic')->find(array('shop_id'=>$shop_id));
+    	if (!$sign_pic) {
+    		$document_type = array(
+
+	            ['document_type'=>'0001','document_name'=>'身份证正面',$this->pic($sign['idcard_front'])],
+
+	            ['document_type'=>'0011','document_name'=>'身份证反面',$this->pic($sign['idcard_back'])],
+
+	            ['document_type'=>'0002','document_name'=>'营业执照',$this->pic($shop['license'])],
+
+	            ['document_type'=>'0003','document_name'=>'税务登记证',$this->pic($sign['tax'])],
+
+	            ['document_type'=>'0005','document_name'=>'门头照',$this->pic($sign['door'])],
+
+	            ['document_type'=>'0007','document_name'=>'手持身份证自拍照',$this->pic($sign['hand_idcard'])],
+
+	            ['document_type'=>'0006','document_name'=>'开户许可证',$this->pic($sign['open'])],
+
+	            ['document_type'=>'0025','document_name'=>'银行卡正面照',$this->pic($sign['bank_fount'])],
+
+	            ['document_type'=>'0026','document_name'=>'银行卡反面照',$this->pic($sign['bank_fount'])],
+
+	            ['document_type'=>'0015','document_name'=>'室内照片',$this->pic($sign['house_pic'])],
+	        );
+	        foreach($document_type as $k => $v){
+        		$insert['shop_id'] = $shop_id;
+        		$insert['document_type'] = $v['document_type'];
+        		$insert['document_name'] = $v['document_name'];
+        		$insert['path'] = $v[0];
+        		if($v[0]){
+        			Dever::db('shop/sign_pic')->insert($insert);
+        		}
+        	}
+    	}
+    	
+        $data['pic_list'] = array();
+        $sign_pic = Dever::db('shop/sign_pic')->state(array('shop_id'=>$shop_id));
+        foreach($sign_pic as $k => $v){
+        	if($v['path']){
+        		$path = (array)json_decode($v['path']);
+        		$data['pic_list'][$k] = array('document_name'=>$v['document_name'],'document_type'=>$v['document_type'],'file_path'=>$path['file_path'],'file_size'=>$path['file_size']);
+        	}
+        }
+        $data['pic_list'] = array_values($data['pic_list']);
+    	// $ids = array('0','1','in1','in2','in3','in4');
+    	$ids = array('0');
+    	$data['product'] = array();
+    	foreach($ids as $k=>$v){
+    		$data['product'][$k] = ['product_id'=>$v]; 
+    	}
+    	// print_R($data);
+    	$url = $this->common($service,$data);
+    	if($url){
+    		$res = (array)json_decode($url);
+    		if($res && isset($res['ums_reg_id']) && $res['ums_reg_id']){
+    			$where['where_id'] = $sign['id'];
+    			$where['ums_reg_id'] = $res['ums_reg_id'];
+    			Dever::db('shop/sign')->update($where);
+    		}
+    	}
+    	// print_R($url);die;
+    	return 'ok';
+    }
+    #3.3  前台签约接口
+    public function agreement_sign_api($shop){
+    	$sign = Dever::db('shop/sign')->find(array('shop_id'=>$shop_id));
+    	$service = 'agreement_sign';
+    	$data['ums_reg_id'] = $sign['ums_reg_id'];
+    	$data['pcOrH5'] = 'H5';
+    	$url = $this->common($service,$data);
+    	return $url;
+    }
+
+    #3.4  入网状态查询接口
+    public function apply_api($shop_id){
+    	$sign = Dever::db('shop/sign')->find(array('shop_id'=>$shop_id));
+    	$service = 'apply_qry';
+    	$data['ums_reg_id'] = $sign['ums_reg_id'];
+    	$url = $this->common($service,$data,$sign['ums_reg_id']);
+    	return $url;
+    }
+    #3.6  对公账户认证接口
+    public function company_account_verify_api(){
+    	$shop_id = Dever::input('shop_id');
+    	$trans_amt = Dever::input('trans_amt');
+    	$sign = Dever::db('shop/sign')->find(array('shop_id'=>$shop_id));
+    	if ($sign['bank_acct_type'] == 1) {
+    		$service = 'company_account_verify';
+	    	$data['ums_reg_id'] = $sign['ums_reg_id'];
+	    	$data['company_account'] = $sign['bank_acct_no'];
+	    	$data['trans_amt'] = $trans_amt;
+	    	$url = $this->common($service,$data,$sign['ums_reg_id']);
+	    	return $url;
+    	}
+    	
+    }
+    #3.7  发起对公账户验证交易接口
+    public function request_account_verify_api($shop_id){
+    	$sign = Dever::db('shop/sign')->find(array('shop_id'=>$shop_id));
+    	$service = 'request_account_verify';
+    	if ($sign['bank_acct_type'] == 1) {
+	    	$data['ums_reg_id'] = $sign['ums_reg_id'];
+	    	$data['company_account'] = $sign['bank_acct_no'];
+	    	$url = $this->common($service,$data,$sign['request_seq']);
+	    	return $url;
+	    }
+    } 
+   
+}