rabin 1 giorno fa
parent
commit
09c2ec146d
92 ha cambiato i file con 389 aggiunte e 369 eliminazioni
  1. 1 1
      src/cate/app/Api/Info.php
  2. 4 3
      src/place/act/app/Lib/Core.php
  3. 1 1
      src/place/benefit/app/Lib/Item.php
  4. 1 1
      src/place/benefit/app/Lib/Item/Perk.php
  5. 1 1
      src/place/benefit/app/Lib/Item/Rebate.php
  6. 1 1
      src/place/benefit/app/Lib/Item/Sales.php
  7. 1 1
      src/place/benefit/app/Lib/Scope.php
  8. 1 1
      src/place/benefit/app/Lib/User.php
  9. 1 1
      src/place/benefit/manage/Api/Main.php
  10. 1 1
      src/place/benefit/manage/Lib/Sales.php
  11. 2 2
      src/place/benefit/manage/Lib/Scope.php
  12. 1 1
      src/place/benefit/manage/rebate.php
  13. 5 5
      src/place/benefit/manage/role.php
  14. 2 2
      src/place/benefit/manage/sales.php
  15. 1 1
      src/place/benefit/table/rebate_rule.php
  16. 1 1
      src/place/benefit/table/role_action.php
  17. 1 1
      src/place/benefit/table/role_period.php
  18. 1 1
      src/place/benefit/table/role_upgrade.php
  19. 1 1
      src/place/boot.php
  20. 2 2
      src/place/channel/sales/app/Lib/Info.php
  21. 5 5
      src/place/channel/sales/manage/Lib/Info.php
  22. 1 1
      src/place/channel/sales/table/offline.php
  23. 2 2
      src/place/channel/sales/table/profit.php
  24. 9 10
      src/place/interface/app/Api/Address.php
  25. 5 5
      src/place/interface/app/Api/Benefit.php
  26. 7 7
      src/place/interface/app/Api/Bind.php
  27. 1 1
      src/place/interface/app/Api/Collect.php
  28. 5 5
      src/place/interface/app/Api/Coupon.php
  29. 1 1
      src/place/interface/app/Api/Gift.php
  30. 21 19
      src/place/interface/app/Api/Main.php
  31. 5 5
      src/place/interface/app/Api/Order.php
  32. 3 3
      src/place/interface/app/Api/Perk.php
  33. 2 3
      src/place/interface/app/Api/Review.php
  34. 2 2
      src/place/interface/app/Api/Role.php
  35. 7 7
      src/place/interface/app/Api/Sales.php
  36. 7 7
      src/place/interface/app/Api/Score.php
  37. 22 22
      src/place/interface/app/Api/Source.php
  38. 32 32
      src/place/interface/app/Api/User.php
  39. 8 8
      src/place/interface/app/Lib/Core.php
  40. 1 1
      src/place/order/app/Lib/Log.php
  41. 22 23
      src/place/order/app/Lib/Pay.php
  42. 2 2
      src/place/order/app/Lib/Role/Pay.php
  43. 2 2
      src/place/order/app/Lib/Source/Cart.php
  44. 5 7
      src/place/order/app/Lib/Source/Order.php
  45. 3 3
      src/place/order/app/Lib/Source/Pay.php
  46. 2 2
      src/place/order/app/Lib/Source/Refund.php
  47. 2 2
      src/place/order/manage/Lib/Source/Pdf.php
  48. 3 3
      src/place/order/manage/Lib/Source/Refund.php
  49. 13 10
      src/place/order/manage/Lib/Source/View.php
  50. 2 2
      src/place/order/manage/pdf.php
  51. 3 3
      src/place/order/manage/role.php
  52. 4 4
      src/place/order/manage/source.php
  53. 4 4
      src/place/order/manage/source_refund_audit.php
  54. 4 4
      src/place/order/manage/source_refund_audit_delivery.php
  55. 2 2
      src/place/role/app/Lib/Info.php
  56. 4 4
      src/place/role/app/Lib/Price.php
  57. 8 13
      src/place/role/app/Lib/User.php
  58. 0 6
      src/place/role/manage/level.php
  59. 1 1
      src/place/role/table/level.php
  60. 6 6
      src/place/score/app/Lib/Log.php
  61. 1 0
      src/place/set/app/Api/Tool.php
  62. 7 6
      src/place/set/app/Lib/Info.php
  63. 1 1
      src/place/set/manage/Lib/Profit.php
  64. 1 1
      src/place/set/manage/account.php
  65. 1 0
      src/place/set/table/account_sms.php
  66. 10 0
      src/place/source/app/Api/Test.php
  67. 6 6
      src/place/source/app/Lib/Cart.php
  68. 15 13
      src/place/source/app/Lib/Info.php
  69. 7 7
      src/place/source/app/Lib/Price.php
  70. 4 4
      src/place/source/manage/Api/Main.php
  71. 1 1
      src/place/source/manage/Lib/Cate.php
  72. 2 2
      src/place/source/manage/Lib/Excel.php
  73. 3 3
      src/place/source/manage/Lib/Info.php
  74. 2 2
      src/place/source/manage/cate.php
  75. 4 4
      src/place/source/manage/content.php
  76. 4 4
      src/place/source/manage/help.php
  77. 11 11
      src/place/source/manage/info.php
  78. 1 1
      src/place/source/manage/sku.php
  79. 1 1
      src/place/source/table/ad.php
  80. 11 2
      src/place/stock/app/Lib/Info.php
  81. 1 1
      src/place/stock/manage/Lib/Info.php
  82. 6 6
      src/place/stock/manage/platform_stock.php
  83. 1 1
      src/place/stock/manage/platform_stock_log.php
  84. 3 2
      src/place/user/app/Lib/Address.php
  85. 1 1
      src/place/user/app/Lib/Coupon.php
  86. 1 1
      src/place/user/app/Lib/Gift.php
  87. 1 1
      src/place/user/app/Lib/Perk.php
  88. 3 3
      src/place/user/manage/Api/User.php
  89. 1 1
      src/place/user/manage/Lib/User.php
  90. 2 2
      src/place/user/manage/user.php
  91. 1 1
      src/place/user/table/search.php
  92. 7 2
      src/sector/app/Lib/Delivery.php

+ 1 - 1
src/cate/app/Api/Info.php

@@ -54,7 +54,7 @@ class Info
         if ($icon) {
             $data['icon_id'] = $icon['id'];
         }
-        $db = Dever::db('level_' . $level);
+        $db = Dever::db('cate/level_' . $level);
         $info = $db->find($data);
         if (!$info) {
             return $db->insert($data);

+ 4 - 3
src/place/act/app/Lib/Core.php

@@ -12,17 +12,18 @@ class Core
     {
         $key = $name . $uid;
         if (empty(static::$instance[$key])) {
-            static::$instance[$key] = new self($key, $uid, $type, $type_id);
+            static::$instance[$key] = new self();
+            static::$instance[$key]->init($name, $uid, $type, $type_id);
         }
         return static::$instance[$key];
     }
 
-    public function __construct($name, $uid, $type = false, $type_id = false)
+    public function init($name = '', $uid = 0, $type = false, $type_id = false)
     {
         $this->uid = $uid;
         $this->type = Dever::input('type', '', '', $type);
         $this->type_id = Dever::input('type_id', '', '', $type_id);
-        $this->db = Dever::db($name, 'Pact');
+        $this->db = Dever::db('pact/' . $name);
     }
 
     protected function check()

+ 1 - 1
src/place/benefit/app/Lib/Item.php

@@ -5,7 +5,7 @@ class Item
     # 载入某个权益
     public function load($name)
     {
-        return Dever::load('\\Pbenefit\Lib\\Item\\' . ucfirst($name))
+        return Dever::load('Pbenefit\Lib\\Item\\' . ucfirst($name));
     }
 
     # 直接获取权益数据

+ 1 - 1
src/place/benefit/app/Lib/Item/Perk.php

@@ -105,7 +105,7 @@ class Perk
         $up['uid'] = $uid;
         $result = [];
         for ($i = 1; $i <= $num; $i++) {
-            $up['code'] = Dever::load('code', 'Pbenefit')->create($perk['code_type'], $perk['code_prefix'], $perk['code_length']);
+            $up['code'] = Dever::load(\Pbenefit\Lib\Code::class)->create($perk['code_type'], $perk['code_prefix'], $perk['code_length']);
             Dever::db('pbenefit/perk_code')->insert($up);
             $result[] = $up['code'];
         }

+ 1 - 1
src/place/benefit/app/Lib/Item/Rebate.php

@@ -67,7 +67,7 @@ class Rebate
     # 获取描述信息
     public function getDesc($info)
     {
-        $uid = Dever::load(Place::class)->uid;
+        $uid = Dever::get(Place::class)->uid;
         $info['desc'] = '';
         $info = Dever::load(\Pbenefit\Lib\Scope::class)->getInfo($info, 'rebate');
         $rule = Dever::db('pbenefit/rebate_rule')->select(['rebate_id' => $info['id']], ['col' => 'id,value,`condition`,level,score_id']);

+ 1 - 1
src/place/benefit/app/Lib/Item/Sales.php

@@ -32,7 +32,7 @@ class Sales
     # 验证权益是否在范围内有效
     public function check($scope, $buy_scope, $buy_ids)
     {
-        if ($scope) {
+        if ($scope && $buy_scope) {
             return Dever::load(\Pbenefit\Lib\Scope::class)->valid($scope, $buy_scope, $buy_ids);
         } else {
             return true;

+ 1 - 1
src/place/benefit/app/Lib/Scope.php

@@ -86,7 +86,7 @@ class Scope
                 $source = Dever::db('psource/info')->columns(['id' => ['in', $ids]], 'name');
                 $result = implode('、', $source);
             } else {
-                $result = Dever::load(Psource\Lib\Channel::class)->getName($scope);
+                $result = Dever::load(\Psource\Lib\Channel::class)->getName($scope);
                 if (!$result) {
                     $result = '全部资源';
                 }

+ 1 - 1
src/place/benefit/app/Lib/User.php

@@ -167,7 +167,7 @@ class User
             foreach ($log as $k => $v) {
                 $v['cdate'] = date('Y-m-d H:i', $v['cdate']);
                 if ($v['content']) {
-                    $v['num'] = '<a data-content="'.$v['content'].'">' . $v['content'] . '</a>';
+                    $v['num'] = '<a href="'.$v['content'].'" data-content="'.$v['content'].'">' . $v['content'] . '</a>';
                 } else {
                     $v['num'] = Dever::load(\Pbenefit\Lib\Item::class)->getNumDesc($v['type'], $v['type_id'], $v['num']);
                 }

+ 1 - 1
src/place/benefit/manage/Api/Main.php

@@ -14,7 +14,7 @@ class Main
     # 获取权益所需要的范围数据:具体项目选择
     public function getScope($value, $key = 'ids')
     {
-        if (is_array($value)) {
+        if (is_array($value) && $value) {
             $result = [];
             $result[$key]['value'] = [];
             if ($value[0] == 1) {

+ 1 - 1
src/place/benefit/manage/Lib/Sales.php

@@ -5,7 +5,7 @@ class Sales
     # 获取升级奖励信息
     public function getRebate($id, $type = '')
     {
-        $info = Dever::db('sales_rebate' . $type, 'Pbenefit')->select(['sales_id' => $id]);
+        $info = Dever::db('pbenefit/sales_rebate' . $type)->select(['sales_id' => $id]);
         if (!$info) {
             return '无';
         }

+ 2 - 2
src/place/benefit/manage/Lib/Scope.php

@@ -16,7 +16,7 @@ class Scope
     # 获取权益所需要的范围数据
     public function getData($extend = false)
     {
-        $channel = Dever::load(Psource\Manage\Lib\Cate::class)->getList(true);
+        $channel = Dever::load(\Psource\Manage\Lib\Cate::class)->getList(true);
         $role = Dever::db('prole/info')->select(['status' => 1]);
         $data = [
             ['id' => 1, 'name' => '资源', 'children' => $channel],
@@ -49,7 +49,7 @@ class Scope
                 $value = array_shift($v['value']);
                 if ($value == 1) {
                     $content = '范围内全部资源';
-                    $name = Dever::load(Psource\Lib\Channel::class)->getName($v['value']);
+                    $name = Dever::load(\Psource\Lib\Channel::class)->getName($v['value']);
                     if ($name) {
                         $v['name'] = '['.$name.']';
                     } else {

+ 1 - 1
src/place/benefit/manage/rebate.php

@@ -7,7 +7,7 @@ return [
             ],
             'rule' => [
                 'name' => '返利规则',
-                'show' => 'Dever::call("Pbenefit/manage/rebate.getRule", {id})',
+                'show' => 'Dever::call("Pbenefit/Manage/Lib/Rebate.getRule", {id})',
             ],
             'scope' => [
                 'width' => '120px',

+ 5 - 5
src/place/benefit/manage/role.php

@@ -1,6 +1,6 @@
 <?php
 return [
-    'source' => 'Prole/level',
+    'source' => 'prole/level',
     'list' => [
         'field'      => [
             'info_id' => [
@@ -13,11 +13,11 @@ return [
             ],
             'role_upgrade' => [
                 'name' => '固定权益',
-                'show' => 'Dever::call("Pbenefit/manage/role.getUpgrade", {id})',
+                'show' => 'Dever::call("Pbenefit/Manage/Lib/Role.getUpgrade", {id})',
             ],
             'role_period' => [
                 'name' => '周期权益',
-                'show' => 'Dever::call("Pbenefit/manage/role.getPeriod", {id})',
+                'show' => 'Dever::call("Pbenefit/Manage/Lib/Role.getPeriod", {id})',
             ],
         ],
         'button' => [
@@ -28,9 +28,9 @@ return [
 
             /* 这里很复杂,以后再加吧,所有用户的行为都有不同的权益
             '行为权益' => ['route', [
-                'path' => 'Pbenefit/role_action',
+                'path' => 'pbenefit/role_action',
                 'param' => [
-                    'set' => ['level_id' => 'id', 'menu' => 'Pbenefit/role', 'parent' => 'Pbenefit/role'],
+                    'set' => ['level_id' => 'id', 'menu' => 'pbenefit/role', 'parent' => 'pbenefit/role'],
                 ],
             ]],*/
         ],

+ 2 - 2
src/place/benefit/manage/sales.php

@@ -13,11 +13,11 @@ return [
             ],
             'rebate' => [
                 'name' => '自营返利',
-                'show' => 'Dever::call("Pbenefit/manage/sales.getRebate", [{id}])',
+                'show' => 'Dever::call("Pbenefit/Manage/Lib/Sales.getRebate", [{id}])',
             ],
             'rebate_platform' => [
                 'name' => '平台返利',
-                'show' => 'Dever::call("Pbenefit/manage/sales.getRebate", [{id}, "_platform"])',
+                'show' => 'Dever::call("Pbenefit/Manage/Lib/Sales.getRebate", [{id}, "_platform"])',
             ],
         ],
         'button' => [

+ 1 - 1
src/place/benefit/table/rebate_rule.php

@@ -11,7 +11,7 @@ return [
         'score_id'        => [
             'name'      => '奖励积分',
             'type'      => 'int(11)',
-            'value'     => 'Pscore/info',
+            'value'     => 'pscore/info',
         ],
         'level'       => [
             'name'      => '奖励层级',

+ 1 - 1
src/place/benefit/table/role_action.php

@@ -7,7 +7,7 @@ return [
         'level_id'        => [
             'name'      => '身份等级',
             'type'      => 'int(11)',
-            'value'     => 'Prole/level',
+            'value'     => 'prole/level',
         ],
 
         'action_type'        => [

+ 1 - 1
src/place/benefit/table/role_period.php

@@ -7,7 +7,7 @@ return [
         'level_id'        => [
             'name'      => '身份等级',
             'type'      => 'int(11)',
-            'value'     => 'Prole/level',
+            'value'     => 'prole/level',
         ],
         
         'type'        => [

+ 1 - 1
src/place/benefit/table/role_upgrade.php

@@ -7,7 +7,7 @@ return [
         'level_id'        => [
             'name'      => '身份等级',
             'type'      => 'int(11)',
-            'value'     => 'Prole/level',
+            'value'     => 'prole/level',
         ],
         
         'type'        => [

+ 1 - 1
src/place/boot.php

@@ -52,7 +52,7 @@ class Place
         if (!$this->info) {
             Dever::error('信息有误');
         }
-        if ($this->uid != $account['id']) {
+        if ($this->info['uid'] != $account['id']) {
             Dever::error('信息有误');
         }
         $this->info['supplier'] = $account['supplier'];

+ 2 - 2
src/place/channel/sales/app/Lib/Info.php

@@ -23,7 +23,7 @@ class Info
     public function get($type, $type_id)
     {
         $config = $this->getType($type);
-        $info = Dever::db($config['table'], 'Psales')->find($type_id);
+        $info = Dever::db('psales/' . $config['table'])->find($type_id);
         $info['type_name'] = $config['name'];
         return $info;
     }
@@ -43,7 +43,7 @@ class Info
         $list = $this->getType();
         foreach ($list as $k => $v) {
             $where = ['uid' => $uid];
-            $check = Dever::db($v['table'], 'Psales')->select($where, ['col' => 'id,name, ' . $v['id'] . ' as sales_type']);
+            $check = Dever::db('psales/' . $v['table'])->select($where, ['col' => 'id,name, ' . $v['id'] . ' as sales_type']);
             if ($check) {
                 $result = array_merge($check, $result);
             }

+ 5 - 5
src/place/channel/sales/manage/Lib/Info.php

@@ -20,7 +20,7 @@ class Info
         if ($type) {
             foreach ($type as $k => $v) {
                 $where = ['status' => 1];
-                $data = Dever::db($v['table'], 'Psales')->select($where);
+                $data = Dever::db('psales/' . $v['table'])->select($where);
                 if ($data) {
                     $v['children'] = $data;
                     $result[] = $v;
@@ -58,7 +58,7 @@ class Info
         $data[] = ['id' => '0,0', 'name' => '平台'];
         $type = Dever::load(\Psales\Lib\Info::class)->getType();
         foreach ($type as $v) {
-            $info = Dever::db($v['table'], 'Psales')->select(['status' => 1], ['col' => 'concat('.$v['id'].',",",id) as id, concat("'.$v['name'].'","-",name) as name']);
+            $info = Dever::db('psales/' . $v['table'])->select(['status' => 1], ['col' => 'concat('.$v['id'].',",",id) as id, concat("'.$v['name'].'","-",name) as name']);
             $data = array_merge($data, $info);
         }
         return $data;
@@ -68,7 +68,7 @@ class Info
     {
         if (isset($data['mobile']) && $data['mobile'] && $data['id']) {
             $table = Dever::load(\Psales\Lib\Info::class)->getType($data['sales_type'], 'table');
-            $info = Dever::db($table, 'Psales')->find($data['id']);
+            $info = Dever::db('psales/' . $table)->find($data['id']);
             $data['old_mobile'] = $info['mobile'];
             if ($info['mobile'] == $data['mobile']) {
                 # 无需修改
@@ -93,7 +93,7 @@ class Info
                     if ($v == $table) {
                         $where['id'] = ['!=', $data['id']];
                     }
-                    $check = Dever::db($v, 'Psales')->find($where);
+                    $check = Dever::db('psales/' . $v)->find($where);
                     if ($check) {
                         # 创建新用户
                         $data['uid'] = false;
@@ -104,7 +104,7 @@ class Info
             $user = Dever::load(\Puser\Manage\Lib\User::class)->createUser($data['sales_type'], $data['id'], $data['truename'], $data['mobile'], $data['uid']);
             if ($user) {
                 $update['uid'] = $user;
-                Dever::db($table, 'Psales')->update($data['id'], $update);
+                Dever::db('psales/' . $table)->update($data['id'], $update);
             }
         }
     }

+ 1 - 1
src/place/channel/sales/table/offline.php

@@ -112,7 +112,7 @@ return [
         'status' => [
             'name'      => '状态',
             'type'      => 'tinyint(1)',
-            'default'   => 2,
+            'default'   => 1,
             'value'     => [
                 1 => '开启',
                 2 => '关闭',

+ 2 - 2
src/place/channel/sales/table/profit.php

@@ -28,12 +28,12 @@ return [
         'score_id'        => [
             'name'      => '积分',
             'type'      => 'int(11)',
-            'value'     => 'Pscore/info',
+            'value'     => 'pscore/info',
         ],
         'action_id'       => [
             'type'      => 'int(11)',
             'name'      => '用户行为',
-            'value'     => 'Pscore/action',
+            'value'     => 'pscore/action',
         ],
         'amount'        => [
             'name'      => '积分数额',

+ 9 - 10
src/place/interface/app/Api/Address.php

@@ -1,23 +1,22 @@
 <?php namespace Pinterface\Api;
 use Dever;
 use Pinterface\Lib\Core;
-use Puser\Lib\Address;
+use Puser\Lib\Address as Service;
 class Address extends Core
 {
     protected $login = true;
     protected $entry = true;
-    private $address;
 
     public function init()
     {
-        $this->address = Dever::load(Address::class);
-        $this->address->init($this->place['uid']);
+        $this->service = Dever::load(Service::class);
+        $this->service->init($this->place->uid);
     }
 
     # 获取地址列表
     public function list()
     {
-        $data = $this->address->getList();
+        $data = $this->service->getList();
         return ['list' => $data];
     }
 
@@ -36,20 +35,20 @@ class Address extends Core
         $name = Dever::input('name', 'is_string', '联系人');
         $phone = Dever::input('phone', 'is_string', '联系方式');
 
-        return $this->address->update($id, $type, $phone, $name, $province, $city, $county, $town, $address);
+        return $this->service->update($id, $type, $phone, $name, $province, $city, $county, $town, $address);
     }
 
     # 获取默认地址
     public function getDefault()
     {
-        return $this->address->getDefault();
+        return $this->service->getDefault();
     }
 
     # 设置默认地址
     public function setDefault()
     {
         $id = Dever::input('id');
-        return $this->address->setDefault($id);
+        return $this->service->setDefault($id);
     }
 
     # 获取某个收货地址
@@ -58,7 +57,7 @@ class Address extends Core
         $id = Dever::input('id', 'is_numeric', '收货地址');
         $default = $this->getDefault();
         if ($id > 0) {
-            $data = $this->address->getInfo($id, $this->place['uid']);
+            $data = $this->service->getInfo($id, $this->place->uid);
             if ($data) {
                 if ($default && $default['id'] != $id) {
                     $data['type'] = 2;
@@ -90,6 +89,6 @@ class Address extends Core
     public function delete()
     {
         $id = Dever::input('id', 'is_numeric', '收货地址');
-        return $this->address->delete($id);
+        return $this->service->delete($id);
     }
 }

+ 5 - 5
src/place/interface/app/Api/Benefit.php

@@ -1,7 +1,7 @@
 <?php namespace Pinterface\Api;
 use Dever;
 use Pinterface\Lib\Core;
-use Pbenefit\Lib\User as Benefit;
+use Pbenefit\Lib\User as Service;
 class Benefit extends Core
 {
     protected $login = true;
@@ -10,7 +10,7 @@ class Benefit extends Core
 
     public function init()
     {
-        $this->benefit = Dever::load(Benefit::class);
+        $this->benefit = Dever::load(Service::class);
     }
 
     # 我的权益列表
@@ -23,9 +23,9 @@ class Benefit extends Core
         ];
         $data['list'] = [];
         if ($type == 1) {
-            $data['list'] = $this->benefit->getReceive($this->place['uid']);
+            $data['list'] = $this->benefit->getReceive($this->place->uid);
         } else {
-            $data['list'] = $this->benefit->getList($this->place['uid']);
+            $data['list'] = $this->benefit->getList($this->place->uid);
         }
         
         return $data;
@@ -40,7 +40,7 @@ class Benefit extends Core
         if (!$id) {
             Dever::error('权益不存在');
         }
-        $state = $this->benefit->receive($this->place['uid'], $id);
+        $state = $this->benefit->receive($this->place->uid, $id);
         if (!$state) {
             Dever::error('领取失败');
         }

+ 7 - 7
src/place/interface/app/Api/Bind.php

@@ -10,7 +10,7 @@ class Bind extends Core
     # 获取手机号
     public function getMobile()
     {
-        if ($this->place['user']['type'] == 1) {
+        if ($this->place->user['type'] == 1) {
             Dever::error('您已绑定过手机号');
         }
         $mobile = Dever::input('mobile', 'is_numeric', '手机号');
@@ -32,7 +32,7 @@ class Bind extends Core
         # 检测这个手机号是否被绑定过
         $check = Dever::db('puser/info')->find(['mobile' => $mobile]);
         $merge = false;
-        if ($check && $check['id'] != $this->place['uid']) {
+        if ($check && $check['id'] != $this->place->uid) {
             //Dever::error('这个手机号已被绑定,请更换');
             # 直接做合并
             $merge = $check['id'];
@@ -44,7 +44,7 @@ class Bind extends Core
         $state = false;
         if ($merge) {
             # 把当前用户删掉,然后把用户之前的信息都合并过来
-            $oldUid = $this->place['uid'];
+            $oldUid = $this->place->uid;
             $uid = $merge;
             Dever::db('puser/info')->update($oldUid, ['is_delete' => 1]);
             $table = [
@@ -65,11 +65,11 @@ class Bind extends Core
                 Dever::db($v)->update(['uid' => $oldUid], ['uid' => $uid]);
             }
         } else {
-            $state = Dever::db('puser/info')->update($this->place['uid'], ['mobile' => $mobile, 'type' => 1]);
+            $state = Dever::db('puser/info')->update($this->place->uid, ['mobile' => $mobile, 'type' => 1]);
 
-            $user = Dever::db('puser/info')->find($this->place['uid']);
-            Dever::load(\Prole\Lib\Info::class)->up($this->place['uid'], $user['sales_type'], $user['sales_id']);
-            $uid = $this->place['uid'];
+            $user = Dever::db('puser/info')->find($this->place->uid);
+            Dever::load(\Prole\Lib\Info::class)->up($this->place->uid, $user['sales_type'], $user['sales_id']);
+            $uid = $this->place->uid;
         }
         if (!$state) {
             Dever::error('绑定失败,请重试');

+ 1 - 1
src/place/interface/app/Api/Collect.php

@@ -9,7 +9,7 @@ class Collect extends Core
 
     public function init()
     {
-        $this->act = new Act('collect', $this->place['uid']);
+        $this->act = Act::load('collect', $this->place->uid);
     }
 
     public function up_commit(){}

+ 5 - 5
src/place/interface/app/Api/Coupon.php

@@ -28,21 +28,21 @@ class Coupon extends Core
 
         $cate = Dever::load(\Psource\Lib\Cate::class)->getInfo($detail['cate_id']);
         $scope = $cate['scope'] . ',' . $detail['id'];
-        $data['coupon'] = $this->config->getReceiveList($this->place['uid'], $scope, $cate['score']);
+        $data['coupon'] = $this->config->getReceiveList($this->place->uid, $scope, $cate['score']);
         return $data;
     }
 
     # 我的优惠券
     public function my()
     {
-        if (!$this->place['uid']) {
+        if (!$this->place->uid) {
             $this->showLogin();
         }
         $status = Dever::input('status');
         if (!$status) {
             $status = 0;
         }
-        $data['list'] = $this->config->getList($this->place['uid'], true, [], [], false, 0, $status+1);
+        $data['list'] = $this->config->getList($this->place->uid, true, [], [], false, 0, $status+1);
         return $data;
     }
 
@@ -50,14 +50,14 @@ class Coupon extends Core
     # 领取优惠券
     public function receive()
     {
-        if (!$this->place['uid']) {
+        if (!$this->place->uid) {
             $this->showLogin();
         }
         $id = \Dever\Helper\Secure::decode(Dever::input('id'));
         if (!$id) {
             Dever::error('优惠券不存在');
         }
-        $state = $this->config->receive($this->place['uid'], $id);
+        $state = $this->config->receive($this->place->uid, $id);
         if (!$state) {
             Dever::error('领取失败');
         }

+ 1 - 1
src/place/interface/app/Api/Gift.php

@@ -13,7 +13,7 @@ class Gift extends Core
         if (!$status) {
             $status = 0;
         }
-        $data['list'] = Dever::load(\Puser\Lib\Gift::class)->getList($this->place['uid'], true, [], [], false, 0, $status+1);
+        $data['list'] = Dever::load(\Puser\Lib\Gift::class)->getList($this->place->uid, true, [], [], false, 0, $status+1);
         return $data;
     }
 }

+ 21 - 19
src/place/interface/app/Api/Main.php

@@ -6,44 +6,46 @@ class Main extends Core
     # 首页
     public function home()
     {
+        /*
         $data['e'] = false;
-        if ($this->place['type'] == 1) {
+        if ($this->place->info['type'] == 1) {
             # 公开
             $data['e'] = true;
-        } elseif ($this->place['type'] == 2 && $this->place['user']) {
+        } elseif ($this->place->info['type'] == 2 && $this->place->user) {
             # 注册
             $data['e'] = true;
-        } elseif ($this->place['type'] > 2 && $this->place['user'] && $this->place['user']['entry_type'] > 2) {
+        } elseif ($this->place->info['type'] > 2 && $this->place->user && $this->place->user['entry_type'] > 2) {
             # 邀请码、购买、密码等等
             $data['e'] = true;
         } else {
             # 需要注册、购买、输入密码等等
-            if ($this->place['type'] == 2) {
+            if ($this->place->info['type'] == 2) {
                 $data['b'] = [
                     'name' => '注册',
                     'type' => 2,
                 ];
-            } elseif ($this->place['type'] == 3) {
+            } elseif ($this->place->info['type'] == 3) {
                 $data['b'] = [
                     'name' => '邀请码',
                     'type' => 3,
                 ];
-            } elseif ($this->place['type'] == 4) {
+            } elseif ($this->place->info['type'] == 4) {
                 $data['b'] = [
                     'name' => '密码',
                     'type' => 4,
                 ];
-            } elseif ($this->place['type'] == 5) {
+            } elseif ($this->place->info['type'] == 5) {
                 $data['b'] = [
                     'name' => '购买',
                     'type' => 5,
                 ];
             }
         }
-        $data['n'] = $this->place['name'];
-        $data['i'] = $this->place['info'];
-        $data['l'] = $this->place['logo'];
-        $data['u'] = $this->place['update'];
+        */
+        $data['n'] = $this->place->info['name'];
+        $data['i'] = $this->place->info['info'];
+        $data['l'] = $this->place->info['logo'];
+        $data['u'] = $this->place->info['update'];
         $data['m'] = $this->place->nav();
         return $data;
     }
@@ -51,7 +53,7 @@ class Main extends Core
     # 获取品牌介绍
     public function getContent()
     {
-        $data['content'] = htmlspecialchars_decode($this->place['content']);
+        $data['content'] = htmlspecialchars_decode($this->place->info['content']);
         return $data;
     }
 
@@ -114,17 +116,17 @@ class Main extends Core
                 }
             } else {
                 # 如果没有上级,从访问码里找:
-                $parent_uid = $this->place['parent_uid'];
+                $parent_uid = $this->place->info['parent_uid'];
                 /*  这里暂时不做
-                if (!$parent_uid && $this->place['sales_type'] && $this->place['sales_id']) {
+                if (!$parent_uid && $this->place->info['sales_type'] && $this->place->info['sales_id']) {
                     # 如果还没有上级,找销售渠道,销售渠道就是其的上级
-                    $sales = Dever::load(\Psales\Lib\Info::class)->get($this->place['sales_type'] && $this->place['sales_id']);
+                    $sales = Dever::load(\Psales\Lib\Info::class)->get($this->place->info['sales_type'] && $this->place->info['sales_id']);
                     if ($sales['uid']) {
                         $parent_uid = $sales['uid'];
                     }
                 }*/
             }
-            $uid = Dever::load(\Puser\Lib\Info::class)->createUser($mobile, $this->place['sales_type'], $this->place['sales_id'], $parent_uid);
+            $uid = Dever::load(\Puser\Lib\Info::class)->createUser($mobile, $this->place->info['sales_type'], $this->place->info['sales_id'], $parent_uid);
         }
         return $this->result($uid);
     }
@@ -162,9 +164,9 @@ class Main extends Core
         $id = Dever::db('puser/uuid')->insert($data);
         if ($id) {
             # 生成新用户
-            $parent_uid = $this->place['parent_uid'];
+            $parent_uid = $this->place->info['parent_uid'];
             $mobile = Dever::load(\Puser\Lib\Info::class)->createMobile();
-            $uid = Dever::load(\Puser\Lib\Info::class)->createUser($mobile, $this->place['sales_type'], $this->place['sales_id'], $parent_uid, '', '', 2);
+            $uid = Dever::load(\Puser\Lib\Info::class)->createUser($mobile, $this->place->info['sales_type'], $this->place->info['sales_id'], $parent_uid, '', '', 2);
             if ($uid) {
                 Dever::db('puser/uuid')->update($id, ['uid' => $uid]);
                 if ($env == 5) {
@@ -188,7 +190,7 @@ class Main extends Core
             $platform = Dever::input('platform', 'is_string', '平台信息', 'weixin');
             $env = Dever::input('env', 'is_numeric', '环境信息', 3);
 
-            $result = Dever::load(Place\Lib\Account::class)->openid(['key' => $platform], $env, $uid, $result);
+            $result = Dever::load(\Place\Lib\Account::class)->openid(['key' => $platform], $env, $uid, $result);
             if (isset($result['openid'])) {
                 unset($result['openid']);
             }

+ 5 - 5
src/place/interface/app/Api/Order.php

@@ -19,7 +19,7 @@ class Order extends Core
     public function list()
     {
         $status = Dever::input('status');
-        $data = $this->service->getList($this->place['uid'], $status);
+        $data = $this->service->getList($this->place->uid, $status);
         return ['list' => $data];
     }
 
@@ -56,7 +56,7 @@ class Order extends Core
     {
         $info = $this->getInfo();
         if ($info['pay_money_cash'] > 0) {
-            $result['pay'] = Dever::load(Place\Lib\Account::class)->pay($info);
+            $result['pay'] = Dever::load(\Place\Lib\Account::class)->pay($info);
             if (isset($result['pay']['link']) && $result['pay']['link']) {
                 return $result;
             }
@@ -88,7 +88,7 @@ class Order extends Core
         }
         $desc = Dever::input('desc');
 
-        $this->refund->up([], $info, 1, $this->place['uid'], $type, 1, $desc_type, $desc);
+        $this->refund->up([], $info, 1, $this->place->uid, $type, 1, $desc_type, $desc);
         return 'ok';
     }
 
@@ -120,7 +120,7 @@ class Order extends Core
         if (!$id) {
             Dever::error('订单信息有误');
         }
-        $info = Dever::db('porder/source')->find(['id' => $id, 'uid' => $this->place['uid']]);
+        $info = Dever::db('porder/source')->find(['id' => $id, 'uid' => $this->place->uid]);
         if (!$info) {
             Dever::error('订单信息有误');
         }
@@ -156,7 +156,7 @@ class Order extends Core
         }
         $detail = Dever::db('porder/source_detail')->select(['order_id' => $info['id']]);
         foreach ($detail as $v) {
-            $act = Act::load('review', 1, $v['source_id'])->up($data, '请不要发布相同内容');
+            $act = Act::load('review', $this->place->uid, 1, $v['source_id'])->up($data, '请不要发布相同内容');
         }
         Dever::db('porder/source')->update($info['id'], ['review_status' => 3]);
         return 'ok';

+ 3 - 3
src/place/interface/app/Api/Perk.php

@@ -48,7 +48,7 @@ class Perk extends Core
         if (!$status) {
             $status = 0;
         }
-        $data['list'] = $this->service->getList($this->place['uid'], true, false, $status+1);
+        $data['list'] = $this->service->getList($this->place->uid, true, false, $status+1);
         $data['money'] = Dever::load(\Place\Lib\Info::class)->money();
         return $data;
     }
@@ -71,7 +71,7 @@ class Perk extends Core
                 Dever::error('剩余兑换次数不足');
             }
         }
-        $state = $this->service->receive($this->place['uid'], $code);
+        $state = $this->service->receive($this->place->uid, $code);
         if (!$state) {
             Dever::error('兑换失败');
         }
@@ -104,7 +104,7 @@ class Perk extends Core
 
         $item['name'] = $perk['name'];
         $item['num'] = $num;
-        $state = $this->service->use($this->place['uid'], $info, $item);
+        $state = $this->service->use($this->place->uid, $info, $item);
         if (!$state) {
             Dever::error('领取失败');
         }

+ 2 - 3
src/place/interface/app/Api/Review.php

@@ -7,10 +7,9 @@ class Review extends Core
     protected $login = true;
     protected $entry = true;
 
-    public function __construct()
+    public function init()
     {
-        parent::__construct();
-        $this->act = new Act('review', $this->place['uid']);
+        $this->act = Act::load('review', $this->place->uid);
     }
 
     public function up_commit(){}

+ 2 - 2
src/place/interface/app/Api/Role.php

@@ -17,14 +17,14 @@ class Role extends Core
     # 确认支付
     public function payConfirm()
     {
-        if (!$this->place['uid']) {
+        if (!$this->place->uid) {
             $this->showLogin();
         }
         $this->showBindMobile();
         $role_id = Dever::input('type_id', 'is_numeric', '身份');
         $role = Dever::load(\Prole\Lib\Info::class)->getInfo($role_id);
         # 获取已经购买的
-        $role['user'] = Dever::load(\Prole\Lib\User::class)->getInfo($this->place['uid'], $role_id);
+        $role['user'] = Dever::load(\Prole\Lib\User::class)->getInfo($role_id);
 
         //[{"id":6,"num":2}]
         $level = Dever::input('detail', 'is_string', '等级');

+ 7 - 7
src/place/interface/app/Api/Sales.php

@@ -13,19 +13,19 @@ class Sales extends Core
         $this->data['sales_type'] = Dever::input('sales_type', 'is_numeric', '销售渠道类型');
         $this->data['sales_id'] = Dever::input('sales_id', 'is_numeric', '销售渠道ID');
         $this->info = Dever::load(\Psales\Lib\Info::class)->get($this->data['sales_type'], $this->data['sales_id']);
-        if ($this->info['uid'] != $this->place['uid']) {
+        if ($this->info['uid'] != $this->place->uid) {
             Dever::error('您没有权限', -3);
         }
         $this->info['mobile'] = \Dever\Helper\Str::hide($this->info['mobile']);
         if (!$this->info['info']) {
-            $this->info['info'] = $this->place['info'];
+            $this->info['info'] = $this->place->info;
         }
     }
 
     # 销售渠道信息
     public function info()
     {
-        $data['user'] = $this->place['user'];
+        $data['user'] = $this->place->user;
         $data['info'] = $this->info;
         $data['desc'] = $this->info['info'];
 
@@ -134,7 +134,7 @@ class Sales extends Core
     public function getOrder()
     {
         $status = Dever::input('status');
-        $data = Dever::load(\Porder\Lib\Source\Order::class)->getList($this->place['uid'], $status, $this->data['sales_type'], $this->data['sales_id']);
+        $data = Dever::load(\Porder\Lib\Source\Order::class)->getList($this->place->uid, $status, $this->data['sales_type'], $this->data['sales_id']);
         return ['list' => $data];
     }
 
@@ -144,8 +144,8 @@ class Sales extends Core
         $info = $this->getOrderInfo();
         $info = Dever::load(\Porder\Lib\Source\Order::class)->getInfo($info, true);
         $data = ['info' => $info, 'refund_desc_type' => Dever::db('porder/source_refund')->value('desc_type'), 'refund_type' => Dever::db('porder/source_refund')->value('type')];
-        $data['express'] = [Dever::call("sector/delivery.getList", 1)];
-        $data['virtual'] = [Dever::call("sector/delivery.getList", 2)];
+        $data['express'] = [Dever::call("Sector/Lib/Delivery.getList", 1)];
+        $data['virtual'] = [Dever::call("Sector/Lib/Delivery.getList", 2)];
 
         # 获取退货地址
         if ($data['info']['refund_status'] == 1 && isset($data['info']['refund']) && $data['info']['refund'] && $data['info']['refund']['status'] == 1 && $data['info']['refund']['type'] == 1 && $data['info']['method'] > 1) {
@@ -328,7 +328,7 @@ class Sales extends Core
         if ($update) {
             $table = Dever::load(\Psales\Lib\Info::class)->getTypeName($this->data['sales_type']);
             Dever::load(\Place\Lib\Info::class)->update($this->place['id']);
-            Dever::db($table, 'Psales')->update($this->data['sales_id'], $update);
+            Dever::db('psales/' . $table)->update($this->data['sales_id'], $update);
         }
         return $this->getInfo();
     }

+ 7 - 7
src/place/interface/app/Api/Score.php

@@ -10,11 +10,11 @@ class Score extends Core
     public function info()
     {
         $score_id = Dever::input('id', 'is_numeric', '积分ID');
-        $data['info'] = Dever::load(\Pscore\Lib\Info::class)->getInfo($this->place['uid'], $score_id);
-        $data['user'] = Dever::load(\Pscore\Lib\User::class)->getInfo($this->place['uid'], $data['info']);
+        $data['info'] = Dever::load(\Pscore\Lib\Info::class)->getInfo($this->place->uid, $score_id);
+        $data['user'] = Dever::load(\Pscore\Lib\User::class)->getInfo($this->place->uid, $data['info']);
         if ($data['info']['button'] == 2) {
             # 获取待审的提现金额
-            $data['user']['withdraw_cash'] = Dever::load(\Pscore\Lib\Withdraw::class)->getPendingAmount($this->place['uid'], $score_id);
+            $data['user']['withdraw_cash'] = Dever::load(\Pscore\Lib\Withdraw::class)->getPendingAmount($this->place->uid, $score_id);
         }
         return $data;
     }
@@ -24,7 +24,7 @@ class Score extends Core
     {
         $score_id = Dever::input('id', 'is_numeric', '积分ID');
         $type = Dever::input('type', 'is_numeric', '类型', 0);
-        $data['list_' . $type] = Dever::load(\Pscore\Lib\Log::class)->getList($this->place['uid'], $score_id, $name, $type);
+        $data['list_' . $type] = Dever::load(\Pscore\Lib\Log::class)->getList($this->place->uid, $score_id, $name, $type);
         return $data;
     }
 
@@ -32,7 +32,7 @@ class Score extends Core
     public function getCash()
     {
         $name = Dever::input('name', 'is_string', '类型');
-        $data['cash'] = Dever::load(\Pscore\Lib\Log::class)->getCash($this->place['uid'], $name);
+        $data['cash'] = Dever::load(\Pscore\Lib\Log::class)->getCash($this->place->uid, $name);
         return $data;
     }
 
@@ -112,7 +112,7 @@ class Score extends Core
     {
         $data = $this->info();
         # 获取账户列表
-        $data['config'] = Dever::load(\Pscore\Lib\Withdraw::class)->getList($this->place['uid']);
+        $data['config'] = Dever::load(\Pscore\Lib\Withdraw::class)->getList($this->place->uid);
         $data['money'] = $this->place->money();
         return $data;
     }
@@ -149,7 +149,7 @@ class Score extends Core
         if ($data['info']['withdraw'] != 1) {
             Dever::error('提现未开启');
         }
-        return Dever::load(\Pscore\Lib\Withdraw::class)->bind($data['info'], $this->place['uid'], $config, $realname, $account);
+        return Dever::load(\Pscore\Lib\Withdraw::class)->bind($data['info'], $this->place->uid, $config, $realname, $account);
     }
 
 }

+ 22 - 22
src/place/interface/app/Api/Source.php

@@ -9,7 +9,7 @@ class Source extends Core
     {
         $channel_id = Dever::input('channel_id', 'is_numeric', '频道ID');
         # 获取频道信息
-        $channel = Dever::load(Psource\Lib\Channel::class)->getInfo($channel_id);
+        $channel = Dever::load(\Psource\Lib\Channel::class)->getInfo($channel_id);
 
         $data['channel'] = [
             'id'    => $channel['id'],
@@ -43,8 +43,8 @@ class Source extends Core
         $source = Dever::input('source', 'is_numeric', '页面来源');
         # 搜索历史
         $data['history'] = [];
-        if ($this->place['uid']) {
-            $data['history'] = Dever::db('puser/search')->select(['uid' => $this->place['uid'], 'channel_id' => $channel_id], ['limit' => 10]);
+        if ($this->place->uid) {
+            $data['history'] = Dever::db('puser/search')->select(['uid' => $this->place->uid, 'channel_id' => $channel_id], ['limit' => 10]);
         }
         
         # 热门搜索
@@ -58,14 +58,14 @@ class Source extends Core
         $search = Dever::input('search', 'is_string', '搜索词');
         $channel_id = Dever::input('channel_id', 'is_numeric', '频道ID');
         $source = Dever::input('source', 'is_numeric', '页面来源');
-        $channel = Dever::load(Psource\Lib\Channel::class)->getInfo($channel_id);
+        $channel = Dever::load(\Psource\Lib\Channel::class)->getInfo($channel_id);
         $channel['score'] = Dever::load(\Pscore\Lib\Info::class)->get($channel['score_id']);
         $channel['scope'] = '1,' . $channel['id'];
-        $data['list'] = Dever::load(Psource\Lib\Info::class)->getList($channel, false, 10);
+        $data['list'] = Dever::load(\Psource\Lib\Info::class)->getList($channel, false, 10);
 
-        if ($this->place['uid']) {
+        if ($this->place->uid) {
             # 记录历史
-            $history = ['uid' => $this->place['uid'], 'channel_id' => $channel_id, 'source' => $source, 'search' => $search];
+            $history = ['uid' => $this->place->uid, 'channel_id' => $channel_id, 'source' => $source, 'search' => $search];
             $info = Dever::db('puser/search')->find($history);
             if (!$info) {
                 $history['num'] = 1;
@@ -74,7 +74,7 @@ class Source extends Core
                 Dever::db('puser/search')->update($info['id'], ['num' => ['+', 1]]);
             }
             Dever::db('psource/search')->update(['channel_id' => $channel_id, 'value' => $search], ['num' => ['+', 1]]);
-            Dever::load(\Pscore\Lib\Log::class)->action('搜索')->add($this->place['uid']);
+            Dever::load(\Pscore\Lib\Log::class)->action('搜索')->add($this->place->uid);
         }
 
         # 搜索页轮播图、搜索页信息流
@@ -89,7 +89,7 @@ class Source extends Core
     {
         $channel_id = Dever::input('channel_id', 'is_numeric', '频道ID');
         # 获取频道信息
-        $channel = Dever::load(Psource\Lib\Channel::class)->getInfo($channel_id);
+        $channel = Dever::load(\Psource\Lib\Channel::class)->getInfo($channel_id);
 
         $data['channel'] = [
             'id'    => $channel['id'],
@@ -115,7 +115,7 @@ class Source extends Core
         $show = Dever::input('show');
         $cate_id = Dever::input('id', 'is_numeric', '分类ID');
         $cate = Dever::load(\Psource\Lib\Cate::class)->getInfo($cate_id);
-        $data['list'] = Dever::load(Psource\Lib\Info::class)->getList($cate, false, 10);
+        $data['list'] = Dever::load(\Psource\Lib\Info::class)->getList($cate, false, 10);
         if ($show == 2) {
             # 仅展示分类列表
             return $data;
@@ -126,7 +126,7 @@ class Source extends Core
             'desc'  => $cate['desc'],
         ];
 
-        $channel = Dever::load(Psource\Lib\Channel::class)->getInfo($cate['channel_id']);
+        $channel = Dever::load(\Psource\Lib\Channel::class)->getInfo($cate['channel_id']);
 
         $data['channel'] = [
             'id'    => $channel['id'],
@@ -158,8 +158,8 @@ class Source extends Core
     public function info()
     {
         $source_id = Dever::input('id', 'is_numeric', '资源ID');
-        $info = Dever::load(Psource\Lib\Info::class)->getInfo($source_id);
-        $data['user'] = $this->place['user'];
+        $info = Dever::load(\Psource\Lib\Info::class)->getInfo($this->place->uid, $source_id);
+        $data['user'] = $this->place->user;
         $data['info'] = [
             'id'            => $info['id'],
             'cate_id'       => $info['cate_id'],
@@ -200,9 +200,9 @@ class Source extends Core
         }*/
 
         # 获取评价
-        $data['review'] = Act::load('review', 1, $source_id)->getList(['limit' => 3], 'content,pic,rate,open');
+        $data['review'] = Act::load('review', $this->place->uid, 1, $source_id)->getList(['limit' => 3], 'content,pic,rate,open');
         # 评价总数
-        $data['review_total'] = Act::load('review', 1, $source_id)->getTotal();
+        $data['review_total'] = Act::load('review', $this->place->uid, 1, $source_id)->getTotal();
 
         # 详情页轮播、详情页信息流
         $data['ad'] = Dever::load(\Ppage\Lib\Ad::class)->gets([21,22], $info['channel_id'], $info['cate_parent_id']);
@@ -214,7 +214,7 @@ class Source extends Core
     public function sku()
     {
         $source_id = Dever::input('id', 'is_numeric', '资源ID');
-        $data['sku'] = Dever::load(Psource\Lib\Info::class)->getSku($source_id);
+        $data['sku'] = Dever::load(\Psource\Lib\Info::class)->getSku($source_id);
         return $data;
     }
 
@@ -222,7 +222,7 @@ class Source extends Core
     public function content()
     {
         $source_id = Dever::input('id', 'is_numeric', '资源ID');
-        $source = Dever::load(Psource\Lib\Info::class)->getBaseInfo($source_id);
+        $source = Dever::load(\Psource\Lib\Info::class)->getBaseInfo($source_id);
         list($data['top'], $data['cate_id']) = Dever::load(\Psource\Lib\Content::class)->getCate($source_id);
 
         $data['top'] = array_merge([['id' => 0, 'name' => '全部']], $data['top']);
@@ -246,14 +246,14 @@ class Source extends Core
     {
         $content_id = Dever::input('id', 'is_numeric', '内容ID');
         $data['content'] = Dever::load(\Psource\Lib\Content::class)->getInfo($content_id);
-        $data['source'] = Dever::load(Psource\Lib\Info::class)->getBaseInfo($data['content']['info_id']);
+        $data['source'] = Dever::load(\Psource\Lib\Info::class)->getBaseInfo($data['content']['info_id']);
         return $data;
     }
 
     # 确认支付
     public function payConfirm()
     {
-        if (!$this->place['uid']) {
+        if (!$this->place->uid) {
             $this->showLogin();
         }
         $this->showBindMobile();
@@ -269,7 +269,7 @@ class Source extends Core
         if (!isset($source[0])) {
             Dever::error('资源不存在');
         }
-        $data = Dever::load(\Porder\Lib\Source\Pay::class)->init($this->place['uid'], $this->sector['id'], $this->place)->get($source, $cate);
+        $data = Dever::load(\Porder\Lib\Source\Pay::class)->get($source, $cate);
         return $data;
     }
 
@@ -285,7 +285,7 @@ class Source extends Core
     {
         $source_id = Dever::input('source_id', 'is_numeric', '资源ID');
         $num = Dever::input('num', 'is_numeric', '分页条数', 10);
-        $data = Act::load('review', 1, $source_id)->getList(['num' => $num], 'content,pic,rate,open');
+        $data = Act::load('review', $this->place->uid, 1, $source_id)->getList(['num' => $num], 'content,pic,rate,open');
         $result['list'] = $data;
         $result['total'] = Dever::page('total');
         return $result;
@@ -294,7 +294,7 @@ class Source extends Core
     # 资源订单列表
     public function getOrderList()
     {
-        $where['uid'] = $this->place['uid'];
+        $where['uid'] = $this->place->uid;
         $set['num'] = 10;
         $set['col'] = 'id,order_num,source_id,name,cash,num,cdate,status';
         $status = Dever::input('status');

+ 32 - 32
src/place/interface/app/Api/User.php

@@ -10,22 +10,22 @@ class User extends Core
     # 我的信息
     public function info()
     {
-        $data['user'] = $this->place['user'];
-        $data['user']['mobile'] = \Dever\Helper\Str::hide($this->place['user']['mobile']);
+        $data['user'] = $this->place->user;
+        $data['user']['mobile'] = \Dever\Helper\Str::hide($this->place->user['mobile']);
         if ($data['user']['type'] == 2) {
             $data['user']['mobile'] = '临时用户,请先绑定手机号';
         }
         # 优惠券
-        $data['user']['coupon'] = Dever::db('puser/coupon')->count(['uid' => $this->place['uid'], 'status' => 1]);
+        $data['user']['coupon'] = Dever::db('puser/coupon')->count(['uid' => $this->place->uid, 'status' => 1]);
         # 礼品卡
-        $data['user']['gift'] = Dever::db('puser/gift')->count(['uid' => $this->place['uid'], 'status' => 1]);
+        $data['user']['gift'] = Dever::db('puser/gift')->count(['uid' => $this->place->uid, 'status' => 1]);
         # 权益包
-        $data['user']['perk'] = Dever::db('puser/perk')->count(['uid' => $this->place['uid'], 'status' => 1]);
+        $data['user']['perk'] = Dever::db('puser/perk')->count(['uid' => $this->place->uid, 'status' => 1]);
 
         $data['role'] = [];
         $role = Dever::db('prole/info')->select(['status' => 1], ['col' => 'id,name,info']);
         # 获取用户的身份
-        $user_role = Dever::load(\Prole\Lib\User::class)->getList($this->place['uid']);
+        $user_role = Dever::load(\Prole\Lib\User::class)->getList($this->place->uid);
         $data['role_info'] = [];
         if ($role) {
             foreach ($role as $v) {
@@ -41,7 +41,7 @@ class User extends Core
                     $v['button'] = '立即开通';
                 }
                 
-                if ($v['info'] && !$data['role_info']) {
+                if (!$data['role_info']) {
                     $data['role_info'] = $v;
                 }
                 $data['role'][] = $v;
@@ -51,7 +51,7 @@ class User extends Core
         # 获取所有积分
         $data['score'] = Dever::db('pscore/info')->select(['status' => 1], ['col' => 'id,name']);
         # 获取用户的积分
-        $user_score = Dever::load(\Pscore\Lib\User::class)->getList($this->place['uid']);
+        $user_score = Dever::load(\Pscore\Lib\User::class)->getList($this->place->uid);
         if ($data['score']) {
             foreach ($data['score'] as &$score) {
                 $score['num'] = $user_score[$score['id']] ?? '0.00';
@@ -59,23 +59,23 @@ class User extends Core
         }
 
         # 获取待付款
-        $data['order_1'] = Dever::db('porder/source')->count(['uid' => $this->place['uid'], 'status' => 1]);
+        $data['order_1'] = Dever::db('porder/source')->count(['uid' => $this->place->uid, 'status' => 1]);
         # 待发货
-        $data['order_2'] = Dever::db('porder/source')->count(['uid' => $this->place['uid'], 'status' => 2]);
+        $data['order_2'] = Dever::db('porder/source')->count(['uid' => $this->place->uid, 'status' => 2]);
         # 待收货
-        $data['order_3'] = Dever::db('porder/source')->count(['uid' => $this->place['uid'], 'status' => ['in', '3,4']]);
+        $data['order_3'] = Dever::db('porder/source')->count(['uid' => $this->place->uid, 'status' => ['in', '3,4']]);
         # 待评价
-        $data['order_4'] = Dever::db('porder/source')->count(['uid' => $this->place['uid'], 'review_status' => 2]);
+        $data['order_4'] = Dever::db('porder/source')->count(['uid' => $this->place->uid, 'review_status' => 2]);
 
         # 获取用户管理信息
-        $data['sales'] = Dever::load(\Psales\Lib\Info::class)->getList($this->place['uid']);
+        $data['sales'] = Dever::load(\Psales\Lib\Info::class)->getList($this->place->uid);
         return $data;
     }
 
     # 仅获取用户信息
     public function my()
     {
-        $data['user'] = $this->place['user'];
+        $data['user'] = $this->place->user;
         return $data;
     }
 
@@ -83,7 +83,7 @@ class User extends Core
     public function upload()
     {
         $file = Dever::input('file', '!empty', '上传文件错误');
-        $uid = $this->place['uid'];
+        $uid = $this->place->uid;
         return Dever::load(\Upload\Lib\Save::class)->init(7, 1, false, false)->act($file, 'png', $uid);
     }
 
@@ -93,28 +93,28 @@ class User extends Core
         $update = [];
         $name = Dever::input('name');
         if ($name) {
-            $this->place['user']['name'] = $update['name'] = $name;
+            $this->place->user['name'] = $update['name'] = $name;
         }
         $avatar = Dever::input('avatar');
         if ($avatar) {
-            $this->place['user']['avatar'] = $update['avatar'] = $avatar;
+            $this->place->user['avatar'] = $update['avatar'] = $avatar;
         }
         $sign = Dever::input('sign');
         if ($sign) {
-            $this->place['user']['sign'] = $update['sign'] = $sign;
+            $this->place->user['sign'] = $update['sign'] = $sign;
         }
         $sex = Dever::input('sex');
         if ($sex) {
-            $this->place['user']['sex'] = $update['sex'] = $sex;
+            $this->place->user['sex'] = $update['sex'] = $sex;
         }
         $weixin = Dever::input('weixin');
         if ($weixin) {
-            $this->place['user']['weixin'] = $update['weixin'] = $weixin;
+            $this->place->user['weixin'] = $update['weixin'] = $weixin;
         }
         if ($update) {
-            Dever::db('puser/info')->update($this->place['uid'], $update);
+            Dever::db('puser/info')->update($this->place->uid, $update);
         }
-        return $this->place['user'];
+        return $this->place->user;
     }
 
     # 修改密码
@@ -124,15 +124,15 @@ class User extends Core
         //$pwd = Dever::input('pwd', '/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_]).{8,}$/', '密码');
         $pwd = Dever::input('pwd', 'is_string', '密码');
         $code = Dever::input('code', 'is_string', '验证码');
-        Dever::load(\Msg\Lib\Template::class)->check('user_code', $this->place['user']['mobile'], $code);
+        Dever::load(\Msg\Lib\Template::class)->check('user_code', $this->place->user['mobile'], $code);
         $update = Dever::load(\Manage\Lib\Util::class)->createPwd($pwd);
-        Dever::db('puser/info')->update($this->place['uid'], $update);
+        Dever::db('puser/info')->update($this->place->uid, $update);
     }
 
     # 发送短信验证码
     public function sms()
     {
-        $data = Dever::load(\Msg\Lib\Template::class)->send('user_code', ['mobile' => $this->place['user']['mobile']], [], 'place');
+        $data = Dever::load(\Msg\Lib\Template::class)->send('user_code', ['mobile' => $this->place->user['mobile']], [], 'place');
         return $data;
     }
 
@@ -140,11 +140,11 @@ class User extends Core
     public function invite()
     {
         # 代理邀请码
-        $data['code'] = Dever::load(\Invite\Lib\Code::class)->get($this->place['uid']);
+        $data['code'] = Dever::load(\Invite\Lib\Code::class)->get($this->place->uid);
 
         $data['parent'] = 2;
         # 获取我的上级
-        $relation = Dever::load(\Invite\Lib\Relation::class)->getParent($this->place['uid']);
+        $relation = Dever::load(\Invite\Lib\Relation::class)->getParent($this->place->uid);
         if ($relation) {
             $data['parent'] = 1;
             $data['parent_info'] = Dever::db('puser/info')->find($relation['uid'], ['col' => 'id,name,avatar']);
@@ -157,7 +157,7 @@ class User extends Core
     {
         $data['parent'] = 2;
         # 获取我的上级
-        $relation = Dever::load(\Invite\Lib\Relation::class)->getParent($this->place['uid']);
+        $relation = Dever::load(\Invite\Lib\Relation::class)->getParent($this->place->uid);
         if ($relation) {
             $data['parent'] = 1;
             $data['parent_info'] = Dever::db('puser/info')->find($relation['uid'], ['col' => 'id,name,avatar,cdate']);
@@ -166,7 +166,7 @@ class User extends Core
             }
         }
 
-        $relation = Dever::load(\Invite\Lib\Relation::class)->getChild($this->place['uid']);
+        $relation = Dever::load(\Invite\Lib\Relation::class)->getChild($this->place->uid);
         $data['list'] = [];
         if ($relation) {
             foreach ($relation as $k => $v) {
@@ -185,7 +185,7 @@ class User extends Core
     # 填写邀请码,添加上级
     public function addParent()
     {
-        $relation = Dever::load(\Invite\Lib\Relation::class)->getParent($this->place['uid']);
+        $relation = Dever::load(\Invite\Lib\Relation::class)->getParent($this->place->uid);
         if ($relation) {
             Dever::error('您已经有上级了');
         }
@@ -198,8 +198,8 @@ class User extends Core
         if (!$parent) {
             Dever::error('邀请码不存在');
         }
-        Dever::load(\Invite\Lib\Relation::class)->set($parent_uid, $this->place['uid']);
-        Dever::db('puser/info')->update($this->place['uid'], ['parent_uid' => $parent_uid]);
+        Dever::load(\Invite\Lib\Relation::class)->set($parent_uid, $this->place->uid);
+        Dever::db('puser/info')->update($this->place->uid, ['parent_uid' => $parent_uid]);
         return 'ok';
     }
 }

+ 8 - 8
src/place/interface/app/Lib/Core.php

@@ -19,7 +19,7 @@ class Core
                 if ($t['uid'] && $t['uid'] > 0) {
                     $this->place->user($t['uid']);
                 }
-                if ($this->login && !$this->place['uid']) {
+                if ($this->login && !$this->place->uid) {
                     $this->showLogin();
                 }
             } elseif ($this->login) {
@@ -27,11 +27,11 @@ class Core
             }
         }
         if ($this->entry) {
-            if ($this->place['type'] >= 2 && !$this->place['uid']) {
+            if ($this->place->info['type'] >= 2 && !$this->place->uid) {
                 Dever::error('您没有权限', -2);
             }
             /*
-            if ($this->place['user']['entry_type'] <= 2) {
+            if ($this->place->user['entry_type'] <= 2) {
                 Dever::error('您没有权限');
             }*/
         }
@@ -48,26 +48,26 @@ class Core
 
     protected function showBindMobile()
     {
-        if ($this->place['user']['type'] == 2) {
+        if ($this->place->user['type'] == 2) {
             Dever::error('您需要绑定手机号才能继续操作', -5);
         }
     }
 
     protected function showBindEmail()
     {
-        if ($this->place['user']['type'] == 2) {
+        if ($this->place->user['type'] == 2) {
             Dever::error('您需要绑定邮箱才能继续操作', -6);
         }
     }
 
     # 获取要更新的数据版本号
-    protected function getUpdate()
+    public function getUpdate()
     {
-        return $this->place['info']['update'];
+        return $this->place->info['update'];
     }
 
     # 获取要更新的系统版本号
-    protected function getVersion()
+    public function getVersion()
     {
         return 100;
     }

+ 1 - 1
src/place/order/app/Lib/Log.php

@@ -10,7 +10,7 @@ class Log
         $update['order_id'] = $order_id;
         $update['desc'] = $desc;
         if ($id) {
-            Dever::db('porder/ ' . $this->table)->update($id, $update);
+            Dever::db('porder/' . $this->table)->update($id, $update);
         } else {
             Dever::db('porder/' . $this->table)->insert($update);
         }

+ 22 - 23
src/place/order/app/Lib/Pay.php

@@ -14,7 +14,7 @@ class Pay
     public function __construct(Place $place)
     {
         $this->place = $place;
-        if (!$this->place['uid']) {
+        if (!$this->place->uid) {
             Dever::error('请先登录');
         }
     }
@@ -29,9 +29,9 @@ class Pay
         $this->set['rebate'] = ['rule' => []];
         $this->order['cash'] = $this->order['num'] = 0;
         $this->order['sales_type'] = $this->order['sales_id'] = 0;
-        if ($this->place['info']['sales_type'] && $this->place['info']['sales_id']) {
-            $this->order['sales_type'] = $this->place['info']['sales_type'];
-            $this->order['sales_id'] = $this->place['info']['sales_id'];
+        if ($this->place->info['sales_type'] && $this->place->info['sales_id']) {
+            $this->order['sales_type'] = $this->place->info['sales_type'];
+            $this->order['sales_id'] = $this->place->info['sales_id'];
         }
         foreach ($detail as $k => $v) {
             $this->getDetail($v);
@@ -51,20 +51,20 @@ class Pay
         $gift_cash = Dever::input('gift_cash');
 
         # 获取当前余额
-        $this->user['wallet'] = Dever::load(\Pscore\Lib\User::class)->getInfo($this->place['uid'], $this->set['score']);
+        $this->user['wallet'] = Dever::load(\Pscore\Lib\User::class)->getInfo($this->place->uid, $this->set['score']);
 
         # 获取当前可用的优惠券
-        $this->user['coupon'] = Dever::load(\Puser\Lib\Coupon::class)->getUseList($this->place['uid'], $this->detail, $this->set['score'], $coupon_id, $coupon_cash);
+        $this->user['coupon'] = Dever::load(\Puser\Lib\Coupon::class)->getUseList($this->place->uid, $this->detail, $this->set['score'], $coupon_id, $coupon_cash);
 
         # 获取当前可用的礼品卡
-        $this->user['gift'] = Dever::load(\Puser\Lib\Gift::class)->getUseList($this->place['uid'], $this->detail, $this->set['score'], $gift_id, $gift_cash);
+        $this->user['gift'] = Dever::load(\Puser\Lib\Gift::class)->getUseList($this->place->uid, $this->detail, $this->set['score'], $gift_id, $gift_cash);
 
         # 获取地址
         if (isset($this->order['deliver_type']) && $this->order['deliver_type'] == 1 && $this->order['is_address'] == 1) {
             if ($address_id) {
-                $this->user['address'] = Dever::load(\Puser\Lib\Address::class)->getInfo($address_id, $this->place['uid']);
+                $this->user['address'] = Dever::load(\Puser\Lib\Address::class)->init($this->place->uid)->getInfo($address_id);
             } else {
-                $this->user['address'] = Dever::load(\Puser\Lib\Address::class)->getDefault();
+                $this->user['address'] = Dever::load(\Puser\Lib\Address::class)->init($this->place->uid)->getDefault();
             }
         }
     }
@@ -72,7 +72,7 @@ class Pay
     # 获取订单信息
     private function getOrder()
     {
-        $this->order['uid'] = $this->place['uid'];
+        $this->order['uid'] = $this->place->uid;
         $this->order['cash'] = Dever::number($this->order['cash']);
         # 支付金额
         $this->order['pay_cash'] = $this->order['cash'];
@@ -227,7 +227,7 @@ class Pay
 
     # 下单
     public function act_commit(){}
-    public function act($detail = false, $sector_id, $place_id)
+    public function act($detail = false)
     {
         if ($detail) {
             $this->get($detail);
@@ -238,25 +238,25 @@ class Pay
         if ($this->order['num'] <= 0) {
             Dever::error('下单失败,数量为0');
         }
-        $table = 'Porder/' . $this->type;
+        $table = 'porder/' . $this->type;
         $prefix = strtoupper(substr($this->type, 0, 2));
-        $this->order['uid'] = $this->place['uid'];
+        $this->order['uid'] = $this->place->uid;
         # 获取上级
-        if ($this->user['parent_uid'] && $this->user['parent_uid'] > 0) {
-            $this->order['parent_uid'] = $this->user['parent_uid'];
+        if ($this->place->user['parent_uid'] && $this->place->user['parent_uid'] > 0) {
+            $this->order['parent_uid'] = $this->place->user['parent_uid'];
         }
         if (is_array($this->order['name'])) {
             $this->order['name'] = implode('、', $this->order['name']);
         }
         $this->order['order_num'] = Dever::load(\Api\Lib\Util::class)->createNumber($prefix, $table);
-        $this->order['notify'] = $table . '/pay.notify|' . $this->place['sector']['id'] . '|'  . $this->place['info']['id'] . '|' . $this->order['order_num'];
+        $this->order['notify'] = $table . '/pay.notify|' . $this->place->sector['id'] . '|'  . $this->place->info['id'] . '|' . $this->order['order_num'];
         $this->order['buy_info'] = Dever::input('remark');
 
         $this->check();
 
         $result = [];
         if ($this->order['pay_money_cash'] > 0) {
-            $result['pay'] = Dever::load(Place\Lib\Account::class)->pay($this->order);
+            $result['pay'] = Dever::load(\Place\Lib\Account::class)->pay($this->order);
             if (isset($result['pay']['link']) && $result['pay']['link']) {
                 //return $result;
             }
@@ -270,7 +270,7 @@ class Pay
                 $result['order_num'] = $this->order['order_num'];
                 $this->success($result['order_id']);
                 if ($result['pay'] === true) {
-                    $this->notify($this->place['sector']['id'], $this->place['info']['id'], $result['order_num'], 1);
+                    $this->notify($this->place->sector['id'], $this->place->info['id'], $result['order_num'], 1);
                 }
             }
         }
@@ -339,7 +339,7 @@ class Pay
         }
 
         # 设置活跃
-        Dever::db('place/code')->update(['code' => $this->place['code']], ['status' => 1]);
+        Dever::db('place/code')->update(['code' => $this->place->code], ['status' => 1]);
     }
 
     # 支付回调
@@ -404,10 +404,9 @@ class Pay
             if ($sales && $sales['uid']) {
                 $benefit = Dever::db('pbenefit/sales')->find(['sales_cate_id' => $sales['cate_id'], 'status' => 1]);
                 if ($benefit && $benefit['score_id']) {
-                    if ($order['method'] == 1) {
-                        # 平台发货
-                        $table = 'sales_rebate_platform';
-                    } else {
+                    # 平台发货
+                    $table = 'sales_rebate_platform';
+                    if (isset($order['method']) && $order['method'] >= 2) {
                         # 店铺发货
                         $table = 'sales_rebate';
                     }

+ 2 - 2
src/place/order/app/Lib/Role/Pay.php

@@ -19,8 +19,8 @@ class Pay extends Core
         $detail = Dever::load(\Prole\Lib\Price::class)->get($detail, $this->set, $info['num']);
 
         $this->detail[] = [
-            'uid' => $this->place['uid'],
-            'pic' => $this->place['logo'],
+            'uid' => $this->place->uid,
+            'pic' => $this->place->info['logo'],
             'role_id' => $detail['info_id'],
             'level_id' => $detail['id'],
             'level' => $detail['level'],

+ 2 - 2
src/place/order/app/Lib/Source/Cart.php

@@ -13,7 +13,7 @@ class Cart
             foreach($data as &$v) {
                 Dever::input('num', 'set', $v['num']);
                 Dever::input('sku_id', 'set', $v['sku_id']);
-                $info = Dever::load(Psource\Lib\Info::class)->getInfo($v['source_id']);
+                $info = Dever::load(\Psource\Lib\Info::class)->getInfo($v['source_id']);
                 if (!$info) {
                     $v['del'] = 1;
                 } else {
@@ -117,7 +117,7 @@ class Cart
                 $sku_id = $v['sku_id'];
                 Dever::input('num', 'set', $num);
                 Dever::input('sku_id', 'set', $sku_id);
-                $info = Dever::load(Psource\Lib\Info::class)->getInfo($v['source_id']);
+                $info = Dever::load(\Psource\Lib\Info::class)->getInfo($v['source_id']);
                 if ($info) {
                     $v = $info;
                     $v['cart_id'] = $id;

+ 5 - 7
src/place/order/app/Lib/Source/Order.php

@@ -134,7 +134,7 @@ class Order
 
         # 收货地址
         if ($info['address_id']) {
-            $info['address'] = Dever::load(\Puser\Lib\Address::class)->getInfo($info['address_id'], $info['uid']);
+            $info['address'] = Dever::load(\Puser\Lib\Address::class)->init($info['uid'])->getInfo($info['address_id']);
         }
         $info['user'] = Dever::db('puser/info')->find($info['uid'], ['col' => 'id,name,mobile,avatar']);
         if (in_array($info['status'], [3,4,5,6])) {
@@ -214,22 +214,20 @@ class Order
                 }
                 $refund['detail_str'] = implode('、', $refund['detail_str']);
                 $this->getViewDate($refund);
-                if ($refund['status'] < 4 && !$info['refund']) {
+                if ($refund['status'] < 5 && !$info['refund']) {
                     $info['refund'] = $refund;
                     if ($refund['address_id']) {
                         if (strstr($refund['address_id'], '_')) {
                             $temp = explode('_', $refund['address_id']);
-
-                            $name = ucfirst($temp[0]);
-                            $address = Dever::load('P' . $name . '\\Lib\\Info')->get($temp[1], $temp[2]);
+                            $address = Dever::load('P' . $temp[0] . '\\Lib\\Info')->get($temp[1], $temp[2]);
 
                             //$address = Dever::load('info', 'place_channel_' . $temp[0])->get($temp[1], $temp[2]);
                             $name = $address['name'] . ',' . $address['mobile'] . ',' . Dever::load(\Area\Lib\Data::class)->string($address['area'], ',') . ',' . $address['address'];
-                            $info['refund']['address'] = $name;
+                            $refund['address'] = $info['refund']['address'] = $name;
                         } else {
                             $address = Dever::db('place/address')->find($refund['address_id']);
                             $name = $address['name'] . ',' . $address['phone'] . ',' . Dever::load(\Area\Lib\Data::class)->string($address['area'], ',') . ',' . $address['address'];
-                            $info['refund']['address'] = $name;
+                            $refund['address'] = $info['refund']['address'] = $name;
                         }
                     }
                 }

+ 3 - 3
src/place/order/app/Lib/Source/Pay.php

@@ -14,8 +14,8 @@ class Pay extends Core
         if ($this->set['id'] != $source['cate_id']) {
             Dever::error('资源不存在');
         }
-        //$detail = Dever::load(\Api\Lib\Sku::class)->getList(['info_id' => $source['id']], $info['sku_id'], 'Psource');
-        $detail = Dever::load(\Api\Lib\Sku::class)->getInfo(['id' => $info['sku_id'], 'info_id' => $source['id']], 'Psource');
+        //$detail = Dever::load(\Api\Lib\Sku::class)->getList(['info_id' => $source['id']], $info['sku_id'], 'psource');
+        $detail = Dever::load(\Api\Lib\Sku::class)->getInfo(['id' => $info['sku_id'], 'info_id' => $source['id']], 'psource');
         if (!$detail) {
             Dever::error('规格不存在');
         }
@@ -30,7 +30,7 @@ class Pay extends Core
         }
 
         $this->detail[] = [
-            'uid' => $this->place['uid'],
+            'uid' => $this->place->uid,
             'source_id' => $source['id'],
             'source_type' => $source['type'],
             'sku_id' => $detail['id'],

+ 2 - 2
src/place/order/app/Lib/Source/Refund.php

@@ -42,7 +42,7 @@ class Refund
         $refund = Dever::db('porder/source_refund')->find($id);
         if ($refund['status'] == 3) {
             if ($type == 1) {
-                $refund['status'] = $update['status'] = 3;
+                $refund['status'] = $update['status'] = 2;
                 $update['delivery_pdate'] = time();
                 $desc = '退款:审核通过';
             } else {
@@ -58,7 +58,7 @@ class Refund
                 $desc .= '-' . $update['delivery_audit_desc'];
             }
             Dever::load(\Porder\Lib\Source\Log::class)->up($utype, $uid, $refund['order_id'], $desc);
-            if ($refund['status'] == 3) {
+            if ($refund['status'] == 2) {
                 $order = Dever::db('porder/source')->find($refund['order_id']);
                 $this->finish($order, $refund);
             }

+ 2 - 2
src/place/order/manage/Lib/Source/Pdf.php

@@ -9,7 +9,7 @@ class Pdf
         $button[] = [
             'name' => '保存',
             'type' => 'fastedit',
-            'path' => 'sector_porder/pdf_edit',
+            'path' => 'sector_place_order/pdf_edit',
             'row' => [
                 'id' => $result['id'],
             ],
@@ -19,7 +19,7 @@ class Pdf
         $button[] = [
             'name' => '重新获取',
             'type' => 'fastedit',
-            'path' => 'sector_porder/pdf',
+            'path' => 'sector_place_order/pdf',
             'row' => [
                 'id' => $result['id'],
             ],

+ 3 - 3
src/place/order/manage/Lib/Source/Refund.php

@@ -5,7 +5,7 @@ class Refund
     # 后台提交申请
     public function update($db, $data)
     {
-        $detail = Dever::input('Porder/source_refund_detail');
+        $detail = Dever::input('porder/source_refund_detail');
         $order = Dever::db('porder/source')->find($data['order_id']);
         if ($order && $order['status'] <= 4) {
             $uid = Dever::getData('muser')['id'];
@@ -54,7 +54,7 @@ class Refund
         $refund = Dever::db('porder/source_refund')->find($data['id']);
         if ($refund['status'] == 3) {
             if ($data['audit'] == 1) {
-                $refund['status'] = $update['status'] = 3;
+                $refund['status'] = $update['status'] = 2;
                 $update['delivery_pdate'] = time();
                 $desc = '退货:审核通过';
             } else {
@@ -70,7 +70,7 @@ class Refund
                 $desc .= '-' . $update['delivery_audit_desc'];
             }
             Dever::load(\Porder\Lib\Source\Log::class)->up(2, Dever::getData('muser')['id'], $refund['order_id'], $desc);
-            if ($refund['type'] == 2 && $refund['status'] == 2) {
+            if ($refund['status'] == 2) {
                 $order = Dever::db('porder/source')->find($refund['order_id']);
                 Dever::load(\Porder\Lib\Source\Refund::class)->finish($order, $refund);
             }

+ 13 - 10
src/place/order/manage/Lib/Source/View.php

@@ -407,7 +407,7 @@ class View
     {
         $data['name'] = $this->score->getText($detail['cash'], $this->info['score']);
         $promotion = Dever::db('porder/promotion')->select(['table' => 'source_detail', 'table_id' => $detail['id']]);
-        if ($promotion) {
+        if ($detail) {
             $data['content'] = [];
             $data['content']['type'] = 'line';
             $data['content']['content'] = [];
@@ -526,6 +526,9 @@ class View
         } elseif ($refund['status'] >= 2) {
             $data['content']['content'][] = ['name' => '申请审核', 'content' => $refund['audit_desc']];
         }
+        if ($refund['type'] == 1 && $refund['address']) {
+            $data['content']['content'][] = ['name' => '退货地址', 'content' => $refund['address']];
+        }
         # 退货退款
         if ($refund['type'] == 1 && $refund['status'] >= 3) {
             $refund = Dever::load(\Porder\Lib\Source\Delivery::class)->getRefundInfo($refund);
@@ -663,7 +666,7 @@ class View
                 $button[] = [
                     'name' => '修改收货信息',
                     'type' => 'fastedit',
-                    'path' => 'sector_porder/source_address',
+                    'path' => 'sector_place_order/source_address',
                     'row' => [
                         'id' => $this->info['id'],
                     ],
@@ -673,7 +676,7 @@ class View
                     'name' => '快递发货',
                     # fastedit、fastadd、oper、api、link、route
                     'type' => 'fastadd',
-                    'path' => 'sector_porder/source_express',
+                    'path' => 'sector_place_order/source_express',
                     'row' => [
                         'id' => $this->info['id'],
                     ],
@@ -692,7 +695,7 @@ class View
                     $button[] = [
                         'name' => $name,
                         'type' => 'fastadd',
-                        'path' => 'sector_porder/source_delivery',
+                        'path' => 'sector_place_order/source_delivery',
                         # row必填,这里的按钮来自于列表页,需要依赖哪一行。这里就写id就行,后续优化这里吧
                         'row' => [],
                         'param' => [
@@ -708,7 +711,7 @@ class View
             $button[] = [
                 'name' => '修改发货信息',
                 'type' => 'fastadd',
-                'path' => 'sector_porder/source_delivery',
+                'path' => 'sector_place_order/source_delivery',
                 # row必填,这里的按钮来自于列表页,需要依赖哪一行。这里就写id就行,后续优化这里吧
                 'row' => [],
                 'param' => [
@@ -723,7 +726,7 @@ class View
                     $button[] = [
                     'name' => '查看发货信息',
                     'type' => 'fastadd',
-                    'path' => 'sector_porder/source_delivery',
+                    'path' => 'sector_place_order/source_delivery',
                     # row必填,这里的按钮来自于列表页,需要依赖哪一行。这里就写id就行,后续优化这里吧
                     'row' => [],
                     'param' => [
@@ -737,7 +740,7 @@ class View
             $button[] = [
                 'name' => '确认收货',
                 'type' => 'api',
-                'path' => 'sector_porder/source_delivery',
+                'path' => 'sector_place_order/source_delivery',
                 # row必填,这里的按钮来自于列表页,需要依赖哪一行。这里就写id就行,后续优化这里吧
                 'row' => [],
                 'param' => [
@@ -753,7 +756,7 @@ class View
             $button[] = [
                 'name' => '退款申请',
                 'type' => 'fastadd',
-                'path' => 'sector_porder/source_refund',
+                'path' => 'sector_place_order/source_refund',
                 'row' => [],
                 'param' => [
                     'order_id' => $this->info['id'],
@@ -767,7 +770,7 @@ class View
             $button[] = [
                 'name' => '退款审核',
                 'type' => 'fastedit',
-                'path' => 'sector_porder/source_refund_audit',
+                'path' => 'sector_place_order/source_refund_audit',
                 'row' => [
                     'id' => $this->info['refund']['id'],
                 ],
@@ -780,7 +783,7 @@ class View
             $button[] = [
                 'name' => '退货审核',
                 'type' => 'fastedit',
-                'path' => 'sector_porder/source_refund_audit_delivery',
+                'path' => 'sector_place_order/source_refund_audit_delivery',
                 'row' => [
                     'id' => $this->info['refund']['id'],
                 ],

+ 2 - 2
src/place/order/manage/pdf.php

@@ -17,11 +17,11 @@ return [
         'data_button' => [
             '重新获取' => ['fastedit'],
             '审阅' => ['view', [
-                'path' => 'sector_porder/pdf',
+                'path' => 'sector_place_order/pdf',
                 'param' => [
                     'type' => 'pdf',
                     'id' => 'id',
-                    'set' => ['menu' => 'sector_porder/pdf', 'parent' => 'sector_porder/pdf'],
+                    'set' => ['menu' => 'sector_place_order/pdf', 'parent' => 'sector_place_order/pdf'],
                 ],
             ], '', '{status} > 2'],
             '预览原文件' => ['link', '{file}'],

+ 3 - 3
src/place/order/manage/role.php

@@ -45,11 +45,11 @@ $config = [
         ],
         'data_button' => [
             '详情' => ['drawer', [
-                'path' => 'sector_porder/role',
+                'path' => 'sector_place_order/role',
                 'param' => [
                     'type' => 'view',
                     'id' => 'id',
-                    'set' => ['menu' => 'sector_porder/role', 'parent' => 'sector_porder/role'],
+                    'set' => ['menu' => 'sector_place_order/role', 'parent' => 'sector_place_order/role'],
                 ],
             ]],
         ],
@@ -82,6 +82,6 @@ $config = [
         ],
     ],
     # 详情页配置
-    'view' => 'Porder/manage/role/view.get',
+    'view' => 'Porder/Manage/Lib/Role/View.get',
 ];
 return $config;

+ 4 - 4
src/place/order/manage/source.php

@@ -2,7 +2,7 @@
 $config = [
     'list' => [
         'selection' => true,
-        'filter' => 'Porder/manage/source/info.getFilter',
+        'filter' => 'Porder/Manage/Lib/Source/Info.getFilter',
         'field'      => [
             'order_num' => [
                 'align' => 'left',
@@ -48,17 +48,17 @@ $config = [
         'button' => [
             //'新增' => ['add'],
             '发货单导入' => ['fastadd', [
-                'path' => 'sector_porder/import',
+                'path' => 'sector_place_order/import',
             ]],
         ],
         'data_button' => [
             //'编辑' => 'edit',
             '详情' => ['drawer', [
-                'path' => 'sector_porder/source',
+                'path' => 'sector_place_order/source',
                 'param' => [
                     'type' => 'view',
                     'id' => 'id',
-                    'set' => ['menu' => 'sector_porder/source', 'parent' => 'sector_porder/source'],
+                    'set' => ['menu' => 'sector_place_order/source', 'parent' => 'sector_place_order/source'],
                 ],
             ]],
         ],

+ 4 - 4
src/place/order/manage/source_refund_audit.php

@@ -3,15 +3,15 @@
 $config = [
     'source' => 'porder/source_refund',
     'update' => [
-        'start' => 'Porder/Manage/Source/Refund.audit',
+        'start' => 'Porder/Manage/Lib/Source/Refund.audit',
         'field'    => [
             'type' => [
                 'type' => 'show',
-                'default' => 'Dever::call("Porder/Manage/Source/Refund.show", ["type", "{type}"])',
+                'default' => 'Dever::call("Porder/Manage/Lib/Source/Refund.show", ["type", "{type}"])',
             ],
             'desc_type' => [
                 'type' => 'show',
-                'default' => 'Dever::call("Porder/Manage/Source/Refund.show", ["desc_type", "{desc_type}"])',
+                'default' => 'Dever::call("Porder/Manage/Lib/Source/Refund.show", ["desc_type", "{desc_type}"])',
             ],
             'audit' => [
                 'name' => '退款审核',
@@ -39,7 +39,7 @@ if ($id) {
         $config['update']['field']['address_id'] = [
             'type' => 'select',
             'rules' => true,
-            'option' => 'Dever::call("place/address.getList")',
+            'option' => 'Dever::call("Place/Lib/Address.getList")',
         ];
     }
 }

+ 4 - 4
src/place/order/manage/source_refund_audit_delivery.php

@@ -3,20 +3,20 @@
 $config = [
     'source' => 'porder/source_refund',
     'update' => [
-        'start' => 'Porder/Manage/Source/Refund.auditDelivery',
+        'start' => 'Porder/Manage/Lib/Source/Refund.auditDelivery',
         'field'    => [
             'type' => [
                 'type' => 'show',
-                'default' => 'Dever::call("Porder/Manage/Source/Refund.show", ["type", "{type}"])',
+                'default' => 'Dever::call("Porder/Manage/Lib/Source/Refund.show", ["type", "{type}"])',
             ],
             'desc_type' => [
                 'type' => 'show',
-                'default' => 'Dever::call("Porder/Manage/Source/Refund.show", ["desc_type", "{desc_type}"])',
+                'default' => 'Dever::call("Porder/Manage/Lib/Source/Refund.show", ["desc_type", "{desc_type}"])',
             ],
             'info' => [
                 'type' => 'show',
                 'name' => '退货信息',
-                'default' => 'Dever::call("Porder/Manage/Source/Refund.showDelivery", ["{id}"])',
+                'default' => 'Dever::call("Porder/Manage/Lib/Source/Refund.showDelivery", ["{id}"])',
             ],
             'audit' => [
                 'name' => '退货审核',

+ 2 - 2
src/place/role/app/Lib/Info.php

@@ -126,8 +126,8 @@ class Info
             if (is_string($role)) {
                 $role = explode(',', $role);
             }
-            $role = Dever::db('prole/info')->find($role[0]);
-            $result = $role['name'];
+            $info = Dever::db('prole/info')->find($role[0]);
+            $result = $info['name'];
             if (isset($role[1])) {
                 $level = Dever::db('prole/level')->find($role[1]);
                 $result .= '.' . $level['name'];

+ 4 - 4
src/place/role/app/Lib/Price.php

@@ -32,8 +32,8 @@ class Price
         }
 
         # 促销 必须登录才有
-        if ($this->place['uid']) {
-            $info['promotion'] = Dever::load(\Pbenefit\Lib\Item::class)->load('promotion')->get($this->place['uid'], $info['scope'], $info['price'], $set['score']['exp']);
+        if ($this->place->uid) {
+            $info['promotion'] = Dever::load(\Pbenefit\Lib\Item::class)->load('promotion')->get($this->place->uid, $info['scope'], $info['price'], $set['score']['exp']);
             if ($info['promotion']) {
                 $info['price'] = $info['promotion']['price'];
                 $promotion[] = $info['promotion'];
@@ -72,9 +72,9 @@ class Price
             $info['total_price'] = Dever::math('mul', $info['price'], $buy_num);
         } else {
             # 返利
-            if ($this->place['uid']) {
+            if ($this->place->uid) {
                 $info['money'] = Dever::math('mul', $info['total_price'], $set['score']['exp']);
-                $info['rebate'] = Dever::load(\Pbenefit\Lib\Item::class)->load('rebate')->get($this->place['uid'], $info['scope'], $info['money'], $rebate);
+                $info['rebate'] = Dever::load(\Pbenefit\Lib\Item::class)->load('rebate')->get($this->place->uid, $info['scope'], $info['money'], $rebate);
             }
 
             # 获取促销标签

+ 8 - 13
src/place/role/app/Lib/User.php

@@ -1,13 +1,7 @@
 <?php namespace Prole\Lib;
 use Dever;
-use Place;
 class User
 {
-    public function __construct(Place $place)
-    {
-        $this->place = $place;
-    }
-    
     # 检测是否开通相关身份
     public function check($uid, $info_id, $level_id)
     {
@@ -23,8 +17,9 @@ class User
 
     public function getInfo($id)
     {
+        $this->place = Dever::get(\Place::class);
         $user = [
-            'logo' => $this->place['logo'],
+            'logo' => $this->place->info['logo'],
             'sign' => '',
             'level_id' => 0,
             'level' => 0,
@@ -35,11 +30,11 @@ class User
             'card' => '开通立享权益',
             'button' => '立即开通',
         ];
-        if ($this->place['uid']) {
-            $user['logo'] = $this->place['user']['avatar'];
-            $user['name'] = $this->place['user']['name'];
-            $user['sign'] = $this->place['user']['sign'];
-            $info = Dever::db('prole/user')->find(['uid' => $this->place['uid'], 'info_id' => $id]);
+        if ($this->place->uid) {
+            $user['logo'] = $this->place->user['avatar'];
+            $user['name'] = $this->place->user['name'];
+            $user['sign'] = $this->place->user['sign'];
+            $info = Dever::db('prole/user')->find(['uid' => $this->place->uid, 'info_id' => $id]);
             if ($info) {
                 if ($info['edate'] > time()) {
                     $level = Dever::db('prole/level')->find(['id' => $info['level_id'], 'status' => 1]);
@@ -132,7 +127,7 @@ class User
                 }
             } else {
                 $data['edate'] += $date;
-                $data['card'] = Dever::load(\Api\Lib\Util::class)->createNumber('', 'Prole/user', [], 'card');
+                $data['card'] = Dever::load(\Api\Lib\Util::class)->createNumber('', 'prole/user', [], 'card');
                 $state = Dever::db('prole/user')->insert($data);
             }
             if ($state) {

+ 0 - 6
src/place/role/manage/level.php

@@ -22,12 +22,6 @@ return [
         ],
     ],
     'update' => [
-        /*
-        'tab' => [
-            '基本信息' => 'name,level,info,price,pay,day,content',
-            '权益设置' => 'Prole/profit_buy,Prole/profit_sale,Prole/profit_partner',
-        ],
-        */
         'control' => [
             'pay' => 'type=1',
             'pay_price' => 'type=1',

+ 1 - 1
src/place/role/table/level.php

@@ -7,7 +7,7 @@ return [
         'info_id'        => [
             'name'      => '身份',
             'type'      => 'int(11)',
-            'value'     => 'Prole/info',
+            'value'     => 'prole/info',
         ],
 
         'name' => [

+ 6 - 6
src/place/score/app/Lib/Log.php

@@ -1,4 +1,4 @@
-<?php namespace PlaceScore\Lib;
+<?php namespace Pscore\Lib;
 use Dever;
 class Log
 {
@@ -16,7 +16,7 @@ class Log
     public function add_commit(){}
     public function add($uid, $desc = '', $num = 0, $status = 1, $relation = '', $sales_type = 0, $sales_id = 0)
     {
-        $this->place['uid'] = $uid;
+        $this->uid = $uid;
         $this->status = $status;
         if (!$this->action_id) {
             Dever::error('用户行为错误');
@@ -183,7 +183,7 @@ class Log
         # 有上限限制
         $limit = $rule['upper_limit'];
         # 获取用户最新一次积分变化日志
-        $where['uid'] = $this->place['uid'];
+        $where['uid'] = $this->uid;
         $where['info_id'] = $rule['info_id'];
         $where['action_id'] = $rule['action_id'];
         $log = Dever::db('pscore/user_log')->find($where);
@@ -214,8 +214,8 @@ class Log
             return ['id' => 0];
         }
         # 获取账户信息
-        $user = Dever::load(User::class)->get($this->place['uid'], $info_id);
-        $data['uid'] = $this->place['uid'];
+        $user = Dever::load(User::class)->get($this->uid, $info_id);
+        $data['uid'] = $this->uid;
         $data['info_id'] = $info_id;
         $data['user_id'] = $user['id'];
         $data['action_id'] = $this->action_id;
@@ -244,7 +244,7 @@ class Log
             if ($sales_type && $sales_id && $data['amount'] > 0) {
                 $score = Dever::load(Info::class)->get($info_id);
                 $money = Dever::load(Info::class)->toMoney($data['amount'], $score['exp']);
-                Dever::load('profit', 'Psales')->up($data['uid'], $data['user_id'], $data['id'], $data['info_id'], $data['action_id'], $sales_type, $sales_id, $data['amount'], $money);
+                Dever::load(\Psales\Lib\Profit::class)->up($data['uid'], $data['user_id'], $data['id'], $data['info_id'], $data['action_id'], $sales_type, $sales_id, $data['amount'], $money);
             }
         }
         return $data;

+ 1 - 0
src/place/set/app/Api/Tool.php

@@ -23,6 +23,7 @@ class Tool
         $sales_type = Dever::input('sales_type');
         $sales_id = Dever::input('sales_id');
         $result = Dever::load(\Place\Lib\Info::class)->share($id, $sales_type, $sales_id, 0, true);
+        print_r($result);die;
         header('HTTP/1.1 301 Moved Permanently');
         header('location:' . $result['url']);
     }

+ 7 - 6
src/place/set/app/Lib/Info.php

@@ -6,17 +6,18 @@ class Info
 {
     public function money()
     {
-        if (isset(Dever::$data['money'])) {
-            return Dever::$data['money'];
+        if ($money = Dever::getData('money')) {
+            return $money;
         }
         if ($muser = Dever::getData('muser')) {
             $place_id = $muser['select']['data_id'];
             $place = Dever::db('place/info')->find($place_id);
-            Dever::$data['money'] = Dever::db('sector/money')->find($place['money_id']);
+            $money = Dever::db('sector/money')->find($place['money_id']);
         } else {
-            Dever::$data['money'] = Dever::load(Place::class)->money();
+            $money = Dever::get(Place::class)->money();
         }
-        return Dever::$data['money'];
+        Dever::setData('money', $money);
+        return $money;
     }
 
     # 生成分享需要的东西
@@ -54,7 +55,7 @@ class Info
             $result['h5_ercode'] = '';
             
 
-            $code = Dever::load(Place\Lib\Account::class)->getAppletCode('weixin', 5, 'code=' . $info['code'] . '&jump=', 'pages/main', 'develop');
+            $code = Dever::load(\Place\Lib\Account::class)->getAppletCode('weixin', 5, 'code=' . $info['code'] . '&jump=', 'pages/main', 'develop');
             # 小程序码
             $result['applet'] = [
                 # 微信小程序

+ 1 - 1
src/place/set/manage/Lib/Profit.php

@@ -17,7 +17,7 @@ class Profit
     public function getInfo($cate = true)
     {
         if ($cate) {
-            $channel = Dever::load(Psource\Manage\Lib\Cate::class)->getList(false);
+            $channel = Dever::load(\Psource\Manage\Lib\Cate::class)->getList(false);
         } else {
             $channel = Dever::db('psource/channel')->select(['status' => 1]);
         }

+ 1 - 1
src/place/set/manage/account.php

@@ -4,7 +4,7 @@ $show = false;
 $account_setting = [];
 $desc = '';
 if ($id) {
-    $account = Dever::load(Place\Lib\Account::class)->getInfo(['id' => $id]);
+    $account = Dever::load(\Place\Lib\Account::class)->getInfo(['id' => $id]);
     $desc = $account['desc'];
     $setting = Dever::db('api/platform_setting')->select(['platform_id' => $account['platform_id']]);
     if ($setting) {

+ 1 - 0
src/place/set/table/account_sms.php

@@ -2,6 +2,7 @@
 return [
     'name' => '短信设置',
     'partition' => 'Dever::call("Manage/Lib/Util.system")',
+    'order' => 'id asc',
     'struct' => [
         'account_id'        => [
             'type'      => 'int(11)',

+ 10 - 0
src/place/source/app/Api/Test.php

@@ -0,0 +1,10 @@
+<?php namespace Psource\Api;
+use Dever;
+class Test
+{
+    # 获取资源信息
+    public function get()
+    {
+        Dever::load(\Prole\Lib\User::class)->up(1,1,1);
+    }
+}

+ 6 - 6
src/place/source/app/Lib/Cart.php

@@ -7,7 +7,7 @@ class Cart
     # 购物车列表
     public function getList()
     {
-        $where['uid'] = $this->place['uid'];
+        $where['uid'] = $this->place->uid;
         $set = [];
         //$set['num'] = 100;
         $data = Dever::db('goods/cart')->select($where, $set);
@@ -41,7 +41,7 @@ class Cart
     # 购物车增减
     public function up($info_id, $sku_id, $num)
     {
-        $data['uid'] = $this->place['uid'];
+        $data['uid'] = $this->place->uid;
         $data['info_id'] = $info_id;
         $data['sku_id'] = $sku_id;
 
@@ -73,7 +73,7 @@ class Cart
     # 购物车选中状态
     public function edit($info_id, $sku_id, $status)
     {
-        $data['uid'] = $this->place['uid'];
+        $data['uid'] = $this->place->uid;
         $data['info_id'] = $info_id;
         $data['sku_id'] = $sku_id;
         $info = Dever::db('goods/cart')->find($data);
@@ -86,7 +86,7 @@ class Cart
     # 删除资源
     public function delete($info_id, $sku_id)
     {
-        $data['uid'] = $this->place['uid'];
+        $data['uid'] = $this->place->uid;
         $data['info_id'] = $info_id;
         $data['sku_id'] = $sku_id;
         Dever::db('goods/cart')->delete($data);
@@ -95,7 +95,7 @@ class Cart
 
     public function drop()
     {
-        $data['uid'] = $this->place['uid'];
+        $data['uid'] = $this->place->uid;
         Dever::db('goods/cart')->delete($data);
         return $this->getList();
     }
@@ -103,7 +103,7 @@ class Cart
     public function confirm()
     {
         //$id = Dever::input('ids', 'is_string', '请选择资源');
-        $where['uid'] = $this->place['uid'];
+        $where['uid'] = $this->place->uid;
         $where['status'] = 1;
         $data = Dever::db('goods/cart')->select($where);
         if ($data) {

+ 15 - 13
src/place/source/app/Lib/Info.php

@@ -64,13 +64,13 @@ class Info
             if (isset($pic[0])) {
                 $info['cover'] = $pic[0];
             }
-            $info = Dever::load(\Psource\Lib\Price::class)->get($info, $cate, -1);
+            $info = Dever::load(Price::class)->get($info, $cate, -1);
         }
         return $info;
     }
 
     # 获取资源详细信息
-    public function getInfo($id)
+    public function getInfo($uid, $id)
     {
         $info = Dever::db('psource/info')->find(['id' => $id, 'status' => 1], ['col' => 'id,name,info,price,sku_id,pic,content,channel_id,cate_parent_id,cate_id,have_vip,num_sell']);
         if (!$info) {
@@ -79,7 +79,7 @@ class Info
         # 分类
         $cate = Dever::load(Cate::class)->getInfo($info['cate_id']);
         # 价格
-        $info = Dever::load(\Psource\Lib\Price::class)->get($info, $cate, -1);
+        $info = Dever::load(Price::class)->get($info, $cate, -1);
         $info['pic'] = explode(',', $info['pic']);
         $info['content'] = htmlspecialchars_decode($info['content']);
         if ($info['content'] == '<p><br></p>') {
@@ -88,20 +88,22 @@ class Info
         # 获取sku基本信息
         $sku = Dever::db('psource/sku')->find($info['sku_id']);
         if ($sku) {
-            $info['sku_name'] = Dever::load(\Api\Lib\Sku::class)->getName($sku['key'], 'Psource');
+            $info['sku_name'] = Dever::load(\Api\Lib\Sku::class)->getName($sku['key'], 'psource');
         }
 
         # 查看是否专享
-        $info['have_vip'] = Dever::load(\Psource\Lib\Price::class)->getHave($info);
+        $info['have_vip'] = Dever::load(Price::class)->getHave($info);
 
         # 展示说明
         $info['help'] = Dever::load(Help::class)->getList($cate['help_cate_id']);
 
         # 是否收藏
         $info['collect'] = false;
-        $act = new Act('collect', 1, $info['id']);
-        if ($act->getInfo()) {
-            $info['collect'] = true;
+        if ($uid) {
+            $act = Act::load('collect', $uid, 1, $info['id']);
+            if ($act->getInfo()) {
+                $info['collect'] = true;
+            }
         }
         return $info;
     }
@@ -117,14 +119,14 @@ class Info
         # 分类
         $cate = Dever::load(Cate::class)->getInfo($info['cate_id']);
 
-        $sku = Dever::load(\Api\Lib\Sku::class)->getList(['info_id' => $info['id']], $info['sku_id'], 'Psource');
+        $sku = Dever::load(\Api\Lib\Sku::class)->getList(['info_id' => $info['id']], $info['sku_id'], 'psource');
 
         if ($sku['info']) {
-            $sku['info'] = Dever::load(\Psource\Lib\Price::class)->get($sku['info'], $cate, -1);
+            $sku['info'] = Dever::load(Price::class)->get($sku['info'], $cate, -1);
         }
         if ($sku['price']) {
             foreach ($sku['price'] as &$price) {
-                $price = Dever::load(\Psource\Lib\Price::class)->get($price, $cate, -1);
+                $price = Dever::load(Price::class)->get($price, $cate, -1);
             }
         }
         return $sku;
@@ -143,7 +145,7 @@ class Info
     # 获取资源编号或者ID
     public function getCode($id, $encode = true)
     {
-        if (isset(Dever::getData('muser'))) {
+        if (Dever::getData('muser')) {
             $salt = Dever::getData('muser')['select']['data_id'];//品牌id
             $xorkey = Dever::getData('muser')['id'];//当前登录的管理员id
         } else {
@@ -186,7 +188,7 @@ class Info
         (
             array
             (
-                'table' => 'Psource_info',
+                'table' => 'psource_info',
                 'type' => 'left join',
                 'on' => 'main.info_id=t0.id',
             ),

+ 7 - 7
src/place/source/app/Lib/Price.php

@@ -34,8 +34,8 @@ class Price
 
         # 促销 必须登录才有
         $info['promotion'] = $info['rebate'] = [];
-        if ($this->place['uid']) {
-            $info['promotion'] = Dever::load(\Pbenefit\Lib\Item::class)->load('promotion')->get($this->place['uid'], $info['scope'], $info['price'], $set['score']['exp']);
+        if ($this->place->uid) {
+            $info['promotion'] = Dever::load(\Pbenefit\Lib\Item::class)->load('promotion')->get($this->place->uid, $info['scope'], $info['price'], $set['score']['exp']);
             if ($info['promotion']) {
                 $info['price'] = $info['promotion']['price'];
             }
@@ -82,9 +82,9 @@ class Price
             */
         } else {
             # 返利
-            if ($this->place['uid']) {
+            if ($this->place->uid) {
                 $info['money'] = Dever::math('mul', $info['total_price'], $set['score']['exp']);
-                $info['rebate'] = Dever::load(\Pbenefit\Lib\Item::class)->load('rebate')->get($this->place['uid'], $info['scope'], $info['money'], $rebate);
+                $info['rebate'] = Dever::load(\Pbenefit\Lib\Item::class)->load('rebate')->get($this->place->uid, $info['scope'], $info['money'], $rebate);
             }
 
             # 获取促销标签
@@ -103,8 +103,8 @@ class Price
             $where['id'] = ['in', $info['have_vip']];
             $level = Dever::db('prole/level')->select($where, ['col' => 'id,name,info_id']);
             if ($level) {
-                if ($this->place['uid'] && !isset($this->place['user']['role_level'])) {
-                    $this->place['user']['role_level'] = Dever::db('puser/role')->getLevel($this->place['uid']);
+                if ($this->place->uid && !isset($this->place->user['role_level'])) {
+                    $this->place->user['role_level'] = Dever::db('puser/role')->getLevel($this->place->uid);
                 }
                 $role = [];
                 foreach ($level as $v) {
@@ -113,7 +113,7 @@ class Price
                         $role[$v['info_id']]['list'] = [];
                     }
                     $role[$v['info_id']]['list'][] = $v;
-                    if ($this->place['user']['role_level'] && in_array($v['id'], $this->place['user']['role_level'])) {
+                    if ($this->place->user['role_level'] && in_array($v['id'], $this->place->user['role_level'])) {
                         $result['status'] = 1;
                     }
                 }

+ 4 - 4
src/place/source/manage/Api/Main.php

@@ -5,7 +5,7 @@ class Main
     # 获取导入模板
     public function getSourceExcel()
     {
-        return Dever::load(Psource\Lib\Manage\Excel::class)->getTemplate(true);
+        return Dever::load(\Psource\Manage\Lib\Excel::class)->getTemplate(true);
     }
 
     # 获取规格信息
@@ -14,12 +14,12 @@ class Main
         return Dever::load(\Manage\Lib\Util::class)->cascader(2, function($level, $parent) {
             if ($level == 1) {
                 $search = Dever::input('search');
-                $data = Dever::load(Psource\Lib\Info::class)->getListByCate($search);
+                $data = Dever::load(\Psource\Lib\Info::class)->getListByCate($search);
             } elseif ($level == 2) {
                 $data = Dever::db('psource/sku')->select(['info_id' => $parent, 'state' => 1]);
                 if ($data) {
                     foreach ($data as &$v) {
-                        $v['name'] = Dever::load(\Api\Lib\Sku::class)->getName($v['key'], 'Psource');
+                        $v['name'] = Dever::load(\Api\Lib\Sku::class)->getName($v['key'], 'psource');
                         if (!$v['name']) {
                             $v['name'] = '无规格';
                         }
@@ -75,7 +75,7 @@ class Main
             $result = [];
             $result['source_id']['value'] = [];
             $value = implode(',', $value);
-            $result['source_id']['remote'] = Dever::url('Psource/manage/api.getInfo', ['search' => $value]);
+            $result['source_id']['remote'] = Dever::url('Psource/Manage/Api/Main.getInfo', ['search' => $value]);
             return $result;
         }
     }

+ 1 - 1
src/place/source/manage/Lib/Cate.php

@@ -33,7 +33,7 @@ class Cate
     # 获取分类信息
     public function getInfo($cate = '')
     {
-        return Dever::load(Psource\Lib\Channel::class)->getName($cate);
+        return Dever::load(\Psource\Lib\Channel::class)->getName($cate);
     }
 
     # 获取分类图标

+ 2 - 2
src/place/source/manage/Lib/Excel.php

@@ -39,7 +39,7 @@ class Excel
                 $s = [$v['id'], $v['ids'], $v['name'], $channel['name'], $parent['name'] ?? '', $child['name'] ?? '', $v['type'], $v['price']];
                 foreach ($sku as $v1) {
                     $s[8] = $v1['code'];
-                    $s[9] = Dever::load(\Api\Lib\Sku::class)->getName($v1['key'], 'Psource', true);
+                    $s[9] = Dever::load(\Api\Lib\Sku::class)->getName($v1['key'], 'psource', true);
                     $s[10] = $v1['price'];
                     $result['body'][] = $s;
                 }
@@ -203,7 +203,7 @@ class Excel
                         Dever::db('psource/sku')->insert($sku_data);
                     }
 
-                    $sku = Dever::load(\Api\Lib\Sku::class)->getPrice(['info_id' => $id], $update['spec_type'], 'Psource');
+                    $sku = Dever::load(\Api\Lib\Sku::class)->getPrice(['info_id' => $id], $update['spec_type'], 'psource');
                     $update['price'] = $sku['price'];
                     $update['sku_id'] = $sku['id'];
                     Dever::db('psource/info')->update($id, $update);

+ 3 - 3
src/place/source/manage/Lib/Info.php

@@ -9,7 +9,7 @@ class Info
             if (!$data['import']) {
                 Dever::error('请选择导入文件');
             }
-            Dever::load(Psource\Lib\Manage\Excel::class)->import($data['import']);
+            Dever::load(\Psource\Lib\Manage\Excel::class)->import($data['import']);
             return 'end';
         }
         if ($data['cate']) {
@@ -25,7 +25,7 @@ class Info
                 $update['cate_id'] = $data['cate'][2];
             }
             # 更新价格
-            $sku = Dever::load(\Api\Lib\Sku::class)->getPrice(['info_id' => $data['id']], $data['spec_type'], 'Psource');
+            $sku = Dever::load(\Api\Lib\Sku::class)->getPrice(['info_id' => $data['id']], $data['spec_type'], 'psource');
             $update['price'] = $sku['price'];
             $update['sku_id'] = $sku['id'];
             $db->update($data['id'], $update);
@@ -51,7 +51,7 @@ class Info
     # 根据资源编号获取资源id
     public function getIdByCode($value)
     {
-        $info = Dever::load(Psource\Lib\Info::class)->getCode($value, false);
+        $info = Dever::load(\Psource\Lib\Info::class)->getCode($value, false);
         return ['source_id', 'in', $info];
     }
 

+ 2 - 2
src/place/source/manage/cate.php

@@ -54,9 +54,9 @@ return [
         'button' => [
             '新增主分类' => ['fastadd', ['parent_id' => '0', 'channel_id' => $channel_id]],
             '热搜推荐词' => ['route', [
-                'path' => 'sector_psource/search',
+                'path' => 'sector_place_source/search',
                 'param' => [
-                    'set' => ['channel_id' => $channel_id, 'menu' => 'sector_psource/cate', 'parent' => 'sector_psource/cate'],
+                    'set' => ['channel_id' => $channel_id, 'menu' => 'sector_place_source/cate', 'parent' => 'sector_place_source/cate'],
                 ],
             ]],
         ],

+ 4 - 4
src/place/source/manage/content.php

@@ -7,7 +7,7 @@ $config = [
         'field'      => [
             'name',
             'cate_id' => [
-                'show' => 'Dever::field("Psource/content_cate", "{cate_id}")',
+                'show' => 'Dever::field("psource/content_cate", "{cate_id}")',
             ],
             'sku_id' => [
                 'show' => 'Dever::call("Psource/manage/sku.getName", "{sku_id}")',
@@ -23,13 +23,13 @@ $config = [
         'button' => [
             '新增' => ['add', ['info_id' => $info_id]],
             '添加分类' => ['fastadd', [
-                'path' => 'sector_psource/content_cate',
+                'path' => 'sector_place_source/content_cate',
                 'field' => ['info_id' => $info_id],
             ]],
             '分类列表' => ['route', [
-                'path' => 'sector_psource/content_cate',
+                'path' => 'sector_place_source/content_cate',
                 'param' => [
-                    'set' => ['info_id' => $info_id, 'menu' => 'sector_psource/info', 'parent' => 'sector_psource/content'],
+                    'set' => ['info_id' => $info_id, 'menu' => 'sector_place_source/info', 'parent' => 'sector_place_source/content'],
                 ],
             ]],
         ],

+ 4 - 4
src/place/source/manage/help.php

@@ -11,15 +11,15 @@ return [
         'button' => [
             '新增' => ['fastadd'],
             '类别' => ['route', [
-                'path' => 'sector_psource/help_cate',
+                'path' => 'sector_place_source/help_cate',
                 'param' => [
-                    'set' => ['menu' => 'sector_psource/help', 'parent' => 'sector_psource/help'],
+                    'set' => ['menu' => 'sector_place_source/help', 'parent' => 'sector_place_source/help'],
                 ],
             ]],
             '栏目' => ['route', [
-                'path' => 'sector_psource/help_column',
+                'path' => 'sector_place_source/help_column',
                 'param' => [
-                    'set' => ['menu' => 'sector_psource/help', 'parent' => 'sector_psource/help'],
+                    'set' => ['menu' => 'sector_place_source/help', 'parent' => 'sector_place_source/help'],
                 ],
             ]],
         ],

+ 11 - 11
src/place/source/manage/info.php

@@ -42,11 +42,11 @@ $config = [
         'button' => [
             '新增' => ['add'],
             '导入' => ['fastadd', [
-                'path' => 'sector_psource/import',
+                'path' => 'sector_place_source/import',
             ]],
             /*
             '更改状态' => ['oper', [
-                'path' => 'sector_psource/info',
+                'path' => 'sector_place_source/info',
                 'field' => 'status',
             ]],*/
         ],
@@ -54,9 +54,9 @@ $config = [
         'data_button' => [
             '编辑' => 'edit',
             '内容' => ['route', [
-                'path' => 'sector_psource/content',
+                'path' => 'sector_place_source/content',
                 'param' => [
-                    'set' => ['info_id' => 'id', 'menu' => 'sector_psource/info', 'parent' => 'sector_psource/info'],
+                    'set' => ['info_id' => 'id', 'menu' => 'sector_place_source/info', 'parent' => 'sector_place_source/info'],
                     # 打开新页面
                     //'open' => true,
                 ],
@@ -67,9 +67,9 @@ $config = [
         'data_button_list' => [
             '编辑' => 'edit',
             '内容' => ['route', [
-                'path' => 'sector_psource/content',
+                'path' => 'sector_place_source/content',
                 'param' => [
-                    'set' => ['info_id' => 'id', 'menu' => 'sector_psource/info', 'parent' => 'sector_psource/info'],
+                    'set' => ['info_id' => 'id', 'menu' => 'sector_place_source/info', 'parent' => 'sector_place_source/info'],
                 ],
             ]],
         ],*/
@@ -94,11 +94,11 @@ $config = [
     'update' => [
         'end' => 'Psource/Manage/Lib/Info.update',
         'control' => [
-            'Psource/sku' => [
+            'psource/sku' => [
                 'spec_type' => 2,
             ],
 
-            'Psource/sku#' => [
+            'psource/sku#' => [
                 'spec_type' => 3,
             ],
         ],
@@ -112,7 +112,7 @@ $config = [
             ],
             '价格设置' => 'spec_type,psource/sku,psource/sku#',
             '限制设置' => 'have_vip',
-            //'奖励设置' => 'Psource/info_benefit',
+            //'奖励设置' => 'psource/info_benefit',
         ],
         'field'    => [
             'name' => [
@@ -192,7 +192,7 @@ $config = [
                 # 获取规格数据的接口
                 'spec_data' => 'Api/Lib/Spec.manage',
                 # 获取规格模版的接口,这里直接用path
-                'spec_template' => 'sector_psource/spec_import',
+                'spec_template' => 'sector_place_source/spec_import',
                 'desc' => '如需设置库存,请到“资源库存”中设置,不设置库存则无库存',
                 'disable' => false,
             ],
@@ -205,7 +205,7 @@ $config = [
             'ad' => [
                 'desc' => '直接输入10,就是看激励广告将抵扣当前价格的10%,输入0,看广告后本资源免费',
             ],
-            'Psource/info_benefit' => [
+            'psource/info_benefit' => [
                 'name' => '奖励权益',
                 'tip' => '用户购买资源后并确认收货后,将发放奖励到权益中',
                 'where'  => ['info_id' => 'id'],

+ 1 - 1
src/place/source/manage/sku.php

@@ -4,7 +4,7 @@ return [
         'field'    => [
             'key' => [
                 'type' => 'hidden',
-                'remote' => 'Api/Lib/Manage.keyToField?project=Psource',
+                'remote' => 'Api/Api/Manage.keyToField?project=psource',
             ],
             'pic' => [
                 'type' => 'upload',

+ 1 - 1
src/place/source/table/ad.php

@@ -12,7 +12,7 @@ return [
             'name'      => '渠道',
             'type'      => 'int(11)',
             'default'   => -1,
-            //'value'     => 'Psource/channel',
+            //'value'     => 'psource/channel',
         ],
         'cate_id' => [
             'name'      => '分类',

+ 11 - 2
src/place/stock/app/Lib/Info.php

@@ -7,13 +7,22 @@ class Info
 
     public function init($type = '', $type_id = '')
     {
+        $this->where = [];
+        $this->table = 'info';
         if ($type && $type_id) {
             $this->where['sales_type'] = $type;
             $this->where['sales_id'] = $type_id;
             $this->table = 'sales';
         } else {
-            $this->where = [];
-            $this->table = 'info';
+            if (class_exists('\\Place')) {
+                if ($place = Dever::get('Place')) {
+                    if ($place->info['sales_type'] && $place->info['sales_id']) {
+                        $this->where['sales_type'] = $place->info['sales_type'];
+                        $this->where['sales_id'] = $place->info['sales_id'];
+                        $this->table = 'sales';
+                    }
+                }
+            }
         }
     }
 

+ 1 - 1
src/place/stock/manage/Lib/Info.php

@@ -42,7 +42,7 @@ class Info
                 }
             }
         } else {
-            $source = Dever::load(Psource\Lib\Info::class)->getSkuByCate($data['cate']);
+            $source = Dever::load(\Psource\Lib\Info::class)->getSkuByCate($data['cate']);
             foreach ($source as $v) {
                 Dever::load(\Pstock\Lib\Info::class)->oper($sales_type, $sales_id, $v['info_id'], $v['id'], $data['type'], $data['num'], $data['desc']);
             }

+ 6 - 6
src/place/stock/manage/platform_stock.php

@@ -17,7 +17,7 @@ $config = [
             ],
             'sku_id' => [
                 'name' => '规格',
-                'show' => 'Dever::call("Psource/Lib/Sku.getName", [{sku_id}])',
+                'show' => 'Dever::call("Psource/Manage/Lib/Sku.getName", [{sku_id}])',
             ],
             'in',
             'out',
@@ -29,9 +29,9 @@ $config = [
         ],
         'data_button' => [
             '记录' => ['route', [
-                'path' => 'sector_psource/platform_stock_log',
+                'path' => 'sector_place_source/platform_stock_log',
                 'param' => [
-                    'set' => ['stock_id' => 'id', 'menu' => 'psales/platform_stock', 'parent' => 'sector_psource/platform_stock'],
+                    'set' => ['stock_id' => 'id', 'menu' => 'psales/platform_stock', 'parent' => 'sector_place_source/platform_stock'],
                 ],
             ]],
         ],
@@ -60,7 +60,7 @@ $config = [
                 'check' => true,
                 'type' => 'cascader',
                 'option'    => 'Dever::call("Psource/Manage/Lib/Cate.getList")',
-                'remote' => 'Psource/manage/api.getSkuList',
+                'remote' => 'Psource/Manage/Api/Main.getSkuList',
                 'clearable' => true,
                 'width' => '100%',
             ],
@@ -70,7 +70,7 @@ $config = [
                 'check' => true,
                 'multiple' => true,
                 'type' => 'cascader',
-                //'remote'    => 'Psource/manage/api.getInfo',
+                //'remote'    => 'Psource/Manage/Lib/Api.getInfo',
                 'clearable' => true,
                 'desc' => '不选择资源或具体规格,则会批量添加该资源库存',
                 'width' => '100%',
@@ -92,7 +92,7 @@ $config = [
                 # 打开选择弹窗
                 'open' => [
                     'name' => '选择',
-                    'path' => 'sector_psource/open_sku',
+                    'path' => 'sector_place_source/open_sku',
                     'param' => [
                         'set' => ['stock_id' => 'id', 'menu' => 'sector_source/stock', 'parent' => 'sector_source/stock'],
                     ],

+ 1 - 1
src/place/stock/manage/platform_stock_log.php

@@ -14,7 +14,7 @@ $config = [
             ],
             'sku_id' => [
                 'name' => '规格',
-                'show' => 'Dever::call("Psource/Lib/Sku.getName", [{sku_id}])',
+                'show' => 'Dever::call("Psource/Manage/Lib/Sku.getName", [{sku_id}])',
             ],
             'type',
             'desc',

+ 3 - 2
src/place/user/app/Lib/Address.php

@@ -7,6 +7,7 @@ class Address
     public function init($uid)
     {
         $this->uid = $uid;
+        return $this;
     }
     public function getDefault($type = 1)
     {
@@ -38,10 +39,10 @@ class Address
     }
 
     # 获取某个收货地址
-    public function getInfo($id, $uid)
+    public function getInfo($id)
     {
         $where['id'] = $id;
-        $where['uid'] = $uid;
+        $where['uid'] = $this->uid;
         $info = Dever::db('puser/address')->find($where, ['col' => $this->col]);
         if ($info && Dever::project('area')) {
             $info = $this->handleInfo($info);

+ 1 - 1
src/place/user/app/Lib/Coupon.php

@@ -36,7 +36,7 @@ class Coupon
         }
         $set['join'] = [
             [
-                'table' => 'Pbenefit_coupon',
+                'table' => 'pbenefit_coupon',
                 'type' => 'left join',
                 'on' => 't0.id=main.coupon_id',
             ],

+ 1 - 1
src/place/user/app/Lib/Gift.php

@@ -10,7 +10,7 @@ class Gift
         }
         $set['join'] = [
             [
-                'table' => 'Pbenefit_gift',
+                'table' => 'pbenefit_gift',
                 'type' => 'left join',
                 'on' => 't0.id=main.gift_id',
             ],

+ 1 - 1
src/place/user/app/Lib/Perk.php

@@ -10,7 +10,7 @@ class Perk
         }
         $set['join'] = [
             [
-                'table' => 'Pbenefit_perk',
+                'table' => 'pbenefit_perk',
                 'type' => 'left join',
                 'on' => 't0.id=main.perk_id',
             ],

+ 3 - 3
src/place/user/manage/Api/User.php

@@ -1,10 +1,10 @@
-<?php namespace Puser\Manage\Lib;
+<?php namespace Puser\Manage\Api;
 use Dever;
-class Api
+class User
 {
     # 获取用户导入模板
     public function getUserExcel()
     {
-        return Dever::load('manage/excel', 'Puser')->getTemplate([], true);
+        return Dever::load(\Puser\Manage\Lib\Excel::class)->getTemplate([], true);
     }
 }

+ 1 - 1
src/place/user/manage/Lib/User.php

@@ -15,7 +15,7 @@ class User
         if (isset($data['mobile']) && $data['mobile']) {
             $data['type'] = 1;
             if (isset($data['id']) && $data['id'] > 0) {
-                $info = Dever::db('puser/info')->find(['mobile' => $data['mobile'], 'id' => ['!=', $data['id']]]);
+                $info = Dever::db('puser/info')->find(['mobile' => $data['mobile']]);
                 if ($info) {
                     Dever::error('手机号'.$data['mobile'].'已存在');
                 }

+ 2 - 2
src/place/user/manage/user.php

@@ -71,7 +71,7 @@ $config = [
                 'name' => '用户搜索',
                 'type' => 'select_text',
                 'option' => [
-                    ['id' => 1, 'name' => '用户ID', 'value' => 'uid'],
+                    ['id' => 1, 'name' => '用户ID', 'value' => 'id'],
                     ['id' => 2, 'name' => '用户名', 'value' => 'name'],
                     ['id' => 3, 'name' => '用户手机号', 'value' => 'mobile'],
                 ],
@@ -164,7 +164,7 @@ $config = [
                 # 更新时的值,始终是空的,有值才更新
                 'update' => '',
                 # 对更新的值进行处理
-                'handle' => 'manage/util.createPwd',
+                'handle' => 'Manage/Lib/Util.createPwd',
                 # 空值不允许入库
                 'empty'  => false,
                 'rules'     => [

+ 1 - 1
src/place/user/table/search.php

@@ -41,6 +41,6 @@ return [
     ],
 
     'index' => [
-        'search' => 'uid,channel_id,page',
+        'search' => 'uid,channel_id',
     ],
 ];

+ 7 - 2
src/sector/app/Lib/Delivery.php

@@ -29,7 +29,7 @@ class Delivery
                 # 快递要获取单号
                 $log = Dever::db('sector/delivery_log')->find(['number' => $info['content']]);
                 if ($log) {
-                    if ($log['status'] == 1 && $log['content'] && $log['content'] != '[]') {
+                    if ($log['status'] == 1 && $log['content']) {
                         $info['log'] = Dever::json_decode($log['content']);
                     } else {
                         if (time() - $log['udate'] > 3600) {
@@ -50,7 +50,8 @@ class Delivery
                         if ($detail['address_id']) {
                             if (strstr($detail['address_id'], '_')) {
                                 $temp = explode('_', $detail['address_id']);
-                                $address = Dever::load('info', 'place_channel_' . $temp[0])->get($temp[1], $temp[2]);
+                                $address = Dever::load('P' . $temp[0] . '\\Lib\\Info')->get($temp[1], $temp[2]);
+                                //$address = Dever::load('info', 'place_channel_' . $temp[0])->get($temp[1], $temp[2]);
                                 $mobile = $address['mobile'];
                             } else {
                                 $address = Dever::db('place/address')->find($detail['address_id']);
@@ -76,6 +77,10 @@ class Delivery
         $data = Dever::load(\Api\Lib\Account::class)->run('aliyun_market', 'express', $param, 1, 'run', 'place');
         //$data['data']['list'] = [];
         //$data['data']['state'] = 3;
+        if (empty($data['data']['list'])) {
+            $data['data']['list'] = [];
+            $data['data']['state'] = 1;
+        }
         if ($data && isset($data['data']['list'])) {
             if ($data['data']['state'] == 3) {
                 # 已签收