rabin 3 years ago
parent
commit
7bf70d6b50
4 changed files with 37 additions and 24 deletions
  1. 1 1
      app/shop/database/info.php
  2. 2 1
      app/shop/database/sign.php
  3. 19 18
      app/shop/lib/Sign.php
  4. 15 4
      service/bill/lib/Cron.php

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

@@ -73,7 +73,7 @@ $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}" == ""');
+$add = array('自主签约','"sign&search_option_shop_id={id}&shop_id={id}&oper_table=info&where_id={id}"', '"{mid}" == ""');
 
 return array
 (

+ 2 - 1
app/shop/database/sign.php

@@ -10,7 +10,7 @@ $mer_type = array
     1 => '企业商户',
     //3 => '小微商户',
 );
-$id = Dever::input('search_option_shop_id');
+$id = Dever::input('shop_id');
 $shop = array();
 $desc = '';
 if ($id && $id > 0) {
@@ -463,5 +463,6 @@ return array
     (
         'desc' => $desc,
         'tab' => array('门店信息', '法人信息', '企业信息', '银行信息'),
+        'list' => 'update',
     ),
 );

+ 19 - 18
app/shop/lib/Sign.php

@@ -27,29 +27,30 @@ Class Sign {
 	# 获取日志
 	public function getLog($shop)
 	{
-		Dever::setInput('search_option_shop_id', -1);
+		Dever::setInput('shop_id', -1);
 		$sign = Dever::db('shop/sign')->find(array('shop_id' => $shop['id']));
 		if (!$sign) {
 			return Dever::timeline('填写资料');
 		}
 		$result = array();
-		if ($sign['step'] == -1) {
-			$url = Dever::url('shop/lib/sign.handle?shop_id=' . $sign['shop_id'] . '&json=1');
-			$result = array('<a href="javascript:;" onclick="load(\''.$url.'\')">点此上传资料</a>');
-		} else {
-			$log = Dever::db('shop/sign_log')->select(array('sign_id' => $sign['id']));
-			if ($log) {
-				foreach ($log as $k => $v) {
-					if ($v['step'] == 4) {
-						$v['response'] = Dever::json_decode($v['response']);
-						$v['desc'] .= '  <a href="'.$v['response']['url'].'" target="_blank">点此打开</a>  <a style="cursor:pointer" data-clipboard-text="'.$v['response']['url'].'" class="clipboard">复制链接</a>';
-					}
-					$date = date('Y-m-d H:i', $v['cdate']);
-					$result[] = $date . '&nbsp;&nbsp;' . $v['desc'];
+		
+		$log = Dever::db('shop/sign_log')->select(array('sign_id' => $sign['id']));
+		if ($log) {
+			foreach ($log as $k => $v) {
+				if ($v['step'] == 4) {
+					$v['response'] = Dever::json_decode($v['response']);
+					$v['desc'] .= '  <a href="'.$v['response']['url'].'" target="_blank">点此打开</a>  <a style="cursor:pointer" data-clipboard-text="'.$v['response']['url'].'" class="clipboard">复制链接</a>';
 				}
+				$date = date('Y-m-d H:i', $v['cdate']);
+				$result[] = $date . '&nbsp;&nbsp;' . $v['desc'];
 			}
 		}
 
+		if ($sign['step'] == -1) {
+			$url = Dever::url('shop/lib/sign.handle?shop_id=' . $sign['shop_id'] . '&json=1');
+			$result[] = '<a href="javascript:;" onclick="load(\''.$url.'\')">点此上传资料</a>';
+		}
+
 		$result = Dever::timeline('签约记录', $result);
 		return $result;
 	}
@@ -338,13 +339,13 @@ Class Sign {
 				$result['code'] = 1;
 				$result['msg'] = '请求成功';
 				$result['data'] = $response;
-			} elseif (isset($result['res_msg']) && $result['res_msg']) {
+			} elseif (isset($response['res_msg']) && $response['res_msg']) {
 				$result['code'] = 2;
-				$result['msg'] = $result['res_msg'];
+				$result['msg'] = $response['res_msg'];
 				$result['data'] = $response;
-			} elseif (isset($result['apply_status_msg']) && $result['apply_status_msg']) {
+			} elseif (isset($response['apply_status_msg']) && $response['apply_status_msg']) {
 				$result['code'] = 2;
-				$result['msg'] = $result['apply_status_msg'];
+				$result['msg'] = $response['apply_status_msg'];
 				$result['data'] = $response;
 			}
 		}

+ 15 - 4
service/bill/lib/Cron.php

@@ -538,9 +538,6 @@ class Cron
                                 $insert['v_num'] += 1;
                                 if ($vinfo['prize_type'] == 1) {
                                     $insert['out_num'] += 1;
-                                    $out_member[] = $v1['mid'];
-                                } else {
-                                    $nei_member[] = $v1['mid'];
                                 }
                             } else {
                                 $insert['dl_num'] += 1;
@@ -552,8 +549,22 @@ class Cron
                     }
                     $insert['month_mids'] = implode(',', $insert['month_mids']);
                 }
+
+                foreach ($member as $k1 => $v1) {
+                    $vinfo = Dever::db('agent/member')->find($v1['mid']);
+                    if ($vinfo) {
+                        if ($vinfo['role'] == 8) {
+                            if ($vinfo['prize_type'] == 1) {
+                                $out_member[] = $v1['mid'];
+                            } else {
+                                $nei_member[] = $v1['mid'];
+                            }
+                        
+                    }
+                }
+
                 $insert['c_money'] = Dever::db('shop/buy_order')->getCashNum(array('type'=>1,'type_id'=>$v['id']));
-               $insert['c_money'] = $insert['c_money']['total'];
+                $insert['c_money'] = $insert['c_money']['total'];
 
                 $where = array
                 (