소스 검색

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

rabin 3 년 전
부모
커밋
2f372ae208
3개의 변경된 파일104개의 추가작업 그리고 100개의 파일을 삭제
  1. 80 76
      package/manage/plugin/Console.php
  2. 2 2
      service/agent/database/option_account.php
  3. 22 22
      service/agent/lib/Option_account.php

+ 80 - 76
package/manage/plugin/Console.php

@@ -8,81 +8,85 @@ class Console
 {
     public function data()
     {
-        $where['start'] = Dever::maketime(date('Y-m-d 00:00:00'));
-        $where['end'] = Dever::maketime(date('Y-m-d 23:59:59'));
-
-        $where['status'] = '1,2,3,4,5,6';
-        $today_sell_cash = Dever::db('shop/sell_order')->getCashNum($where);
-        $today_sell_order = Dever::db('shop/sell_order')->getOrderNum($where);
-
-        $where['status'] = '1,2,3,4,5,6';
-        $today_buy_cash = Dever::db('shop/buy_order')->getCashNum($where);
-        $today_buy_order = Dever::db('shop/buy_order')->getOrderNum($where);
-
-        $today_user = Dever::db('passport/user')->total($where);
-        $user = Dever::db('passport/user')->total();
-        $shop = Dever::db('shop/info')->total();
-        $factory = Dever::db('factory/info')->total();
-        $store = Dever::db('store/info')->total();
-
-        $total = 0;
-        $data[] = array
-        (
-            'name' => '当日销售额',
-            'num' => $today_sell_cash['total'] ? round($today_sell_cash['total'], 2) : 0,
-            'href' => '#',
-        );
-
-        $data[] = array
-        (
-            'name' => '销售订单量',
-            'num' => $today_sell_order,
-            'href' => '#',
-        );
-
-        $data[] = array
-        (
-            'name' => '采购额',
-            'num' => $today_buy_cash['total'] ? round($today_buy_cash['total'], 2) : 0,
-            'href' => '#',
-        );
-
-        $data[] = array
-        (
-            'name' => '采购订单量',
-            'num' => $today_buy_order,
-            'href' => '#',
-        );
-
-        $data[] = array
-        (
-            'name' => '当日用户新增',
-            'num' => $today_user,
-            'href' => '#',
-        );
-
-        $data[] = array
-        (
-            'name' => '用户总量',
-            'num' => $user,
-            'href' => '#',
-        );
-
-        $data[] = array
-        (
-            'name' => '门店数',
-            'num' => $shop,
-            'href' => '#',
-        );
-
-        $data[] = array
-        (
-            'name' => '仓库数/工厂数',
-            'num' => $store . ' / ' . $factory,
-            'href' => '#',
-        );
-
-
-        return $data;
+        if (Dever::load('manage/auth')->checkFunc('console.index', 'edit', '控制台数据概览')) {
+            $where['start'] = Dever::maketime(date('Y-m-d 00:00:00'));
+            $where['end'] = Dever::maketime(date('Y-m-d 23:59:59'));
+
+            $where['status'] = '1,2,3,4,5,6';
+            $today_sell_cash = Dever::db('shop/sell_order')->getCashNum($where);
+            $today_sell_order = Dever::db('shop/sell_order')->getOrderNum($where);
+
+            $where['status'] = '1,2,3,4,5,6';
+            $today_buy_cash = Dever::db('shop/buy_order')->getCashNum($where);
+            $today_buy_order = Dever::db('shop/buy_order')->getOrderNum($where);
+
+            $today_user = Dever::db('passport/user')->total($where);
+            $user = Dever::db('passport/user')->total();
+            $shop = Dever::db('shop/info')->total();
+            $factory = Dever::db('factory/info')->total();
+            $store = Dever::db('store/info')->total();
+
+            $total = 0;
+            $data[] = array
+            (
+                'name' => '当日销售额',
+                'num' => $today_sell_cash['total'] ? round($today_sell_cash['total'], 2) : 0,
+                'href' => '#',
+            );
+
+            $data[] = array
+            (
+                'name' => '销售订单量',
+                'num' => $today_sell_order,
+                'href' => '#',
+            );
+
+            $data[] = array
+            (
+                'name' => '采购额',
+                'num' => $today_buy_cash['total'] ? round($today_buy_cash['total'], 2) : 0,
+                'href' => '#',
+            );
+
+            $data[] = array
+            (
+                'name' => '采购订单量',
+                'num' => $today_buy_order,
+                'href' => '#',
+            );
+
+            $data[] = array
+            (
+                'name' => '当日用户新增',
+                'num' => $today_user,
+                'href' => '#',
+            );
+
+            $data[] = array
+            (
+                'name' => '用户总量',
+                'num' => $user,
+                'href' => '#',
+            );
+
+            $data[] = array
+            (
+                'name' => '门店数',
+                'num' => $shop,
+                'href' => '#',
+            );
+
+            $data[] = array
+            (
+                'name' => '仓库数/工厂数',
+                'num' => $store . ' / ' . $factory,
+                'href' => '#',
+            );
+
+
+            return $data;
+        } else {
+            return array();
+        }
     }
 }

+ 2 - 2
service/agent/database/option_account.php

@@ -249,8 +249,8 @@ return array
             'name'      => '实际补贴期权价值-单位:元',
             'default'   => '0',
             'desc'      => '实际补贴期权价值',
-            'match'     => 'option',
-            // 'update'    => 'text',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
             // 'list'      => true,
         ),
 

+ 22 - 22
service/agent/lib/Option_account.php

@@ -258,28 +258,28 @@ Class Option_account{
 		$audit = Dever::param('audit',$data);
 		$num = Dever::param('num',$data);
 		$info = Dever::db('agent/option_account')->find($id);
-		if (!$info) {
-			if ($price <= $zh_price){
-				$zj_price = $price;
-			} elseif ($price > $zh_price) {
-				$zj_price = $price - $zh_price;
-			}
-			$w['where_id'] = $id;
-			$w['zj_price'] = $zj_price;
-			// print_R($w);die;
-			Dever::db('agent/option_account')->update($w);
-		}
-		if (!$info['zj_price'] || $info['zj_price'] <=0) {
-			if ($info['price'] <= $info['zh_price']) {
-				$zj_price = $info['price'];
-			} elseif ($info['price'] > $info['zh_price']) {
-				$zj_price = $info['price'] - $info['zh_price'];
-			}
-			$w['where_id'] = $info['id'];
-			$w['zj_price'] = $zj_price;
-			// print_R($w);die;
-			Dever::db('agent/option_account')->update($w);
-		}
+		// if (!$info) {
+		// 	if ($price <= $zh_price){
+		// 		$zj_price = $price;
+		// 	} elseif ($price > $zh_price) {
+		// 		$zj_price = $price - $zh_price;
+		// 	}
+		// 	$w['where_id'] = $id;
+		// 	$w['zj_price'] = $zj_price;
+		// 	// print_R($w);die;
+		// 	Dever::db('agent/option_account')->update($w);
+		// }
+		// if (!$info['zj_price'] || $info['zj_price'] <=0) {
+		// 	if ($info['price'] <= $info['zh_price']) {
+		// 		$zj_price = $info['price'];
+		// 	} elseif ($info['price'] > $info['zh_price']) {
+		// 		$zj_price = $info['price'] - $info['zh_price'];
+		// 	}
+		// 	$w['where_id'] = $info['id'];
+		// 	$w['zj_price'] = $zj_price;
+		// 	// print_R($w);die;
+		// 	Dever::db('agent/option_account')->update($w);
+		// }
 		if($audit){
 			if ($audit == 1) {
 				$where['where_id'] = $id;