Your Name 3 년 전
부모
커밋
46b55505b1
3개의 변경된 파일48개의 추가작업 그리고 14개의 파일을 삭제
  1. 10 4
      service/agent/database/soft_cash.php
  2. 34 5
      service/agent/lib/Soft_cash.php
  3. 4 5
      service/bill/lib/Cron.php

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

@@ -6,6 +6,7 @@ $status = array
     2 => array('name' => '待财务终审', 'style' => 'font-weight:bold;color:#436EEE'),
     3 => array('name' => '已完成', 'style' => 'font-weight:bold;color:green'),
     4 => array('name' => '驳回', 'style' => 'font-weight:bold;color:#CD3700'),
+    5 => array('name' => '订单取消', 'style' => 'font-weight:bold;color:#CD3700'),
 );
 
 $manage_audit = array
@@ -41,6 +42,9 @@ $excel = false;
 if(Dever::load('manage/auth')->checkFunc('agent.soft_cash', 'editSoftcash', '数据导出')){
         $excel[] = array('数据导出','软件服务费', 'agent/lib/soft_cash.out_soft_cash');
     }
+    $list_button = array();
+    $list_button['list'] = array('查看详情', '"member_prize&project=agent&id={id}&page_type=1&[refer]"');
+$list_button['oper'] = array('删除订单', '"agent/lib/soft_cash.setOrderStatus?id={id}&value=4"', '{status} == 4');
 return array
 (
     # 表名
@@ -315,10 +319,12 @@ return array
     	'edit'   => false,
         'excel' => $excel,
         'button' => $button,
-    	'list_button' => array
-        (
-        	 'list' => array('查看详情', '"member_prize&project=agent&id={id}&page_type=1&[refer]"'),
-        ),
+    	'list_button' => $list_button,
+        // array
+        // (
+        // 	 'list' => array('查看详情', '"member_prize&project=agent&id={id}&page_type=1&[refer]"'),
+        //      'list1'=> $list['oper'],
+        // ),
     ),
 
     'request' => array

+ 34 - 5
service/agent/lib/Soft_cash.php

@@ -54,11 +54,10 @@ Class Soft_cash
             }
             
            	if($soft){
-               
-                if($audit == 3){
+                if($audit == 3 ){
                     $update['set_status'] = 4;
 
-                }elseif($audit == 2){
+                } elseif($audit == 2){
                     $update['set_status'] = 3;
                     $update['set_zdate'] = time();
                     $order['role'] = $info['role'];
@@ -88,6 +87,7 @@ Class Soft_cash
                 }
             }
             $ids=Dever::db('agent/soft_cash')->update($update);
+            // echo Dever::sql();die;
         }
     }
 
@@ -251,9 +251,20 @@ Class Soft_cash
         $purl = Dever::url('project/database/update?project=agent&table=soft_cash&where_id='.$info['id'].'&audit=3&col=id,audit,audit_desc', 'manage');
         if (Dever::load('manage/auth')->checkFunc('agent.soft_cash', 'edit2', '驳回')) {
 	        if($info['status'] == 4){
-	        	
+               
 	        }
 	    }
+         if (Dever::load('manage/auth')->checkFunc('agent.soft_cash', 'close', '取消订单')) {
+            if ($info['status'] == 4) {
+                # 未完成审核的订单,可以随时挂起
+                $button[] = array
+                (
+                    'type' => 'action',
+                    'link' => Dever::url('lib/soft_cash.setOrderStatus?id=' . $info['id'] . '&value=4', 'agent'),
+                    'name' => '取消订单',
+                );
+            }
+        }
         $button[] = array
         (
             'type' => 'link',
@@ -262,6 +273,23 @@ Class Soft_cash
         );
         return $button;
     }
+    public function setOrderStatus_api()
+    {
+        $where['where_id'] = Dever::input('id');
+        $order = Dever::db('agent/soft_cash')->find($where['where_id']);
+        if ($order) {
+            $where['status'] = Dever::input('value');
+            if ($where['status'] == 4) {
+                $where['status'] = 5;
+                $where['state'] = 2;
+            }
+            // print_R($where);die;
+            Dever::db('agent/soft_cash')->update($where);
+        }
+        
+
+        return 'reload';
+    }
     private function show_agreement($info, $role, $sign_pic, &$result)
     {
         $table = array();
@@ -361,7 +389,7 @@ Class Soft_cash
 
     #数据导出
     public function out_soft_cash_api($data){
-        $header = array('合同乙方', '手机号码', '合同总期数(年)', '合同类型', '签订日期', '合同金额', '购买日期', '录入日期', '终审日期');
+        $header = array('合同乙方', '手机号码', '身份证号码','合同总期数(年)', '合同类型', '签订日期', '合同金额', '购买日期', '录入日期', '终审日期');
         $body = array();
         $agreement_name = '';
         foreach($data as $k => $v){
@@ -434,6 +462,7 @@ Class Soft_cash
             (
                 $member['name'],
                 $v['mobile'],
+                $member['idcard'],
                 $year,
                 $name,
                 $fdate,

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

@@ -282,10 +282,10 @@ class Cron
         
         for($i=0; $i<=$day; $i++) {
             $where = array();
-            $where['fstart'] = $start + 86400*$i;
-            $where['fend'] = $start + 86400*$i + 86399;
+            $where['start'] = $start + 86400*$i;
+            $where['end'] = $start + 86400*$i + 86399;
             $data = array();
-            $data['day'] = $where['fstart'];
+            $data['day'] = $where['start'];
             $info = Dever::db('bill/cash_in_stat')->find($data);
 
             $where['status'] = 4;
@@ -305,8 +305,7 @@ class Cron
                 $data['goods_cash'] = $cash['total'];
             }
             unset($where['status']);
-            $where['start'] = $where['fstart'];
-            $where['end'] = $where['fend'];
+
             $where['type'] = 1;
 
             $data['zt_cash'] = 0;