dever 3 年之前
父节点
当前提交
704781459a

+ 1 - 1
app/factory/admin/Order.php

@@ -36,7 +36,7 @@ class Order extends Core
         		} else {
         		} else {
         			$ps_date = '-';
         			$ps_date = '-';
         		}
         		}
-        		$view = Dever::url('order_view?type=2&order_id=' . $v['id'], 'factory');
+        		$view = Dever::url('order_view?type=2&order_id=' . $v['id'] . '&cash=2', 'factory');
 
 
         		$send = Dever::url('order_send?id=' . $v['id'], 'factory');
         		$send = Dever::url('order_send?id=' . $v['id'], 'factory');
 
 

+ 1 - 1
app/factory/admin/User.php

@@ -91,7 +91,7 @@ class User extends Core
     # 获取基本信息
     # 获取基本信息
     public function getConfig()
     public function getConfig()
     {
     {
-        $data['update'] = Dever::url('admin/update', 'factory');
+        $data['update'] = Dever::url('admin/user.update', 'factory');
         $data['add'] = Dever::url('user_edit', 'factory');
         $data['add'] = Dever::url('user_edit', 'factory');
         $data['add'] = 'fastEdit($(this), \''.$data['add'].'\', \'添加新员工\', \'\', 1)';
         $data['add'] = 'fastEdit($(this), \''.$data['add'].'\', \'添加新员工\', \'\', 1)';
         $data['search'] = Dever::url('user', 'factory');
         $data['search'] = Dever::url('user', 'factory');

+ 1 - 1
app/factory/database/member.php

@@ -93,7 +93,7 @@ return array
             'name'      => '员工手机号',
             'name'      => '员工手机号',
             'default'   => '',
             'default'   => '',
             'desc'      => '请输入员工手机号',
             'desc'      => '请输入员工手机号',
-            'match'     => 'is_numeric',
+            'match'     => Dever::rule('mobile'),
             'update'    => 'text',
             'update'    => 'text',
             'search'    => 'fulltext',
             'search'    => 'fulltext',
             'list'      => true,
             'list'      => true,

+ 11 - 6
app/mshop/lib/Buy.php

@@ -541,6 +541,8 @@ class Buy
 
 
         $type = Dever::input('type', 1);
         $type = Dever::input('type', 1);
 
 
+        $cash_type = Dever::input('cash_type', 1);
+
         $config = Dever::db('shop/buy_order')->config;
         $config = Dever::db('shop/buy_order')->config;
 
 
         $info = Dever::db('shop/buy_order')->one($id);
         $info = Dever::db('shop/buy_order')->one($id);
@@ -881,14 +883,17 @@ class Buy
             $html .= '<div class="layui-card"><div class="layui-card-header">缺货与报损商品</div><div class="layui-card-body" style="max-heights: 300px;overflow: auto;">' . $this->table($head, $refund_body) . '</div></div>';
             $html .= '<div class="layui-card"><div class="layui-card-header">缺货与报损商品</div><div class="layui-card-body" style="max-heights: 300px;overflow: auto;">' . $this->table($head, $refund_body) . '</div></div>';
         }
         }
 
 
-        if ($type == 1) {
-            # 门店结算单
-            $cash_order = Dever::db('cash/order')->select(array('type' => $info['type'], 'type_id' => $info['type_id'], 'source_order_id' => $info['id']));
+        if ($cash_type == 1) {
+            if ($type == 1) {
+                # 门店结算单
+                $cash_order = Dever::db('cash/order')->select(array('type' => $info['type'], 'type_id' => $info['type_id'], 'source_order_id' => $info['id']));
 
 
-        } elseif ($type == 2) {
-            # 工厂结算单
-            $cash_order = Dever::db('cash/order')->select(array('source_type' => $info['source_type'], 'source_id' => $info['source_id'], 'source_order_id' => $info['id']));
+            } elseif ($type == 2) {
+                # 工厂结算单
+                $cash_order = Dever::db('cash/order')->select(array('source_type' => $info['source_type'], 'source_id' => $info['source_id'], 'source_order_id' => $info['id']));
+            }
         }
         }
+        
 
 
         if (isset($cash_order) && $cash_order) {
         if (isset($cash_order) && $cash_order) {
             $head = array('序号', '结算单号', '数量', '金额', '结算类型', '入账状态', '审核状态', '结算时间', '审核未通过原因', '管理');
             $head = array('序号', '结算单号', '数量', '金额', '结算类型', '入账状态', '审核状态', '结算时间', '审核未通过原因', '管理');

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

@@ -257,7 +257,7 @@ return array
             //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} == 2'),
             //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} == 2'),
             //'delete' => array('删除', '', '{status} == 1'),
             //'delete' => array('删除', '', '{status} == 1'),
 
 
-            'list' => array('查看详情', '"buy_order_goods&project=shop&order_id={id}&page_type=1"'),
+            'list' => array('查看详情', '"buy_order_goods&project=shop&order_id={id}&page_type=1&type='.$search_option_type.'"'),
 
 
             'oper'  => array('审核', '"mshop/lib/manage.audit?order_id={id}"', '{status} == 2'),
             'oper'  => array('审核', '"mshop/lib/manage.audit?order_id={id}"', '{status} == 2'),
 
 

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

@@ -151,7 +151,7 @@ return array
             'name'      => '联系人电话',
             'name'      => '联系人电话',
             'default'   => '',
             'default'   => '',
             'desc'      => '请输入联系人电话',
             'desc'      => '请输入联系人电话',
-            'match'     => 'is_numeric',
+            'match'     => Dever::rule('mobile'),
             'update'    => 'text',
             'update'    => 'text',
             'search'    => 'fulltext',
             'search'    => 'fulltext',
             'list'      => true,
             'list'      => true,

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

@@ -93,7 +93,7 @@ return array
             'name'      => '员工手机号',
             'name'      => '员工手机号',
             'default'   => '',
             'default'   => '',
             'desc'      => '请输入员工手机号',
             'desc'      => '请输入员工手机号',
-            'match'     => 'is_numeric',
+            'match'     => Dever::rule('mobile'),
             'update'    => 'text',
             'update'    => 'text',
             'search'    => 'fulltext',
             'search'    => 'fulltext',
             'list'      => true,
             'list'      => true,

+ 20 - 9
app/shop/lib/Info.php

@@ -15,12 +15,16 @@ class Info
     }
     }
 
 
     # 获取店铺基本信息
     # 获取店铺基本信息
-    public function get($city, $lng, $lat, $name = '', $method = 'fetch', $shop_id = false)
+    public function get($city, $lng, $lat, $name = '', $method = 'fetch', $shop_id = false, $address = false)
     {
     {
         if (!$city) {
         if (!$city) {
             Dever::alert('请传入城市');
             Dever::alert('请传入城市');
         }
         }
 
 
+        if ((!$lng || !$lat) && $address) {
+            list($lng, $lat) = Dever::load('shop/lib/info')->geo($city, $address);
+        }
+
         if (!$lng || !$lat) {
         if (!$lng || !$lat) {
             $city_info = Dever::db('area/city')->find($city);
             $city_info = Dever::db('area/city')->find($city);
             list($lng, $lat) = Dever::load('shop/lib/info')->geo($city, $city_info['name']);
             list($lng, $lat) = Dever::load('shop/lib/info')->geo($city, $city_info['name']);
@@ -157,7 +161,7 @@ class Info
     }
     }
 
 
     # 获取距离
     # 获取距离
-    private function fetch($id, $city, $lng, $lat, $type = 1, $name = '', $method = 'fetch')
+    public function fetch($id, $city, $lng, $lat, $type = 1, $name = '', $method = 'fetch')
     {
     {
         $page = array();
         $page = array();
         if ($method == 'fetchAll') {
         if ($method == 'fetchAll') {
@@ -167,15 +171,22 @@ class Info
             $page = false;
             $page = false;
         }
         }
 
 
-        $where = 'type = '.$type.' and status = 1 and state = 1';
+        $where = 'status = 1 and state = 1';
 
 
-        $county = Dever::db('area/county')->find($city);
-        if ($county) {
-            $city = $county['city_id'];
+        if ($type) {
+            $where .= ' and type = ' . $type;
         }
         }
-        if ($type == 1 && $city) {
-            $where .= ' and city = ' . $city;
+
+        if ($city) {
+            $county = Dever::db('area/county')->find($city);
+            if ($county) {
+                $city = $county['city_id'];
+            }
+            if ($type == 1 && $city) {
+                $where .= ' and city = ' . $city;
+            }
         }
         }
+        
         if ($name) {
         if ($name) {
             $where .= ' and name like("%'.$name.'%")';
             $where .= ' and name like("%'.$name.'%")';
         }
         }
@@ -183,7 +194,7 @@ class Info
             $where .= ' and id = ' . $id;
             $where .= ' and id = ' . $id;
         }
         }
         if ($lng && $lat) {
         if ($lng && $lat) {
-            $sql = 'select id,name,`desc`,truename,mobile,lng,lat,address,open,worktime,method,gotime,pdesc,round((st_distance(point(lng, lat), point('.$lng.', '.$lat.'))*111195)/1000, 2) as distance from {table} where '.$where.' order by distance asc';
+            $sql = 'select id,name,`desc`,truename,mobile,lng,lat,address,open,worktime,method,gotime,city,area,province,county,town,coupon_city,pdesc,license,food_license,jy_license,license_number,company_name,round((st_distance(point(lng, lat), point('.$lng.', '.$lat.'))*111195)/1000, 2) as distance from {table} where '.$where.' order by distance asc';
 
 
             $data = Dever::db('shop/info')->$method($sql, array(), $page);
             $data = Dever::db('shop/info')->$method($sql, array(), $page);
         } else {
         } else {

+ 7 - 8
app/shop/src/Buy.php

@@ -17,17 +17,16 @@ class Buy extends Core
 			Dever::alert('请选择门店');
 			Dever::alert('请选择门店');
 		}
 		}
 
 
-		$this->shop = Dever::db('shop/info')->getOne($this->shop_id);
-
-		if (!$this->shop) {
-			Dever::alert('门店不存在');
-		}
-
-		# 得到公里数
 		$lng = Dever::input('lng');
 		$lng = Dever::input('lng');
 		$lat = Dever::input('lat');
 		$lat = Dever::input('lat');
 		if ($lng && $lat) {
 		if ($lng && $lat) {
-			$this->shop['distance'] = Dever::distance($lng, $lat, $this->shop['lng'], $this->shop['lat']);
+			$this->shop = Dever::load('shop/lib/info')->fetch($this->shop_id, false, $lng, $lat, false);
+		} else {
+			$this->shop = Dever::db('shop/info')->getOne($this->shop_id);
+		}
+
+		if (!$this->shop) {
+			Dever::alert('门店不存在');
 		}
 		}
 	}
 	}
 
 

+ 1 - 0
app/shop/src/Main.php

@@ -74,6 +74,7 @@ class Main extends Core
         $lat = Dever::input('lat');
         $lat = Dever::input('lat');
         $name = Dever::input('name');
         $name = Dever::input('name');
         $shop_id = Dever::input('shop_id');
         $shop_id = Dever::input('shop_id');
+        $address = Dever::input('address');
 
 
         # 获取门店
         # 获取门店
         $this->data['shop'] = array();
         $this->data['shop'] = array();

+ 1 - 1
app/store/admin/User.php

@@ -91,7 +91,7 @@ class User extends Core
     # 获取基本信息
     # 获取基本信息
     public function getConfig()
     public function getConfig()
     {
     {
-        $data['update'] = Dever::url('admin/update', 'store');
+        $data['update'] = Dever::url('admin.update', 'store');
         $data['add'] = Dever::url('user_edit', 'store');
         $data['add'] = Dever::url('user_edit', 'store');
         $data['add'] = 'fastEdit($(this), \''.$data['add'].'\', \'添加新员工\', \'\', 1)';
         $data['add'] = 'fastEdit($(this), \''.$data['add'].'\', \'添加新员工\', \'\', 1)';
         $data['search'] = Dever::url('user', 'store');
         $data['search'] = Dever::url('user', 'store');

+ 1 - 1
app/store/database/member.php

@@ -93,7 +93,7 @@ return array
             'name'      => '员工手机号',
             'name'      => '员工手机号',
             'default'   => '',
             'default'   => '',
             'desc'      => '请输入员工手机号',
             'desc'      => '请输入员工手机号',
-            'match'     => 'is_numeric',
+            'match'     => Dever::rule('mobile'),
             'update'    => 'text',
             'update'    => 'text',
             'search'    => 'fulltext',
             'search'    => 'fulltext',
             'list'      => true,
             'list'      => true,