瀏覽代碼

Merge branch 'master' of ssh://git.dever.cc:10022/dever-product/churen

rabin 3 年之前
父節點
當前提交
c706757c0b
共有 3 個文件被更改,包括 13 次插入4 次删除
  1. 4 0
      learn/active/lib/Cron.php
  2. 7 3
      learn/active/lib/Manage.php
  3. 2 1
      learn/active/src/Home.php

+ 4 - 0
learn/active/lib/Cron.php

@@ -13,6 +13,10 @@ Class Cron{
     			if ($v['cdate'] && $time-$v['cdate']>900) {
     				Dever::db('active/order')->update(array('where_id'=>$v['id'],'set_status'=>3));
     			}
+                $active = Dever::db('active/info')->find($v['active_id']);
+                if ($time > $active['act_end']) {
+                    Dever::db('active/order')->update(array('where_id'=>$v['id'],'set_status'=>4));
+                }
     		}
     	}
     	return 'ok';

+ 7 - 3
learn/active/lib/Manage.php

@@ -431,14 +431,18 @@ Class Manage
         $data = Dever::db('active/order')->find($order_id);
         $ids = $this->common($data,3,'',$code_id);
         if ($ids) {
+            $admin = Dever::load('manage/auth.info');
             $w['where_id'] = $code_id;
             $w['status'] = 3;
+            $w['offdate'] = time();
+            $w['audit_admin'] = $admin['id'];
             Dever::db('active/code')->update($w);
         }
         return 'reload';
     }
 
     public function common($data,$type,$num=false,$refund_id=false){
+        Dever::config('base')->hook = true;
         $active = Dever::db('active/info')->find($data['active_id']);
         $info = Dever::db('active/info_refund')->state(array('order_id'=>$data['id']));
         if (time() > $active['act_start']) {
@@ -497,10 +501,10 @@ Class Manage
                 }
                 $where['refund_num'] = $refund_num + $data['refund_num'];
 
-                if ($type == 1 || ($type == 2 && $price = $data['price'])) {
+                if ($type == 1 || ($price == $data['price'])) {
                     Dever::db('active/order')->update($where);
-                } elseif (($type == 2 && $price != $data['price']) || $type == 3) {
-                    $where['status'] = 5;
+                } else {
+                    $where['status'] = 2;
                     $ids = Dever::db('active/order')->update($where);
                 }
                 if ($type == 2) {

+ 2 - 1
learn/active/src/Home.php

@@ -275,10 +275,11 @@ Class Home extends Core
 			if ($data['status'] == 2) {
 				Dever::alert('当前核销码已核销');
 			}
+			$admin = Dever::load('manage/auth.info');
 			$where['where_id'] = $code_id;
 			$where['status'] = 2;
 			$where['time'] = time();
-			$where['top_admin'] = $this->uid;
+			$where['audit_admin'] = $admin['id'];
 			$ids = Dever::db('active/code')->update($where);
 			if ($ids) {
 				$data['msg'] = '核销成功';