wupengfei 1 year ago
parent
commit
2f318a5db3
100 changed files with 1756 additions and 675 deletions
  1. 2 2
      .idea/deployment.xml
  2. 3 3
      .idea/webServers.xml
  3. 133 32
      .idea/workspace.xml
  4. 3 0
      application/api/controller/Activity.php
  5. 2 2
      application/api/controller/Alipay.php
  6. 27 10
      application/api/controller/Article.php
  7. 20 11
      application/api/controller/Datum.php
  8. 19 9
      application/api/controller/Demand.php
  9. 14 0
      application/api/controller/Es.php
  10. 47 34
      application/api/controller/Expedite.php
  11. 10 5
      application/api/controller/Forum.php
  12. 41 15
      application/api/controller/LevelOrder.php
  13. 2 0
      application/api/controller/Login.php
  14. 121 68
      application/api/controller/Mall.php
  15. 158 94
      application/api/controller/Order.php
  16. 32 19
      application/api/controller/Press.php
  17. 80 3
      application/api/controller/Qc.php
  18. 36 6
      application/api/controller/Recruit.php
  19. 3 0
      application/api/controller/Report.php
  20. 12 6
      application/api/controller/Supplier.php
  21. 86 1
      application/api/controller/Task.php
  22. 60 89
      application/api/controller/Trolley.php
  23. 16 9
      application/api/controller/Video.php
  24. 1 1
      application/api/controller/WeChatPay.php
  25. 3 3
      application/common/model/ArticleIntro.php
  26. 1 1
      application/common/model/DatumIntro.php
  27. 1 1
      application/common/model/GoodsOrder.php
  28. 0 1
      application/common/model/GoodsOrderItem.php
  29. 15 0
      application/common/model/ShoppingTrolley.php
  30. 6 1
      application/common/model/StoreGoodsItem.php
  31. 95 0
      application/common/model/TopSearch.php
  32. 2 0
      application/common/model/UserFacility.php
  33. 20 0
      application/common/model/UserLoginLog.php
  34. 6 5
      application/common/model/UserMessage.php
  35. 3 2
      application/common/model/UserSearch.php
  36. 2 2
      application/common/service/CheckPower.php
  37. 3 1
      application/common/service/Elastic.php
  38. 3 1
      application/common/service/OrderCallback.php
  39. 45 9
      application/common/service/UserSynth.php
  40. 12 0
      application/mall/controller/Banner.php
  41. 41 25
      application/mall/controller/GoodsCate.php
  42. 7 5
      application/mall/view/banner/form.html
  43. 9 34
      application/mall/view/goods_cate/form.html
  44. 65 51
      application/mall/view/goods_cate/index.html
  45. 88 0
      application/mall/view/goods_cate/second.html
  46. 87 0
      application/mall/view/goods_cate/third.html
  47. 55 5
      application/mall/view/store_goods/form.html
  48. 7 1
      application/nutrition/controller/ArticleItem.php
  49. 7 1
      application/nutrition/controller/DatumUrl.php
  50. 1 1
      application/nutrition/controller/SeriesArticle.php
  51. 1 1
      application/nutrition/controller/SeriesDatum.php
  52. 2 0
      application/nutrition/controller/UserArticle.php
  53. 7 1
      application/nutrition/controller/VideoUrl.php
  54. 8 0
      application/nutrition/view/article_item/form.html
  55. 7 0
      application/nutrition/view/datum_url/form.html
  56. 1 1
      application/nutrition/view/user_article/index.html
  57. 1 1
      application/nutrition/view/user_datum/index.html
  58. 1 1
      application/nutrition/view/user_video/index.html
  59. 9 0
      application/nutrition/view/video_url/form.html
  60. 23 1
      application/operate/controller/Activity.php
  61. 4 5
      application/operate/controller/ActivityApplyItem.php
  62. 15 4
      application/operate/controller/Forum.php
  63. 7 0
      application/operate/controller/PlatformDemand.php
  64. 7 34
      application/operate/controller/Press.php
  65. 34 34
      application/operate/controller/Recruit.php
  66. 6 0
      application/operate/controller/SupplierGoods.php
  67. 8 0
      application/operate/view/activity/form.html
  68. 7 0
      application/operate/view/forum/form.html
  69. 17 0
      application/operate/view/platform_demand/form.html
  70. 18 0
      application/operate/view/press/form.html
  71. 49 12
      application/operate/view/recruit/form.html
  72. 1 1
      application/operate/view/recruit/index.html
  73. 10 10
      application/operate/view/supplier_goods/form.html
  74. BIN
      public/pc/Pig.pdf
  75. 0 0
      public/pc/css/app.bb4c0933.css
  76. 0 0
      public/pc/css/app.df7e7843.css
  77. 0 0
      public/pc/css/app.e4339fb2.css
  78. 0 0
      public/pc/css/chunk-0158d0f2.3416a8f9.css
  79. 0 0
      public/pc/css/chunk-02c759ec.20ac07ed.css
  80. 0 0
      public/pc/css/chunk-045205de.dd157d2b.css
  81. 0 0
      public/pc/css/chunk-04c77c26.d0c995ca.css
  82. 0 0
      public/pc/css/chunk-07dac8b8.a87ff257.css
  83. 0 0
      public/pc/css/chunk-09b9cff4.3bd17d86.css
  84. 0 0
      public/pc/css/chunk-0ae9193a.ccc79207.css
  85. 1 0
      public/pc/css/chunk-0b8b2ded.5d936607.css
  86. 0 0
      public/pc/css/chunk-0c4b0974.6d92e530.css
  87. 0 0
      public/pc/css/chunk-0f052369.c22c38b8.css
  88. 0 0
      public/pc/css/chunk-0f4e2198.c069e1be.css
  89. 0 0
      public/pc/css/chunk-11b83018.64d2c153.css
  90. 0 0
      public/pc/css/chunk-142f2a8f.7a017b81.css
  91. 0 0
      public/pc/css/chunk-151f9851.f3fce80b.css
  92. 0 0
      public/pc/css/chunk-156976a6.da6c5d17.css
  93. 0 0
      public/pc/css/chunk-15d93c3c.180103d2.css
  94. 0 0
      public/pc/css/chunk-16630f24.be324a63.css
  95. 0 0
      public/pc/css/chunk-16d5a58a.5b42e85b.css
  96. 0 0
      public/pc/css/chunk-175f9fc9.0dac2cad.css
  97. 0 0
      public/pc/css/chunk-18b09c82.74a4073f.css
  98. 0 0
      public/pc/css/chunk-198202c2.7d9decc0.css
  99. 0 0
      public/pc/css/chunk-19f2bbfe.998b3af1.css
  100. 0 0
      public/pc/css/chunk-1a4da306.82c0151c.css

+ 2 - 2
.idea/deployment.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
 <project version="4">
-  <component name="PublishConfigData" serverName="正式FTP">
+  <component name="PublishConfigData">
     <serverData>
     <serverData>
-      <paths name="正式FTP">
+      <paths name="测试服">
         <serverdata>
         <serverdata>
           <mappings>
           <mappings>
             <mapping deploy="/" local="$PROJECT_DIR$" web="/" />
             <mapping deploy="/" local="$PROJECT_DIR$" web="/" />

+ 3 - 3
.idea/webServers.xml

@@ -2,12 +2,12 @@
 <project version="4">
 <project version="4">
   <component name="WebServers">
   <component name="WebServers">
     <option name="servers">
     <option name="servers">
-      <webServer id="d50a1f4c-1622-41aa-bc74-8ce58d1946d0" name="正式FTP" url="http://101.132.128.55">
-        <fileTransfer host="101.132.128.55" port="21" accessType="FTPS">
+      <webServer id="9461d280-1c11-4beb-bd19-a4322dec95bf" name="测试服" url="http://120.79.86.50">
+        <fileTransfer host="120.79.86.50" port="22" rootFolder="/www/wwwroot/gaoyixia.hdlkeji.com" accessType="SFTP">
           <advancedOptions>
           <advancedOptions>
             <advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />
             <advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />
           </advancedOptions>
           </advancedOptions>
-          <option name="port" value="21" />
+          <option name="port" value="22" />
         </fileTransfer>
         </fileTransfer>
       </webServer>
       </webServer>
     </option>
     </option>

+ 133 - 32
.idea/workspace.xml

@@ -2,9 +2,79 @@
 <project version="4">
 <project version="4">
   <component name="ChangeListManager">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
+      <change afterPath="$PROJECT_DIR$/application/common/model/UserLoginLog.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/mall/view/goods_cate/second.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/mall/view/goods_cate/third.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/deployment.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/deployment.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/webServers.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/webServers.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Activity.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Activity.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Alipay.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Alipay.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/api/controller/Article.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Article.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/api/controller/Article.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Article.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/api/controller/Datum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Datum.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/api/controller/Datum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Datum.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Demand.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Demand.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Es.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Es.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Expedite.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Expedite.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Forum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Forum.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/LevelOrder.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/LevelOrder.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Login.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Login.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Mall.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Mall.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Order.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Order.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Press.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Press.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Qc.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Qc.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Recruit.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Recruit.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Report.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Report.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Supplier.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Supplier.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Task.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Task.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Trolley.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Trolley.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Video.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Video.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/WeChatPay.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/WeChatPay.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/ArticleIntro.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/ArticleIntro.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/DatumIntro.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/DatumIntro.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/GoodsOrder.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/GoodsOrder.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/GoodsOrderItem.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/GoodsOrderItem.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/ShoppingTrolley.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/ShoppingTrolley.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/StoreGoodsItem.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/StoreGoodsItem.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/TopSearch.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/TopSearch.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/UserFacility.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/UserFacility.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/UserMessage.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/UserMessage.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/UserSearch.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/UserSearch.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/service/CheckPower.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/service/CheckPower.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/service/Elastic.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/service/Elastic.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/service/OrderCallback.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/service/OrderCallback.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/service/UserSynth.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/service/UserSynth.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/controller/Banner.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/mall/controller/Banner.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/controller/GoodsCate.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/mall/controller/GoodsCate.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/banner/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/mall/view/banner/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/goods_cate/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/mall/view/goods_cate/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/goods_cate/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/mall/view/goods_cate/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/store_goods/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/mall/view/store_goods/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/ArticleItem.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/ArticleItem.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/DatumUrl.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/DatumUrl.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/SeriesArticle.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/SeriesArticle.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/SeriesDatum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/SeriesDatum.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/UserArticle.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/UserArticle.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/VideoUrl.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/VideoUrl.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/article_item/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/article_item/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/datum_url/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/datum_url/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/user_article/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/user_article/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/user_datum/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/user_datum/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/user_video/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/user_video/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/video_url/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/video_url/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/Activity.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/Activity.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/ActivityApplyItem.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/ActivityApplyItem.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/Forum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/Forum.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/PlatformDemand.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/PlatformDemand.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/Press.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/Press.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/Recruit.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/Recruit.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/SupplierGoods.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/SupplierGoods.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/activity/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/activity/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/forum/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/forum/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/platform_demand/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/platform_demand/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/press/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/press/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/recruit/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/recruit/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/recruit/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/recruit/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/supplier_goods/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/supplier_goods/form.html" afterDir="false" />
     </list>
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -139,7 +209,7 @@
     <property name="WebServerToolWindowPanel.toolwindow.show.date" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.date" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.permissions" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.permissions" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.size" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.size" value="false" />
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/../crmeb_standard" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/application/common/model" />
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.detected.package.tslint" value="true" />
     <property name="node.js.detected.package.tslint" value="true" />
     <property name="node.js.path.for.package.eslint" value="project" />
     <property name="node.js.path.for.package.eslint" value="project" />
@@ -150,6 +220,13 @@
     <property name="two.files.diff.last.used.folder" value="$PROJECT_DIR$" />
     <property name="two.files.diff.last.used.folder" value="$PROJECT_DIR$" />
   </component>
   </component>
   <component name="RecentsManager">
   <component name="RecentsManager">
+    <key name="CopyFile.RECENT_KEYS">
+      <recent name="D:\zs\gaoyixia\application\common\model" />
+      <recent name="D:\zs\gaoyixia\application\mall\view\goods_cate" />
+      <recent name="\" />
+      <recent name="D:\zs\gaoyixia\application\operate\view\recruit" />
+      <recent name="D:\zs\gaoyixia\application\operate\controller" />
+    </key>
     <key name="MoveFile.RECENT_KEYS">
     <key name="MoveFile.RECENT_KEYS">
       <recent name="D:\zs\gaoyixia\public" />
       <recent name="D:\zs\gaoyixia\public" />
       <recent name="D:\zs\gaoyixia\public\static" />
       <recent name="D:\zs\gaoyixia\public\static" />
@@ -157,13 +234,6 @@
       <recent name="D:\zs\gaoyixia\public\a" />
       <recent name="D:\zs\gaoyixia\public\a" />
       <recent name="D:\zs\gaoyixia\application\api\controller" />
       <recent name="D:\zs\gaoyixia\application\api\controller" />
     </key>
     </key>
-    <key name="CopyFile.RECENT_KEYS">
-      <recent name="D:\zs\gaoyixia\application\operate\view\recruit" />
-      <recent name="D:\zs\gaoyixia\application\common\model" />
-      <recent name="D:\zs\gaoyixia\application\operate\controller" />
-      <recent name="D:\zs\gaoyixia\application\operate\view" />
-      <recent name="D:\zs\gaoyixia\public\static" />
-    </key>
   </component>
   </component>
   <component name="SvnConfiguration">
   <component name="SvnConfiguration">
     <configuration />
     <configuration />
@@ -404,7 +474,20 @@
       <workItem from="1692579530643" duration="3954000" />
       <workItem from="1692579530643" duration="3954000" />
       <workItem from="1692665781192" duration="20574000" />
       <workItem from="1692665781192" duration="20574000" />
       <workItem from="1692752372482" duration="15659000" />
       <workItem from="1692752372482" duration="15659000" />
-      <workItem from="1692838782793" duration="6299000" />
+      <workItem from="1692838782793" duration="7501000" />
+      <workItem from="1692924910651" duration="19786000" />
+      <workItem from="1693011186222" duration="7215000" />
+      <workItem from="1693184218056" duration="5771000" />
+      <workItem from="1693271309168" duration="7808000" />
+      <workItem from="1693356541141" duration="24320000" />
+      <workItem from="1693442664386" duration="6315000" />
+      <workItem from="1693529208176" duration="596000" />
+      <workItem from="1693534142268" duration="7753000" />
+      <workItem from="1693788339931" duration="10079000" />
+      <workItem from="1693874624473" duration="24108000" />
+      <workItem from="1693961752874" duration="17119000" />
+      <workItem from="1694048197092" duration="22485000" />
+      <workItem from="1694134843963" duration="9152000" />
     </task>
     </task>
     <servers />
     <servers />
   </component>
   </component>
@@ -526,50 +609,50 @@
     </option>
     </option>
   </component>
   </component>
   <component name="WindowStateProjectService">
   <component name="WindowStateProjectService">
-    <state x="1056" y="474" key="#Deployment" timestamp="1684465680515">
+    <state x="1056" y="474" key="#Deployment" timestamp="1693191680884">
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>
-    <state x="1056" y="474" key="#Deployment/0.0.2560.1400@0.0.2560.1400" timestamp="1684465680515" />
-    <state x="1410" y="539" key="#com.intellij.fileTypes.FileTypeChooser" timestamp="1684374232836">
+    <state x="1056" y="474" key="#Deployment/0.0.2560.1400@0.0.2560.1400" timestamp="1693191680884" />
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1694071135395">
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>
-    <state x="1410" y="539" key="#com.intellij.fileTypes.FileTypeChooser/0.0.2560.1400@0.0.2560.1400" timestamp="1684374232836" />
-    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1691823777019">
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1694071135395" />
+    <state x="360" y="413" width="1942" height="1088" key="DiffContextDialog" timestamp="1694141245467">
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>
-    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1691823777019" />
-    <state x="301" y="91" width="1942" height="1088" key="DiffContextDialog" timestamp="1692236160071">
+    <state x="360" y="413" width="1942" height="1088" key="DiffContextDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1694141245467" />
+    <state x="1418" y="514" key="FileChooserDialogImpl" timestamp="1693877765883">
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>
-    <state x="301" y="91" width="1942" height="1088" key="DiffContextDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1692236160071" />
-    <state x="1418" y="514" key="FileChooserDialogImpl" timestamp="1692841590866">
+    <state x="1418" y="514" key="FileChooserDialogImpl/0.0.2560.1400@0.0.2560.1400" timestamp="1693877765883" />
+    <state width="498" height="446" key="SwitcherDM" timestamp="1693380266237">
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>
-    <state x="1418" y="514" key="FileChooserDialogImpl/0.0.2560.1400@0.0.2560.1400" timestamp="1692841590866" />
-    <state x="535" y="293" key="com.intellij.ide.util.TipDialog" timestamp="1692838783828">
+    <state width="498" height="446" key="SwitcherDM/0.0.2560.1400@0.0.2560.1400" timestamp="1693380266237" />
+    <state x="535" y="293" key="com.intellij.ide.util.TipDialog" timestamp="1694134853458">
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>
-    <state x="535" y="293" key="com.intellij.ide.util.TipDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1692838783828" />
+    <state x="535" y="293" key="com.intellij.ide.util.TipDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1694134853458" />
     <state x="1166" y="605" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1687246001889">
     <state x="1166" y="605" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1687246001889">
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>
     <state x="1166" y="605" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.2560.1400@0.0.2560.1400" timestamp="1687246001889" />
     <state x="1166" y="605" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.2560.1400@0.0.2560.1400" timestamp="1687246001889" />
-    <state x="920" y="186" width="1407" height="1056" key="find.popup" timestamp="1692683326371">
+    <state x="686" y="156" width="1407" height="1056" key="find.popup" timestamp="1694053022186">
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>
-    <state x="920" y="186" width="1407" height="1056" key="find.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1692683326371" />
-    <state x="1282" y="549" key="ftp.server.browser" timestamp="1684465678841">
+    <state x="686" y="156" width="1407" height="1056" key="find.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1694053022186" />
+    <state x="1282" y="549" key="ftp.server.browser" timestamp="1693012785412">
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>
-    <state x="1282" y="549" key="ftp.server.browser/0.0.2560.1400@0.0.2560.1400" timestamp="1684465678841" />
-    <state x="1291" y="317" key="run.anything.popup" timestamp="1692845544757">
+    <state x="1282" y="549" key="ftp.server.browser/0.0.2560.1400@0.0.2560.1400" timestamp="1693012785412" />
+    <state x="1291" y="317" key="run.anything.popup" timestamp="1693363437168">
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>
-    <state x="1291" y="317" key="run.anything.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1692845544757" />
-    <state x="1581" y="565" width="672" height="678" key="search.everywhere.popup" timestamp="1691569433958">
+    <state x="1291" y="317" key="run.anything.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1693363437168" />
+    <state x="1581" y="565" width="672" height="678" key="search.everywhere.popup" timestamp="1693979623876">
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>
-    <state x="1581" y="565" width="672" height="678" key="search.everywhere.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1691569433958" />
+    <state x="1581" y="565" width="672" height="678" key="search.everywhere.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1693979623876" />
   </component>
   </component>
   <component name="XDebuggerManager">
   <component name="XDebuggerManager">
     <breakpoint-manager>
     <breakpoint-manager>
@@ -586,12 +669,12 @@
         </line-breakpoint>
         </line-breakpoint>
         <line-breakpoint enabled="true" type="javascript">
         <line-breakpoint enabled="true" type="javascript">
           <url>file://$PROJECT_DIR$/application/operate/view/activity/form.html</url>
           <url>file://$PROJECT_DIR$/application/operate/view/activity/form.html</url>
-          <line>655</line>
+          <line>663</line>
           <option name="timeStamp" value="8" />
           <option name="timeStamp" value="8" />
         </line-breakpoint>
         </line-breakpoint>
         <line-breakpoint enabled="true" type="php-line-method">
         <line-breakpoint enabled="true" type="php-line-method">
           <url>file://$PROJECT_DIR$/application/api/controller/Datum.php</url>
           <url>file://$PROJECT_DIR$/application/api/controller/Datum.php</url>
-          <line>745</line>
+          <line>752</line>
           <properties>
           <properties>
             <option name="className" value="\app\api\controller\Datum" />
             <option name="className" value="\app\api\controller\Datum" />
             <option name="methodName" value="getDatumCollect" />
             <option name="methodName" value="getDatumCollect" />
@@ -600,13 +683,31 @@
         </line-breakpoint>
         </line-breakpoint>
         <line-breakpoint enabled="true" type="php-line-method">
         <line-breakpoint enabled="true" type="php-line-method">
           <url>file://$PROJECT_DIR$/application/api/controller/Activity.php</url>
           <url>file://$PROJECT_DIR$/application/api/controller/Activity.php</url>
-          <line>1653</line>
+          <line>1656</line>
           <properties>
           <properties>
             <option name="className" value="\app\api\controller\Activity" />
             <option name="className" value="\app\api\controller\Activity" />
             <option name="methodName" value="applyBill" />
             <option name="methodName" value="applyBill" />
           </properties>
           </properties>
           <option name="timeStamp" value="9" />
           <option name="timeStamp" value="9" />
         </line-breakpoint>
         </line-breakpoint>
+        <line-breakpoint enabled="true" type="php-line-method">
+          <url>file://$PROJECT_DIR$/application/api/controller/Qc.php</url>
+          <line>118</line>
+          <properties>
+            <option name="className" value="\app\api\controller\Qc" />
+            <option name="methodName" value="recommend" />
+          </properties>
+          <option name="timeStamp" value="10" />
+        </line-breakpoint>
+        <line-breakpoint enabled="true" type="php-line-method">
+          <url>file://$PROJECT_DIR$/application/api/controller/Datum.php</url>
+          <line>206</line>
+          <properties>
+            <option name="className" value="\app\api\controller\Datum" />
+            <option name="methodName" value="getDatumList" />
+          </properties>
+          <option name="timeStamp" value="11" />
+        </line-breakpoint>
       </breakpoints>
       </breakpoints>
     </breakpoint-manager>
     </breakpoint-manager>
   </component>
   </component>

+ 3 - 0
application/api/controller/Activity.php

@@ -17,6 +17,7 @@ use app\common\model\DeliveryAddress;
 use app\common\model\GoodsOrderRefund;
 use app\common\model\GoodsOrderRefund;
 use app\common\model\PlatformLike;
 use app\common\model\PlatformLike;
 use app\common\model\StoreOrderRefund;
 use app\common\model\StoreOrderRefund;
+use app\common\model\TopSearch;
 use app\common\model\User;
 use app\common\model\User;
 use app\common\model\UserCollect;
 use app\common\model\UserCollect;
 use app\common\model\UserMessage;
 use app\common\model\UserMessage;
@@ -90,6 +91,7 @@ class Activity extends Base
      * @return name:county type:string default:-- desc:县区
      * @return name:county type:string default:-- desc:县区
      * @return name:address type:string default:-- desc:地址
      * @return name:address type:string default:-- desc:地址
      * @return name:is_apply type:int default:-- desc:是否报名(0否1是)
      * @return name:is_apply type:int default:-- desc:是否报名(0否1是)
+     * @return name:release_time type:string default:-- desc:上架时间
      */
      */
     public function getRecommendList()
     public function getRecommendList()
     {
     {
@@ -300,6 +302,7 @@ class Activity extends Base
         $detail['schedule'] = ActivitySchedule::getActivitySchedule($detail['id']);
         $detail['schedule'] = ActivitySchedule::getActivitySchedule($detail['id']);
         \app\common\model\Activity::where('id',$detail['id'])->setInc('read_num');
         \app\common\model\Activity::where('id',$detail['id'])->setInc('read_num');
         UserTrack::crateTrack($this->user_id,7,input('get.id'),0);
         UserTrack::crateTrack($this->user_id,7,input('get.id'),0);
+        TopSearch::seIncHotNum($detail['id'],$this->request->controller());
         $this->success('ok',['detail'=>$detail]);
         $this->success('ok',['detail'=>$detail]);
     }
     }
 
 

+ 2 - 2
application/api/controller/Alipay.php

@@ -81,7 +81,7 @@ class Alipay extends Base
 
 
     public static function ali_pay_h5($subject,$outTradeNo,$totalAmount,$notifyUrl,$returnUrl)
     public static function ali_pay_h5($subject,$outTradeNo,$totalAmount,$notifyUrl,$returnUrl)
     {
     {
-        Factory::setOptions(self::getOptions($notifyUrl,'H5'));
+        Factory::setOptions(self::getOptions($notifyUrl));
         try {
         try {
             $result = Factory::payment()->Wap()->pay($subject,$outTradeNo,$totalAmount,$returnUrl,$returnUrl);
             $result = Factory::payment()->Wap()->pay($subject,$outTradeNo,$totalAmount,$returnUrl,$returnUrl);
             //   $result = Factory::payment()->Page()->pay($subject,$outTradeNo,$totalAmount,$returnUrl);
             //   $result = Factory::payment()->Page()->pay($subject,$outTradeNo,$totalAmount,$returnUrl);
@@ -132,7 +132,7 @@ class Alipay extends Base
         //可设置异步通知接收服务地址(可选)
         //可设置异步通知接收服务地址(可选)
         $options->notifyUrl = $notifyUrl;
         $options->notifyUrl = $notifyUrl;
         //可设置AES密钥,调用AES加解密相关接口时需要(可选)
         //可设置AES密钥,调用AES加解密相关接口时需要(可选)
-        $options->encryptKey = "vrtxdsUskxUow23KHFGRng==";
+       // $options->encryptKey = "vrtxdsUskxUow23KHFGRng==";
         return $options;
         return $options;
     }
     }
 
 

+ 27 - 10
application/api/controller/Article.php

@@ -9,6 +9,7 @@ use app\common\model\ArticleLike;
 use app\common\model\DatumUrl;
 use app\common\model\DatumUrl;
 use app\common\model\PlatformSwitch;
 use app\common\model\PlatformSwitch;
 use app\common\model\SeriesArticleCate;
 use app\common\model\SeriesArticleCate;
+use app\common\model\TopSearch;
 use app\common\model\User;
 use app\common\model\User;
 use app\common\model\UserCollect;
 use app\common\model\UserCollect;
 use app\common\model\UserArticle;
 use app\common\model\UserArticle;
@@ -140,6 +141,12 @@ class Article extends Base
      * @return name:content_type type:int default:1 desc:1富文本2pdf
      * @return name:content_type type:int default:1 desc:1富文本2pdf
      * @return name:pdf type:string default:-- desc:pdf文件路径
      * @return name:pdf type:string default:-- desc:pdf文件路径
      * @return name:is_release type:int default:-- desc:是否释放【0否1是】,已释放不需要购买vip
      * @return name:is_release type:int default:-- desc:是否释放【0否1是】,已释放不需要购买vip
+     * @return name:release_time type:string default:-- desc:上架时间
+     * @return name:desc type:string default:-- desc:简介
+     * @return name:like_num type:int default:-- desc:点赞量
+     * @return name:is_like type:int default:-- desc:是否点赞
+     * @return name:collect_num type:int default:-- desc:收藏量
+     * @return name:is_collect type:int default:-- desc:是否收藏
      */
      */
     public function getRecommendList()
     public function getRecommendList()
     {
     {
@@ -202,6 +209,7 @@ class Article extends Base
      * @return name:is_over type:int default:-- desc:是否完结(0否,1是)
      * @return name:is_over type:int default:-- desc:是否完结(0否,1是)
      * @return name:read_num type:int default:-- desc:阅读量
      * @return name:read_num type:int default:-- desc:阅读量
      * @return name:label type:string default:-- desc:标签
      * @return name:label type:string default:-- desc:标签
+     * @return name:recently_title type:string default:-- desc:上次观看标题
      * @return name:item_list type:array default:-- desc:图文
      * @return name:item_list type:array default:-- desc:图文
      * @return name:item_list.title type:string default:-- desc:图文标题
      * @return name:item_list.title type:string default:-- desc:图文标题
      * @return name:item_list.is_vip type:int default:-- desc:是否是vip
      * @return name:item_list.is_vip type:int default:-- desc:是否是vip
@@ -220,7 +228,7 @@ class Article extends Base
         $title = input('get.title');
         $title = input('get.title');
         $type = input('get.type',2);
         $type = input('get.type',2);
         $is_tj = input('get.is_tj',0);
         $is_tj = input('get.is_tj',0);
-        $sort_type = 1;//input('get.sort_type',1);
+        $sort_type = input('get.sort_type',1);
         $first_classify = input('get.first_classify');
         $first_classify = input('get.first_classify');
         $second_classify = input('get.second_classify');
         $second_classify = input('get.second_classify');
         $sel_where[]  = ['is_deleted','=',0];
         $sel_where[]  = ['is_deleted','=',0];
@@ -251,6 +259,8 @@ class Article extends Base
             ->select()->toArray();
             ->select()->toArray();
         array_walk($list,function (&$v,$k){
         array_walk($list,function (&$v,$k){
             $v['item_list'] = $v['item_list2'];
             $v['item_list'] = $v['item_list2'];
+            $recently_id = UserTrack::getRecentlyTrack($this->user_id,3,$v['id']);
+            $v['recently_title'] = ArticleItem::where('id',$recently_id)->value('title');
             unset($v['item_list2']);
             unset($v['item_list2']);
             $v['read_num']=  array_sum(array_column($v['item_list'],'read_num'));
             $v['read_num']=  array_sum(array_column($v['item_list'],'read_num'));
             $v['read_num'] = numTransform($v['read_num']);
             $v['read_num'] = numTransform($v['read_num']);
@@ -262,6 +272,7 @@ class Article extends Base
                 $article_auth = ArticleItem::getArticleAuth($iv['user_id'],APPNAME,APPLOGO);
                 $article_auth = ArticleItem::getArticleAuth($iv['user_id'],APPNAME,APPLOGO);
                 $iv['app_name'] = $article_auth['app_name'];
                 $iv['app_name'] = $article_auth['app_name'];
                 $iv['app_logo'] = $article_auth['app_logo'];
                 $iv['app_logo'] = $article_auth['app_logo'];
+
             }
             }
         });
         });
         $total_num = ArticleIntro::where($sel_where) ->where($where_str)->count();
         $total_num = ArticleIntro::where($sel_where) ->where($where_str)->count();
@@ -359,6 +370,9 @@ class Article extends Base
      * @return name:item_list.app_name type:string default:-- desc:发布者
      * @return name:item_list.app_name type:string default:-- desc:发布者
      * @return name:item_list.app_logo type:string default:-- desc:发布者头像
      * @return name:item_list.app_logo type:string default:-- desc:发布者头像
      * @return name:item_list.comment_switch type:int default:-- desc:评论开关【0关闭1开启】
      * @return name:item_list.comment_switch type:int default:-- desc:评论开关【0关闭1开启】
+     * @return name:item_list.release_time type:string default:-- desc:上架时间
+     *
+     *
      */
      */
     public function getArticleDetail()
     public function getArticleDetail()
     {
     {
@@ -455,7 +469,7 @@ class Article extends Base
      * @return name:item_list.goods_id type:int default:-- desc:供应商商品id
      * @return name:item_list.goods_id type:int default:-- desc:供应商商品id
      * @return name:item_list.video_jump type:int default:-- desc:关联视频是否能跳转【0不能跳转,1能跳转,验证是否vip】
      * @return name:item_list.video_jump type:int default:-- desc:关联视频是否能跳转【0不能跳转,1能跳转,验证是否vip】
      * @return name:item_list.datum_jump type:int default:-- desc:关联资料是否能跳转【0不能跳转,1能跳转,验证是否vip】
      * @return name:item_list.datum_jump type:int default:-- desc:关联资料是否能跳转【0不能跳转,1能跳转,验证是否vip】
-     *
+     * @return name:item_list.release_time type:string default:-- desc:上架时间
      * @return name:item_list.author type:string default:-- desc:原创作者
      * @return name:item_list.author type:string default:-- desc:原创作者
      * @return name:item_list.content_type type:int default:1 desc:1富文本2pdf
      * @return name:item_list.content_type type:int default:1 desc:1富文本2pdf
      * @return name:item_list.pdf type:string default:-- desc:pdf文件路径【加密】
      * @return name:item_list.pdf type:string default:-- desc:pdf文件路径【加密】
@@ -558,6 +572,7 @@ class Article extends Base
      * @return name:switch_open type:int default:-- desc:通知开关【0关闭1开启】
      * @return name:switch_open type:int default:-- desc:通知开关【0关闭1开启】
      * @return name:article_title type:string default:-- desc:系列标题
      * @return name:article_title type:string default:-- desc:系列标题
      * @return name:comment_switch type:int default:-- desc:评论开关【0关闭1开启】
      * @return name:comment_switch type:int default:-- desc:评论开关【0关闭1开启】
+     * @return name:release_time type:string default:-- desc:上架时间
      */
      */
     public function getArticleItemInfo()
     public function getArticleItemInfo()
     {
     {
@@ -589,7 +604,7 @@ class Article extends Base
         //var_dump($this->user_id,3,$detail['article_id'],$item_id);
         //var_dump($this->user_id,3,$detail['article_id'],$item_id);
         ArticleItem::where('id',$item_id)->setInc('read_num');
         ArticleItem::where('id',$item_id)->setInc('read_num');
         ArticleIntro::where('id',$detail['article_id'])->setInc('read_num');
         ArticleIntro::where('id',$detail['article_id'])->setInc('read_num');
-
+        TopSearch::seIncHotNum($item_id,$this->request->controller());
         $this->success('ok',['detail'=>$detail]);
         $this->success('ok',['detail'=>$detail]);
     }
     }
 
 
@@ -705,6 +720,7 @@ class Article extends Base
         $article_id = ArticleItem::where('id',$item_id)->value('article_id');
         $article_id = ArticleItem::where('id',$item_id)->value('article_id');
         ArticleItem::where('id',$item_id)->setInc('read_num');
         ArticleItem::where('id',$item_id)->setInc('read_num');
         ArticleIntro::where('id',$article_id)->setInc('read_num');
         ArticleIntro::where('id',$article_id)->setInc('read_num');
+        TopSearch::seIncHotNum($item_id,$this->request->controller());
         $this->success('ok');
         $this->success('ok');
     }
     }
 
 
@@ -817,7 +833,7 @@ class Article extends Base
         $send_user = ArticleItem::where('id',$comment['item_id'])->value('user_id');
         $send_user = ArticleItem::where('id',$comment['item_id'])->value('user_id');
         $comment_switch = ArticleItem::where('id',$comment['item_id'])->value('comment_switch');
         $comment_switch = ArticleItem::where('id',$comment['item_id'])->value('comment_switch');
         if(!$comment_switch) $this->error('评论功能已关闭');
         if(!$comment_switch) $this->error('评论功能已关闭');
-        if($send_user != $this->user_id) UserMessage:: sendUserMessage($send_user,'article',4,0,$this->user_id,$comment['item_id'],$content,$comment['item_id'],$comment['article_id']);
+        //if($send_user != $this->user_id) UserMessage:: sendUserMessage($send_user,'article',4,0,$this->user_id,$comment['item_id'],$content,$comment['item_id'],$comment['article_id']);
         $to_user = $comment['user_id'];
         $to_user = $comment['user_id'];
         unset($comment['id']);
         unset($comment['id']);
         unset($comment['create_at']);
         unset($comment['create_at']);
@@ -1247,7 +1263,7 @@ class Article extends Base
         $sel_where[]  = ['t.pid','=',0];
         $sel_where[]  = ['t.pid','=',0];
         $list = ArticleComment::where($sel_where)
         $list = ArticleComment::where($sel_where)
             ->alias('t')
             ->alias('t')
-            ->field('t.id,t.source_read is_read,t.is_top,t.create_at,i.read_num,t.article_id,t.item_id,t.lev,t.content,i.title,i.label,i.cover,u.name user_name,u.headimg,x.title series_title')
+            ->field('t.id,t.is_read,t.is_top,t.create_at,i.read_num,t.article_id,t.item_id,t.lev,t.content,i.title,i.label,i.cover,u.name user_name,u.headimg,x.title series_title')
             ->leftJoin('ArticleItem i','t.item_id = i.id')
             ->leftJoin('ArticleItem i','t.item_id = i.id')
             ->leftJoin('ArticleIntro x','t.article_id = x.id')
             ->leftJoin('ArticleIntro x','t.article_id = x.id')
             ->leftJoin('store_member u','t.user_id = u.id')
             ->leftJoin('store_member u','t.user_id = u.id')
@@ -1741,7 +1757,7 @@ class Article extends Base
     public function getMarkNum()
     public function getMarkNum()
     {
     {
         // 评论我的
         // 评论我的
-        $comment_num = ArticleComment::where([['t.is_deleted','=',0],['i.user_id','=',$this->user_id],['t.user_id','<>',$this->user_id],['source_read','=',0],['t.pid','=',0]])
+        $comment_num = ArticleComment::where([['t.is_deleted','=',0],['i.user_id','=',$this->user_id],['t.user_id','<>',$this->user_id],['is_read','=',0],['t.pid','=',0]])
             ->leftJoin('ArticleItem i','t.item_id = i.id')
             ->leftJoin('ArticleItem i','t.item_id = i.id')
             ->alias('t')->count();
             ->alias('t')->count();
         // 回复我的
         // 回复我的
@@ -1776,11 +1792,11 @@ class Article extends Base
         $where = [];
         $where = [];
         switch ($type) {
         switch ($type) {
             case 1:
             case 1:
-                ArticleComment::where([['i.user_id','=',$this->user_id]])
+                ArticleComment::where([['i.user_id','=',$this->user_id],['t.pid','=',0]])
                     ->when($id ,function ($query)use ($id){
                     ->when($id ,function ($query)use ($id){
                         if($id) return $query->where('t.id','in',$id);
                         if($id) return $query->where('t.id','in',$id);
                     })->leftJoin('ArticleItem i','t.item_id = i.id')
                     })->leftJoin('ArticleItem i','t.item_id = i.id')
-                    ->alias('t')->update(['source_read'=>input('post.is_read')]);
+                    ->alias('t')->update(['source_read'=>input('post.is_read'),'is_read'=>input('post.is_read')]);
                 break;
                 break;
             case 2:
             case 2:
                 $all_comment = ArticleComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
                 $all_comment = ArticleComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
@@ -1824,7 +1840,7 @@ class Article extends Base
         $del_where[] = ['id','in',input('post.id')];
         $del_where[] = ['id','in',input('post.id')];
         if(in_array($type,[1,3,4,5,6,7,8,9]))   $del_where[] = ['user_id','=',$this->user_id];
         if(in_array($type,[1,3,4,5,6,7,8,9]))   $del_where[] = ['user_id','=',$this->user_id];
         if(in_array($type,[1,3])) ArticleComment::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[1,3])) ArticleComment::where($del_where)->update(['is_deleted'=>1]);
-        if(in_array($type,[2])) ArticleComment::where($del_where)->update(['source_deleted'=>1,'source_read'=>1]);
+        if(in_array($type,[2])) ArticleComment::where($del_where)->update(['source_deleted'=>1,'source_read'=>1,'is_read'=>1]);
         if(in_array($type,[10])) ArticleComment::where($del_where)->update(['to_deleted'=>1,'is_read'=>1]);
         if(in_array($type,[10])) ArticleComment::where($del_where)->update(['to_deleted'=>1,'is_read'=>1]);
         if(in_array($type,[4]))  UserLearn::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[4]))  UserLearn::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[5]))  UserArticle::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[5]))  UserArticle::where($del_where)->update(['is_deleted'=>1]);
@@ -1907,13 +1923,14 @@ class Article extends Base
      * @return name:user_name type:string default:-- desc:会员名称【别人的】
      * @return name:user_name type:string default:-- desc:会员名称【别人的】
      * @return name:headimg type:string default:-- desc:会员头像
      * @return name:headimg type:string default:-- desc:会员头像
      * @return name:cover type:string default:-- desc:封面
      * @return name:cover type:string default:-- desc:封面
+     * @return name:like_id type:int default:-- desc:评论id
      */
      */
     public function praiseMyComment()
     public function praiseMyComment()
     {
     {
         $user_info = $this->userInfo('name,headimg');
         $user_info = $this->userInfo('name,headimg');
         $list =  ArticleCommentLike::where([['c.user_id','=',$this->user_id],['l.to_deleted','=',0],['l.user_id','<>',$this->user_id]])
         $list =  ArticleCommentLike::where([['c.user_id','=',$this->user_id],['l.to_deleted','=',0],['l.user_id','<>',$this->user_id]])
             ->alias('l')
             ->alias('l')
-            ->field('l.id,l.user_id,m.name user_name,m.headimg,l.create_at,v.cover,c.content,v.title,v.read_num,x.title series_title,v.article_id,c.item_id,v.user_id buid')
+            ->field('l.id,l.user_id,l.like_id,m.name user_name,m.headimg,l.create_at,v.cover,c.content,v.title,v.read_num,x.title series_title,v.article_id,c.item_id,v.user_id buid')
             ->leftJoin('StoreMember m','m.id  = l.user_id')
             ->leftJoin('StoreMember m','m.id  = l.user_id')
             ->leftJoin('ArticleComment c','c.id  = l.like_id')
             ->leftJoin('ArticleComment c','c.id  = l.like_id')
             ->leftJoin('ArticleItem v','v.id  = c.item_id')
             ->leftJoin('ArticleItem v','v.id  = c.item_id')

+ 20 - 11
application/api/controller/Datum.php

@@ -8,6 +8,7 @@ use app\common\model\DatumIntro;
 use app\common\model\DatumLike;
 use app\common\model\DatumLike;
 use app\common\model\DatumUrl;
 use app\common\model\DatumUrl;
 use app\common\model\PlatformSwitch;
 use app\common\model\PlatformSwitch;
+use app\common\model\TopSearch;
 use app\common\model\User;
 use app\common\model\User;
 use app\common\model\UserCollect;
 use app\common\model\UserCollect;
 use app\common\model\UserDatum;
 use app\common\model\UserDatum;
@@ -132,6 +133,7 @@ class Datum extends Base
      * @return name:is_encrypt type:int default:-- desc:是否加密(0否1是)
      * @return name:is_encrypt type:int default:-- desc:是否加密(0否1是)
      * @return name:pdf_clear type:string default:-- desc:资料未加密路径【is_encrypt=1时用】
      * @return name:pdf_clear type:string default:-- desc:资料未加密路径【is_encrypt=1时用】
      * @return name:is_release type:int default:-- desc:是否释放【0否1是】,已释放不需要购买vip
      * @return name:is_release type:int default:-- desc:是否释放【0否1是】,已释放不需要购买vip
+     * @return name:release_time type:string default:-- desc:上架时间
      */
      */
     public function getRecommendList()
     public function getRecommendList()
     {
     {
@@ -199,6 +201,7 @@ class Datum extends Base
      * @return name:url_arr.url type:string default:-- desc:资料地址
      * @return name:url_arr.url type:string default:-- desc:资料地址
      * @return name:url_arr.is_down type:int default:-- desc:是否能下载(0否1是)
      * @return name:url_arr.is_down type:int default:-- desc:是否能下载(0否1是)
      * @return name:url_arr.is_encrypt type:int default:-- desc:是否加密(0否1是)
      * @return name:url_arr.is_encrypt type:int default:-- desc:是否加密(0否1是)
+     * @return name:url_arr.release_time type:string default:-- desc:上架时间
      * @return name:url_arr.pdf_clear type:int default:-- desc:资料未加密路径【is_encrypt=1时用】
      * @return name:url_arr.pdf_clear type:int default:-- desc:资料未加密路径【is_encrypt=1时用】
      */
      */
     public function getDatumList()
     public function getDatumList()
@@ -207,7 +210,7 @@ class Datum extends Base
         $title = input('get.title');
         $title = input('get.title');
         $type = input('get.type',2);
         $type = input('get.type',2);
         $is_tj = input('get.is_tj',0);
         $is_tj = input('get.is_tj',0);
-        $sort_type = 1;//input('get.sort_type',1);
+        $sort_type = input('get.sort_type',1);
         $sel_where[]  = ['is_deleted','=',0];
         $sel_where[]  = ['is_deleted','=',0];
         $sel_where[]  = ['status','=',1];
         $sel_where[]  = ['status','=',1];
         $sel_where[] = ['url_num','>',0];
         $sel_where[] = ['url_num','>',0];
@@ -282,6 +285,7 @@ class Datum extends Base
      * @return name:url_arr.pdf_clear type:int default:-- desc:资料未加密路径【is_encrypt=1时用】
      * @return name:url_arr.pdf_clear type:int default:-- desc:资料未加密路径【is_encrypt=1时用】
      * @return name:url_arr.is_recently type:int default:-- desc:是否最近观看【0否1是】
      * @return name:url_arr.is_recently type:int default:-- desc:是否最近观看【0否1是】
      * @return name:url_arr.comment_switch type:int default:-- desc:评论开关【0关闭1开启】
      * @return name:url_arr.comment_switch type:int default:-- desc:评论开关【0关闭1开启】
+     * @return name:url_arr.release_time type:string default:-- desc:上架时间
      */
      */
     public function getDatumDetail()
     public function getDatumDetail()
     {
     {
@@ -346,6 +350,7 @@ class Datum extends Base
      * @return name:comment_switch type:int default:-- desc:评论开关【0关闭1开启】
      * @return name:comment_switch type:int default:-- desc:评论开关【0关闭1开启】
      * @return name:app_name type:string default:-- desc:发布者
      * @return name:app_name type:string default:-- desc:发布者
      * @return name:app_logo type:string default:-- desc:发布者头像
      * @return name:app_logo type:string default:-- desc:发布者头像
+     * @return name:release_time type:string default:-- desc:上架时间
      */
      */
     public function getDatumItemInfo()
     public function getDatumItemInfo()
     {
     {
@@ -373,6 +378,7 @@ class Datum extends Base
         UserTrack::crateTrack($this->user_id,2,$detail['datum_id'],$url_id);
         UserTrack::crateTrack($this->user_id,2,$detail['datum_id'],$url_id);
         DatumUrl::where('id',$url_id)->setInc('read_num');
         DatumUrl::where('id',$url_id)->setInc('read_num');
         DatumIntro::where('id',$detail['datum_id'])->setInc('read_num');
         DatumIntro::where('id',$detail['datum_id'])->setInc('read_num');
+        TopSearch::seIncHotNum($url_id,$this->request->controller());
         $this->success('ok',['detail'=>$detail]);
         $this->success('ok',['detail'=>$detail]);
     }
     }
 
 
@@ -432,6 +438,7 @@ class Datum extends Base
         $datum_id =  DatumUrl::where('id',$url_id)->value('datum_id');
         $datum_id =  DatumUrl::where('id',$url_id)->value('datum_id');
         DatumUrl::where('id',$url_id)->setInc('read_num');
         DatumUrl::where('id',$url_id)->setInc('read_num');
         DatumIntro::where('id',$datum_id)->setInc('read_num');
         DatumIntro::where('id',$datum_id)->setInc('read_num');
+        TopSearch::seIncHotNum($url_id,$this->request->controller());
         $this->success('ok');
         $this->success('ok');
     }
     }
 
 
@@ -825,12 +832,13 @@ class Datum extends Base
         if($title)  $sel_where[]  = ['t.title|t.label','like','%'.$title.'%'];
         if($title)  $sel_where[]  = ['t.title|t.label','like','%'.$title.'%'];
         $list = DatumUrl::where($sel_where)
         $list = DatumUrl::where($sel_where)
             ->alias('t')
             ->alias('t')
-            ->field('t.id,t.title,t.is_vip,t.url,t.datum_id,t.is_encrypt,t.pdf_clear,t.create_at,t.label,t.is_down,x.title series_title')
+            ->field('t.id,t.title,t.is_vip,t.url,t.datum_id,t.is_encrypt,t.pdf_clear,t.create_at,t.label,t.is_down,x.title series_title,t.read_num')
             ->order('t.id desc')
             ->order('t.id desc')
             ->leftJoin('DatumIntro x','x.id  = t.datum_id')
             ->leftJoin('DatumIntro x','x.id  = t.datum_id')
             ->limit($this->off_set,$this->page_num)
             ->limit($this->off_set,$this->page_num)
             ->select()->toArray();
             ->select()->toArray();
         foreach ($list as &$v) {
         foreach ($list as &$v) {
+            $v['read_num']  = numTransform($v['read_num']);
             $v['is_normal'] = CheckPower::checkModulesPower($v['datum_id'],$v['id'],$this->request->controller());
             $v['is_normal'] = CheckPower::checkModulesPower($v['datum_id'],$v['id'],$this->request->controller());
         }
         }
         $total_num= DatumUrl::where($sel_where) ->alias('t')->count();
         $total_num= DatumUrl::where($sel_where) ->alias('t')->count();
@@ -1061,7 +1069,7 @@ class Datum extends Base
         $del_where[] = ['id','in',input('post.id')];
         $del_where[] = ['id','in',input('post.id')];
         if(in_array($type,[1,3,4,5,6,7,8,9,13,14]))   $del_where[] = ['user_id','=',$this->user_id];
         if(in_array($type,[1,3,4,5,6,7,8,9,13,14]))   $del_where[] = ['user_id','=',$this->user_id];
         if(in_array($type,[1,3])) DatumComment::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[1,3])) DatumComment::where($del_where)->update(['is_deleted'=>1]);
-        if(in_array($type,[2])) DatumComment::where($del_where)->update(['source_deleted'=>1,'source_read'=>1]);
+        if(in_array($type,[2])) DatumComment::where($del_where)->update(['source_deleted'=>1,'source_read'=>1,'is_read'=>1]);
         if(in_array($type,[10])) DatumComment::where($del_where)->update(['to_deleted'=>1,'to_read'=>1]);
         if(in_array($type,[10])) DatumComment::where($del_where)->update(['to_deleted'=>1,'to_read'=>1]);
         if(in_array($type,[4]))  UserLearn::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[4]))  UserLearn::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[5]))  UserDatum::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[5]))  UserDatum::where($del_where)->update(['is_deleted'=>1]);
@@ -1165,15 +1173,15 @@ class Datum extends Base
      * @return name:reply_num type:int default:-- desc:未读量--回复我的
      * @return name:reply_num type:int default:-- desc:未读量--回复我的
      * @return name:comment_num type:int default:-- desc:未读量--评论我的
      * @return name:comment_num type:int default:-- desc:未读量--评论我的
      * @return name:praise_num type:int default:-- desc:点赞我的【包含视频点赞和评论点赞】
      * @return name:praise_num type:int default:-- desc:点赞我的【包含视频点赞和评论点赞】
-     * @return name:datum_praise_num type:int default:-- desc:-视频点赞
+     * @return name:datum_praise_num type:int default:-- desc:-资料点赞
      * @return name:comment_praise_num type:int default:-- desc:评论点赞
      * @return name:comment_praise_num type:int default:-- desc:评论点赞
      * @return name:follow_num type:int default:-- desc:订阅
      * @return name:follow_num type:int default:-- desc:订阅
      */
      */
     public function getMarkNum()
     public function getMarkNum()
     {
     {
         // 评论我的
         // 评论我的
-        $comment_num = DatumComment::where([['t.is_deleted','=',0],['i.user_id','=',$this->user_id],['t.user_id','<>',$this->user_id],['source_read','=',0],['t.pid','=',0]])
-            ->leftJoin('DatumUrl i','t.datum_id = i.id')
+        $comment_num = DatumComment::where([['t.is_deleted','=',0],['i.user_id','=',$this->user_id],['t.user_id','<>',$this->user_id],['is_read','=',0],['t.pid','=',0]])
+            ->leftJoin('DatumUrl i','t.url_id = i.id')
             ->alias('t')->count();
             ->alias('t')->count();
         // 回复我的
         // 回复我的
         $all_comment = DatumComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
         $all_comment = DatumComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
@@ -1181,7 +1189,7 @@ class Datum extends Base
         // 点赞我的
         // 点赞我的
         $all_datum = DatumUrl::where('user_id',$this->user_id)->where('is_deleted',0)->column('id');
         $all_datum = DatumUrl::where('user_id',$this->user_id)->where('is_deleted',0)->column('id');
 
 
-        $datum_praise_num =  DatumLike::where([['is_read','=',0],['datum_id','in',$all_datum],['user_id','<>',$this->user_id]])->count();
+        $datum_praise_num =  DatumLike::where([['is_read','=',0],['url_id','in',$all_datum],['user_id','<>',$this->user_id]])->count();
         $comment_praise_num = DatumCommentLike::where([['is_read','=',0],['like_id','in',$all_comment],['user_id','<>',$this->user_id]])->count();
         $comment_praise_num = DatumCommentLike::where([['is_read','=',0],['like_id','in',$all_comment],['user_id','<>',$this->user_id]])->count();
         $praise_num = $datum_praise_num + $comment_praise_num;
         $praise_num = $datum_praise_num + $comment_praise_num;
         $follow_num = UserMessage::getUnreadNum($this->user_id,'datum',5);
         $follow_num = UserMessage::getUnreadNum($this->user_id,'datum',5);
@@ -1210,6 +1218,7 @@ class Datum extends Base
      * @return name:user_name type:string default:-- desc:会员名称【别人的】
      * @return name:user_name type:string default:-- desc:会员名称【别人的】
      * @return name:headimg type:string default:-- desc:会员头像
      * @return name:headimg type:string default:-- desc:会员头像
      * @return name:url type:string default:-- desc:文件路径
      * @return name:url type:string default:-- desc:文件路径
+     * @return name:like_id type:int default:-- desc:评论id
      * @return name:content type:string default:-- desc:评论内容
      * @return name:content type:string default:-- desc:评论内容
      */
      */
     public function praiseMyComment()
     public function praiseMyComment()
@@ -1400,7 +1409,7 @@ class Datum extends Base
         $sel_where[]  = ['t.source_deleted','=',0];
         $sel_where[]  = ['t.source_deleted','=',0];
         $sel_where[]  = ['t.pid','=',0];
         $sel_where[]  = ['t.pid','=',0];
         $list = DatumComment::where($sel_where)->alias('t')
         $list = DatumComment::where($sel_where)->alias('t')
-            ->field('t.id,t.source_read is_read,t.is_top,t.create_at,i.read_num,t.datum_id,t.url_id,t.lev,t.content,i.title,i.url,u.name user_name,u.headimg,x.title series_title')
+            ->field('t.id,t.is_read,t.is_top,t.create_at,i.read_num,t.datum_id,t.url_id,t.lev,t.content,i.title,i.url,u.name user_name,u.headimg,x.title series_title')
             ->leftJoin('DatumUrl i','t.url_id = i.id')
             ->leftJoin('DatumUrl i','t.url_id = i.id')
             ->leftJoin('DatumIntro x','t.datum_id = x.id')
             ->leftJoin('DatumIntro x','t.datum_id = x.id')
             ->leftJoin('store_member u','t.user_id = u.id')
             ->leftJoin('store_member u','t.user_id = u.id')
@@ -1439,12 +1448,12 @@ class Datum extends Base
         $where = [];
         $where = [];
         switch ($type) {
         switch ($type) {
             case 1:
             case 1:
-                DatumComment::where([['i.user_id','=',$this->user_id]])
+                DatumComment::where([['i.user_id','=',$this->user_id],['t.pid','=',0]])
                     ->when($id ,function ($query)use ($id){
                     ->when($id ,function ($query)use ($id){
                         if($id) return $query->where('t.id','in',$id);
                         if($id) return $query->where('t.id','in',$id);
                     })->leftJoin('DatumUrl i','t.url_id = i.id')
                     })->leftJoin('DatumUrl i','t.url_id = i.id')
                     ->alias('t')
                     ->alias('t')
-                    ->update(['source_read'=>input('post.is_read')]);
+                    ->update(['source_read'=>input('post.is_read'),'is_read'=>input('post.is_read')]);
                 break;
                 break;
             case 2:
             case 2:
                 $all_comment = DatumComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
                 $all_comment = DatumComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
@@ -1460,7 +1469,7 @@ class Datum extends Base
                 break;
                 break;
             case 4:
             case 4:
                 $all_datum = DatumUrl::where('user_id',$this->user_id)->where('is_deleted',0)->column('id');
                 $all_datum = DatumUrl::where('user_id',$this->user_id)->where('is_deleted',0)->column('id');
-                DatumLike::where([['is_read','=',0],['datum_id','in',$all_datum]])->update(['is_read'=>1]);
+                DatumLike::where([['is_read','=',0],['url_id','in',$all_datum]])->update(['is_read'=>1]);
                 break;
                 break;
             case 5:
             case 5:
                 $all_comment = DatumComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
                 $all_comment = DatumComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');

+ 19 - 9
application/api/controller/Demand.php

@@ -5,6 +5,7 @@ use app\common\model\PlatformDemand;
 use app\common\model\DemandComment;
 use app\common\model\DemandComment;
 use app\common\model\PlatformLike;
 use app\common\model\PlatformLike;
 use app\common\model\PlatformSwitch;
 use app\common\model\PlatformSwitch;
+use app\common\model\TopSearch;
 use app\common\model\User;
 use app\common\model\User;
 use app\common\model\UserCollect;
 use app\common\model\UserCollect;
 use app\common\model\UserDemand;
 use app\common\model\UserDemand;
@@ -69,6 +70,7 @@ class Demand extends Base
      * @return name:app_logo type:string default:-- desc:发布方头像
      * @return name:app_logo type:string default:-- desc:发布方头像
      * @return name:label_name type:array default:-- desc:标签
      * @return name:label_name type:array default:-- desc:标签
      * @return name:is_over type:int default:-- desc:是否解决或开源【0否,1是,2开源】
      * @return name:is_over type:int default:-- desc:是否解决或开源【0否,1是,2开源】
+     * @return name:release_time type:string default:-- desc:上架时间
      *
      *
      *
      *
      */
      */
@@ -148,6 +150,7 @@ class Demand extends Base
      * @return name:app_name type:string default:-- desc:发布方名称
      * @return name:app_name type:string default:-- desc:发布方名称
      * @return name:app_logo type:string default:-- desc:发布方头像
      * @return name:app_logo type:string default:-- desc:发布方头像
      * @return name:read_num type:string default:-- desc:阅读量
      * @return name:read_num type:string default:-- desc:阅读量
+     * @return name:release_time type:string default:-- desc:上架时间
      */
      */
      public function getDemandList()
      public function getDemandList()
      {
      {
@@ -237,6 +240,7 @@ class Demand extends Base
      * @return name:label_name type:array default:-- desc:标签
      * @return name:label_name type:array default:-- desc:标签
      * @return name:solve_phone type:string default:-- desc:发布方电话
      * @return name:solve_phone type:string default:-- desc:发布方电话
      * @return name:solve_email type:string default:-- desc:发布方邮箱
      * @return name:solve_email type:string default:-- desc:发布方邮箱
+     * @return name:release_time type:string default:-- desc:上架时间
      * @return name:solve_qrcode type:string default:-- desc:发布方二维码
      * @return name:solve_qrcode type:string default:-- desc:发布方二维码
      */
      */
      public function getDemandInfo()
      public function getDemandInfo()
@@ -257,6 +261,7 @@ class Demand extends Base
          $detail['switch_open'] =  PlatformSwitch::checkSwitch($this->user_id,$detail['id'],12);
          $detail['switch_open'] =  PlatformSwitch::checkSwitch($this->user_id,$detail['id'],12);
          $detail['comment_num'] = DemandComment::getCommentNum($detail['id']);
          $detail['comment_num'] = DemandComment::getCommentNum($detail['id']);
          PlatformDemand::where('id',input('get.id'))->setInc('read_num');
          PlatformDemand::where('id',input('get.id'))->setInc('read_num');
+         TopSearch::seIncHotNum($detail['id'],$this->request->controller());
          $this->success('ok',['detail'=>$detail]);
          $this->success('ok',['detail'=>$detail]);
      }
      }
 
 
@@ -381,7 +386,7 @@ class Demand extends Base
         $user_info = $this->userInfo('name');
         $user_info = $this->userInfo('name');
         if($comment['user_id'] != $this->user_id)UserMessage:: sendUserMessage($comment['user_id'],'demand',3,0,$this->user_id,$comment['id'],input('post.content'));
         if($comment['user_id'] != $this->user_id)UserMessage:: sendUserMessage($comment['user_id'],'demand',3,0,$this->user_id,$comment['id'],input('post.content'));
         $send_user =$info->user_id;
         $send_user =$info->user_id;
-        if($send_user && $send_user != $this->user_id) UserMessage::sendUserMessage($send_user,'demand',4,0,$this->user_id,$comment['first_id'],input('post.content'));
+        //if($send_user && $send_user != $this->user_id) UserMessage::sendUserMessage($send_user,'demand',4,0,$this->user_id,$comment['first_id'],input('post.content'));
         unset($comment['id']);
         unset($comment['id']);
         unset($comment['create_at']);
         unset($comment['create_at']);
         $comment['pid'] = input('post.id');
         $comment['pid'] = input('post.id');
@@ -754,7 +759,9 @@ class Demand extends Base
      * @header name:Authorization require:1 desc:Token
      * @header name:Authorization require:1 desc:Token
      * @return name:comment_num type:int default:-- desc:评论我的
      * @return name:comment_num type:int default:-- desc:评论我的
      * @return name:reply_num type:int default:-- desc:回复我的
      * @return name:reply_num type:int default:-- desc:回复我的
-     * @return name:praise_num type:int default:-- desc:点赞我的
+     * @return name:praise_demand type:int default:-- desc:点赞我的--需求
+     * @return name:praise_num type:int default:-- desc:点赞我的--评论
+     * @return name:praise_comment type:int default:-- desc:点赞我的--需求+评论
      * @return name:total_num type:int default:-- desc:总数【comment_num+reply_num】
      * @return name:total_num type:int default:-- desc:总数【comment_num+reply_num】
      */
      */
     public function getMarkNum()
     public function getMarkNum()
@@ -768,10 +775,10 @@ class Demand extends Base
         $reply_num =  DemandComment::where([['t.is_deleted','=',0],['t.lev','>=',2],['is_read','=',0],['t.pid','in',implode(',',$all_comment)]])->alias('t')->count();
         $reply_num =  DemandComment::where([['t.is_deleted','=',0],['t.lev','>=',2],['is_read','=',0],['t.pid','in',implode(',',$all_comment)]])->alias('t')->count();
         $total_num = $comment_num +  $reply_num ;
         $total_num = $comment_num +  $reply_num ;
 
 
-        $praise_demand = PlatformLike::where([['p.type', '=', 9],['f.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0]])->alias('p') ->leftJoin('PlatformDemand f', 'f.id = p.like_id')->count();
-        $praise_comment = PlatformLike::where([['p.type', '=', 6],['c.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0]])->alias('p')->leftJoin('DemandComment c', 'c.id = p.like_id')->count();
+        $praise_demand = PlatformLike::where([['p.type', '=', 9],['f.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0],['p.user_id','<>',$this->user_id]])->alias('p') ->leftJoin('PlatformDemand f', 'f.id = p.like_id')->count();
+        $praise_comment = PlatformLike::where([['p.type', '=', 6],['c.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0],['p.user_id','<>',$this->user_id]])->alias('p')->leftJoin('DemandComment c', 'c.id = p.like_id')->count();
         $praise_num = $praise_demand + $praise_comment;
         $praise_num = $praise_demand + $praise_comment;
-        $this->success('ok',compact(['comment_num','reply_num','total_num','praise_num']));
+        $this->success('ok',compact(['comment_num','reply_num','total_num','praise_num','praise_comment','praise_demand']));
     }
     }
 
 
     /**
     /**
@@ -782,7 +789,7 @@ class Demand extends Base
      * @url /api/Demand/unreadChange
      * @url /api/Demand/unreadChange
      * @header name:Authorization require:1 desc:Token
      * @header name:Authorization require:1 desc:Token
      * @param name:id type:string default:-- desc:记录id(多个逗号隔开,不传修改全部])
      * @param name:id type:string default:-- desc:记录id(多个逗号隔开,不传修改全部])
-     * @param name:type type:string default:1 desc:消息类型【1评论我的,2回复我的,3点赞我的】
+     * @param name:type type:string default:1 desc:消息类型【1评论我的,2回复我的,3点赞我的--需求,4点赞我的--评论
      * @param name:is_read type:int default:1 desc:变更类型【0消息变更为未读,1变更为已读】
      * @param name:is_read type:int default:1 desc:变更类型【0消息变更为未读,1变更为已读】
      */
      */
     public function unreadChange()
     public function unreadChange()
@@ -806,9 +813,12 @@ class Demand extends Base
                     })->alias('t')->update(['is_read'=>$is_read]);
                     })->alias('t')->update(['is_read'=>$is_read]);
                 break;
                 break;
             case 3:
             case 3:
-                $ids = PlatformLike::where([['p.type', '=', 9],['f.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0]])->alias('p')->leftJoin('PlatformDemand f', 'f.id = p.like_id')->column('p.id');
-                $ids2 = PlatformLike::where([['p.type', '=', 6],['c.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0]])->alias('p')->leftJoin('DemandComment c', 'c.id = p.like_id')->column('p.id');
-                PlatformLike::where('id','in' ,$ids + $ids2)->update(['is_read'=>1]);
+                $ids = PlatformLike::where([['p.type', '=', 9],['f.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0],['p.user_id','<>',$this->user_id]])->alias('p')->leftJoin('PlatformDemand f', 'f.id = p.like_id')->column('p.id');
+                PlatformLike::where('id','in' ,$ids )->update(['is_read'=>1]);
+                break;
+            case 4:
+                $ids2 = PlatformLike::where([['p.type', '=', 6],['c.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0],['p.user_id','<>',$this->user_id]])->alias('p')->leftJoin('DemandComment c', 'c.id = p.like_id')->column('p.id');
+                PlatformLike::where('id','in' , $ids2)->update(['is_read'=>1]);
                 break;
                 break;
         }
         }
         $this->success('消息变更成功');
         $this->success('消息变更成功');

+ 14 - 0
application/api/controller/Es.php

@@ -272,6 +272,20 @@ class Es extends Base
         $this->success('ok');
         $this->success('ok');
     }
     }
 
 
+
+    public function addRecruit()
+    {
+        $list = \app\common\model\Recruit::field('a.*')->alias('a')
+            ->where('a.id','>',0)
+            ->where('a.is_deleted','=',0)
+            ->select()->toArray();
+        foreach ($list as $info) {
+            \app\common\model\Recruit::esAdd($info['id'],$info);
+        }
+        $this->success('ok');
+    }
+
+
     /**
     /**
      * @title 获取详情
      * @title 获取详情
      * @desc
      * @desc

+ 47 - 34
application/api/controller/Expedite.php

@@ -64,7 +64,7 @@ class Expedite extends Base
      * @header name:Authorization require:1 desc:Token
      * @header name:Authorization require:1 desc:Token
      * @param  name:num type:int  default:5 desc:查询数量
      * @param  name:num type:int  default:5 desc:查询数量
      * @return name:cover type:string default:-- desc:图片路径
      * @return name:cover type:string default:-- desc:图片路径
-     * @return name:place type:string default:-- desc:跳转模块【video=>视频,article=>图文,datum=>资料,activity=>活动,demand=>需求,forum=>问答,press=>新闻,supplier=>供应商商品,recruit=>招聘,mall=>商城】
+     * @return name:place type:string default:-- desc:跳转模块【video=>视频,article=>图文,datum=>资料,activity=>活动,demand=>需求,forum=>问答,press=>新闻,supplier=>供应商商品,recruit=>招聘,mall=>商城,service=>客服
      * @return name:first_id type:int default:-- desc:详情id(视频、图文、资料为系列id)
      * @return name:first_id type:int default:-- desc:详情id(视频、图文、资料为系列id)
      * @return name:second_id type:second_id default:-- desc:系列某详情id(视频、图文、资料)
      * @return name:second_id type:second_id default:-- desc:系列某详情id(视频、图文、资料)
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
@@ -135,41 +135,30 @@ class Expedite extends Base
     }
     }
 
 
     /**
     /**
-     * @title 获取热搜设置标题
-     * @desc  获取热搜设置
+     * @title 获取热搜列表
+     * @desc  获取热搜列表
      * @author  qc
      * @author  qc
      * @url /api/Expedite/getTopSearch
      * @url /api/Expedite/getTopSearch
      * @method GET
      * @method GET
-     * @param name:sort_type type:int default:1 desc:排序规则1默认2搜索量
      * @param name:page type:int default:-- desc:页数
      * @param name:page type:int default:-- desc:页数
      * @param name:page_num type:int default:-- desc:每页数量
      * @param name:page_num type:int default:-- desc:每页数量
-     * @param name:type type:int default:-- desc:类型0=>"全部",1=>'视频',2=>'图文',3=>'资料',4=>'新闻',5=>'需求',6=>'问答',7=>'商品',8=>'招聘',9=>'供应商',10=>'供应商产品',11=>'活动',
+     * @param name:module type:string default:-- desc:模块,不传查全部的[video=>视频,article=>图文,datum=>资料,goods=>商城商品,press=>新闻,supplier_goods=>供应商商品,demand=>需求,recruit=>招聘,forum=>问答,activity=>活动]
      * @return name:title type:string default:-- desc:标题
      * @return name:title type:string default:-- desc:标题
-     * @return name:num type:int default:-- desc:搜索量
-     * @return name:type type:int default:-- desc:类型0=>"全部",1=>'视频',2=>'图文',3=>'资料',4=>'新闻',5=>'需求',6=>'问答',7=>'商品',8=>'招聘',9=>'供应商',10=>'供应商产品',11=>'活动',
+     * @return name:hot_num type:int default:-- desc:热搜量
+     * @return name:rel_id type:int default:-- desc:相关详情id【不是系列id】
+     * @return name:series_id type:int default:-- desc:系列id【图文、视频、资料用】
+     * @return name:module type:string default:-- desc:[video=>视频,article=>图文,datum=>资料,goods=>商城商品,press=>新闻,supplier_goods=>供应商商品,demand=>需求,recruit=>招聘,forum=>问答,activity=>活动]
      */
      */
     public function getTopSearch()
     public function getTopSearch()
     {
     {
-        $type = input('type');
-        $sort_type= input('sort_type',1);
-        switch ($sort_type) {
-            case 1:
-                $order =  ['sort'=>'desc','id'=>'asc'];
-                break;
-            case 2:
-                $order =  ['num'=>'desc','id'=>'desc'];
-                break;
-            default:
-                $order =  ['num'=>'desc','id'=>'desc'];
-                break;
-        }
+        $module = input('module');
         $sel = [];
         $sel = [];
         $sel['is_deleted'] = 0;
         $sel['is_deleted'] = 0;
         $sel['status'] = 1;
         $sel['status'] = 1;
-        if($type)   $sel['type'] =$type;
-        $list = TopSearch::field('id,title,type,num')
+        if($module)   $sel['module'] =$module;
+        $list = TopSearch::field('id,title,rel_id,module,hot_num,series_id')
             ->where($sel)
             ->where($sel)
-            ->order($order)
+            ->order('hot_num desc')
             ->limit($this->off_set,$this->page_num)
             ->limit($this->off_set,$this->page_num)
             ->select()->toArray();
             ->select()->toArray();
         $total_num =TopSearch::where($sel)->count();
         $total_num =TopSearch::where($sel)->count();
@@ -931,7 +920,7 @@ class Expedite extends Base
      * @author  qc
      * @author  qc
      * @url /api/Expedite/getModulesCover
      * @url /api/Expedite/getModulesCover
      * @method GET
      * @method GET
-     * @param name:tag type:string default:-- desc:标识【video=>视频,article=>图文,datum=>资料,activity=>活动,demand=>需求,forum=>问答,press=>新闻,supplier=>供应商,recruit=>招聘,mall=>商城】
+     * @param name:tag type:string default:-- desc:标识【video=>视频,article=>图文,datum=>资料,activity=>活动,demand=>需求,forum=>问答,press=>新闻,supplier=>供应商,recruit=>招聘,mall=>商城,'search'=>热搜
      * @return name:cover type:string default:-- desc:封面
      * @return name:cover type:string default:-- desc:封面
      * @return name:place type:string default:-- desc:归属模块
      * @return name:place type:string default:-- desc:归属模块
      * @return name:tag type:string default:-- desc:归属标识【可以按照这个值查询或是区分所属模块】
      * @return name:tag type:string default:-- desc:归属标识【可以按照这个值查询或是区分所属模块】
@@ -939,7 +928,7 @@ class Expedite extends Base
     public function getModulesCover()
     public function getModulesCover()
     {
     {
         $tag = input('get.tag');
         $tag = input('get.tag');
-        $sel_tag = $tag ? [$tag] : ['video','article','datum','activity','demand','forum','press','supplier','recruit','mall'];
+        $sel_tag = $tag ? [$tag] : ['video','article','datum','activity','demand','forum','press','supplier','recruit','mall','search'];
         $list = Db::name('cover')->where('tag','in',$sel_tag)->column('tag,cover,tag,place','tag');
         $list = Db::name('cover')->where('tag','in',$sel_tag)->column('tag,cover,tag,place','tag');
         $this->success('ok',$list);
         $this->success('ok',$list);
     }
     }
@@ -1065,7 +1054,7 @@ class Expedite extends Base
         // 回复我的
         // 回复我的
         $video_reply_num =  VideoComment::where([['t.is_deleted','=',0],['t.to_deleted','=',0],['t.user_id','<>',$this->user_id],['t.lev','>=',2],['is_read','=',0],['t.pid','in',implode(',',$video_all_comment)]])->alias('t')->count();
         $video_reply_num =  VideoComment::where([['t.is_deleted','=',0],['t.to_deleted','=',0],['t.user_id','<>',$this->user_id],['t.lev','>=',2],['is_read','=',0],['t.pid','in',implode(',',$video_all_comment)]])->alias('t')->count();
         // 评论我的
         // 评论我的
-        $video_comment_num = VideoComment::where([['t.is_deleted','=',0],['i.user_id','=',$this->user_id],['t.user_id','<>',$this->user_id],['source_read','=',0],['t.pid','=',0]])
+        $video_comment_num = VideoComment::where([['t.is_deleted','=',0],['i.user_id','=',$this->user_id],['t.user_id','<>',$this->user_id],['t.is_read','=',0],['t.pid','=',0]])
             ->leftJoin('VideoUrl i','t.url_id = i.id')
             ->leftJoin('VideoUrl i','t.url_id = i.id')
             ->alias('t')->count();
             ->alias('t')->count();
         // 追更
         // 追更
@@ -1081,7 +1070,7 @@ class Expedite extends Base
         $article_all_comment = ArticleComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
         $article_all_comment = ArticleComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
         $article_reply_num =  ArticleComment::where([['t.is_deleted','=',0],['t.to_deleted','=',0],['t.user_id','<>',$this->user_id],['t.lev','>=',2],['is_read','=',0],['t.pid','in',implode(',',$article_all_comment)]])->alias('t')->count();
         $article_reply_num =  ArticleComment::where([['t.is_deleted','=',0],['t.to_deleted','=',0],['t.user_id','<>',$this->user_id],['t.lev','>=',2],['is_read','=',0],['t.pid','in',implode(',',$article_all_comment)]])->alias('t')->count();
         // 评论我的
         // 评论我的
-        $article_comment_num = ArticleComment::where([['t.is_deleted','=',0],['i.user_id','=',$this->user_id],['t.user_id','<>',$this->user_id],['source_read','=',0],['t.pid','=',0]])
+        $article_comment_num = ArticleComment::where([['t.is_deleted','=',0],['i.user_id','=',$this->user_id],['t.user_id','<>',$this->user_id],['t.is_read','=',0],['t.pid','=',0]])
             ->leftJoin('ArticleItem i','t.item_id = i.id')
             ->leftJoin('ArticleItem i','t.item_id = i.id')
             ->alias('t')->count();
             ->alias('t')->count();
         // 追更
         // 追更
@@ -1094,8 +1083,8 @@ class Expedite extends Base
 
 
 
 
         // 评论我的
         // 评论我的
-        $datum_comment_num = DatumComment::where([['t.is_deleted','=',0],['i.user_id','=',$this->user_id],['t.user_id','<>',$this->user_id],['t.source_read','=',0],['t.pid','=',0]])
-            ->leftJoin('DatumUrl i','t.datum_id = i.id')
+        $datum_comment_num = DatumComment::where([['t.is_deleted','=',0],['i.user_id','=',$this->user_id],['t.user_id','<>',$this->user_id],['t.is_read','=',0],['t.pid','=',0]])
+            ->leftJoin('DatumUrl i','t.url_id = i.id')
             ->alias('t')->count();
             ->alias('t')->count();
         // 回复我的
         // 回复我的
         $datum_all_comment = DatumComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
         $datum_all_comment = DatumComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
@@ -1103,8 +1092,8 @@ class Expedite extends Base
         // 点赞我的
         // 点赞我的
         $all_datum = DatumUrl::where('user_id',$this->user_id)->where('is_deleted',0)->column('id');
         $all_datum = DatumUrl::where('user_id',$this->user_id)->where('is_deleted',0)->column('id');
 
 
-        $datum_praise_num = 0;//DatumCommentLike::where([['is_read','=',0],['like_id','in',$all_datum]])->count();
-        $comment_praise_num =0;// DatumLike::where([['is_read','=',0],['datum_id','in',$datum_all_comment]])->count();
+        $datum_praise_num = DatumCommentLike::where([['is_read','=',0],['like_id','in',$all_datum]])->count();
+        $comment_praise_num = DatumLike::where([['is_read','=',0],['url_id','in',$datum_all_comment]])->count();
         $follow_num = UserMessage::getUnreadNum($this->user_id,'datum',5);
         $follow_num = UserMessage::getUnreadNum($this->user_id,'datum',5);
         $datum_num =$datum_comment_num + $datum_reply_num +$datum_praise_num + $comment_praise_num +$follow_num;
         $datum_num =$datum_comment_num + $datum_reply_num +$datum_praise_num + $comment_praise_num +$follow_num;
 
 
@@ -1152,7 +1141,7 @@ class Expedite extends Base
         $sys_num =  0;//UserMessage::where(['user_id'=>$this->user_id,'is_deleted'=>0])->where('is_read',0)->count();
         $sys_num =  0;//UserMessage::where(['user_id'=>$this->user_id,'is_deleted'=>0])->where('is_read',0)->count();
 
 
         // 供应商
         // 供应商
-        $supplier_comment_num = SupplierComment::where([['g.user_id', '=', $this->user_id],['c.is_deleted', '=', 0],['c.to_deleted', '=', 0],['c.source_read','=',0],['c.pid','=',0]])
+        $supplier_comment_num = SupplierComment::where([['g.user_id', '=', $this->user_id],['c.is_deleted', '=', 0],['c.to_deleted', '=', 0],['c.is_read','=',0],['c.pid','=',0]])
             ->alias('c') ->leftJoin('SupplierGoods g', 'g.id = c.goods_id')->count();
             ->alias('c') ->leftJoin('SupplierGoods g', 'g.id = c.goods_id')->count();
         //回复我的
         //回复我的
         $supplier_all_comment = SupplierComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
         $supplier_all_comment = SupplierComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
@@ -1251,13 +1240,15 @@ class Expedite extends Base
      * @method GET
      * @method GET
      * @param name:page type:int default:-- desc:页数
      * @param name:page type:int default:-- desc:页数
      * @param name:page_num type:int default:-- desc:每页数量
      * @param name:page_num type:int default:-- desc:每页数量
-     * @param name:search type:int default:-- desc:搜索关键词
+     * @param name:search type:string default:-- desc:搜索关键词
      * @param name:sort_type type:int default:1 desc:1默认2发布时间正序3发布时间倒序
      * @param name:sort_type type:int default:1 desc:1默认2发布时间正序3发布时间倒序
      * @param name:is_over type:int default:-1 desc:-1全部0未解决1已解决2开源【需求模块用】
      * @param name:is_over type:int default:-1 desc:-1全部0未解决1已解决2开源【需求模块用】
+     * @param name:city type:string default:-- desc:城市搜索【招聘模块用】
      * @param name:module type:string default:-- desc:搜索类型(不传查全部)[video=>视频,article=>图文,datum=>资料,goods=>商城商品,press=>新闻,supplier_goods=>供应商商品,demand=>需求,recruit=>招聘,forum=>问答,activity=>活动]
      * @param name:module type:string default:-- desc:搜索类型(不传查全部)[video=>视频,article=>图文,datum=>资料,goods=>商城商品,press=>新闻,supplier_goods=>供应商商品,demand=>需求,recruit=>招聘,forum=>问答,activity=>活动]
      * @return name:highlight type:array default:-- desc:高亮【目前设置三个字段:title、label、desc】
      * @return name:highlight type:array default:-- desc:高亮【目前设置三个字段:title、label、desc】
      *
      *
      * @return name:module type:string default:-- desc:模块名
      * @return name:module type:string default:-- desc:模块名
+     * @return name:release_time type:string default:-- desc:上架时间
      * @return name:series_id type:int default:-- desc:系列id【视频、图文、资料用】
      * @return name:series_id type:int default:-- desc:系列id【视频、图文、资料用】
      * @return name:id type:int default:-- desc:某个模块的详情id【不是系列id】
      * @return name:id type:int default:-- desc:某个模块的详情id【不是系列id】
      * @return name:title type:string default:-- desc:标题或名称
      * @return name:title type:string default:-- desc:标题或名称
@@ -1300,6 +1291,16 @@ class Expedite extends Base
      * @return name:is_over type:int default:-- desc:0未解决1已解决2开源【需求模块用】
      * @return name:is_over type:int default:-- desc:0未解决1已解决2开源【需求模块用】
      * @return name:money type:string default:-- desc:金额【需求模块用】
      * @return name:money type:string default:-- desc:金额【需求模块用】
      *
      *
+     * @return name:company type:string default:-- desc:公司名称【招聘】
+     * @return name:company_intro type:string default:-- desc:公司简介【招聘】
+     * @return name:is_ss type:string default:-- desc:是否上市,1上市【招聘】
+     * @return name:scale type:string default:-- desc:公司规模(人数)【招聘】
+     * @return name:principal type:string default:-- desc:联系人【招聘】
+     * @return name:province type:string default:-- desc:省【招聘】
+     * @return name:city type:string default:-- desc:市【招聘】
+     * @return name:salary type:string default:-- desc:薪资【招聘】
+     * @return name:hr_headimg type:string default:-- desc:联系人头像【招聘】
+     *
      */
      */
     public function elasticSearch()
     public function elasticSearch()
     {
     {
@@ -1308,6 +1309,7 @@ class Expedite extends Base
         $module = input('module','');
         $module = input('module','');
         $is_over = intval(input('is_over',-1));
         $is_over = intval(input('is_over',-1));
         $sort_type = input('sort_type',1);
         $sort_type = input('sort_type',1);
+        $city = input('city');
         //"全部",1=>'视频',2=>'资料',3=>'图文',4=>'新闻',5=>'问答',6=>'商品',7=>'活动',8=>'招聘',9=>'供应商',10=>'供应商商品',11=>'需求'
         //"全部",1=>'视频',2=>'资料',3=>'图文',4=>'新闻',5=>'问答',6=>'商品',7=>'活动',8=>'招聘',9=>'供应商',10=>'供应商商品',11=>'需求'
         //  video=>视频,article=>图文,datum=>资料,goods=>商城商品,press=>新闻,supplier_goods=>供应商商品,demand=>需求,recruit=>招聘,forum=>问答,activity=>活动]
         //  video=>视频,article=>图文,datum=>资料,goods=>商城商品,press=>新闻,supplier_goods=>供应商商品,demand=>需求,recruit=>招聘,forum=>问答,activity=>活动]
         $search_type = [
         $search_type = [
@@ -1397,7 +1399,8 @@ class Expedite extends Base
             ]
             ]
         ];
         ];
         if($module)             $where['body']['query']['bool']['must'][] = ['match' =>['module'=> $module]];
         if($module)             $where['body']['query']['bool']['must'][] = ['match' =>['module'=> $module]];
-        if($module == 'demand' && $is_over != -1 ) $where['body']['query']['bool']['must'][] = ['match' =>['is_over'=> $is_over]];
+        if($module == 'demand' && $is_over != -1 )  $where['body']['query']['bool']['must'][] = ['match' =>['is_over'=> $is_over]];
+        if($module == 'recruit' && $city )          $where['body']['query']['bool']['must'][] = ['match' =>['city'=> $city]];
         if($search) $where['body']['query']['bool']['must'][] = ['bool' =>[
         if($search) $where['body']['query']['bool']['must'][] = ['bool' =>[
             'should'=> [
             'should'=> [
                 'multi_match' => [
                 'multi_match' => [
@@ -1413,6 +1416,7 @@ class Expedite extends Base
         {
         {
             $v['_source']['label_arr'] =  $v['_source']['label'] ? explode(',',$v['_source']['label']):null;
             $v['_source']['label_arr'] =  $v['_source']['label'] ? explode(',',$v['_source']['label']):null;
             $v['_source']['create_at'] = date("Y-m-d",$v['_source']['create_at']);
             $v['_source']['create_at'] = date("Y-m-d",$v['_source']['create_at']);
+            $v['_source']['release_time'] = date("Y-m-d",$v['_source']['release_time']);
             $v['_source']['is_over'] = isset($v['_source']['is_over']) ? intval($v['_source']['is_over']) : 0;
             $v['_source']['is_over'] = isset($v['_source']['is_over']) ? intval($v['_source']['is_over']) : 0;
             switch ($v['_source']['module']) {
             switch ($v['_source']['module']) {
                 case "video":
                 case "video":
@@ -1507,6 +1511,15 @@ class Expedite extends Base
                     $auth_info = \app\common\model\Recruit::getAuth($v['_source']['user_id'],APPNAME,APPLOGO);
                     $auth_info = \app\common\model\Recruit::getAuth($v['_source']['user_id'],APPNAME,APPLOGO);
                     $v['_source']['app_name']  = $auth_info['app_name'];
                     $v['_source']['app_name']  = $auth_info['app_name'];
                     $v['_source']['app_logo']  = $auth_info['app_logo'];
                     $v['_source']['app_logo']  = $auth_info['app_logo'];
+                    $v['_source']['scale']  = $info['scale'];
+                    $v['_source']['is_ss']  = $info['is_ss'];
+                    $v['_source']['company']  = $info['company'];
+                    $v['_source']['company_intro']  = $info['company_intro'];
+                    $v['_source']['province']  = $info['province'];
+                    $v['_source']['salary']  = $info['salary'];
+                    $v['_source']['city']  = $info['city'];
+                    $v['_source']['principal']  = $info['principal'];
+                    $v['_source']['hr_headimg']  = $info['hr_headimg'];
                     break;
                     break;
             }
             }
         }
         }

+ 10 - 5
application/api/controller/Forum.php

@@ -4,6 +4,7 @@ use app\common\model\ForumReply;
 use app\common\model\ForumReplyComment;
 use app\common\model\ForumReplyComment;
 use app\common\model\PlatformLike;
 use app\common\model\PlatformLike;
 use app\common\model\PlatformSwitch;
 use app\common\model\PlatformSwitch;
+use app\common\model\TopSearch;
 use app\common\model\User;
 use app\common\model\User;
 use app\common\model\UserCollect;
 use app\common\model\UserCollect;
 use app\common\model\UserForum;
 use app\common\model\UserForum;
@@ -83,6 +84,7 @@ class Forum extends Base
      * @return name:browse_num type:int default:-- desc:浏览量
      * @return name:browse_num type:int default:-- desc:浏览量
      * @return name:reply_num type:int default:-- desc:回答量
      * @return name:reply_num type:int default:-- desc:回答量
      * @return name:open_vip type:int default:-- desc:是否需要开通vip[0不需要1需要]
      * @return name:open_vip type:int default:-- desc:是否需要开通vip[0不需要1需要]
+     * @return name:release_time type:string default:-- desc:上架时间
      *
      *
      */
      */
     public function getForumList()
     public function getForumList()
@@ -175,6 +177,7 @@ class Forum extends Base
      * @return name:replay_num type:int default:-- desc:回复数量
      * @return name:replay_num type:int default:-- desc:回复数量
      * @return name:is_like type:int default:-- desc:是否点赞(0否1是)
      * @return name:is_like type:int default:-- desc:是否点赞(0否1是)
      * @return name:like_num type:int default:-- desc:点赞数量
      * @return name:like_num type:int default:-- desc:点赞数量
+     * @return name:release_time type:string default:-- desc:上架时间
      */
      */
     public function getForumInfo()
     public function getForumInfo()
     {
     {
@@ -184,7 +187,7 @@ class Forum extends Base
         $app_logo = sysconf('app_logo');
         $app_logo = sysconf('app_logo');
         $detail = UserForum::where('f.id', $id)
         $detail = UserForum::where('f.id', $id)
             ->alias('f')
             ->alias('f')
-            ->field('f.id,f.title,f.is_deleted,f.content,f.label,f.images,f.level,f.browse_num,f.status,is_read,f.create_at,u.name,u.headimg,IFNULL( (SELECT count(r.id) FROM dd_forum_reply as r WHERE f.id=r.forum_id  ),0 ) as reply_num')
+            ->field('f.id,f.title,f.is_deleted,release_time,f.content,f.label,f.images,f.level,f.browse_num,f.status,is_read,f.create_at,u.name,u.headimg,IFNULL( (SELECT count(r.id) FROM dd_forum_reply as r WHERE f.id=r.forum_id  ),0 ) as reply_num')
             ->leftJoin('store_member u', 'u.id = f.user_id')
             ->leftJoin('store_member u', 'u.id = f.user_id')
             ->find()->toArray();
             ->find()->toArray();
         if ($detail['is_deleted'] ||  $detail['status'] == 0) $this->error('该问答已删除');
         if ($detail['is_deleted'] ||  $detail['status'] == 0) $this->error('该问答已删除');
@@ -206,6 +209,7 @@ class Forum extends Base
         $detail['is_like'] = PlatformLike::checkTags($this->user_id, $detail['id'], 10);
         $detail['is_like'] = PlatformLike::checkTags($this->user_id, $detail['id'], 10);
         $detail['like_num'] = PlatformLike::getPraiseNum($detail['id'], 10);
         $detail['like_num'] = PlatformLike::getPraiseNum($detail['id'], 10);
         UserForum::where('id', $id)->setInc('browse_num');// 增加浏览量
         UserForum::where('id', $id)->setInc('browse_num');// 增加浏览量
+        TopSearch::seIncHotNum($id,$this->request->controller());
         if (!$detail['is_read']) UserForum::where('id', $detail['id'])->update(['is_read' => 1]);
         if (!$detail['is_read']) UserForum::where('id', $detail['id'])->update(['is_read' => 1]);
         UserTrack::crateTrack($this->user_id, 5, input('get.id'), 0);
         UserTrack::crateTrack($this->user_id, 5, input('get.id'), 0);
         $this->success('ok', ['detail' => $detail]);
         $this->success('ok', ['detail' => $detail]);
@@ -315,6 +319,7 @@ class Forum extends Base
      * @return name:name type:string default:-- desc:会员
      * @return name:name type:string default:-- desc:会员
      * @return name:headimg type:string default:-- desc:会员头像
      * @return name:headimg type:string default:-- desc:会员头像
      * @return name:like_num type:int default:-- desc:点赞数量
      * @return name:like_num type:int default:-- desc:点赞数量
+     * @return name:user_id type:int default:-- desc:回答人id
      * @return name:is_top type:int default:-- desc:是否置顶(0否1是)
      * @return name:is_top type:int default:-- desc:是否置顶(0否1是)
      * @return name:is_like type:int default:-- desc:是否点赞(0否1是)
      * @return name:is_like type:int default:-- desc:是否点赞(0否1是)
      * @return name:serial_number type:int default:-- desc:第几个回答的
      * @return name:serial_number type:int default:-- desc:第几个回答的
@@ -1277,8 +1282,8 @@ class Forum extends Base
         $sel_where[] = ['f.user_id', '=', $this->user_id];
         $sel_where[] = ['f.user_id', '=', $this->user_id];
         $sel_where[] = ['p.user_id', '<>', $this->user_id];
         $sel_where[] = ['p.user_id', '<>', $this->user_id];
         $sel_where[] = ['p.to_deleted', '=', 0];
         $sel_where[] = ['p.to_deleted', '=', 0];
-        PlatformLike::where($sel_where)->alias('p')->leftJoin('ForumReply f', 'f.id = p.like_id')
-            ->leftJoin('StoreMember u', 'u.id = p.user_id')->update(['p.is_read'=>1]);
+      /*  PlatformLike::where($sel_where)->alias('p')->leftJoin('ForumReply f', 'f.id = p.like_id')
+            ->leftJoin('StoreMember u', 'u.id = p.user_id')->update(['p.is_read'=>1]);*/
         $list = PlatformLike::where($sel_where)
         $list = PlatformLike::where($sel_where)
             ->field('p.*,f.content,f.is_deleted,f.to_deleted,u.name user_name,u.headimg,m.level,f.forum_id,f.id reply_id')
             ->field('p.*,f.content,f.is_deleted,f.to_deleted,u.name user_name,u.headimg,m.level,f.forum_id,f.id reply_id')
             ->alias('p')
             ->alias('p')
@@ -1326,9 +1331,9 @@ class Forum extends Base
         $sel_where[] = ['c.user_id', '=', $this->user_id];
         $sel_where[] = ['c.user_id', '=', $this->user_id];
         $sel_where[] = ['p.user_id', '<>', $this->user_id];
         $sel_where[] = ['p.user_id', '<>', $this->user_id];
         $sel_where[] = ['p.to_deleted', '=', 0];
         $sel_where[] = ['p.to_deleted', '=', 0];
-        PlatformLike::where($sel_where)->alias('p') ->leftJoin('ForumReplyComment c', 'c.id = p.like_id')
+     /*   PlatformLike::where($sel_where)->alias('p') ->leftJoin('ForumReplyComment c', 'c.id = p.like_id')
             ->leftJoin('UserForum f', 'f.id = c.forum_id')
             ->leftJoin('UserForum f', 'f.id = c.forum_id')
-            ->leftJoin('StoreMember u', 'u.id = p.user_id')->update(['p.is_read'=>1]);
+            ->leftJoin('StoreMember u', 'u.id = p.user_id')->update(['p.is_read'=>1]);*/
         $list = PlatformLike::where($sel_where)
         $list = PlatformLike::where($sel_where)
             ->field('p.*,c.content,c.is_deleted,c.forum_id,c.to_deleted,c.source_deleted,u.name user_name,u.headimg,f.title,c.reply_id,f.level,f.user_id forum_user')
             ->field('p.*,c.content,c.is_deleted,c.forum_id,c.to_deleted,c.source_deleted,u.name user_name,u.headimg,f.title,c.reply_id,f.level,f.user_id forum_user')
             ->alias('p')
             ->alias('p')

+ 41 - 15
application/api/controller/LevelOrder.php

@@ -6,6 +6,7 @@ use app\common\model\UserLevel;
 use app\common\model\LevelOrder as LOM;
 use app\common\model\LevelOrder as LOM;
 use app\common\model\UserLevelRank;
 use app\common\model\UserLevelRank;
 use app\common\service\UserSynth;
 use app\common\service\UserSynth;
+use EasyWeChat\Factory;
 use think\Db;
 use think\Db;
 
 
 /**
 /**
@@ -59,6 +60,7 @@ class LevelOrder extends Base
             'level_id' => $level_id,
             'level_id' => $level_id,
             'level_key' => $level_key,
             'level_key' => $level_key,
             'month' => $level_price[$level_key]['time'],
             'month' => $level_price[$level_key]['time'],
+            'level_title' => $level_price[$level_key]['title'],
             'price_total' =>$is_renew ? $level_price[$level_key]['renew']  :  $level_price[$level_key]['price'],
             'price_total' =>$is_renew ? $level_price[$level_key]['renew']  :  $level_price[$level_key]['price'],
         ];
         ];
         $order_info = LOM::create($order_insert);
         $order_info = LOM::create($order_insert);
@@ -211,7 +213,7 @@ class LevelOrder extends Base
      * @header name:Authorization require:1 desc:Token
      * @header name:Authorization require:1 desc:Token
      * @param name:level_id type:int require:1  default:0 desc:会员等级
      * @param name:level_id type:int require:1  default:0 desc:会员等级
      * @param name:level_key type:int require:1  default:0 desc:等级价格的key值
      * @param name:level_key type:int require:1  default:0 desc:等级价格的key值
-     * @param name:pay_type type:int require:1  default:0 desc:支付方式(1.h5微信,2.h5支付宝,3.app微信,4.app支付宝,5.h5微信内支付)
+     * @param name:pay_type type:int require:1  default:0 desc:支付方式(1.h5微信,2.h5支付宝,3.app微信,4.app支付宝,5.h5微信内支付,6微信pc,7pc支付宝)
      * @return name:config type:array default:0 desc:支付配置
      * @return name:config type:array default:0 desc:支付配置
      * @return name:config.appId type:string default:-- desc:公众账号ID
      * @return name:config.appId type:string default:-- desc:公众账号ID
      * @return name:config.signType type:string default:-- desc:签名类型
      * @return name:config.signType type:string default:-- desc:签名类型
@@ -250,6 +252,7 @@ class LevelOrder extends Base
             'level_key' => $level_key,
             'level_key' => $level_key,
             'pay_type' => $pay_type,
             'pay_type' => $pay_type,
             'month' => $level_price[$level_key]['time'],
             'month' => $level_price[$level_key]['time'],
+            'level_title' => $level_price[$level_key]['title'],
             'price_total' =>$is_renew ? $level_price[$level_key]['renew']  :  $level_price[$level_key]['price'],
             'price_total' =>$is_renew ? $level_price[$level_key]['renew']  :  $level_price[$level_key]['price'],
             'pay_no' =>get_order_sn()
             'pay_no' =>get_order_sn()
         ];
         ];
@@ -265,7 +268,7 @@ class LevelOrder extends Base
         $order_info = LOM::create($order_insert);
         $order_info = LOM::create($order_insert);
         $order_info = $order_info->toArray();
         $order_info = $order_info->toArray();
         $pay_no  = $order_info['pay_no'];
         $pay_no  = $order_info['pay_no'];
-        $ret_data = ['pay_status'=>0,'config'=>[],'code_url'=>'','openid'=>$user_info['openid']];
+        $ret_data = ['pay_status'=>0,'config'=>[],'code_url'=>'','openid'=>$user_info['openid'],'order_id'=>$order_info['id']];
         Db::startTrans();
         Db::startTrans();
         try {
         try {
             switch ($pay_type){
             switch ($pay_type){
@@ -303,10 +306,32 @@ class LevelOrder extends Base
                 case 5 :
                 case 5 :
                     if(!$user_info['openid']) $this->exception('请绑定openid');
                     if(!$user_info['openid']) $this->exception('请绑定openid');
                     $notify_url = $this->request->root(true) . '/api/we_chat_pay/LevelOrderNotify';
                     $notify_url = $this->request->root(true) . '/api/we_chat_pay/LevelOrderNotify';
-                    $pay_config = WeChatPay::wxPay('订单支付',$pay_no,$order_info['price_total'],$notify_url,'JSAPI',$user_info['openid']);
+                    $pay_config = WeChatPay::wxPay('订单支付',$pay_no,$order_info['price_total'],$notify_url,'NATIVE',$user_info['openid']);
                     if($pay_config['code'] != 200) $this->exception($pay_config['msg']);
                     if($pay_config['code'] != 200) $this->exception($pay_config['msg']);
                     $ret_data['config'] = $pay_config['config'];
                     $ret_data['config'] = $pay_config['config'];
                     break;
                     break;
+                case 6:
+                    $notify_url = $this->request->root(true) . '/api/we_chat_pay/LevelOrderNotify';
+                    /*$app = Factory::payment(config('app.wx_pay'));
+                    $pay_config = $app->order->unify([
+                        'body' => '订单支付',
+                        'out_trade_no' => $pay_no,
+                        'total_fee' => $order_info['price_total']*100,
+                        'notify_url' => $notify_url, // 支付结果通知网址,如果不设置则会使用配置里的默认地址
+                        'trade_type' => 'NATIVE', // 请对应换成你的支付方式对应的值类型
+                    ]);*/
+
+                    $pay_config = WeChatPay::wxPay('订单支付',$pay_no,$order_info['price_total'] ,$notify_url,'NATIVE');
+                    $ret_data['config'] = $pay_config['config'];
+                    $ret_data['code_url'] = $pay_config['pc_pay_url'];
+                    break;
+                case 7:
+                    $notify_url = $this->request->root(true) . '/api/Alipay/LevelOrderNotify';
+                    $return_url ='https://'.$_SERVER['HTTP_HOST']."/pc/#/vip-member";
+                    $config = Alipay::ali_pay_pc('订单支付',$pay_no,$order_info['price_total'],$notify_url,$return_url);
+                    $ret_data['config']['ali_url'] = $config;
+                    $ret_data['ali_url'] = $config;
+                    break;
             }
             }
             Db::commit();
             Db::commit();
         }catch (\Exception $e){
         }catch (\Exception $e){
@@ -330,17 +355,18 @@ class LevelOrder extends Base
      * @return name:price_total type:float default:--  desc:待支付金额
      * @return name:price_total type:float default:--  desc:待支付金额
      * @return name:level_id type:float default:--  desc:等级id
      * @return name:level_id type:float default:--  desc:等级id
      * @return name:level_name type:float default:--  desc:等级名称
      * @return name:level_name type:float default:--  desc:等级名称
+     * @return name:level_title type:float default:--  desc:等级标题
      * @return name:month type:float default:--  desc:时长(月)
      * @return name:month type:float default:--  desc:时长(月)
      * @return name:pay_state type:int default:--  desc:支付状态(0未支付1已支付)
      * @return name:pay_state type:int default:--  desc:支付状态(0未支付1已支付)
      * @return name:bill_apply type:int default:--  desc:是否申请发票【0否1是】
      * @return name:bill_apply type:int default:--  desc:是否申请发票【0否1是】
      * @return name:create_at type:string default:--  desc:时间
      * @return name:create_at type:string default:--  desc:时间
      * @return name:level_logo type:string default:--  desc:等级LOGO
      * @return name:level_logo type:string default:--  desc:等级LOGO
-     * @return name:pay_type type:int default:--  desc:支付方式(1.h5微信,2.h5支付宝,3.app微信,4.app支付宝,5.h5微信内支付)
+     * @return name:pay_type type:int default:--  desc:支付方式(1.h5微信,2.h5支付宝,3.app微信,4.app支付宝,5.h5微信内支付,6微信pc
      * @return name:bill_info type:array default:--  desc:发票详情
      * @return name:bill_info type:array default:--  desc:发票详情
      */
      */
     public function getOrderList()
     public function getOrderList()
     {
     {
-        $field = 'id,level_id,level_key,month,price_total,pay_type,order_no,create_at';
+        $field = 'id,level_id,level_key,month,price_total,pay_type,order_no,create_at,level_title';
         $list = \app\common\model\LevelOrder::field($field)->where(['user_id'=>$this->user_id,'pay_state'=>1])
         $list = \app\common\model\LevelOrder::field($field)->where(['user_id'=>$this->user_id,'pay_state'=>1])
             ->order('id desc ')->limit($this->off_set,$this->page_num)->select()->toArray();
             ->order('id desc ')->limit($this->off_set,$this->page_num)->select()->toArray();
         array_walk($list,function (&$v){
         array_walk($list,function (&$v){
@@ -379,18 +405,18 @@ class LevelOrder extends Base
      * @param name:remark type:string default:-- desc:备注
      * @param name:remark type:string default:-- desc:备注
      */
      */
 
 
-    public function applyBill()
+       public function applyBill()
     {
     {
         $order_id  = input('post.order_id');
         $order_id  = input('post.order_id');
-    /*    $type  = input('post.type');
-        $header  = input('post.header');
-        $identify_number  = input('post.identify_number');
-        $address  = input('post.address');
-        $bank  = input('post.bank');
-        $card_no = input('post.card_no');
-        $remark = input('post.remark');
-        $phone = input('post.phone');
-        $email = input('post.email');*/
+        /*    $type  = input('post.type');
+            $header  = input('post.header');
+            $identify_number  = input('post.identify_number');
+            $address  = input('post.address');
+            $bank  = input('post.bank');
+            $card_no = input('post.card_no');
+            $remark = input('post.remark');
+            $phone = input('post.phone');
+            $email = input('post.email');*/
         $post = input('post.');
         $post = input('post.');
         $order_info = \app\common\model\LevelOrder::where('id',$order_id)->find()->toArray();
         $order_info = \app\common\model\LevelOrder::where('id',$order_id)->find()->toArray();
         if(!$order_info['pay_state'])$this->error('订单未支付');
         if(!$order_info['pay_state'])$this->error('订单未支付');

+ 2 - 0
application/api/controller/Login.php

@@ -3,6 +3,7 @@ namespace app\api\controller;
 use app\common\model\UserFacility;
 use app\common\model\UserFacility;
 use app\common\model\UserGroup;
 use app\common\model\UserGroup;
 use app\common\model\UserLevelRank;
 use app\common\model\UserLevelRank;
+use app\common\model\UserLoginLog;
 use app\common\validate\UserVali;
 use app\common\validate\UserVali;
 use app\common\model\User;
 use app\common\model\User;
 use app\common\model\UserWallet;
 use app\common\model\UserWallet;
@@ -121,6 +122,7 @@ class Login extends Base
             $redis = new Redis();
             $redis = new Redis();
             // 登录账号的token
             // 登录账号的token
             $redis->set('TOKEN_'.$user_info['id'].'_'.$facility_type,$ret_data['token'],86400 * 7);//保存redis 天
             $redis->set('TOKEN_'.$user_info['id'].'_'.$facility_type,$ret_data['token'],86400 * 7);//保存redis 天
+            UserLoginLog::creatLog($user_info['id'],$facility_type,$facility_code,$account,$ret_data['token']);
             Db::commit();
             Db::commit();
         }catch (\Exception $e){
         }catch (\Exception $e){
             $ret_data['code'] = 201;
             $ret_data['code'] = 201;

+ 121 - 68
application/api/controller/Mall.php

@@ -1,15 +1,19 @@
 <?php
 <?php
 namespace app\api\controller;
 namespace app\api\controller;
 use app\common\model\GoodsCate;
 use app\common\model\GoodsCate;
+use app\common\model\GoodsOrder;
 use app\common\model\GoodsSeason;
 use app\common\model\GoodsSeason;
 use app\common\model\GoodsServe;
 use app\common\model\GoodsServe;
+use app\common\model\ShoppingTrolley;
 use app\common\model\StoreGoods;
 use app\common\model\StoreGoods;
 use app\common\model\User;
 use app\common\model\User;
 use app\common\model\UserCollect;
 use app\common\model\UserCollect;
+use app\common\model\UserMessage;
 use app\common\model\UserSearch;
 use app\common\model\UserSearch;
 use app\common\model\UserTrack;
 use app\common\model\UserTrack;
 use app\common\service\Activity;
 use app\common\service\Activity;
 use app\common\service\CheckPower;
 use app\common\service\CheckPower;
+use app\common\service\UserSynth;
 use library\tools\Data;
 use library\tools\Data;
 use think\Db;
 use think\Db;
 
 
@@ -33,7 +37,7 @@ class Mall extends Base
     }
     }
 
 
     /**
     /**
-     * @title 获取商品分类
+     * @title 获取商品全部分类
      * @desc  获取商品分类
      * @desc  获取商品分类
      * @author  qc
      * @author  qc
      * @url /api/Mall/getGoodsCate
      * @url /api/Mall/getGoodsCate
@@ -59,7 +63,7 @@ class Mall extends Base
      * @header name:Authorization require:1 desc:Token
      * @header name:Authorization require:1 desc:Token
      * @param  name:id type:int default:-- desc:一级分类id
      * @param  name:id type:int default:-- desc:一级分类id
      * @return name:title type:srting default:-- desc:标题
      * @return name:title type:srting default:-- desc:标题
-     * @return name:lev type:srting default:-- desc:分类等级(1,2,3,4
+     * @return name:lev type:srting default:-- desc:分类等级(1,2)
      */
      */
     public function getSecondCate()
     public function getSecondCate()
     {
     {
@@ -68,6 +72,33 @@ class Mall extends Base
     }
     }
 
 
 
 
+    /**
+     * @title 获取第三级分类
+     * @desc  获取第三级分类
+     * @author  qc
+     * @url /api/Supplier/getThirdCate
+     * @method GET
+     * @header name:Authorization require:1 desc:Token
+     * @param name:fid type:int  default:-- desc:一级分类id
+     * @param name:pid type:int default:-- desc:二级分类id【不传查一级分类下全部的三级分类】
+     * @return name:id type:int default:-- desc:分类id
+     * @return name:title type:string default:0 desc:分类名称
+     * @return name:lev type:int default:0 desc:分类等级
+     * @return name:children type:array default:0 desc:下级分类
+     */
+    public function getThirdCate()
+    {
+        $where = [];
+        $where[]=['is_deleted','=',0];
+        $where[]=['pid','=',input('fid')];
+        if(input('pid')) $where[] = ['id','=',input('pid')];
+        $list = GoodsCate::where($where)->field('id,title,pid,lev,logo')->order('sort desc,id asc')->select()->toArray();
+        foreach ($list  as &$v) {
+            $v['children'] =  GoodsCate::where([['is_deleted','=',0],['pid','=',$v['id']]])->field('id,title,pid,lev,logo')->order('sort desc,id asc')->select()->toArray();
+        }
+        $this->success('ok',['list'=>$list]);
+    }
+
 
 
     /**
     /**
      * @title 商城商品推荐
      * @title 商城商品推荐
@@ -78,32 +109,26 @@ class Mall extends Base
      * @header name:Authorization require:1 desc:Token
      * @header name:Authorization require:1 desc:Token
      * @param  name:page type:int default:0 desc:页数
      * @param  name:page type:int default:0 desc:页数
      * @param  name:page_num type:int default:20 desc:每页数
      * @param  name:page_num type:int default:20 desc:每页数
-     * @return name:id type:int default:-- desc:id
+     * @param  name:rand_user type:string default:-- desc:随机id(非登录状态必传,page=1时生成(a123),其他页数(a123),一直查询到没有数据)
+     * @return name:id type:int default:-- desc:商品id
      * @return name:name type:string default:-- desc:商品名称
      * @return name:name type:string default:-- desc:商品名称
      * @return name:cover type:string default:-- desc:封面
      * @return name:cover type:string default:-- desc:封面
+     * @return name:sale_num type:int default:-- desc:销量
+     * @return name:label_name type:array default:-- desc:标签
      * @return name:low_price type:float default:-- desc:价格
      * @return name:low_price type:float default:-- desc:价格
      */
      */
     public function getRecommendList()
     public function getRecommendList()
     {
     {
-        $search_log =  UserSearch::getSearchTitle($this->user_id,7);
-        $search_arr = [];
-        $where_str = 'b.id > 0';
-        foreach ($search_log as $t){
-            $search_arr[] =  " b.name like '".'%'.$t."%'" .' ';
-        }
-        if(!empty($search_arr)) $where_str  =  implode(' OR ',$search_arr);
-        $field = 'a.id,name,cover,low_price,IFNULL(is_recommend,0) is_recommend ';
-        $table = 'dd_store_goods';
-        $order_by_two = 'a.id';
-        $sql = "SELECT $field FROM " .$table . " a LEFT JOIN ( SELECT id,IF(id,1,1) is_recommend FROM $table b WHERE ( $where_str )) AS c ON c.id = a.id WHERE a.status =1 AND a.is_deleted = 0 ORDER BY is_recommend DESC , $order_by_two desc LIMIT {$this->off_set},{$this->page_num}";
-        $list = Db::query($sql);
-        $list = dispose_recommend($list);
-        $this->success('ok',['list'=>$list]);
+        $user_id = $this->user_id ? $this->user_id : input('rand_user');
+        if(!$user_id) $this->error('参数错误');
+        $list = UserSynth::getRecommendList($user_id,'goods',$this->page,$this->page_num,[],input('sort_type',1));
+        if($list['code'] != 200) $this->error($list['msg']);
+        $this->success('ok',$list);
     }
     }
 
 
 
 
     /**
     /**
-     * @title 获取商品列表
+     * @title 商品合集列表
      * @desc  获取商品列表
      * @desc  获取商品列表
      * @author  qc
      * @author  qc
      * @url /api/Mall/getGoodsList
      * @url /api/Mall/getGoodsList
@@ -111,52 +136,25 @@ class Mall extends Base
      * @header name:Authorization require:1 desc:Token
      * @header name:Authorization require:1 desc:Token
      * @param  name:page type:int default:1 desc:页数
      * @param  name:page type:int default:1 desc:页数
      * @param  name:page_num type:int default:20 desc:每页数
      * @param  name:page_num type:int default:20 desc:每页数
-     * @param  name:goods_name type:string require:0  default:-- desc:商品名称
-     * @param  name:first_classify type:int require:0  default:-- desc:一级分类id
-     * @param  name:second_classify type:int require:0  default:-- desc:二级分类id
+     * @param  name:third_classify type:int require:0  default:-- desc:三级分类id
      * @param  name:sort_type type:int default:1 desc:排序--1默认2时间升序3时间降序
      * @param  name:sort_type type:int default:1 desc:排序--1默认2时间升序3时间降序
      * @return name:name type:string default:-- desc:商品名称
      * @return name:name type:string default:-- desc:商品名称
      * @return name:cover type:string default:-- desc:商品封面图
      * @return name:cover type:string default:-- desc:商品封面图
-     * @return name:desc type:string default:-- desc:商品简述(副标题)
-     * @return name:image type:string default:-- desc:商品展示图[多张|隔开]
-     * @return name:content type:string default:-- desc:商品详情图[多张|隔开]
+     * @return name:label_name type:array default:-- desc:标签
      * @return name:low_price type:float default:-- desc:最低售价
      * @return name:low_price type:float default:-- desc:最低售价
-     * @return name:max_price type:float default:-- desc:最高售价
-     * @return name:low_original type:float default:-- desc:最低原价格
-     * @return name:total_num type:int default:-- desc:商品总数量
-     * @return name:detail type:int default:-- desc:商品详情
-     * @return name:first_classify type:int require:0  default:-- desc:一级分类id
-     * @return name:second_classify type:int require:0  default:-- desc:二级分类id
-     * @return name:freight_type type:int default:-- desc:运费类型0固定金额,1运费模板
-     * @return name:freight_id type:int default:-- desc:模板id(freight_type=1)
-     * @return name:postage type:float default:-- desc:运费(freight_type=0)
-     * @return name:item_list type:array default:-- desc:商品多规格列表
-     * @return name:item_list.spec_info type:array default:-- desc:规格型号设置['规格组id'=>'规格id','规格组id'=>'规格id'];
-     * @return name:item_list.goods_no type:string default:-- desc:规格货号
-     * @return name:item_list.goods_title:string default:-- desc:规格标题
-     * @return name:item_list.cover type:string default:-- desc:规格封面
-     * @return name:item_list.stock type:int default:-- desc:剩余库存
-     * @return name:item_list.original_price type:float default:-- desc:原价
-     * @return name:item_list.sell_price type:float default:-- desc:售价
-     * @return name:item_list.virtual type:int default:-- desc:虚拟销量
-     * @return name:item_list.weight type:float default:-- desc:重量【kg】
+     * @return name:sale_name type:int default:-- desc:销量
      * @return name:total_num type:int default:-- desc:总数
      * @return name:total_num type:int default:-- desc:总数
      */
      */
     public function getGoodsList(){
     public function getGoodsList(){
-        $all_cate = GoodsCate::field('id,title')->select()->toArray();
-        $all_cate = array_column($all_cate,null,'id');
         $input = input('get.');
         $input = input('get.');
         $sel_where = [];
         $sel_where = [];
         $sel_where[] = ['status','=',1];
         $sel_where[] = ['status','=',1];
         $sel_where[] = ['is_deleted','=',0];
         $sel_where[] = ['is_deleted','=',0];
         $sort_type = input('get.sort_type',1);
         $sort_type = input('get.sort_type',1);
-        if(isset_full($input,'goods_name')) {
-            $sel_where[] = ['name','like',"%".$input['goods_name']."%"];
-            if($this->user_id) UserSearch::saveSearchTitle($this->user_id,$input['goods_name'],7);
-        }
         if(isset_full($input,'first_classify'))$sel_where[] = ['first_classify','=',$input['first_classify']];
         if(isset_full($input,'first_classify'))$sel_where[] = ['first_classify','=',$input['first_classify']];
         if(isset_full($input,'second_classify'))$sel_where[] = ['second_classify','=',$input['second_classify']];
         if(isset_full($input,'second_classify'))$sel_where[] = ['second_classify','=',$input['second_classify']];
-
+        if(isset_full($input,'third_classify'))$sel_where[] = ['third_classify','=',$input['third_classify']];
+        if(!isset($sel_where['third_classify'])) $this->error('参数错误');
         switch ($sort_type) {
         switch ($sort_type) {
             case 1:
             case 1:
                 $order =  ['sort'=>'desc','id'=>'asc'];
                 $order =  ['sort'=>'desc','id'=>'asc'];
@@ -170,20 +168,19 @@ class Mall extends Base
         }
         }
 
 
         $list = StoreGoods::with(['itemList'])
         $list = StoreGoods::with(['itemList'])
-            ->field('specs,lists',true)
+            ->field('id,name,label,sale_num,cover')
             ->where($sel_where)->limit($this->off_set,$this->page_num)
             ->where($sel_where)->limit($this->off_set,$this->page_num)
             ->order($order)
             ->order($order)
             ->select()->toArray();
             ->select()->toArray();
         foreach ($list as &$v){
         foreach ($list as &$v){
-            $v['first_classify_name'] = isset($all_cate[$v['first_classify']]['title']) ? $all_cate[$v['first_classify']]['title']:'';
-            $v['second_classify_name'] = isset($all_cate[$v['second_classify']]['title']) ? $all_cate[$v['second_classify']]['title']:'';
-            $v['low_original'] = empty($v['item_list']) ? 0 :  min(array_column($v['item_list'],'original_price'));
+            //$v['low_original'] = empty($v['item_list']) ? 0 :  min(array_column($v['item_list'],'original_price'));
             $v['low_price'] = empty($v['item_list']) ? 0 : min(array_column($v['item_list'],'sell_price'));
             $v['low_price'] = empty($v['item_list']) ? 0 : min(array_column($v['item_list'],'sell_price'));
-            $v['max_price'] = empty($v['item_list']) ? 0 : max(array_column($v['item_list'],'sell_price'));
-            $v['total_num'] =  empty($v['item_list']) ? 0 :array_sum(array_column($v['item_list'],'base_stock'));
+            //$v['max_price'] = empty($v['item_list']) ? 0 : max(array_column($v['item_list'],'sell_price'));
+            //$v['total_num'] =  empty($v['item_list']) ? 0 :array_sum(array_column($v['item_list'],'base_stock'));
+            unset($v['item_list']);
         }
         }
         $total_num =  StoreGoods::where($sel_where)->count();
         $total_num =  StoreGoods::where($sel_where)->count();
-        $this->success('ok',['list'=>$list,'total_num'=>numTransform($total_num)]);
+        $this->success('ok',['list'=>$list,'total_count'=>$total_num,'page_num'=>$this->page_num]);
 
 
     }
     }
 
 
@@ -198,26 +195,37 @@ class Mall extends Base
      * @return name:name type:string default:-- desc:商品名称
      * @return name:name type:string default:-- desc:商品名称
      * @return name:cover type:string default:-- desc:商品封面图
      * @return name:cover type:string default:-- desc:商品封面图
      * @return name:desc type:string default:-- desc:商品简述(副标题)
      * @return name:desc type:string default:-- desc:商品简述(副标题)
-     * @return name:low_price type:float default:-- desc:最低价格
-     * @return name:max_price type:float default:-- desc:最高价格(下划线公用)
+     * @return name:min_price type:float default:-- desc:最低价格
+     * @return name:max_price type:float default:-- desc:最高价格
      * @return name:detail type:string default:-- desc:详情(富文本)
      * @return name:detail type:string default:-- desc:详情(富文本)
      * @return name:freight_type type:int default:-- desc:运费类型0固定金额,1运费模板
      * @return name:freight_type type:int default:-- desc:运费类型0固定金额,1运费模板
      * @return name:freight_id type:int default:-- desc:模板id(freight_type=1)
      * @return name:freight_id type:int default:-- desc:模板id(freight_type=1)
      * @return name:postage type:float default:-- desc:运费(freight_type=0)
      * @return name:postage type:float default:-- desc:运费(freight_type=0)
      * @return name:is_collect type:int default:-- desc:是否收藏(1是0否)
      * @return name:is_collect type:int default:-- desc:是否收藏(1是0否)
-     * @return name:item_list type:array default:-- desc:商品多规格列表
+     * @return name:label_name type:array default:-- desc:标签
+     * @return name:sale_num type:int default:-- desc:销量
+     * @return name:image_arr type:array default:-- desc:轮播图片
+     * @return name:content_arr type:array default:-- desc:详情图
      * @return name:item_list.spec_info type:array default:-- desc:规格型号设置;
      * @return name:item_list.spec_info type:array default:-- desc:规格型号设置;
      * @return name:item_list.goods_no type:string default:-- desc:规格货号
      * @return name:item_list.goods_no type:string default:-- desc:规格货号
      * @return name:item_list.stock type:int default:-- desc:剩余库存
      * @return name:item_list.stock type:int default:-- desc:剩余库存
      * @return name:item_list.original_price type:float default:-- desc:原价
      * @return name:item_list.original_price type:float default:-- desc:原价
      * @return name:item_list.sell_price type:float default:-- desc:售价
      * @return name:item_list.sell_price type:float default:-- desc:售价
+     * @return name:had_join type:array default:-- desc:已选规格
+     * @return name:had_join.goods_spec type:array default:-- desc:规格
      */
      */
     public function getGoodsDetail()
     public function getGoodsDetail()
     {
     {
         $goods_id = input('goods_id');
         $goods_id = input('goods_id');
-        $detail = StoreGoods::with(['itemList'])->field('specs,lists',true)->where('id',$goods_id)->find()->toArray();
-        $detail['max_price'] = max(array_column($detail['item_list'],'original_price'));
+        $detail = StoreGoods::with(['itemList'])->field('id,name,label,status,is_deleted,sale_num,image,content,lists')->where('id',$goods_id)->find()->toArray();
+        if($detail['status'] == 0 || $detail['is_deleted'] !=  0) $this->error('商品已下架');
+        $detail['min_price'] =  empty($detail['item_list']) ? 0 : min(array_column($detail['item_list'],'sell_price'));
+        $detail['max_price'] = empty($detail['item_list']) ? 0 : max(array_column($detail['item_list'],'sell_price'));
         $detail['is_collect'] = UserCollect::checkCollectByType($this->user_id,6,$detail['id']);
         $detail['is_collect'] = UserCollect::checkCollectByType($this->user_id,6,$detail['id']);
+        $detail['label_name'] = $detail['label'] ?  explode(',',trim($detail['label'],',')): null;
+        $detail['image_arr'] = $detail['image'] ?  explode('|',$detail['label']): null;
+        $detail['content_arr'] = $detail['content'] ?  explode('|',$detail['content']): null;
+        $detail['had_join'] = ShoppingTrolley::getTrolleyList(['t.user_id'=>$this->user_id,'t.goods_id'=>$detail['id']]);
         UserTrack::crateTrack($this->user_id,6,$goods_id,0);
         UserTrack::crateTrack($this->user_id,6,$goods_id,0);
         $this->success('oK',['goods_info'=>$detail]);
         $this->success('oK',['goods_info'=>$detail]);
     }
     }
@@ -271,12 +279,13 @@ class Mall extends Base
             $v['time'] = date("Y-m-d H:i:s",$v['update_int']);
             $v['time'] = date("Y-m-d H:i:s",$v['update_int']);
             $v['is_normal'] = CheckPower::checkModulesPower($v['goods_id'],0,$this->request->controller());
             $v['is_normal'] = CheckPower::checkModulesPower($v['goods_id'],0,$this->request->controller());
         }
         }
-        $this->success('ok',['list'=>$list]);
+        $total_num =  UserTrack::where($sel_where) ->alias('t') ->leftJoin('StoreGoods i','t.first_id = i.id')->count();
+        $this->success('ok',['list'=>$list,'total_count'=>$total_num,'page_num'=>$this->page_num]);
     }
     }
 
 
 
 
     /**
     /**
-     * @title 商品收藏列表
+     * @title 我的收藏列表
      * @desc  商品收藏列表
      * @desc  商品收藏列表
      * @author  qc
      * @author  qc
      * @url /api/Mall/getGoodsCollectList
      * @url /api/Mall/getGoodsCollectList
@@ -308,13 +317,14 @@ class Mall extends Base
         array_walk($list,function (&$v){
         array_walk($list,function (&$v){
             $v['is_normal'] = CheckPower::checkModulesPower($v['goods_id'],0,$this->request->controller());
             $v['is_normal'] = CheckPower::checkModulesPower($v['goods_id'],0,$this->request->controller());
         });
         });
-        $this->success('ok',['list'=>$list]);
+        $total_num =  UserCollect::where($sel_where) ->alias('t') ->leftJoin('StoreGoods i','t.coll_id = i.id')->count();
+        $this->success('ok',['list'=>$list,'total_count'=>$total_num,'page_num'=>$this->page_num]);
     }
     }
 
 
 
 
     /**
     /**
-     * @title 获取我发布的商品列表
-     * @desc  获取我发布的商品列表
+     * @title 我发布
+     * @desc  我发布
      * @author  qc
      * @author  qc
      * @url /api/Mall/getOwnGoodsList
      * @url /api/Mall/getOwnGoodsList
      * @method GET
      * @method GET
@@ -338,7 +348,50 @@ class Mall extends Base
         array_walk($list,function (&$v){
         array_walk($list,function (&$v){
             $v['is_normal'] = CheckPower::checkModulesPower($v['id'],0,$this->request->controller());
             $v['is_normal'] = CheckPower::checkModulesPower($v['id'],0,$this->request->controller());
         });
         });
-        $this->success('ok',['list'=>$list]);
+        $total_num =  StoreGoods::where(['user_id'=>$this->user_id])->count();
+        $this->success('ok',['list'=>$list,'total_count'=>$total_num,'page_num'=>$this->page_num]);
+    }
+
+
+
+    /**
+     * @title 批量删除||批量取消
+     * @desc 删除||取消
+     * @author qc
+     * @method POST
+     * @url /api/Activity/batchesDel
+     * @header name:Authorization require:1 desc:Token
+     * @param name:id type:string default:1 desc:记录id【多个用逗号隔开=>'1,2'】
+     * @param name:type type:string default:1 desc:类型【1我的收藏】
+     */
+    public function batchesDel()
+    {
+        $type = input('post.type',1);
+        $del_where = [];
+        $del_where[] = ['id','in',input('post.id')];
+        $del_where[] = ['user_id','=',$this->user_id];
+        if(in_array($type,[1]))  UserCollect::where($del_where)->delete();
+        $this->success('操作成功');
+    }
+
+
+    /**
+     * @title 获取角标数量
+     * @desc 获取角标数量
+     * @author qc
+     * @method GET
+     * @url /api/Mall/getMarkNum
+     * @header name:Authorization require:1 desc:Token
+     * @return name:trolley_num type:int default:-- desc:购物车商品数量
+     * @return name:no_pay_num type:int default:-- desc:未支付订单数量
+     * @return name:no_express_num type:int default:-- desc:未发货订单数量
+     */
+    public function getMarkNum()
+    {
+        $trolley_num = ShoppingTrolley::where(['user_id'=>$this->user_id])->sum('num');
+        $no_pay_num = GoodsOrder::where(['user_id'=>$this->user_id,'is_deleted'=>0,'pay_state'=>0,'cancel_state'=>0])->count();
+        $no_express_num = GoodsOrder::where(['user_id'=>$this->user_id,'is_deleted'=>0,'pay_state'=>1,'express_state'=>0,'cancel_state'=>0])->count();
+        $this->success('ok',compact(['trolley_num','no_pay_num','no_express_num']));
     }
     }
 
 
 
 

+ 158 - 94
application/api/controller/Order.php

@@ -1,5 +1,6 @@
 <?php
 <?php
 namespace app\api\controller;
 namespace app\api\controller;
+use app\common\model\BillApply;
 use app\common\model\OrderComment;
 use app\common\model\OrderComment;
 use app\common\model\OrderLogisticsUrge;
 use app\common\model\OrderLogisticsUrge;
 use app\common\model\ShoppingTrolley;
 use app\common\model\ShoppingTrolley;
@@ -11,6 +12,7 @@ use app\common\model\GoodsOrderItem;
 use app\common\model\User;
 use app\common\model\User;
 use app\common\model\UserMessage;
 use app\common\model\UserMessage;
 use app\common\service\ExpressService;
 use app\common\service\ExpressService;
+use app\common\service\UserSynth;
 use think\Db;
 use think\Db;
 use think\Exception;
 use think\Exception;
 
 
@@ -106,6 +108,14 @@ class Order extends Base
      * @param name:num type:int default:1 desc:数量
      * @param name:num type:int default:1 desc:数量
      * @param name:add_id type:int default:1 desc:收货地址id
      * @param name:add_id type:int default:1 desc:收货地址id
      * @param name:remark type:string default:1 desc:订单备注
      * @param name:remark type:string default:1 desc:订单备注
+     *
+     * @param name:bill_info type:string default:-- desc:发票信息--json【不开票可以不传】
+     * @param name:bill_info.type type:int default:-- desc:类型id
+     * @param name:bill_info.header type:string default:-- desc:抬头名称[公司名称||个人名称]
+     * @param name:bill_info.identify_number type:string default:-- desc:纳税人识别号
+     * @param name:bill_info.email type:string default:-- desc:邮箱
+     * @param name:bill_info.remark type:string default:-- desc:备注
+     *
      * @return name:order_id type:int default:1 desc:订单id
      * @return name:order_id type:int default:1 desc:订单id
      */
      */
     public function createOrderImmediately()
     public function createOrderImmediately()
@@ -115,6 +125,8 @@ class Order extends Base
         $num = input('post.num');
         $num = input('post.num');
         $add_id = input('post.add_id');
         $add_id = input('post.add_id');
         $remark = input('post.remark');
         $remark = input('post.remark');
+        $post_bill = input('post.bill_info');
+        $bill_info = json_decode(stripslashes($post_bill),true);
         if(!$goods_id || !$spec_id)  $this->error('请选择商品');
         if(!$goods_id || !$spec_id)  $this->error('请选择商品');
         if($num <=0 ) $this->error('数量有误');
         if($num <=0 ) $this->error('数量有误');
         if(!$add_id ) $this->error('请选择收货地址');
         if(!$add_id ) $this->error('请选择收货地址');
@@ -128,7 +140,6 @@ class Order extends Base
                 'pro_name' => $add_info['pro_name'],
                 'pro_name' => $add_info['pro_name'],
                 'city_name' => $add_info['city_name'],
                 'city_name' => $add_info['city_name'],
                 'county_name' => $add_info['county_name'],
                 'county_name' => $add_info['county_name'],
-                'street_name' => $add_info['street_name'],
                 'user_name' => $add_info['name'],
                 'user_name' => $add_info['name'],
                 'add_detail' => $add_info['detail'],
                 'add_detail' => $add_info['detail'],
                 'phone' => $add_info['phone'],
                 'phone' => $add_info['phone'],
@@ -173,8 +184,12 @@ class Order extends Base
             ];
             ];
             GoodsOrderItem::create($order_item);
             GoodsOrderItem::create($order_item);
             StoreGoods::where('id',$goods_id)->setDec('stock',$num);
             StoreGoods::where('id',$goods_id)->setDec('stock',$num);
-
             StoreGoodsItem::where('id',$spec_id)->setDec('stock',$num);
             StoreGoodsItem::where('id',$spec_id)->setDec('stock',$num);
+            // 申请开票
+            if($order_money > 0 && !empty($bill_info)){
+                $ret_val  = UserSynth::buildBillApply($this->user_id, $order_info->id,2,$bill_info,0,1,$bill_info['remark'],0);
+                if($ret_val['code'] != 200) $this->exception($ret_val['msg']);
+            }
             Db::commit();
             Db::commit();
         }catch (\Exception $e){
         }catch (\Exception $e){
             $this->is_commit = false;
             $this->is_commit = false;
@@ -194,12 +209,23 @@ class Order extends Base
      * @param name:ids type:int require:1  default:0 desc:购物车记录id
      * @param name:ids type:int require:1  default:0 desc:购物车记录id
      * @param name:add_id type:int default:1 desc:收货地址id
      * @param name:add_id type:int default:1 desc:收货地址id
      * @param name:remark type:string default:1 desc:订单备注
      * @param name:remark type:string default:1 desc:订单备注
+     *
+     * @param name:bill_info type:string default:-- desc:发票信息--json【不开票可以不传】
+     * @param name:bill_info.type type:int default:-- desc:类型id
+     * @param name:bill_info.header type:string default:-- desc:抬头名称[公司名称||个人名称]
+     * @param name:bill_info.identify_number type:string default:-- desc:纳税人识别号
+     * @param name:bill_info.email type:string default:-- desc:邮箱
+     * @param name:bill_info.remark type:string default:-- desc:备注
+     *
      * @return name:order_id type:int default:1 desc:订单id
      * @return name:order_id type:int default:1 desc:订单id
      */
      */
     public function createOrderByTrolley()
     public function createOrderByTrolley()
     {
     {
         $ids  = input('post.ids');
         $ids  = input('post.ids');
         $add_id = input('post.add_id');
         $add_id = input('post.add_id');
+        $remark = input('post.remark');
+        $post_bill = input('post.bill_info');
+        $bill_info = json_decode(stripslashes($post_bill),true);
         if(!$ids) $this->error('请选择商品');
         if(!$ids) $this->error('请选择商品');
         if(!$add_id ) $this->error('请选择收货地址');
         if(!$add_id ) $this->error('请选择收货地址');
         $ret_data = ['order_id'=>0];
         $ret_data = ['order_id'=>0];
@@ -227,6 +253,10 @@ class Order extends Base
             $order_item = [];// 订单列表
             $order_item = [];// 订单列表
             foreach ($trolley_list as $trolley)
             foreach ($trolley_list as $trolley)
             {
             {
+                //验证库存
+                if( $trolley['goods_spec']['stock'] < $trolley['num']) $this->exception('商品库存不足');
+                // 扣除库存
+                StoreGoodsItem::stockChange($trolley['spec_id'],$trolley['goods_id'],$trolley['num'],-1);
                 $price_goods += $trolley['num'] * $trolley['goods_spec']['sell_price'];
                 $price_goods += $trolley['num'] * $trolley['goods_spec']['sell_price'];
                 $original_total += $trolley['num'] * $trolley['goods_spec']['original_price'];
                 $original_total += $trolley['num'] * $trolley['goods_spec']['original_price'];
                 $total_num +=$trolley['num'];
                 $total_num +=$trolley['num'];
@@ -255,6 +285,7 @@ class Order extends Base
                 'user_name' => $add_info['name'],
                 'user_name' => $add_info['name'],
                 'add_detail' => $add_info['detail'],
                 'add_detail' => $add_info['detail'],
                 'phone' => $add_info['phone'],
                 'phone' => $add_info['phone'],
+                'remark' => $remark,
             ];
             ];
             $price_total = bcadd($price_goods ,$price_express,2);
             $price_total = bcadd($price_goods ,$price_express,2);
             $order_insert['price_total'] = $price_total;
             $order_insert['price_total'] = $price_total;
@@ -268,6 +299,11 @@ class Order extends Base
             (new GoodsOrderItem())->insertAll($order_item);// 生成订单商品详情
             (new GoodsOrderItem())->insertAll($order_item);// 生成订单商品详情
             ShoppingTrolley::where('id','in',$ids)->delete();// 删除购物车
             ShoppingTrolley::where('id','in',$ids)->delete();// 删除购物车
             $ret_data['order_id'] =  $order_info->id;
             $ret_data['order_id'] =  $order_info->id;
+            // 申请开票
+            if($price_total > 0 && !empty($bill_info)){
+                $ret_val  = UserSynth::buildBillApply($this->user_id, $order_info->id,2,$bill_info,0,1,$bill_info['remark'],0);
+                if($ret_val['code'] != 200) $this->exception($ret_val['msg']);
+            }
             Db::commit();
             Db::commit();
         }catch (\Exception $e){
         }catch (\Exception $e){
             $this->ret_msg = $e->getMessage();
             $this->ret_msg = $e->getMessage();
@@ -366,62 +402,61 @@ class Order extends Base
 
 
     /**
     /**
      * @title 获取订单列表
      * @title 获取订单列表
-     * @desc 订单优惠:int_cash + coupon_cash
+     * @desc 获取订单列表
      * @author qc
      * @author qc
      * @method GET
      * @method GET
      * @url /api/Order/getOrderList
      * @url /api/Order/getOrderList
      * @header name:Authorization require:1 desc:Token
      * @header name:Authorization require:1 desc:Token
      * @param  name:page type:int  default:1 desc:页数
      * @param  name:page type:int  default:1 desc:页数
      * @param  name:page_num type:int default:20 desc:每页数
      * @param  name:page_num type:int default:20 desc:每页数
-     * @param  name:status type:int default:-1  desc:订单状态(0待支付,1已支付(待发货),2已发货(待收货),3已收货(待评论)4已完成,8已退款,9取消)
+     * @param  name:status type:int default:-1  desc:订单状态(0待支付,1已支付(待发货),2已发货(待收货),3已收货(已完成,8已退款,9取消)
      * @param  name:pay_state type:int default:-1  desc:支付状态(-1全部,0未支付,1已支付)
      * @param  name:pay_state type:int default:-1  desc:支付状态(-1全部,0未支付,1已支付)
      * @param  name:cancel_state type:int default:-1  desc:取消状态(-1全部,0未取消,1已取消)
      * @param  name:cancel_state type:int default:-1  desc:取消状态(-1全部,0未取消,1已取消)
      * @param  name:apply_refund type:int default:-1  desc:申请退款状态(-1全部,0未申请||已取消,1已申请)
      * @param  name:apply_refund type:int default:-1  desc:申请退款状态(-1全部,0未申请||已取消,1已申请)
      * @return name:id type:int default:--  desc:订单id
      * @return name:id type:int default:--  desc:订单id
+     * @return name:id type:int default:--  desc:订单id
      * @return name:order_no type:string default:--  desc:订单号
      * @return name:order_no type:string default:--  desc:订单号
-     * @return name:price_total type:float default:--  desc:待支付金额(所以优惠完价格+运费)
-     * @return name:price_goods type:float default:--  desc:商品金额(用售价计算)
+     * @return name:price_total type:float default:--  desc:待支付金额(商品价格+运费)
+     * @return name:price_goods type:float default:--  desc:商品金额
      * @return name:price_express type:float default:--  desc:运费金额
      * @return name:price_express type:float default:--  desc:运费金额
-     * @return name:original_total type:float default:--  desc:总原价(下划线)
      * @return name:pay_state type:int default:--  desc:支付状态(0未支付1已支付)
      * @return name:pay_state type:int default:--  desc:支付状态(0未支付1已支付)
      * @return name:pay_type type:int default:--  desc:支付方式(1.h5微信,2.h5支付宝,3移动支付(微信),4移动支付(支付宝),5.h5微信内支付)
      * @return name:pay_type type:int default:--  desc:支付方式(1.h5微信,2.h5支付宝,3移动支付(微信),4移动支付(支付宝),5.h5微信内支付)
      * @return name:pay_no type:string default:--  desc:支付号
      * @return name:pay_no type:string default:--  desc:支付号
      * @return name:pay_at type:string default:--  desc:支付时间
      * @return name:pay_at type:string default:--  desc:支付时间
      * @return name:cancel_state type:int default:--  desc:取消状态(0未取消1已取消)
      * @return name:cancel_state type:int default:--  desc:取消状态(0未取消1已取消)
      * @return name:cancel_at type:string default:--  desc:取消时间
      * @return name:cancel_at type:string default:--  desc:取消时间
-     * @return name:cancel_desc type:string default:--  desc:取消原因
-     * @return name:cancel_desc type:string default:--  desc:取消原因
-     * @return name:refund_state type:int default:--  desc:退款状态(0未申请1待审核,2审核通过,3审核拒绝)
+     * @return name:refund_state type:int default:--  desc:退款状态(0未申请1待审核,2审核拒绝,3审核通过)
      * @return name:express_state type:int default:--  desc:发货状态(0未发货,1已发货,2已签收)
      * @return name:express_state type:int default:--  desc:发货状态(0未发货,1已发货,2已签收)
      * @return name:express_company_title type:string default:--  desc:发货快递公司名称
      * @return name:express_company_title type:string default:--  desc:发货快递公司名称
      * @return name:express_send_no type:string default:--  desc:物流单号
      * @return name:express_send_no type:string default:--  desc:物流单号
      * @return name:express_send_at type:string default:--  desc:发货时间
      * @return name:express_send_at type:string default:--  desc:发货时间
-     * @return name:status type:int default:--  desc:订单状态(0待支付,1已支付(待发货),2已发货(待收货),3已收货(待评论)4已完成,8已退款,9取消)
+     * @return name:status type:int default:--  desc:订单状态(0待支付,1已支付(待发货),2已发货(待收货),3已收货(已完成,8已退款,9取消)
      * @return name:create_at type:string default:--  desc:下单时间
      * @return name:create_at type:string default:--  desc:下单时间
-     * @return name:integral type:string default:--  desc:使用积分数量
-     * @return name:int_cash type:float default:--  desc:使用积分抵扣金额
-     * @return name:cl_ids type:string default:--  desc:使用优惠券id串
-     * @return name:coupon_cash type:string default:--  desc:使用优惠券抵扣金额
-     * @return name:blance type:string default:--  desc:使用余额支付金额
-     * @return name:redu_money type:float default:--  desc:订单满减金额
      * @return name:remark type:string default:--  desc:订单备注
      * @return name:remark type:string default:--  desc:订单备注
      * @return name:goods_num type:int default:--  desc:订单商品总数量
      * @return name:goods_num type:int default:--  desc:订单商品总数量
      * @return name:pro_name type:string default:--  desc:省名称(收货地址)
      * @return name:pro_name type:string default:--  desc:省名称(收货地址)
      * @return name:city_name type:string default:--  desc:市名称(收货地址)
      * @return name:city_name type:string default:--  desc:市名称(收货地址)
      * @return name:county_name type:string default:--  desc:县区名称(收货地址)
      * @return name:county_name type:string default:--  desc:县区名称(收货地址)
-     * @return name:street_name type:string default:--  desc:街道名称(收货地址)
      * @return name:add_detail type:string default:--  desc:详细地址(收货地址)
      * @return name:add_detail type:string default:--  desc:详细地址(收货地址)
      * @return name:user_name type:string default:--  desc:收货人
      * @return name:user_name type:string default:--  desc:收货人
      * @return name:phone type:string default:--  desc:收货人联系电话
      * @return name:phone type:string default:--  desc:收货人联系电话
-     * @return name:act_type type:int default:--  desc:活动类型0无1秒杀2拼团
-     * @return name:act_id type:int default:--  desc:活动id
-     * @return name:share_user type:int default:--  desc:分享人id
      * @return name:order_item type:array default:--  desc:订单商品列表
      * @return name:order_item type:array default:--  desc:订单商品列表
      * @return name:order_item.name type:float default:--  desc:商品名
      * @return name:order_item.name type:float default:--  desc:商品名
      * @return name:order_item.cover type:float default:--  desc:商品图
      * @return name:order_item.cover type:float default:--  desc:商品图
      * @return name:order_item.sell_price type:float default:--  desc:购买价格
      * @return name:order_item.sell_price type:float default:--  desc:购买价格
      * @return name:order_item.goods_spec type:float default:--  desc:规格
      * @return name:order_item.goods_spec type:float default:--  desc:规格
      * @return name:order_item.num type:int default:--  desc:数量
      * @return name:order_item.num type:int default:--  desc:数量
+     *
+     * @return name:bill_info type:array default:-- desc:发票申请信息
+     * @return name:bill_info.header type:string default:0 desc:抬头
+     * @return name:bill_info.type type:int default:0 desc:发票类型
+     * @return name:bill_info.email type:string default:0 desc:邮箱
+     * @return name:bill_info.phone type:string default:0 desc:电话
+     * @return name:bill_info.bank type:string default:0 desc:开户行
+     * @return name:bill_info.card_no type:string default:0 desc:银行账号
+     * @return name:bill_info.identify_number type:string default:0 desc:纳税人识别号
+     * @return name:bill_info.bill_img type:string default:0 desc:点子发票url
+     * @return name:bill_info.remark type:string default:0 desc:备注
      */
      */
     public function getOrderList()
     public function getOrderList()
     {
     {
@@ -431,20 +466,25 @@ class Order extends Base
         $refund_state = input('get.apply_refund',-1);
         $refund_state = input('get.apply_refund',-1);
         $where = [];
         $where = [];
         $where[] = ['user_id','=',$this->user_id];
         $where[] = ['user_id','=',$this->user_id];
+        $where[] = ['is_deleted','=',0];
         if($status > -1) $where[] = ['status','=',$status];
         if($status > -1) $where[] = ['status','=',$status];
         if($pay_state > -1) $where[] = ['pay_state','=',$pay_state];
         if($pay_state > -1) $where[] = ['pay_state','=',$pay_state];
         if($cancel_state > -1) $where[] = ['cancel_state','=',$cancel_state];
         if($cancel_state > -1) $where[] = ['cancel_state','=',$cancel_state];
         if($refund_state == 0) $where[] = ['refund_state','=',$refund_state];
         if($refund_state == 0) $where[] = ['refund_state','=',$refund_state];
         if($refund_state == 1) $where[] = ['refund_state','in','1,2,3,4'];
         if($refund_state == 1) $where[] = ['refund_state','in','1,2,3,4'];
-        $list = GoodsOrder::with(['orderItem'])->where($where)->order('id desc ')
+        $field = 'id,order_no,price_total,price_goods,price_express,create_at,pay_at,pay_type,goods_num,remark,pro_name,city_name,county_name,add_detail,pay_state,user_name,phone,remark,cancel_state,cancel_at,refund_state,express_state,express_company_title,express_send_no,express_send_at';
+        $list = GoodsOrder::with(['orderItem'])->field($field)->where($where)->order('id desc ')
             ->limit($this->off_set,$this->page_num)
             ->limit($this->off_set,$this->page_num)
             ->select()->toArray();
             ->select()->toArray();
         foreach ($list as &$info) {
         foreach ($list as &$info) {
+            $bill_info = BillApply::field('id,header,type,phone,email,bank,card_no,identify_number,bill_img,remark')->where(['order_type'=>2,'order_id'=>$info['id']])->find();
+            $info['bill_info'] = !empty($bill_info) ? $bill_info->toArray() : null;
             foreach ($info['order_item'] as &$v) {
             foreach ($info['order_item'] as &$v) {
                 $v['goods_spec'] = str_replace(['::',';;'],[':',';'],$v['goods_spec']);
                 $v['goods_spec'] = str_replace(['::',';;'],[':',';'],$v['goods_spec']);
             }
             }
         }
         }
-        $this->success('',['list'=>$list]);
+        $total_num =  GoodsOrder::where($where)->count();
+        $this->success('ok',['list'=>$list,'total_count'=>$total_num,'page_num'=>$this->page_num]);
     }
     }
 
 
     /**
     /**
@@ -460,29 +500,24 @@ class Order extends Base
      * @return name:price_total type:float default:--  desc:待支付金额(商品价格+运费)
      * @return name:price_total type:float default:--  desc:待支付金额(商品价格+运费)
      * @return name:price_goods type:float default:--  desc:商品金额
      * @return name:price_goods type:float default:--  desc:商品金额
      * @return name:price_express type:float default:--  desc:运费金额
      * @return name:price_express type:float default:--  desc:运费金额
-     * @return name:original_total type:float default:--  desc:总原价(下划线)
-     * @return name:original_total type:float default:--  desc:总原价(下划线)
      * @return name:pay_state type:int default:--  desc:支付状态(0未支付1已支付)
      * @return name:pay_state type:int default:--  desc:支付状态(0未支付1已支付)
      * @return name:pay_type type:int default:--  desc:支付方式(1.h5微信,2.h5支付宝,3移动支付(微信),4移动支付(支付宝),5.h5微信内支付)
      * @return name:pay_type type:int default:--  desc:支付方式(1.h5微信,2.h5支付宝,3移动支付(微信),4移动支付(支付宝),5.h5微信内支付)
      * @return name:pay_no type:string default:--  desc:支付号
      * @return name:pay_no type:string default:--  desc:支付号
      * @return name:pay_at type:string default:--  desc:支付时间
      * @return name:pay_at type:string default:--  desc:支付时间
      * @return name:cancel_state type:int default:--  desc:取消状态(0未取消1已取消)
      * @return name:cancel_state type:int default:--  desc:取消状态(0未取消1已取消)
      * @return name:cancel_at type:string default:--  desc:取消时间
      * @return name:cancel_at type:string default:--  desc:取消时间
-     * @return name:cancel_desc type:string default:--  desc:取消原因
      * @return name:refund_state type:int default:--  desc:退款状态(0未申请1待审核,2审核拒绝,3审核通过)
      * @return name:refund_state type:int default:--  desc:退款状态(0未申请1待审核,2审核拒绝,3审核通过)
      * @return name:express_state type:int default:--  desc:发货状态(0未发货,1已发货,2已签收)
      * @return name:express_state type:int default:--  desc:发货状态(0未发货,1已发货,2已签收)
      * @return name:express_company_title type:string default:--  desc:发货快递公司名称
      * @return name:express_company_title type:string default:--  desc:发货快递公司名称
      * @return name:express_send_no type:string default:--  desc:物流单号
      * @return name:express_send_no type:string default:--  desc:物流单号
      * @return name:express_send_at type:string default:--  desc:发货时间
      * @return name:express_send_at type:string default:--  desc:发货时间
-     * @return name:status type:int default:--  desc:订单状态(0待支付,1已支付(待发货),2已发货(待收货),3已收货(待评论)4已完成,8已退款,9取消)
+     * @return name:status type:int default:--  desc:订单状态(0待支付,1已支付(待发货),2已发货(待收货),3已收货(已完成,8已退款,9取消)
      * @return name:create_at type:string default:--  desc:下单时间
      * @return name:create_at type:string default:--  desc:下单时间
-     * @return name:blance type:string default:--  desc:使用余额支付金额(余额抵扣)
      * @return name:remark type:string default:--  desc:订单备注
      * @return name:remark type:string default:--  desc:订单备注
      * @return name:goods_num type:int default:--  desc:订单商品总数量
      * @return name:goods_num type:int default:--  desc:订单商品总数量
      * @return name:pro_name type:string default:--  desc:省名称(收货地址)
      * @return name:pro_name type:string default:--  desc:省名称(收货地址)
      * @return name:city_name type:string default:--  desc:市名称(收货地址)
      * @return name:city_name type:string default:--  desc:市名称(收货地址)
      * @return name:county_name type:string default:--  desc:县区名称(收货地址)
      * @return name:county_name type:string default:--  desc:县区名称(收货地址)
-     * @return name:street_name type:string default:--  desc:街道名称(收货地址)
      * @return name:add_detail type:string default:--  desc:详细地址(收货地址)
      * @return name:add_detail type:string default:--  desc:详细地址(收货地址)
      * @return name:user_name type:string default:--  desc:收货人
      * @return name:user_name type:string default:--  desc:收货人
      * @return name:phone type:string default:--  desc:收货人联系电话
      * @return name:phone type:string default:--  desc:收货人联系电话
@@ -492,21 +527,35 @@ class Order extends Base
      * @return name:order_item.sell_price type:float default:--  desc:购买价格
      * @return name:order_item.sell_price type:float default:--  desc:购买价格
      * @return name:order_item.goods_spec type:float default:--  desc:规格
      * @return name:order_item.goods_spec type:float default:--  desc:规格
      * @return name:order_item.num type:int default:--  desc:数量
      * @return name:order_item.num type:int default:--  desc:数量
+     *
+     * @return name:bill_info type:array default:-- desc:发票申请信息
+     * @return name:bill_info.header type:string default:0 desc:抬头
+     * @return name:bill_info.type type:int default:0 desc:发票类型
+     * @return name:bill_info.email type:string default:0 desc:邮箱
+     * @return name:bill_info.phone type:string default:0 desc:电话
+     * @return name:bill_info.bank type:string default:0 desc:开户行
+     * @return name:bill_info.card_no type:string default:0 desc:银行账号
+     * @return name:bill_info.identify_number type:string default:0 desc:纳税人识别号
+     * @return name:bill_info.bill_img type:string default:0 desc:点子发票url
+     * @return name:bill_info.remark type:string default:0 desc:备注
      */
      */
     public function getOrderDetail()
     public function getOrderDetail()
     {
     {
         $order_id = input('get.order_id');
         $order_id = input('get.order_id');
-        $detail = GoodsOrder::where('id',$order_id)->find()->toArray();
+        $field = 'id,order_no,price_total,price_goods,price_express,create_at,pay_at,pay_type,goods_num,remark,pro_name,city_name,county_name,add_detail,pay_state,user_name,phone,remark,cancel_state,cancel_at,refund_state,express_state,express_company_title,express_send_no,express_send_at';
+        $detail = GoodsOrder::where('id',$order_id)->field($field)->find()->toArray();
         $detail['order_item']  = (new GoodsOrderItem())->getOrderItem($order_id);
         $detail['order_item']  = (new GoodsOrderItem())->getOrderItem($order_id);
         foreach ($detail['order_item'] as &$v) {
         foreach ($detail['order_item'] as &$v) {
             $v['goods_spec'] = str_replace(['::',';;'],[':',';'],$v['goods_spec']);
             $v['goods_spec'] = str_replace(['::',';;'],[':',';'],$v['goods_spec']);
         }
         }
+        $bill_info = BillApply::field('id,header,type,phone,email,bank,card_no,identify_number,bill_img,remark')->where(['order_type'=>2,'order_id'=>$detail['id']])->find();
+        $detail['bill_info'] = !empty($bill_info) ? $bill_info->toArray() : null;
         $this->success('ok',['detail'=>$detail]);
         $this->success('ok',['detail'=>$detail]);
     }
     }
 
 
     /**
     /**
-     * @title 计算商品运费(一个商品id
-     * @desc  计算商品运费(一个商品id
+     * @title 计算商品运费(一个商品)
+     * @desc  计算商品运费(一个商品)
      * @author qc
      * @author qc
      * @url /api/Order/getGoodsFreight
      * @url /api/Order/getGoodsFreight
      * @method GET
      * @method GET
@@ -583,10 +632,7 @@ class Order extends Base
             foreach ($detail['order_item'] as $item_info) {
             foreach ($detail['order_item'] as $item_info) {
                 //  更改订单详情状态
                 //  更改订单详情状态
                 GoodsOrderItem::update(['status'=>9],['id'=>$item_info['id']]);
                 GoodsOrderItem::update(['status'=>9],['id'=>$item_info['id']]);
-                // 商品规格库存返回
-                StoreGoodsItem::where('id',$item_info['spec_id'])->setInc('stock',$item_info['num']);
-                // 商品总库存增加
-                StoreGoods::where('id',$item_info['goods_id'])->setInc('stock',$item_info['num']);
+                StoreGoodsItem::stockChange($item_info['spec_id'],$item_info['goods_id'],$item_info['num']);
             }
             }
             Db::commit();
             Db::commit();
         }catch (\Exception $e){
         }catch (\Exception $e){
@@ -637,7 +683,6 @@ class Order extends Base
             'pro_name' => $add_info['pro_name'],
             'pro_name' => $add_info['pro_name'],
             'city_name' => $add_info['city_name'],
             'city_name' => $add_info['city_name'],
             'county_name' => $add_info['county_name'],
             'county_name' => $add_info['county_name'],
-            'street_name' => $add_info['street_name'],
             'add_detail' => $add_info['detail'],
             'add_detail' => $add_info['detail'],
             'user_name' => $add_info['name'],
             'user_name' => $add_info['name'],
             'phone' => $add_info['phone'],
             'phone' => $add_info['phone'],
@@ -669,62 +714,7 @@ class Order extends Base
         $this->success('已确认收货');
         $this->success('已确认收货');
     }
     }
 
 
-    /**
-     * @title 订单评价
-     * @desc  订单评价
-     * @author  qc
-     * @url /api/Order/orderComment
-     * @method POST
-     * @header name:Authorization require:1 desc:Token
-     * @param  name:item_id type:int require:1  default:0 desc:订单item表id
-     * @param  name:content type:string require:1  default:0 desc:评论内容
-     * @param  name:images type:string default:0 desc:图片
-     * @param  name:video type:string default:0 desc:视频
-     * @param  name:goods_core type:int default:0 desc:商品评分
-     * @param  name:wl_core type:int default:0 desc:物流评分
-     * @param  name:serve_core type:int default:0 desc:服务评分
-     */
-    public function orderComment()
-    {
-        $item_id = input('post.item_id','');
-        $content = input('post.content','');
-        $images = input('post.images','');
-        $video = input('post.video','');
-        $goods_core = input('post.goods_core','');
-        $wl_core = input('post.wl_core','');
-        $serve_core = input('post.serve_core','');
-        $item = GoodsOrderItem::get($item_id);
-        if(!$item) $this->error('订单不存在');
-        $order_info = GoodsOrder::where('id',$item->order_id)->find();
-        if($order_info->status < 3) $this->error('请先确认收货');
-        GoodsOrderItem::where('id',$item->id)->update(['status'=>4]);
-        GoodsOrder::where('id',$item->order_id)->update(['status'=>4]);
-        $data = [
-            'user_id' => $this->user_id,
-            'order_id' =>$item->order_id,
-            'goods_id' =>$item->goods_id,
-            'spec_id' =>$item->spec_id,
-            'content' =>$content,
-            'images' =>$images,
-            'video' =>$video,
-            'goods_core' =>$goods_core,
-            'wl_core' =>$wl_core,
-            'serve_core' =>$serve_core,
-        ];
-        OrderComment::create($data);
-        $this->success('评论成功');
-    }
-
 
 
-    /**
-     * @title 以下接口为二期需求
-     * @desc  以下接口为二期需求
-     * @author  qc
-     * @url /api/Order/secondPhase
-     * @method
-     * @return name:1 type:string default:-- desc:以下接口为二期需求
-     */
-    public function secondPhase(){}
 
 
     /**
     /**
      * @title 获取物流详情
      * @title 获取物流详情
@@ -759,8 +749,8 @@ class Order extends Base
 
 
 
 
     /**
     /**
-     * @title 订单催
-     * @desc 订单催
+     * @title 发货提醒
+     * @desc 发货提醒
      * @author qc
      * @author qc
      * @url /api/Order/orderUrge
      * @url /api/Order/orderUrge
      * @method POST
      * @method POST
@@ -796,5 +786,79 @@ class Order extends Base
     }
     }
 
 
 
 
+    /**
+     *
+     * @title 申请开票
+     * @desc 申请开票
+     * @author qc
+     * @method POST
+     * @url /api/Order/applyBill
+     * @header name:Authorization require:1 desc:Token
+     * @param name:order_id type:string default:1 desc:订单id
+     * @param name:type type:int default:-- desc:类型id
+     * @param name:header type:string default:-- desc:抬头名称[公司名称||个人名称]
+     * @param name:identify_number type:string default:-- desc:纳税人识别号
+     * @param name:email type:string default:-- desc:邮箱
+     * @param name:remark type:string default:-- desc:备注
+     */
+
+    public function applyBill()
+    {
+        $order_id  = input('post.order_id');
+        $post = input('post.');
+        $order_info = GoodsOrder::where('id',$order_id)->find()->toArray();
+        if(!$order_info['pay_state'])$this->error('订单未支付');
+        if(BillApply::checkBillApply($order_id,2)) $this->error('已申请开票');
+        $ret_val = UserSynth::buildBillApply($this->user_id, $order_id, 2,$post,0,1,$post['remark']);
+        if($ret_val['code'] != 200) $this->error($ret_val['msg']);
+        $this->success('申请成功');
+    }
+
+    /**
+     *
+     * @title 订单商品添加购物车
+     * @desc 订单商品添加购物车
+     * @author qc
+     * @method POST
+     * @url /api/Order/addTrolleyFromOrder
+     * @header name:Authorization require:1 desc:Token
+     * @param name:order_id type:string default:1 desc:订单id
+     */
+    public function addTrolleyFromOrder(){
+        $order_id = input('post.order_id');
+        Db::startTrans();
+        try {
+            $detail = GoodsOrder::with('orderItem')->where('id',$order_id)->find()->toArray();
+            foreach ($detail['order_item'] as $item_info) {
+                $goods_info = StoreGoods::getGoodsSpec($item_info['goods_id'],$item_info['spec_id']);
+                if(!$goods_info) $this->exception('商品已下架');
+                if(empty($goods_info['item_list'])) $this->exception('商品规格已下架');
+                if($goods_info['item_list'][0]['stock'] < $item_info['num'])$this->exception('库存不足');
+                //某商品某规格是否已经添加购物车
+                $trolley_id = ShoppingTrolley::checkTrolley($this->user_id,$item_info['goods_id'],$item_info['spec_id']);
+                // 添加到购物车
+                if($trolley_id) {
+                    ShoppingTrolley::where('id',$trolley_id)->setInc('num',$item_info['num']);
+                }else{
+                    $trolley_info = [
+                        'user_id' => $this->user_id,
+                        'goods_id' => $item_info['goods_id'],
+                        'spec_id' => $item_info['spec_id'],
+                        'goods_no' => $goods_info['item_list'][0]['goods_no'],
+                        'num' => $item_info['num'],
+                    ];
+                    ShoppingTrolley::create($trolley_info);
+                }
+            }
+            Db::commit();
+        }catch (\Exception $e){
+            $this->ret_msg = $e->getMessage();
+            $this->is_commit = false;
+            Db::rollback();
+        }
+        $this->is_commit ? $this->success('添加成功') : $this->error($this->ret_msg);
+    }
+
+
 
 
 }
 }

+ 32 - 19
application/api/controller/Press.php

@@ -5,6 +5,7 @@ use app\common\model\DatumUrl;
 use app\common\model\PlatformSwitch;
 use app\common\model\PlatformSwitch;
 use app\common\model\PressComment;
 use app\common\model\PressComment;
 use app\common\model\PlatformLike;
 use app\common\model\PlatformLike;
+use app\common\model\TopSearch;
 use app\common\model\User;
 use app\common\model\User;
 use app\common\model\UserCollect;
 use app\common\model\UserCollect;
 use app\common\model\UserMessage;
 use app\common\model\UserMessage;
@@ -81,11 +82,11 @@ class Press extends Base
      * @return name:comment_num type:int default:-- desc:评论量
      * @return name:comment_num type:int default:-- desc:评论量
      * @return name:app_name type:string default:-- desc:发布方名称
      * @return name:app_name type:string default:-- desc:发布方名称
      * @return name:app_logo type:string default:-- desc:发布方头像
      * @return name:app_logo type:string default:-- desc:发布方头像
-     *
+     * @return name:release_time type:string default:-- desc:上架时间
+     * @return name:switch_open type:int default:-- desc:通知开关【0关闭1开启】
      */
      */
     public function getRecommendList()
     public function getRecommendList()
     {
     {
-
         $user_id = $this->user_id ? $this->user_id : input('rand_user');
         $user_id = $this->user_id ? $this->user_id : input('rand_user');
         if(!$user_id) $this->error('参数错误');
         if(!$user_id) $this->error('参数错误');
         $list = UserSynth::getRecommendList($user_id,'press',$this->page,$this->page_num);
         $list = UserSynth::getRecommendList($user_id,'press',$this->page,$this->page_num);
@@ -154,7 +155,7 @@ class Press extends Base
      * @return name:is_praise type:int default:-- desc:是否点赞
      * @return name:is_praise type:int default:-- desc:是否点赞
      * @return name:comment_num type:int default:-- desc:评论量
      * @return name:comment_num type:int default:-- desc:评论量
      * @return name:app_name type:string default:-- desc:发布方名称
      * @return name:app_name type:string default:-- desc:发布方名称
-     * @return name:app_logo type:string default:-- desc:发布方头像
+     * @return name:release_time type:string default:-- desc:上架时间
      */
      */
     public function getPressList(){
     public function getPressList(){
         $title = input('get.title');
         $title = input('get.title');
@@ -174,7 +175,7 @@ class Press extends Base
 
 
         if($title && $this->user_id) UserSearch::saveSearchTitle($this->user_id,$title,4);
         if($title && $this->user_id) UserSearch::saveSearchTitle($this->user_id,$title,4);
         $list = \app\common\model\Press::where(['is_deleted'=>0])
         $list = \app\common\model\Press::where(['is_deleted'=>0])
-            ->field('id,images,title,content,read_num,create_at,transmit_num,user_id')
+            ->field('id,images,title,content,read_num,create_at,transmit_num,user_id,release_time')
             ->when($title,function ($query)use($title){
             ->when($title,function ($query)use($title){
             if($title) $query->where('title|label','like','%'.$title.'%');
             if($title) $query->where('title|label','like','%'.$title.'%');
         })->order($order)->limit($this->off_set,$this->page_num)->select()->toArray();
         })->order($order)->limit($this->off_set,$this->page_num)->select()->toArray();
@@ -222,6 +223,7 @@ class Press extends Base
      * @return name:switch_open type:int default:-- desc:通知开关【0关闭1开启】
      * @return name:switch_open type:int default:-- desc:通知开关【0关闭1开启】
      * @return name:comment_switch type:int default:-- desc:评论开关【0关闭1开启】
      * @return name:comment_switch type:int default:-- desc:评论开关【0关闭1开启】
      * @return name:goods_id type:int default:-- desc:供应商商品id
      * @return name:goods_id type:int default:-- desc:供应商商品id
+     * @return name:release_time type:string default:-- desc:上架时间
      *
      *
      * @return name:video_id type:int default:-- desc:视频系列id
      * @return name:video_id type:int default:-- desc:视频系列id
      * @return name:video_item type:int default:-- desc:关联视频详情id【video_arr.id】
      * @return name:video_item type:int default:-- desc:关联视频详情id【video_arr.id】
@@ -239,7 +241,7 @@ class Press extends Base
     public function getPressDetail()
     public function getPressDetail()
     {
     {
         $sel_where[]  = ['id','=',input('get.id')];
         $sel_where[]  = ['id','=',input('get.id')];
-        $detail = \app\common\model\Press::field('id,images,goods_id,title,content,read_num,create_at,transmit_num,user_id,is_deleted,status,video_id,video_item,article_id,article_item,datum_id,datum_item')->where($sel_where)->find()->toArray();
+        $detail = \app\common\model\Press::field('id,images,goods_id,title,release_time,content,read_num,create_at,transmit_num,user_id,is_deleted,status,video_id,video_item,article_id,article_item,datum_id,datum_item')->where($sel_where)->find()->toArray();
         if($detail['is_deleted'] == 1 || $detail['status'] == 0) $this->error('该新闻已下架');
         if($detail['is_deleted'] == 1 || $detail['status'] == 0) $this->error('该新闻已下架');
         $detail['comment_num'] = PressComment::where(['first_id'=>$detail['id'],'type'=>1,'is_deleted'=>0])->count();
         $detail['comment_num'] = PressComment::where(['first_id'=>$detail['id'],'type'=>1,'is_deleted'=>0])->count();
         $detail['comment_num'] = numTransform($detail['comment_num']);
         $detail['comment_num'] = numTransform($detail['comment_num']);
@@ -423,6 +425,7 @@ class Press extends Base
     {
     {
         $press_id = input('post.id',0);
         $press_id = input('post.id',0);
         \app\common\model\Press::where('id',$press_id)->setInc('read_num');
         \app\common\model\Press::where('id',$press_id)->setInc('read_num');
+        TopSearch::seIncHotNum($press_id,$this->request->controller());
         $this->success('ok');
         $this->success('ok');
     }
     }
 
 
@@ -485,7 +488,7 @@ class Press extends Base
         $id = input('post.id');
         $id = input('post.id');
         $content = input('post.content',0);
         $content = input('post.content',0);
         if(!$content) $this->error('请输入评论内容');
         if(!$content) $this->error('请输入评论内容');
-        $comment_info = \app\common\model\Press::where('id',$id)->find()->toArray();value('comment_switch');
+        $comment_info = \app\common\model\Press::where('id',$id)->find()->toArray();
         if(!$comment_info['comment_switch']) $this->error('评论功能已关闭');
         if(!$comment_info['comment_switch']) $this->error('评论功能已关闭');
         $res = PressComment::create(['user_id'=>$this->user_id,'content'=>$content,'first_id'=>$id,'type'=>1]);
         $res = PressComment::create(['user_id'=>$this->user_id,'content'=>$content,'first_id'=>$id,'type'=>1]);
         $detail  =PressComment::where('p.id',$res->id)
         $detail  =PressComment::where('p.id',$res->id)
@@ -545,7 +548,9 @@ class Press extends Base
      * @return name:reply_num type:int default:-- desc:未读量--回复我的
      * @return name:reply_num type:int default:-- desc:未读量--回复我的
      * @return name:comment_num type:int default:-- desc:未读量--评论我的
      * @return name:comment_num type:int default:-- desc:未读量--评论我的
      * @return name:total_num type:int default:-- desc:总数【reply_num+comment_num】
      * @return name:total_num type:int default:-- desc:总数【reply_num+comment_num】
-     * @return name:praise_num type:int default:-- desc:点赞我的
+     * @return name:praise_press type:int default:-- desc:点赞我的--新闻
+     * @return name:praise_comment type:int default:-- desc:点赞我的--评论
+     * @return name:praise_num type:int default:-- desc:点赞我的--新闻+评论
      */
      */
     public function getMarkNum()
     public function getMarkNum()
     {
     {
@@ -558,11 +563,10 @@ class Press extends Base
         $reply_num =  PressComment::where([['t.is_deleted','=',0],['t.lev','>=',2],['is_read','=',0],['t.pid','in',implode(',',$all_comment)]])->alias('t')->count();
         $reply_num =  PressComment::where([['t.is_deleted','=',0],['t.lev','>=',2],['is_read','=',0],['t.pid','in',implode(',',$all_comment)]])->alias('t')->count();
         $total_num = $comment_num +  $reply_num ;
         $total_num = $comment_num +  $reply_num ;
 
 
-        $praise_press = PlatformLike::where([['p.type', '=', 1],['f.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0]])->alias('p') ->leftJoin('SupplierGoods f', 'f.id = p.like_id')->count();
-        $praise_comment = PlatformLike::where([['p.type', '=', 2],['c.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0]])->alias('p')->leftJoin('SupplierComment c', 'c.id = p.like_id')->count();
+        $praise_press = PlatformLike::where([['p.type', '=', 1],['f.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0],['p.user_id','<>',$this->user_id]])->alias('p') ->leftJoin('Press f', 'f.id = p.like_id')->count();
+        $praise_comment = PlatformLike::where([['p.type', '=', 2],['c.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0],['p.user_id','<>',$this->user_id]])->alias('p')->leftJoin('PressComment c', 'c.id = p.like_id')->count();
         $praise_num = $praise_press + $praise_comment;
         $praise_num = $praise_press + $praise_comment;
-
-        $this->success('ok',compact(['reply_num','comment_num','total_num','praise_num']));
+        $this->success('ok',compact(['reply_num','comment_num','total_num','praise_num','praise_press','praise_comment']));
     }
     }
 
 
 
 
@@ -575,7 +579,7 @@ class Press extends Base
      * eadChange
      * eadChange
      * @header name:Authorization require:1 desc:Token
      * @header name:Authorization require:1 desc:Token
      * @param name:id type:string default:-- desc:记录id(多个逗号隔开,不传修改全部])
      * @param name:id type:string default:-- desc:记录id(多个逗号隔开,不传修改全部])
-     * @param name:type type:string default:1 desc:消息类型【1评论我的,2回复我的,3点赞我的】
+     * @param name:type type:string default:1 desc:消息类型【1评论我的,2回复我的,3点赞我的--新闻,4点赞我的-评论
      * @param name:is_read type:int default:1 desc:变更类型【0消息变更为未读,1变更为已读】
      * @param name:is_read type:int default:1 desc:变更类型【0消息变更为未读,1变更为已读】
      */
      */
 
 
@@ -602,9 +606,12 @@ class Press extends Base
                     })->alias('t')->update(['is_read'=>$is_read]);
                     })->alias('t')->update(['is_read'=>$is_read]);
                 break;
                 break;
             case 3:
             case 3:
-                $ids = PlatformLike::where([['p.type', '=', 1],['f.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0]])->alias('p') ->leftJoin('SupplierGoods f', 'f.id = p.like_id')->column('p.id');
-                $ids2 = PlatformLike::where([['p.type', '=', 2],['c.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0]])->alias('p')->leftJoin('SupplierComment c', 'c.id = p.like_id')->column('p.id');
-                PlatformLike::where('id','in' ,$ids + $ids2)->update(['is_read'=>1]);
+                $ids = PlatformLike::where([['p.type', '=', 1],['f.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0]])->alias('p') ->leftJoin('Press f', 'f.id = p.like_id')->column('p.id');
+                PlatformLike::where('id','in' ,$ids)->update(['is_read'=>1]);
+                break;
+            case 4:
+                $ids2 = PlatformLike::where([['p.type', '=', 2],['c.user_id', '=', $this->user_id],['p.to_deleted', '=', 0],['p.is_read','=',0]])->alias('p')->leftJoin('PressComment c', 'c.id = p.like_id')->column('p.id');
+                PlatformLike::where('id','in' ,$ids2)->update(['is_read'=>1]);
                 break;
                 break;
         }
         }
         PressComment::where('id',input('post.id'))->update(['is_read'=>1]);
         PressComment::where('id',input('post.id'))->update(['is_read'=>1]);
@@ -721,7 +728,7 @@ class Press extends Base
         $sel_where[]  = ['t.to_deleted','=',0];
         $sel_where[]  = ['t.to_deleted','=',0];
         $list = PressComment::where($sel_where)
         $list = PressComment::where($sel_where)
             ->alias('t')
             ->alias('t')
-            ->field('t.id,t.source_read is_read,t.is_top,t.create_at,t.first_id press_id,t.content,i.images,i.title,i.cover,u.name user_name,u.headimg,i.read_num')
+            ->field('t.id,t.is_read,t.is_top,t.create_at,t.first_id press_id,t.content,i.images,i.title,i.cover,u.name user_name,u.headimg,i.read_num')
             ->leftJoin('Press i','t.first_id = i.id')
             ->leftJoin('Press i','t.first_id = i.id')
             ->leftJoin('store_member u','t.user_id = u.id')
             ->leftJoin('store_member u','t.user_id = u.id')
             ->order('t.is_top desc,t.id desc')
             ->order('t.is_top desc,t.id desc')
@@ -893,7 +900,7 @@ class Press extends Base
         $sel_where[]  = ['t.coll_type','=',4];
         $sel_where[]  = ['t.coll_type','=',4];
         $list = UserCollect::where($sel_where)
         $list = UserCollect::where($sel_where)
             ->alias('t')
             ->alias('t')
-            ->field('t.id,t.create_at,t.coll_id press_id,i.title,images,i.user_id')
+            ->field('t.id,t.create_at,t.coll_id press_id,i.title,images,i.user_id,i.transmit_num,i.read_num')
             ->leftJoin('Press i','t.coll_id = i.id')
             ->leftJoin('Press i','t.coll_id = i.id')
             ->order('id desc')
             ->order('id desc')
             ->limit($this->off_set,$this->page_num)
             ->limit($this->off_set,$this->page_num)
@@ -907,6 +914,9 @@ class Press extends Base
             $v['collect_num'] = UserCollect::getCollectNum(4,$v['press_id']);
             $v['collect_num'] = UserCollect::getCollectNum(4,$v['press_id']);
             $v['is_praise'] = PlatformLike::checkTags($this->user_id,$v['press_id'],1);
             $v['is_praise'] = PlatformLike::checkTags($this->user_id,$v['press_id'],1);
             $v['praise_num'] = PlatformLike::getPraiseNum($v['press_id'],1);
             $v['praise_num'] = PlatformLike::getPraiseNum($v['press_id'],1);
+            $v['transmit_num'] =numTransform($v['transmit_num']);
+            $v['read_num'] =numTransform($v['read_num']);
+            $v['praise_num'] = PlatformLike::getPraiseNum($v['press_id'],1);
             $v['switch_open'] =  PlatformSwitch::checkSwitch($this->user_id,$v['press_id'],10);
             $v['switch_open'] =  PlatformSwitch::checkSwitch($this->user_id,$v['press_id'],10);
             $info_auth = \app\common\model\Press::getInfoAuth($v['user_id'],APPNAME,APPLOGO);
             $info_auth = \app\common\model\Press::getInfoAuth($v['user_id'],APPNAME,APPLOGO);
             $v['app_name'] = $info_auth['app_name'];
             $v['app_name'] = $info_auth['app_name'];
@@ -954,12 +964,14 @@ class Press extends Base
         $sel_where[]  = ['t.type','=',1];
         $sel_where[]  = ['t.type','=',1];
         $list = PlatformLike::where($sel_where)
         $list = PlatformLike::where($sel_where)
             ->alias('t')
             ->alias('t')
-            ->field('t.id,t.create_at,t.like_id press_id,i.title,i.cover,images,i.read_num,comment_switch,i.user_id')
+            ->field('t.id,t.create_at,t.like_id press_id,i.title,i.cover,images,transmit_num,i.read_num,comment_switch,i.user_id')
             ->leftJoin('Press i','t.like_id = i.id')
             ->leftJoin('Press i','t.like_id = i.id')
             ->order('id desc')
             ->order('id desc')
             ->limit($this->off_set,$this->page_num)
             ->limit($this->off_set,$this->page_num)
             ->select()->toArray();
             ->select()->toArray();
         foreach ($list as &$v) {
         foreach ($list as &$v) {
+            $v['transmit_num'] = numTransform($v['transmit_num']);
+            $v['read_num'] = numTransform($v['read_num']);
             $v['is_normal'] = CheckPower::checkModulesPower($v['press_id'],0,$this->request->controller());
             $v['is_normal'] = CheckPower::checkModulesPower($v['press_id'],0,$this->request->controller());
             $v['comment_num'] = PressComment::getCommentNum($v['press_id']);
             $v['comment_num'] = PressComment::getCommentNum($v['press_id']);
             $v['is_collect'] = UserCollect::checkCollectByType($this->user_id,4,$v['press_id']);
             $v['is_collect'] = UserCollect::checkCollectByType($this->user_id,4,$v['press_id']);
@@ -1059,6 +1071,7 @@ class Press extends Base
         $sel_where = [];
         $sel_where = [];
         $sel_where[] = ['p.type', '=', 1];
         $sel_where[] = ['p.type', '=', 1];
         $sel_where[] = ['f.user_id', '=', $this->user_id];
         $sel_where[] = ['f.user_id', '=', $this->user_id];
+        $sel_where[] = ['p.user_id', '<>', $this->user_id];
         $sel_where[] = ['p.to_deleted', '=', 0];
         $sel_where[] = ['p.to_deleted', '=', 0];
         $list = PlatformLike::where($sel_where)
         $list = PlatformLike::where($sel_where)
             ->field('p.*,f.title,u.name user_name,u.headimg,f.images,f.read_num,f.content')
             ->field('p.*,f.title,u.name user_name,u.headimg,f.images,f.read_num,f.content')
@@ -1109,7 +1122,7 @@ class Press extends Base
     public function praiseCommentList()
     public function praiseCommentList()
     {
     {
         $user_info = $this->userInfo('name,headimg');
         $user_info = $this->userInfo('name,headimg');
-        $list =  PlatformLike::where([['l.type','=',2],['c.user_id','=',$this->user_id],['l.to_deleted','=',0]])
+        $list =  PlatformLike::where([['l.type','=',2],['c.user_id','=',$this->user_id],['l.to_deleted','=',0],['l.user_id','<>',$this->user_id]])
             ->alias('l')
             ->alias('l')
             ->field('l.id,l.user_id,m.name user_name,m.headimg,c.is_deleted,c.to_deleted,c.source_deleted,l.create_at,v.images,c.first_id press_id,v.user_id buid,v.title,v.read_num,c.content,v.content press_content,v.comment_switch')
             ->field('l.id,l.user_id,m.name user_name,m.headimg,c.is_deleted,c.to_deleted,c.source_deleted,l.create_at,v.images,c.first_id press_id,v.user_id buid,v.title,v.read_num,c.content,v.content press_content,v.comment_switch')
             ->leftJoin('StoreMember m','m.id  = l.user_id')
             ->leftJoin('StoreMember m','m.id  = l.user_id')

+ 80 - 3
application/api/controller/Qc.php

@@ -1,10 +1,12 @@
 <?php
 <?php
 
 
 namespace app\api\controller;
 namespace app\api\controller;
+use app\common\model\ArticleItem;
 use app\common\model\DatumIntro;
 use app\common\model\DatumIntro;
 use app\common\model\DatumUrl;
 use app\common\model\DatumUrl;
 use app\common\model\LabelMessage;
 use app\common\model\LabelMessage;
 use app\common\model\LevelOrder as LOM;
 use app\common\model\LevelOrder as LOM;
+use app\common\model\TopSearch;
 use app\common\model\User;
 use app\common\model\User;
 use app\common\model\UserSearch;
 use app\common\model\UserSearch;
 use app\common\model\VideoUrl;
 use app\common\model\VideoUrl;
@@ -22,6 +24,81 @@ use function AlibabaCloud\Client\value;
 
 
 class Qc extends Base {
 class Qc extends Base {
 
 
+    // 热搜设置
+    public function topSearchSet()
+    {
+        // 视频
+        $list = VideoUrl::column('id');
+        array_walk($list,function ($v){
+           // VideoUrl::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
+            TopSearch::saveData($v,'video');
+        });
+        // 图文
+        $list = ArticleItem::column('id');
+        array_walk($list,function ($v){
+           // ArticleItem::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
+            TopSearch::saveData($v,'article');
+        });
+        // 资料
+        $list = DatumUrl::column('id');
+        array_walk($list,function ($v){
+           // DatumUrl::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
+            TopSearch::saveData($v,'datum');
+        });
+        // 活动
+        $list = \app\common\model\Activity::column('id');
+        array_walk($list,function ($v){
+            //\app\common\model\Activity::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
+            TopSearch::saveData($v,'activity');
+        });
+
+        // 需求
+        $list = \app\common\model\PlatformDemand::column('id');
+        array_walk($list,function ($v){
+           // \app\common\model\PlatformDemand::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
+            TopSearch::saveData($v,'demand');
+        });
+
+        // 新闻
+        $list = \app\common\model\Press::column('id');
+        array_walk($list,function ($v){
+           // \app\common\model\Press::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
+            TopSearch::saveData($v,'press');
+        });
+
+        // 问答
+        $list = \app\common\model\UserForum::column('id');
+        array_walk($list,function ($v){
+           // \app\common\model\UserForum::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
+            TopSearch::saveData($v,'forum');
+        });
+        // 招聘
+        $list = \app\common\model\Recruit::column('id');
+        array_walk($list,function ($v){
+           // \app\common\model\Recruit::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
+            TopSearch::saveData($v,'recruit');
+        });
+
+        // 供应商
+        $list = \app\common\model\SupplierGoods::column('id');
+        array_walk($list,function ($v){
+           // \app\common\model\SupplierGoods::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
+            TopSearch::saveData($v,'supplier_goods');
+        });
+
+        // 商品
+        $list = \app\common\model\StoreGoods::column('id');
+        array_walk($list,function ($v){
+          //  \app\common\model\StoreGoods::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
+            TopSearch::saveData($v,'goods');
+        });
+
+
+
+
+
+    }
+
 
 
     public function getUserByToken()
     public function getUserByToken()
     {
     {
@@ -100,9 +177,9 @@ class Qc extends Base {
 
 
     function index ()
     function index ()
     {
     {
-        $url = "2023-07-17/08dc7248f9ac00ea/4c655f017d1f11e5.jpg";
-        $res =  rtrim(strtr(base64_encode(input('url')), '+/', '-_'), '=');
-        var_dump($res);
+        $st = '12ABcc';
+        $st1 = '12abcc';
+        var_dump($st==$st1 ,strt);
     }
     }
 
 
 
 

+ 36 - 6
application/api/controller/Recruit.php

@@ -5,6 +5,7 @@ use app\common\model\PlatformLike;
 use app\common\model\PlatformSwitch;
 use app\common\model\PlatformSwitch;
 use app\common\model\RecruitCate;
 use app\common\model\RecruitCate;
 use app\common\model\RecruitResume;
 use app\common\model\RecruitResume;
+use app\common\model\TopSearch;
 use app\common\model\User;
 use app\common\model\User;
 use app\common\model\UserCollect;
 use app\common\model\UserCollect;
 use app\common\model\UserMessage;
 use app\common\model\UserMessage;
@@ -211,6 +212,10 @@ class Recruit extends Base
      * @return name:address type:string default:-- desc:地址
      * @return name:address type:string default:-- desc:地址
      * @return name:app_name type:string default:-- desc:发布方名称
      * @return name:app_name type:string default:-- desc:发布方名称
      * @return name:app_logo type:string default:-- desc:发布方头像
      * @return name:app_logo type:string default:-- desc:发布方头像
+     * @return name:release_time type:string default:-- desc:上架时间
+     * @return name:company_intro type:string default:-- desc:公司简介
+     * @return name:is_ss type:string default:-- desc:是否上市,1上市0未上市
+     * @return name:scale type:string default:-- desc:公司规模(人数)
      */
      */
     public function getRecommendList()
     public function getRecommendList()
     {
     {
@@ -280,8 +285,12 @@ class Recruit extends Base
      * @return name:num type:int default:-- desc:招聘人数
      * @return name:num type:int default:-- desc:招聘人数
      * @return name:app_name type:string default:-- desc:发布方名称
      * @return name:app_name type:string default:-- desc:发布方名称
      * @return name:app_logo type:string default:-- desc:发布方头像
      * @return name:app_logo type:string default:-- desc:发布方头像
+     * @return name:release_time type:string default:-- desc:上架时间
      * @return name:follow_switch type:int default:-- desc:订阅开关状态【0关闭1开启】
      * @return name:follow_switch type:int default:-- desc:订阅开关状态【0关闭1开启】
      * @return name:third_title type:string default:-- desc:第三级分类名称
      * @return name:third_title type:string default:-- desc:第三级分类名称
+     * @return name:company_intro type:string default:-- desc:公司简介
+     * @return name:is_ss type:string default:-- desc:是否上市,1上市0未上市
+     * @return name:scale type:string default:-- desc:公司规模(人数)
      */
      */
     public function getRecruitList(){
     public function getRecruitList(){
         $sort_type = input('get.sort_type',1);
         $sort_type = input('get.sort_type',1);
@@ -308,7 +317,7 @@ class Recruit extends Base
         if($second_classify)  $sel_where[]  = ['second_classify','=',$second_classify];
         if($second_classify)  $sel_where[]  = ['second_classify','=',$second_classify];
         if($third_classify)  $sel_where[]  = ['third_classify','=',$third_classify];
         if($third_classify)  $sel_where[]  = ['third_classify','=',$third_classify];
         if($city)  $sel_where[]  = ['city','like','%'.$city.'%'];
         if($city)  $sel_where[]  = ['city','like','%'.$city.'%'];
-        $field = "id,title,num,province,city,county,address,user_id,principal,hr_headimg,label,welfare,salary";
+        $field = "id,title,num,province,city,county,address,user_id,principal,hr_headimg,label,welfare,salary,release_time,company,company_intro,is_ss,scale";
         $list = \app\common\model\Recruit::field($field)->where($sel_where)->order($order)->limit($this->off_set,$this->page_num)->select()->toArray();
         $list = \app\common\model\Recruit::field($field)->where($sel_where)->order($order)->limit($this->off_set,$this->page_num)->select()->toArray();
         $third_title = RecruitCate::where('id',$third_classify)->value('title');
         $third_title = RecruitCate::where('id',$third_classify)->value('title');
         foreach ($list as &$v) {
         foreach ($list as &$v) {
@@ -362,7 +371,12 @@ class Recruit extends Base
      * @return name:latitude type:string default:-- desc:纬度
      * @return name:latitude type:string default:-- desc:纬度
      * @return name:num type:int default:-- desc:招聘人数
      * @return name:num type:int default:-- desc:招聘人数
      * @return name:hr_code type:int default:-- desc:二维码
      * @return name:hr_code type:int default:-- desc:二维码
+     * @return name:release_time type:string default:-- desc:上架时间
      * @return name:follow_switch type:int default:-- desc:订阅开关状态【0关闭1开启】
      * @return name:follow_switch type:int default:-- desc:订阅开关状态【0关闭1开启】
+     * @return name:company_intro type:string default:-- desc:公司简介
+     * @return name:is_ss type:string default:-- desc:是否上市,1上市0未上市
+     * @return name:scale type:string default:-- desc:公司规模(人数)
+     *
      */
      */
     public function getRecruitDetail()
     public function getRecruitDetail()
     {
     {
@@ -378,6 +392,7 @@ class Recruit extends Base
         $detail['collect_num'] = UserCollect::getCollectNum(8,$detail['id']);
         $detail['collect_num'] = UserCollect::getCollectNum(8,$detail['id']);
         $detail['transmit_num'] = numTransform($detail['transmit_num']);
         $detail['transmit_num'] = numTransform($detail['transmit_num']);
         \app\common\model\Recruit::where('id',$detail['id'])->setInc('read_num');
         \app\common\model\Recruit::where('id',$detail['id'])->setInc('read_num');
+        TopSearch::seIncHotNum($detail['id'],$this->request->controller());
         UserTrack::crateTrack($this->user_id,8,input('get.id'),0);
         UserTrack::crateTrack($this->user_id,8,input('get.id'),0);
         $this->success('ok',['detail'=>$detail]);
         $this->success('ok',['detail'=>$detail]);
     }
     }
@@ -453,6 +468,9 @@ class Recruit extends Base
      * @return name:experience_min type:int default:0 desc:最低工作年限
      * @return name:experience_min type:int default:0 desc:最低工作年限
      * @return name:experience_max type:int default:0 desc:最高工作年限
      * @return name:experience_max type:int default:0 desc:最高工作年限
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
+     * @return name:company_intro type:string default:-- desc:公司简介
+     * @return name:is_ss type:string default:-- desc:是否上市,1上市0未上市
+     * @return name:scale type:string default:-- desc:公司规模(人数)
      */
      */
 
 
     public function praiseRecruitList()
     public function praiseRecruitList()
@@ -463,7 +481,7 @@ class Recruit extends Base
         $sel_where[] = ['p.user_id', '<>', $this->user_id];
         $sel_where[] = ['p.user_id', '<>', $this->user_id];
         $sel_where[] = ['p.to_deleted', '=', 0];
         $sel_where[] = ['p.to_deleted', '=', 0];
         $list = PlatformLike::where($sel_where)
         $list = PlatformLike::where($sel_where)
-            ->field('p.id,p.like_id,f.title,u.name user_name,u.headimg,f.title,f.id recruit_id,f.label,salary,f.company,education,experience_min,experience_max,p.create_at')
+            ->field('p.id,p.like_id,f.title,u.name user_name,u.headimg,f.title,f.id recruit_id,f.label,salary,f.company,f.company_intro,f.is_ss,f.scale,education,experience_min,experience_max,p.create_at')
             ->alias('p')
             ->alias('p')
             ->leftJoin('Recruit f', 'f.id = p.like_id')
             ->leftJoin('Recruit f', 'f.id = p.like_id')
             ->leftJoin('StoreMember u', 'u.id = p.user_id')
             ->leftJoin('StoreMember u', 'u.id = p.user_id')
@@ -500,6 +518,9 @@ class Recruit extends Base
      * @return name:principal type:string default:-- desc:联系人
      * @return name:principal type:string default:-- desc:联系人
      * @return name:hr_headimg type:string default:-- desc:联系人头像
      * @return name:hr_headimg type:string default:-- desc:联系人头像
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
+     * @return name:company_intro type:string default:-- desc:公司简介
+     * @return name:is_ss type:string default:-- desc:是否上市,1上市0未上市
+     * @return name:scale type:string default:-- desc:公司规模(人数)
      */
      */
 
 
     public function getTagsRecruit()
     public function getTagsRecruit()
@@ -510,7 +531,7 @@ class Recruit extends Base
         $sel_where[] = ['f.user_id', '<>', $this->user_id];
         $sel_where[] = ['f.user_id', '<>', $this->user_id];
         $sel_where[] = ['p.to_deleted', '=', 0];
         $sel_where[] = ['p.to_deleted', '=', 0];
         $list = PlatformLike::where($sel_where)
         $list = PlatformLike::where($sel_where)
-            ->field('p.id,p.like_id,f.title,u.name user_name,u.headimg,f.title,f.id recruit_id,f.label,salary,f.company,education,experience_min,experience_max,principal,hr_headimg')
+            ->field('p.id,p.like_id,f.title,u.name user_name,u.headimg,f.title,f.id recruit_id,f.label,salary,f.company,f.company_intro,f.is_ss,f.scale,education,experience_min,experience_max,principal,hr_headimg')
             ->alias('p')
             ->alias('p')
             ->leftJoin('Recruit f', 'f.id = p.like_id')
             ->leftJoin('Recruit f', 'f.id = p.like_id')
             ->leftJoin('StoreMember u', 'u.id = p.user_id')
             ->leftJoin('StoreMember u', 'u.id = p.user_id')
@@ -635,6 +656,9 @@ class Recruit extends Base
      * @return name:principal type:string default:-- desc:联系人
      * @return name:principal type:string default:-- desc:联系人
      * @return name:hr_headimg type:string default:-- desc:联系人头像
      * @return name:hr_headimg type:string default:-- desc:联系人头像
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
+     * @return name:company_intro type:string default:-- desc:公司简介
+     * @return name:is_ss type:string default:-- desc:是否上市,1上市0未上市
+     * @return name:scale type:string default:-- desc:公司规模(人数)
      */
      */
     public function getOwnRecruitList()
     public function getOwnRecruitList()
     {
     {
@@ -644,7 +668,7 @@ class Recruit extends Base
         $sel_where[] = ['status','=',1];
         $sel_where[] = ['status','=',1];
         $sel_where[] = ['user_id','=',$this->user_id];
         $sel_where[] = ['user_id','=',$this->user_id];
         $list = \app\common\model\Recruit::where($sel_where)
         $list = \app\common\model\Recruit::where($sel_where)
-            ->field('id,title,company,label,welfare,education,experience_min,salary,experience_max,price_min,price_max,create_at,num,principal,hr_headimg,province,city,county')
+            ->field('id,title,company,company_intro,is_ss,scale,label,welfare,education,experience_min,salary,experience_max,price_min,price_max,create_at,num,principal,hr_headimg,province,city,county')
             ->when($title,function ($query)use($title){
             ->when($title,function ($query)use($title){
                 if($title) $query->where('title|label','like','%'.$title.'%');
                 if($title) $query->where('title|label','like','%'.$title.'%');
             })->order(['id'=>'asc'])
             })->order(['id'=>'asc'])
@@ -692,6 +716,9 @@ class Recruit extends Base
      * @return name:app_name type:string default:-- desc:发布人名称
      * @return name:app_name type:string default:-- desc:发布人名称
      * @return name:app_logo type:string default:-- desc:发布人头像
      * @return name:app_logo type:string default:-- desc:发布人头像
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
+     * @return name:company_intro type:string default:-- desc:公司简介
+     * @return name:is_ss type:string default:-- desc:是否上市,1上市0未上市
+     * @return name:scale type:string default:-- desc:公司规模(人数)
      */
      */
     public function getBrowseList()
     public function getBrowseList()
     {
     {
@@ -702,7 +729,7 @@ class Recruit extends Base
         if($title)  $sel_where[]  = ['i.title|i.label','like','%'.$title.'%'];
         if($title)  $sel_where[]  = ['i.title|i.label','like','%'.$title.'%'];
         $list = UserTrack::where($sel_where)
         $list = UserTrack::where($sel_where)
             ->alias('t')
             ->alias('t')
-            ->field('t.id,t.update_int,t.first_id recruit_id,i.salary,i.title,i.price_max,i.company,i.label,province,city,county,i.welfare,i.education,i.experience_min,i.experience_max,price_min,price_max,i.num,principal,hr_headimg,i.user_id')
+            ->field('t.id,t.update_int,t.first_id recruit_id,i.salary,i.title,i.price_max,i.company,i.company_intro,i.is_ss,i.scale,i.label,province,city,county,i.welfare,i.education,i.experience_min,i.experience_max,price_min,price_max,i.num,principal,hr_headimg,i.user_id')
             ->leftJoin('Recruit i','t.first_id = i.id')
             ->leftJoin('Recruit i','t.first_id = i.id')
             ->order('update_int desc')
             ->order('update_int desc')
             ->limit($this->off_set,$this->page_num)
             ->limit($this->off_set,$this->page_num)
@@ -751,6 +778,9 @@ class Recruit extends Base
      * @return name:app_name type:string default:-- desc:发布人名称
      * @return name:app_name type:string default:-- desc:发布人名称
      * @return name:app_logo type:string default:-- desc:发布人头像
      * @return name:app_logo type:string default:-- desc:发布人头像
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
+     * @return name:company_intro type:string default:-- desc:公司简介
+     * @return name:is_ss type:string default:-- desc:是否上市,1上市0未上市
+     * @return name:scale type:string default:-- desc:公司规模(人数)
      */
      */
     public function getRecruitCollect()
     public function getRecruitCollect()
     {
     {
@@ -761,7 +791,7 @@ class Recruit extends Base
         $sel_where[]  = ['t.coll_type','=',8];
         $sel_where[]  = ['t.coll_type','=',8];
         $list = UserCollect::where($sel_where)
         $list = UserCollect::where($sel_where)
             ->alias('t')
             ->alias('t')
-            ->field('t.id,t.create_at,t.coll_id recruit_id,i.title,i.company,i.label,i.salary,i.welfare,i.education,i.experience_min,i.experience_max,price_min,price_max,i.num,principal,hr_headimg,province,city,county,i.user_id')
+            ->field('t.id,t.create_at,t.coll_id recruit_id,i.title,i.company,i.company_intro,i.is_ss,i.scale,i.label,i.salary,i.welfare,i.education,i.experience_min,i.experience_max,price_min,price_max,i.num,principal,hr_headimg,province,city,county,i.user_id')
             ->leftJoin('Recruit i','t.coll_id = i.id')
             ->leftJoin('Recruit i','t.coll_id = i.id')
             ->order('id desc')
             ->order('id desc')
             ->limit($this->off_set,$this->page_num)
             ->limit($this->off_set,$this->page_num)

+ 3 - 0
application/api/controller/Report.php

@@ -2,14 +2,17 @@
 namespace app\api\controller;
 namespace app\api\controller;
 use app\common\model\ArticleComment;
 use app\common\model\ArticleComment;
 use app\common\model\ArticleIntro;
 use app\common\model\ArticleIntro;
+use app\common\model\ArticleItem;
 use app\common\model\DatumComment;
 use app\common\model\DatumComment;
 use app\common\model\DatumIntro;
 use app\common\model\DatumIntro;
+use app\common\model\DatumUrl;
 use app\common\model\ReportCase;
 use app\common\model\ReportCase;
 use app\common\model\User;
 use app\common\model\User;
 use app\common\model\UserForum;
 use app\common\model\UserForum;
 use app\common\model\UserReport;
 use app\common\model\UserReport;
 use app\common\model\VideoComment;
 use app\common\model\VideoComment;
 use app\common\model\VideoIntro;
 use app\common\model\VideoIntro;
+use app\common\model\VideoUrl;
 use library\tools\Data;
 use library\tools\Data;
 
 
 /**
 /**

+ 12 - 6
application/api/controller/Supplier.php

@@ -6,6 +6,7 @@ use app\common\model\PlatformLike;
 use app\common\model\PlatformSwitch;
 use app\common\model\PlatformSwitch;
 use app\common\model\SupplierCate;
 use app\common\model\SupplierCate;
 use app\common\model\SupplierComment;
 use app\common\model\SupplierComment;
+use app\common\model\TopSearch;
 use app\common\model\UserCollect;
 use app\common\model\UserCollect;
 use app\common\model\UserMessage;
 use app\common\model\UserMessage;
 use app\common\model\UserSearch;
 use app\common\model\UserSearch;
@@ -235,6 +236,7 @@ class Supplier extends Base
      * @return name:supplier_name type:float default:-- desc:供应商名称
      * @return name:supplier_name type:float default:-- desc:供应商名称
      * @return name:supplier_logo type:string default:-- desc供应商logo
      * @return name:supplier_logo type:string default:-- desc供应商logo
      * @return name:read_num type:int default:-- desc:浏览量
      * @return name:read_num type:int default:-- desc:浏览量
+     * @return name:release_time type:string default:-- desc:上架时间
      *
      *
      */
      */
     public function getRecommendList()
     public function getRecommendList()
@@ -288,6 +290,7 @@ class Supplier extends Base
      * @return name:cover type:string default:-- desc:图片【多张|隔开】
      * @return name:cover type:string default:-- desc:图片【多张|隔开】
      * @return name:cover_arr type:array default:-- desc:图片数组
      * @return name:cover_arr type:array default:-- desc:图片数组
      * @return name:label_name type:array default:-- desc:标签
      * @return name:label_name type:array default:-- desc:标签
+     * @return name:release_time type:string default:-- desc:上架时间
      * @return name:total_num type:array default:-- desc:总数
      * @return name:total_num type:array default:-- desc:总数
      *
      *
      */
      */
@@ -312,7 +315,7 @@ class Supplier extends Base
         }
         }
         $list = SupplierGoods::where($sel_where)
         $list = SupplierGoods::where($sel_where)
             ->alias('g')
             ->alias('g')
-            ->field('g.id,g.label,g.cover,g.name,s.title supplier_name,s.logo supplier_logo')
+            ->field('g.id,g.label,g.cover,g.name,s.title supplier_name,s.logo supplier_logo,release_time')
             ->leftJoin('Supplier s','s.id = g.supplier_id')
             ->leftJoin('Supplier s','s.id = g.supplier_id')
             ->order($order)
             ->order($order)
             ->select()->toArray();
             ->select()->toArray();
@@ -340,6 +343,7 @@ class Supplier extends Base
      * @return name:cover type:string default:-- desc:图片【多张|隔开】
      * @return name:cover type:string default:-- desc:图片【多张|隔开】
      * @return name:cover_arr type:array default:-- desc:图片数组
      * @return name:cover_arr type:array default:-- desc:图片数组
      * @return name:label_name type:array default:-- desc:标签
      * @return name:label_name type:array default:-- desc:标签
+     * @return name:release_time type:string default:-- desc:上架时间
      * @return name:is_recently type:int default:-- desc:是否最近观看【0否1是】
      * @return name:is_recently type:int default:-- desc:是否最近观看【0否1是】
      * @return name:supplier_info type:array default:-- desc:供应商信息
      * @return name:supplier_info type:array default:-- desc:供应商信息
      * @return name:supplier_info.id type:int default:-- desc:供应商id
      * @return name:supplier_info.id type:int default:-- desc:供应商id
@@ -367,7 +371,7 @@ class Supplier extends Base
         $sel_where[] = ['status','=',1];
         $sel_where[] = ['status','=',1];
         $sel_where[] = ['supplier_id','=',$supplier_id];
         $sel_where[] = ['supplier_id','=',$supplier_id];
         $list = SupplierGoods::where($sel_where)
         $list = SupplierGoods::where($sel_where)
-            ->field('id,name,label,cover,create_at,read_num')
+            ->field('id,name,label,cover,create_at,read_num,release_time')
             ->order($order)->select()->toArray();
             ->order($order)->select()->toArray();
         $supplier_info = \app\common\model\Supplier::where('id',$supplier_id)->field('id,title,logo')->find()->toArray();
         $supplier_info = \app\common\model\Supplier::where('id',$supplier_id)->field('id,title,logo')->find()->toArray();
         $supplier_info['follow_switch'] =  PlatformSwitch::checkSwitch($this->user_id,$supplier_id,5);
         $supplier_info['follow_switch'] =  PlatformSwitch::checkSwitch($this->user_id,$supplier_id,5);
@@ -409,6 +413,7 @@ class Supplier extends Base
      * @return name:praise_num type:int default:-- desc:点赞量
      * @return name:praise_num type:int default:-- desc:点赞量
      * @return name:is_praise type:int default:-- desc:是否点赞
      * @return name:is_praise type:int default:-- desc:是否点赞
      * @return name:transmit_num type:int default:-- desc:转发量
      * @return name:transmit_num type:int default:-- desc:转发量
+     * @return name:release_time type:string default:-- desc:上架时间
      * @return name:switch_open type:int default:-- desc:通知开关【0关闭1开启】
      * @return name:switch_open type:int default:-- desc:通知开关【0关闭1开启】
      * @return name:article_jump type:int default:-- desc:关联图文是否能跳转【0不能跳转,1能跳转,验证是否vip】
      * @return name:article_jump type:int default:-- desc:关联图文是否能跳转【0不能跳转,1能跳转,验证是否vip】
      * @return name:datum_jump type:int default:-- desc:关联资料是否能跳转【0不能跳转,1能跳转,验证是否vip】
      * @return name:datum_jump type:int default:-- desc:关联资料是否能跳转【0不能跳转,1能跳转,验证是否vip】
@@ -451,6 +456,7 @@ class Supplier extends Base
         $supplier_info['follow_switch'] = PlatformSwitch::checkSwitch($this->user_id,$detail['supplier_id'],5);
         $supplier_info['follow_switch'] = PlatformSwitch::checkSwitch($this->user_id,$detail['supplier_id'],5);
         UserTrack::crateTrack($this->user_id,10,$goods_id,0);
         UserTrack::crateTrack($this->user_id,10,$goods_id,0);
         SupplierGoods::where('id',$goods_id)->setInc('read_num');
         SupplierGoods::where('id',$goods_id)->setInc('read_num');
+        TopSearch::seIncHotNum($detail['id'],'supplier_goods');
         $this->success('ok',['detail'=>$detail,'supplier_info'=>$supplier_info]);
         $this->success('ok',['detail'=>$detail,'supplier_info'=>$supplier_info]);
     }
     }
 
 
@@ -515,7 +521,7 @@ class Supplier extends Base
         if($comment['user_id'] != $this->user_id)UserMessage:: sendUserMessage($comment['user_id'],'supplier',3,0,$this->user_id,$comment['id'],$content);
         if($comment['user_id'] != $this->user_id)UserMessage:: sendUserMessage($comment['user_id'],'supplier',3,0,$this->user_id,$comment['id'],$content);
         $goods_info = SupplierGoods::where('id',$comment['goods_id'])->find()->toArray();
         $goods_info = SupplierGoods::where('id',$comment['goods_id'])->find()->toArray();
         if(!$goods_info['comment_switch']) $this->error('评论功能已关闭');
         if(!$goods_info['comment_switch']) $this->error('评论功能已关闭');
-        if($goods_info['user_id'] && $goods_info['user_id'] != $this->user_id) UserMessage:: sendUserMessage($goods_info['user_id'],'supplier',4,0,$this->user_id,$comment['goods_id'],$content);
+        //if($goods_info['user_id'] && $goods_info['user_id'] != $this->user_id) UserMessage:: sendUserMessage($goods_info['user_id'],'supplier',4,0,$this->user_id,$comment['goods_id'],$content);
         unset($comment['id']);
         unset($comment['id']);
         unset($comment['create_at']);
         unset($comment['create_at']);
         unset($comment['to_deleted']);
         unset($comment['to_deleted']);
@@ -1197,7 +1203,7 @@ class Supplier extends Base
             ->limit($this->off_set, $this->page_num)
             ->limit($this->off_set, $this->page_num)
             ->select()->toArray();
             ->select()->toArray();
         array_walk($list, function (&$v) {
         array_walk($list, function (&$v) {
-            $v['is_read'] = $v['source_read'];
+           // $v['is_read'] = $v['source_read'];
             $v['is_normal'] = CheckPower::checkModulesPower($v['goods_id'], 0, $this->request->controller());
             $v['is_normal'] = CheckPower::checkModulesPower($v['goods_id'], 0, $this->request->controller());
             $v['cover_arr'] = $v['cover']? explode('|',trim($v['cover'],'|')):null;
             $v['cover_arr'] = $v['cover']? explode('|',trim($v['cover'],'|')):null;
             $v['read_num'] = numTransform($v['read_num']);
             $v['read_num'] = numTransform($v['read_num']);
@@ -1300,7 +1306,7 @@ class Supplier extends Base
     public function getMarkNum()
     public function getMarkNum()
     {
     {
         // 评论我的
         // 评论我的
-        $comment_num = SupplierComment::where([['g.user_id', '=', $this->user_id],['c.is_deleted', '=', 0],['c.to_deleted', '=', 0],['c.source_read','=',0],['c.pid','=',0]])
+        $comment_num = SupplierComment::where([['g.user_id', '=', $this->user_id],['c.is_deleted', '=', 0],['c.to_deleted', '=', 0],['c.is_read','=',0],['c.pid','=',0]])
             ->alias('c') ->leftJoin('SupplierGoods g', 'g.id = c.goods_id')->count();
             ->alias('c') ->leftJoin('SupplierGoods g', 'g.id = c.goods_id')->count();
         //回复我的
         //回复我的
         $all_comment = SupplierComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
         $all_comment = SupplierComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
@@ -1451,7 +1457,7 @@ class Supplier extends Base
         $del_where[] = ['id','in',input('post.id')];
         $del_where[] = ['id','in',input('post.id')];
         if(in_array($type,[1,3,4,5,6,7]))   $del_where[] = ['user_id','=',$this->user_id];
         if(in_array($type,[1,3,4,5,6,7]))   $del_where[] = ['user_id','=',$this->user_id];
         if(in_array($type,[1,3])) SupplierComment::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[1,3])) SupplierComment::where($del_where)->update(['is_deleted'=>1]);
-        if(in_array($type,[2])) SupplierComment::where($del_where)->update(['source_deleted'=>1,'source_read'=>1]);
+        if(in_array($type,[2])) SupplierComment::where($del_where)->update(['source_deleted'=>1,'source_read'=>1,'is_read'=>1]);
         if(in_array($type,[4]))  PlatformSwitch::where($del_where)->delete();
         if(in_array($type,[4]))  PlatformSwitch::where($del_where)->delete();
         if(in_array($type,[5]))  UserMessage::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[5]))  UserMessage::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[6,7]))  PlatformLike::where($del_where)->delete();
         if(in_array($type,[6,7]))  PlatformLike::where($del_where)->delete();

+ 86 - 1
application/api/controller/Task.php

@@ -4,11 +4,15 @@ namespace app\api\controller;
 use app\common\model\ActivityApply;
 use app\common\model\ActivityApply;
 use app\common\model\ActivityApplyItem;
 use app\common\model\ActivityApplyItem;
 use app\common\model\ActivityPrice;
 use app\common\model\ActivityPrice;
+use app\common\model\ArticleItem;
+use app\common\model\DatumUrl;
 use app\common\model\LabelMessage;
 use app\common\model\LabelMessage;
+use app\common\model\TopSearch;
 use app\common\model\User;
 use app\common\model\User;
 use app\common\model\UserFacility;
 use app\common\model\UserFacility;
 use app\common\model\UserMessage;
 use app\common\model\UserMessage;
 use app\common\model\UserSearch;
 use app\common\model\UserSearch;
+use app\common\model\VideoUrl;
 use app\common\service\UserSynth;
 use app\common\service\UserSynth;
 use think\Db;
 use think\Db;
 
 
@@ -94,7 +98,7 @@ class Task extends Base
      * @url /api/Task/removeFacility
      * @url /api/Task/removeFacility
      */
      */
     public function removeFacility(){
     public function removeFacility(){
-        UserFacility::where(['set_time','> time',date('Y-m-d H:i:s',strtotime('-180 days'))])->update(['facility'=>'','set_time'=>date('Y-m-d H:i:s')]);
+        UserFacility::where(['set_time','< time',date('Y-m-d H:i:s',strtotime('-180 days'))])->update(['facility'=>'','set_time'=>date('Y-m-d H:i:s')]);
     }
     }
 
 
 
 
@@ -155,6 +159,87 @@ class Task extends Base
     }
     }
 
 
 
 
+    /**
+     * @title 热搜定时
+     * @desc
+     * @author  qc
+     * @url /api/Task/topSearchTask
+     */
+    public function topSearchTask()
+    {
+        $where[] = ['hot_time','< time',date('Y-m-d H:i:s',strtotime('-7 days'))];
+        // 视频
+        $list = VideoUrl::where($where)->column('id');
+        array_walk($list,function ($v){
+            VideoUrl::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s'),'hot_num'=>0]);
+            TopSearch::saveData($v,'video');
+        });
+        // 图文
+        $list = ArticleItem::where($where)->column('id');
+        array_walk($list,function ($v){
+            ArticleItem::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s'),'hot_num'=>0]);
+            TopSearch::saveData($v,'article');
+        });
+        // 资料
+        $list = DatumUrl::where($where)->column('id');
+        array_walk($list,function ($v){
+            DatumUrl::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s'),'hot_num'=>0]);
+            TopSearch::saveData($v,'datum');
+        });
+        // 活动
+        $list = \app\common\model\Activity::where($where)->column('id');
+        array_walk($list,function ($v){
+            \app\common\model\Activity::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s'),'hot_num'=>0]);
+            TopSearch::saveData($v,'activity');
+        });
+
+
+        // 需求
+        $list = \app\common\model\PlatformDemand::where($where)->column('id');
+        array_walk($list,function ($v){
+            \app\common\model\PlatformDemand::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s'),'hot_num'=>0]);
+            TopSearch::saveData($v,'demand');
+        });
+
+        // 新闻
+        $list = \app\common\model\Press::where($where)->column('id');
+        array_walk($list,function ($v){
+            \app\common\model\Press::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s'),'hot_num'=>0]);
+            TopSearch::saveData($v,'press');
+        });
+
+        // 问答
+        $list = \app\common\model\UserForum::where($where)->column('id');
+        array_walk($list,function ($v){
+            \app\common\model\UserForum::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s'),'hot_num'=>0]);
+            TopSearch::saveData($v,'forum');
+        });
+        // 招聘
+        $list = \app\common\model\Recruit::where($where)->column('id');
+        array_walk($list,function ($v){
+            \app\common\model\Recruit::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s'),'hot_num'=>0]);
+            TopSearch::saveData($v,'recruit');
+        });
+
+        // 供应商
+        $list = \app\common\model\SupplierGoods::where($where)->column('id');
+        array_walk($list,function ($v){
+            \app\common\model\SupplierGoods::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s'),'hot_num'=>0]);
+            TopSearch::saveData($v,'supplier_goods');
+        });
+
+        // 商品
+        $list = \app\common\model\StoreGoods::where($where)->column('id');
+        array_walk($list,function ($v){
+            \app\common\model\StoreGoods::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s'),'hot_num'=>0]);
+            TopSearch::saveData($v,'goods');
+        });
+
+        $this->success('执行成功');
+
+    }
+
+
 
 
 
 
 
 

+ 60 - 89
application/api/controller/Trolley.php

@@ -58,23 +58,22 @@ class Trolley extends Base
      * @method GET
      * @method GET
      * @header name:Authorization require:1 desc:Token
      * @header name:Authorization require:1 desc:Token
      * @return name:id type:int default:-- desc:购物车记录id
      * @return name:id type:int default:-- desc:购物车记录id
-     * @return name:goods_id type:int default:-- desc:商品id
      * @return name:goods_name type:string default:-- desc:商品名称
      * @return name:goods_name type:string default:-- desc:商品名称
      * @return name:goods_status type:int default:-- desc:商品状态(1上架,0下架)
      * @return name:goods_status type:int default:-- desc:商品状态(1上架,0下架)
      * @return name:cover type:string default:-- desc:商品封面
      * @return name:cover type:string default:-- desc:商品封面
      * @return name:deleted_status type:string default:-- desc:商品删除状态(1删除,0未删除)
      * @return name:deleted_status type:string default:-- desc:商品删除状态(1删除,0未删除)
      * @return name:num type:int default:-- desc:数量
      * @return name:num type:int default:-- desc:数量
      * @return name:goods_id type:int default:-- desc:商品id
      * @return name:goods_id type:int default:-- desc:商品id
-     * @return name:goods_id type:int default:-- desc:商品id
      * @return name:spec_id type:int default:-- desc:规格id
      * @return name:spec_id type:int default:-- desc:规格id
      * @return name:goods_spec type:int default:-- desc:规格
      * @return name:goods_spec type:int default:-- desc:规格
      * @return name:goods_no type:int default:-- desc:货号
      * @return name:goods_no type:int default:-- desc:货号
+     * @return name:stock type:int default:-- desc:剩余规格库存
      * @return name:original_price type:float default:-- desc:规格原价(下划线价格)
      * @return name:original_price type:float default:-- desc:规格原价(下划线价格)
      * @return name:sell_price type:float default:-- desc:规格售价
      * @return name:sell_price type:float default:-- desc:规格售价
      */
      */
     public function getTrolleyList()
     public function getTrolleyList()
     {
     {
-        $join_field = 't.id,t.num,t.spec_id,t.goods_id,i.goods_spec,g.cover,i.goods_no,i.is_deleted,i.original_price,i.sell_price,i.weight,g.name goods_name,g.status goods_status,g.is_deleted deleted_status';
+        $join_field = 't.id,t.num,t.spec_id,t.goods_id,i.goods_spec,g.cover,i.goods_no,i.is_deleted,i.original_price,i.sell_price,i.weight,i.stock,g.name goods_name,g.status goods_status,g.is_deleted deleted_status';
         $list = ShoppingTrolley::field($join_field)
         $list = ShoppingTrolley::field($join_field)
             ->alias('t')
             ->alias('t')
             ->where(['t.user_id'=>$this->user_id])
             ->where(['t.user_id'=>$this->user_id])
@@ -85,7 +84,8 @@ class Trolley extends Base
         /*foreach ($list as &$v) {
         /*foreach ($list as &$v) {
             $v['goods_spec'] = str_replace(['::',';;'],[':',';'],$v['goods_spec']);
             $v['goods_spec'] = str_replace(['::',';;'],[':',';'],$v['goods_spec']);
         }*/
         }*/
-        $this->success('ok',['list'=>$list]);
+        $total_num =  ShoppingTrolley::where(['t.user_id'=>$this->user_id])->leftJoin('StoreGoodsItem i','i.id = t.spec_id')->leftJoin('StoreGoods g','t.goods_id = g.id')->count();
+        $this->success('ok',['list'=>$list,'total_count'=>$total_num]);
     }
     }
 
 
     /**
     /**
@@ -97,7 +97,7 @@ class Trolley extends Base
      * @header name:Authorization require:1 desc:Token
      * @header name:Authorization require:1 desc:Token
      * @param  name:goods_id type:int require:1  default:0 desc:商品id
      * @param  name:goods_id type:int require:1  default:0 desc:商品id
      * @param  name:spec_id type:int  require:1 default:0 desc:规格id
      * @param  name:spec_id type:int  require:1 default:0 desc:规格id
-     * @param  name:num type:int default:1 desc:数量
+     * @param  name:num type:int default:1 desc:新增数量
      */
      */
     public function addTrolley()
     public function addTrolley()
     {
     {
@@ -130,9 +130,6 @@ class Trolley extends Base
                 ];
                 ];
                 ShoppingTrolley::create($trolley_info);
                 ShoppingTrolley::create($trolley_info);
             }
             }
-            // 扣减库存
-            StoreGoods::where('id',$goods_id)->setDec('stock',$num);
-            StoreGoodsItem::where('id',$spec_id)->setDec('stock',$num);
             Db::commit();
             Db::commit();
         }catch (\Exception $e){
         }catch (\Exception $e){
             $this->is_commit = false;
             $this->is_commit = false;
@@ -169,8 +166,6 @@ class Trolley extends Base
                 if(empty($goods_info['item_list'])) $this->exception('该规格已下架');
                 if(empty($goods_info['item_list'])) $this->exception('该规格已下架');
                 if($goods_info['item_list'][0]['stock'] < $num)$this->exception('库存不足');
                 if($goods_info['item_list'][0]['stock'] < $num)$this->exception('库存不足');
                 ShoppingTrolley::where('id',$trolley_id)->setInc('num',$num);
                 ShoppingTrolley::where('id',$trolley_id)->setInc('num',$num);
-                StoreGoods::where('id',$trolley_info->goods_id)->setDec('stock',$num);// 扣减商品库存
-                StoreGoodsItem::where('id',$trolley_info->spec_id)->setDec('stock',$num);// 扣减规格库存
             }else{
             }else{
                 if($trolley_info->num < $num) $this->exception('扣减数量有误');
                 if($trolley_info->num < $num) $this->exception('扣减数量有误');
                 if($trolley_info->num > $num){
                 if($trolley_info->num > $num){
@@ -178,8 +173,6 @@ class Trolley extends Base
                 }else{
                 }else{
                     ShoppingTrolley::where('id',$trolley_id)->delete();//删除记录
                     ShoppingTrolley::where('id',$trolley_id)->delete();//删除记录
                 }
                 }
-                StoreGoods::where('id',$trolley_info->goods_id)->setInc('stock',$num);//增加商品库存
-                StoreGoodsItem::where('id',$trolley_info->spec_id)->setInc('stock',$num);//增加规格库存
             }
             }
             Db::commit();
             Db::commit();
         }catch (\Exception $e){
         }catch (\Exception $e){
@@ -191,6 +184,61 @@ class Trolley extends Base
     }
     }
 
 
     /**
     /**
+     * @title 修改购物车商品规格
+     * @desc  修改购物车规格
+     * @author  qc
+     * @url /api/Trolley/changeTrolleySpec
+     * @method POST
+     * @header name:Authorization require:1 desc:Token
+     * @param name:trolley_id type:int require:1  default:0 desc:购物车记录id
+     * @param name:goods_id type:int require:1 default:1 desc:商品id
+     * @param name:spec_id type:int  require:1 default:0 desc:规格id
+     * @param name:num type:int require:1 default:1 desc:添加数量
+     */
+    public function changeTrolleySpec()
+    {
+        $change_id = input('post.trolley_id');
+        $goods_id = input('post.goods_id');
+        $spec_id = input('post.spec_id');
+        $num    = input('post.num',1);
+        if(!$goods_id || !$spec_id)  $this->error('请选择商品');
+        if($num <=0 ) $this->error('添加数量有误');
+        Db::startTrans();
+        try {
+            // 商品详情
+            $goods_info = StoreGoods::with(['itemList'=>function($query)use($spec_id){
+                return $query->where('id',$spec_id)->where('is_deleted',0);
+            }])->where('id',$goods_id)->where('is_deleted',0)->where('status',1)->find();
+            if(!$goods_info) throw new Exception('商品已下架');
+            $goods_info = $goods_info->toArray();
+            if(empty($goods_info['item_list'])) throw new Exception('该规格已下架');
+            if($goods_info['item_list'][0]['stock'] < $num) throw new Exception('库存不足');
+            $trolley_id = ShoppingTrolley::checkTrolley($this->user_id,$goods_id,$spec_id);
+            // 添加到购物车
+            if($trolley_id != $change_id) {
+                ShoppingTrolley::where('id',$trolley_id)->setInc('num',$num);
+                ShoppingTrolley::where('id',$change_id)->delete();// 删除购物车
+            }else{
+                $trolley_info = [
+                    'user_id' => $this->user_id,
+                    'goods_id' => $goods_id,
+                    'spec_id' => $spec_id,
+                    'goods_no' => $goods_info['item_list'][0]['goods_no'],
+                    'num' => $num,
+                ];
+                ShoppingTrolley::where('id',$change_id)->update($trolley_info);
+            }
+            Db::commit();
+        }catch (\Exception $e){
+            $this->is_commit = false;
+            $this->ret_msg = $e->getMessage();
+            Db::rollback();
+        }
+        $this->is_commit ? $this->success('添加成功'):$this->error($this->ret_msg);
+    }
+
+
+    /**
      * @title 删除购物车记录
      * @title 删除购物车记录
      * @desc  删除购物车记录
      * @desc  删除购物车记录
      * @author  qc
      * @author  qc
@@ -204,15 +252,8 @@ class Trolley extends Base
         $ids = input('post.ids');
         $ids = input('post.ids');
         if(!$ids) $this->error('请选择要删除的数据');
         if(!$ids) $this->error('请选择要删除的数据');
         $trolley_list = ShoppingTrolley::where('id','in',$ids)->select();
         $trolley_list = ShoppingTrolley::where('id','in',$ids)->select();
-        Db::startTrans();
-        foreach ($trolley_list as $trolley_info) {
-            StoreGoods::where('id',$trolley_info->goods_id)->setInc('stock',$trolley_info->num);//增加商品库存
-            StoreGoodsItem::where('id',$trolley_info->spec_id)->setInc('stock',$trolley_info->num);//增加规格库存
-        }
         ShoppingTrolley::where('id','in',$ids)->delete();
         ShoppingTrolley::where('id','in',$ids)->delete();
-        Db::commit();
         $this->success('删除成功');
         $this->success('删除成功');
-
     }
     }
 
 
     /**
     /**
@@ -237,76 +278,6 @@ class Trolley extends Base
     }
     }
 
 
 
 
-    /**
-     * @title 购物车订单确认
-     * @desc  购物车订单确认
-     * @author  qc
-     * @url /api/Trolley/confirmTrolleyList
-     * @method GET
-     * @header name:Authorization require:1 desc:Token
-     * @param  name:ids type:int  default:1 desc:购物车记录id(多条用逗号隔开)
-     * @return name:goods_id type:int default:-- desc:商品id
-     * @return name:goods_name type:string default:-- desc:商品名称
-     * @return name:goods_status type:int default:-- desc:商品状态(1上架,0下架)
-     * @return name:deleted_status type:string default:-- desc:删除状态(1删除,0未删除)
-     * @return name:cover type:string default:-- desc:封面
-     * @return name:item_list type:array default:-- desc:添加该商品的规格列表
-     * @return name:item_list.spec_id type:int default:-- desc:规格id
-     * @return name:item_list.goods_no type:int default:-- desc:货号
-     * @return name:item_list.original_price type:float default:-- desc:规格原价
-     * @return name:item_list.sell_price type:float default:-- desc:规格售价
-     * @return name:item_list.goods_spec type:string default:-- desc:规格
-     * @return name:total_money type:float default:-- desc:商品总金额【不含运费】
-     * @return name:freight type:float default:-- desc:运费
-     * @return name:freight_code type:int default:1 desc:运费提示编号【1所选地址支持发货,0所选地址不支持发货】
-     * @return name:freight_msg type:string default:-- desc:运费提示信息【freight_code=1忽略】
-     */
-    public function confirmTrolleyList()
-    {
-        $ids = input('get.ids');
-        $trolley_goods = ShoppingTrolley::field('goods_id')
-            ->where('user_id',$this->user_id)
-            ->where('id','in',$ids)
-            ->group('goods_id')
-            ->select();
-        if(!$trolley_goods) $this->error('请选择商品');
-        $goods_ids = array_column($trolley_goods->toArray(),'goods_id');
-        $freight = 0;
-        $list = [];
-        $total_money = 0;
-        $goods_list = StoreGoods::where('id','in',$goods_ids)->select()->toArray();
-        $address_info = DeliveryAddress::where(['user_id'=>$this->user_id,'is_mr'=>1])->find();
-        foreach ($goods_list as $goods_info){
-            $trolley_data =  ['goods_id'=>$goods_info['id'],'goods_name'=>$goods_info['name'],'goods_status'=>$goods_info['status'],'cover'=>$goods_info['cover'],'deleted_status'=>$goods_info['is_deleted']];
-            $trolley_data['item_list'] = ShoppingTrolley::field('t.*,i.original_price,i.sell_price,i.goods_spec')
-                ->alias('t')
-                ->where('t.id','in',$ids)
-                ->where('t.goods_id',$goods_info['id'])
-                ->leftJoin('StoreGoodsItem i','i.id = t.spec_id')
-                ->select()->toArray();
-            foreach ($trolley_data['item_list'] as $iv){
-                $total_money = bcadd(bcmul($iv['num'],$iv['sell_price'],2),$total_money,2);
-            }
-            $list[] = $trolley_data;
-            $fre_num = array_sum(array_column($trolley_data['item_list'],'num'));
-            if($address_info) {
-                $goods_freight = ExpressService::getGoodsExpressPrice($goods_info,$address_info->id,$fre_num);
-                if($goods_freight['code'] !=200){
-                    $this->is_commit =  false;
-                    $this->ret_msg =  $goods_freight['msg'];
-                }
-                $freight +=  $goods_freight['freight']; //  商品运费
-            }
-        }
-        $this->success('ok',[
-            'list'=>$list,
-            'total_money'=>$total_money,
-            'address_info'=>$address_info ? $address_info->toArray():null,
-            'freight' =>$freight,
-            'freight_msg' => $this->ret_msg,
-            'freight_code' => $this->is_commit ? 1 :0
-        ]);
-    }
 
 
 
 
 
 

+ 16 - 9
application/api/controller/Video.php

@@ -5,6 +5,7 @@ use app\common\model\ArticleItem;
 use app\common\model\DatumUrl;
 use app\common\model\DatumUrl;
 use app\common\model\PlatformSwitch;
 use app\common\model\PlatformSwitch;
 use app\common\model\SeriesVideoCate;
 use app\common\model\SeriesVideoCate;
+use app\common\model\TopSearch;
 use app\common\model\User;
 use app\common\model\User;
 use app\common\model\UserCollect;
 use app\common\model\UserCollect;
 use app\common\model\UserLearn;
 use app\common\model\UserLearn;
@@ -143,8 +144,10 @@ class Video extends Base
      * @return name:is_vip type:int default:-- desc:是否是vip(0否,1是)
      * @return name:is_vip type:int default:-- desc:是否是vip(0否,1是)
      * @return name:app_name type:string default:-- desc:发布者
      * @return name:app_name type:string default:-- desc:发布者
      * @return name:app_logo type:string default:-- desc:发布者头像
      * @return name:app_logo type:string default:-- desc:发布者头像
+     * @return name:read_num type:string default:-- desc:阅读量
      * @return name:duration type:int default:-- desc:时长(单位:秒)
      * @return name:duration type:int default:-- desc:时长(单位:秒)
      * @return name:cover_type type:int default:-- desc:1显示大图0显示小图【page_num必须是7的倍数(其他页数忽略这个参数),建议21,】
      * @return name:cover_type type:int default:-- desc:1显示大图0显示小图【page_num必须是7的倍数(其他页数忽略这个参数),建议21,】
+     * @return name:release_time type:string default:-- desc:上架时间
      */
      */
     public function getRecommendList()
     public function getRecommendList()
     {
     {
@@ -237,7 +240,7 @@ class Video extends Base
         $is_hot = input('get.is_hot',-1);
         $is_hot = input('get.is_hot',-1);
         $first_classify = input('get.first_classify');
         $first_classify = input('get.first_classify');
         $second_classify = input('get.second_classify');
         $second_classify = input('get.second_classify');
-        $sort_type = 1;//input('get.sort_type',1);
+        $sort_type = input('get.sort_type',1);
         $app_name = sysconf('app_name');
         $app_name = sysconf('app_name');
         $app_logo = sysconf('app_logo');
         $app_logo = sysconf('app_logo');
         if($title && $this->user_id) UserSearch::saveSearchTitle($this->user_id,$title,1);
         if($title && $this->user_id) UserSearch::saveSearchTitle($this->user_id,$title,1);
@@ -497,6 +500,7 @@ class Video extends Base
      * @return name:video_arr.app_logo type:string default:-- desc:发布者头像
      * @return name:video_arr.app_logo type:string default:-- desc:发布者头像
      * @return name:video_arr.comment_switch type:int default:-- desc:评论开关【0关闭1开启】
      * @return name:video_arr.comment_switch type:int default:-- desc:评论开关【0关闭1开启】
      * @return name:video_arr.mp4_url type:string default:-- desc:mp4路径
      * @return name:video_arr.mp4_url type:string default:-- desc:mp4路径
+     * @return name:video_arr.release_time type:string default:-- desc:上架时间
      */
      */
     public function getVideoDetail()
     public function getVideoDetail()
     {
     {
@@ -813,7 +817,7 @@ class Video extends Base
         $to_user = $comment['user_id'];
         $to_user = $comment['user_id'];
         $comment_switch = VideoUrl::where('id',$comment['url_id'])->value('comment_switch');
         $comment_switch = VideoUrl::where('id',$comment['url_id'])->value('comment_switch');
         if(!$comment_switch) $this->error('评论功能已关闭');
         if(!$comment_switch) $this->error('评论功能已关闭');
-        if($send_user && $send_user != $this->user_id) UserMessage:: sendUserMessage($send_user,'video',4,0,$this->user_id,$comment['url_id'],$content,$comment['url_id'],$comment['video_id']);
+        //if($send_user && $send_user != $this->user_id) UserMessage:: sendUserMessage($send_user,'video',4,0,$this->user_id,$comment['url_id'],$content,$comment['url_id'],$comment['video_id']);
         unset($comment['id']);
         unset($comment['id']);
         unset($comment['create_at']);
         unset($comment['create_at']);
         unset($comment['to_deleted']);
         unset($comment['to_deleted']);
@@ -993,6 +997,7 @@ class Video extends Base
         $track_time = input('post.track_time',0);
         $track_time = input('post.track_time',0);
         VideoUrl::where('id',$url_id)->setInc('read_num');
         VideoUrl::where('id',$url_id)->setInc('read_num');
         VideoIntro::where('id',$video_id)->setInc('read_num');
         VideoIntro::where('id',$video_id)->setInc('read_num');
+        TopSearch::seIncHotNum($url_id,$this->request->controller());
         if(!$video_id) $video_id = VideoUrl::where('id',$url_id)->value('video_id');
         if(!$video_id) $video_id = VideoUrl::where('id',$url_id)->value('video_id');
         UserTrack::crateTrack($this->user_id,1,$video_id,$url_id,$track_time);
         UserTrack::crateTrack($this->user_id,1,$video_id,$url_id,$track_time);
         $this->success('ok');
         $this->success('ok');
@@ -1081,7 +1086,7 @@ class Video extends Base
     public function getMarkNum()
     public function getMarkNum()
     {
     {
         // 评论我的
         // 评论我的
-        $comment_num = VideoComment::where([['t.is_deleted','=',0],['i.user_id','=',$this->user_id],['t.user_id','<>',$this->user_id],['source_read','=',0],['t.pid','=',0]])
+        $comment_num = VideoComment::where([['t.is_deleted','=',0],['i.user_id','=',$this->user_id],['t.user_id','<>',$this->user_id],['source_deleted','=',0],['is_read','=',0],['t.pid','=',0]])
             ->leftJoin('VideoUrl i','t.url_id = i.id')
             ->leftJoin('VideoUrl i','t.url_id = i.id')
             ->alias('t')->count();
             ->alias('t')->count();
         // 回复我的
         // 回复我的
@@ -1371,7 +1376,7 @@ class Video extends Base
         $user_info = $this->userInfo('name,headimg');
         $user_info = $this->userInfo('name,headimg');
         $list = VideoComment::where($sel_where)
         $list = VideoComment::where($sel_where)
             ->alias('t')
             ->alias('t')
-            ->field('t.id,t.source_read is_read,t.is_top,t.create_at,t.video_id,t.url_id,t.lev,i.read_num,t.content,i.title,i.cover,i.ali_vid,u.name user_name,u.headimg,i.duration,x.title series_title')
+            ->field('t.id,t.is_read,t.is_top,t.create_at,t.video_id,t.url_id,t.lev,i.read_num,t.content,i.title,i.cover,i.ali_vid,u.name user_name,u.headimg,i.duration,x.title series_title')
             ->leftJoin('VideoUrl i','t.url_id = i.id')
             ->leftJoin('VideoUrl i','t.url_id = i.id')
             ->leftJoin('VideoIntro x','t.video_id = x.id')
             ->leftJoin('VideoIntro x','t.video_id = x.id')
             ->leftJoin('store_member u','t.user_id = u.id')
             ->leftJoin('store_member u','t.user_id = u.id')
@@ -1645,12 +1650,13 @@ class Video extends Base
         if($title)  $sel_where[]  = ['t.title|t.label','like','%'.$title.'%'];
         if($title)  $sel_where[]  = ['t.title|t.label','like','%'.$title.'%'];
         $list = VideoUrl::where($sel_where)
         $list = VideoUrl::where($sel_where)
             ->alias('t')
             ->alias('t')
-            ->field('t.id,t.title,t.cover,t.label,t.is_vip,t.ali_vid,t.video_id,t.duration,t.create_at,x.title series_title')
+            ->field('t.id,t.title,t.cover,t.label,t.is_vip,t.ali_vid,t.video_id,t.duration,t.create_at,x.title series_title,t.read_num')
             ->leftJoin('VideoIntro x','x.id = t.video_id')
             ->leftJoin('VideoIntro x','x.id = t.video_id')
             ->order('id desc')
             ->order('id desc')
             ->limit($this->off_set,$this->page_num)
             ->limit($this->off_set,$this->page_num)
             ->select()->toArray();
             ->select()->toArray();
         foreach ($list as &$v) {
         foreach ($list as &$v) {
+            $v['read_num']  = numTransform($v['read_num']);
             $v['is_normal'] = CheckPower::checkModulesPower($v['video_id'],$v['id'],$this->request->controller());
             $v['is_normal'] = CheckPower::checkModulesPower($v['video_id'],$v['id'],$this->request->controller());
         }
         }
         $total_num =  VideoUrl::where($sel_where)->alias('t')->count();
         $total_num =  VideoUrl::where($sel_where)->alias('t')->count();
@@ -1879,6 +1885,7 @@ class Video extends Base
      * @return name:cover type:string default:-- desc:封面
      * @return name:cover type:string default:-- desc:封面
      * @return name:duration type:string default:-- desc:时长
      * @return name:duration type:string default:-- desc:时长
      * @return name:content type:string default:-- desc:内容
      * @return name:content type:string default:-- desc:内容
+     * @return name:like_id type:int default:-- desc:评论id
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
      * @return name:comment_switch type:int default:-- desc:评论开关【0关闭1开启】
      * @return name:comment_switch type:int default:-- desc:评论开关【0关闭1开启】
      */
      */
@@ -1887,7 +1894,7 @@ class Video extends Base
          $user_info = $this->userInfo('name,headimg');
          $user_info = $this->userInfo('name,headimg');
          $list =  VideoCommentLike::where([['l.type','=',1],['c.user_id','=',$this->user_id],['l.to_deleted','=',0],['l.user_id','<>',$this->user_id]])
          $list =  VideoCommentLike::where([['l.type','=',1],['c.user_id','=',$this->user_id],['l.to_deleted','=',0],['l.user_id','<>',$this->user_id]])
              ->alias('l')
              ->alias('l')
-             ->field('l.id,l.user_id,m.name user_name,m.headimg,l.is_read,l.create_at,v.cover,c.url_id,v.title,v.read_num,v.duration,c.content,v.video_id,v.comment_switch,x.title series_title')
+             ->field('l.id,l.like_id,l.user_id,m.name user_name,m.headimg,l.is_read,l.create_at,v.cover,c.url_id,v.title,v.read_num,v.duration,c.content,v.video_id,v.comment_switch,x.title series_title')
              ->leftJoin('StoreMember m','m.id  = l.user_id')
              ->leftJoin('StoreMember m','m.id  = l.user_id')
              ->leftJoin('VideoComment c','c.id  = l.like_id')
              ->leftJoin('VideoComment c','c.id  = l.like_id')
              ->leftJoin('VideoUrl v','v.id  = c.url_id')
              ->leftJoin('VideoUrl v','v.id  = c.url_id')
@@ -1928,11 +1935,11 @@ class Video extends Base
         $where = [];
         $where = [];
         switch ($type) {
         switch ($type) {
             case 1:
             case 1:
-                VideoComment::where([['i.user_id','=',$this->user_id]])
+                VideoComment::where([['i.user_id','=',$this->user_id],['t.pid','=',0]])
                     ->when($id ,function ($query)use ($id){
                     ->when($id ,function ($query)use ($id){
                         if($id) return $query->where('t.id','in',$id);
                         if($id) return $query->where('t.id','in',$id);
                     })->leftJoin('VideoUrl i','t.url_id = i.id')
                     })->leftJoin('VideoUrl i','t.url_id = i.id')
-                    ->alias('t') ->update(['source_read'=>input('post.is_read')]);
+                    ->alias('t') ->update(['is_read'=>input('post.is_read')]);
                 break;
                 break;
             case 2:
             case 2:
                 $all_comment = VideoComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
                 $all_comment = VideoComment::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
@@ -1974,7 +1981,7 @@ class Video extends Base
         $del_where[] = ['id','in',input('post.id')];
         $del_where[] = ['id','in',input('post.id')];
         if(in_array($type,[1,3,4,5,6,7,8,9]))   $del_where[] = ['user_id','=',$this->user_id];
         if(in_array($type,[1,3,4,5,6,7,8,9]))   $del_where[] = ['user_id','=',$this->user_id];
         if(in_array($type,[1,3])) VideoComment::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[1,3])) VideoComment::where($del_where)->update(['is_deleted'=>1]);
-        if(in_array($type,[2])) VideoComment::where($del_where)->update(['source_deleted'=>1,'source_read'=>1]);
+        if(in_array($type,[2])) VideoComment::where($del_where)->update(['source_deleted'=>1,'source_read'=>1,'is_read'=>1]);
         if(in_array($type,[10])) VideoComment::where($del_where)->update(['to_deleted'=>1,'is_read'=>1]);
         if(in_array($type,[10])) VideoComment::where($del_where)->update(['to_deleted'=>1,'is_read'=>1]);
         if(in_array($type,[4]))  UserLearn::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[4]))  UserLearn::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[5]))  UserVideo::where($del_where)->update(['is_deleted'=>1]);
         if(in_array($type,[5]))  UserVideo::where($del_where)->update(['is_deleted'=>1]);

+ 1 - 1
application/api/controller/WeChatPay.php

@@ -71,7 +71,7 @@ class WeChatPay extends Controller
                 $config = $jssdk->sdkConfig($result['prepay_id']);
                 $config = $jssdk->sdkConfig($result['prepay_id']);
             }
             }
             if(!is_array($config) && $config) $config = json_decode($config,true);
             if(!is_array($config) && $config) $config = json_decode($config,true);
-            return ['code'=> $config ? 200 : 201 , 'config'=>$config,'msg'=>'ok','mweb_url'=> isset($result['mweb_url']) ?  $result['mweb_url']:''];
+            return ['code'=> $config ? 200 : 201 , 'config'=>$config,'msg'=>'ok','mweb_url'=> isset($result['mweb_url']) ?  $result['mweb_url']:'' ,'pc_pay_url'=> isset($result['code_url']) ?  $result['code_url']:''];
         }catch (\Exception $e){
         }catch (\Exception $e){
             return ['code'=> 201,'config'=>[],'msg'=>$e->getMessage(),'mweb_url'=>''];
             return ['code'=> 201,'config'=>[],'msg'=>$e->getMessage(),'mweb_url'=>''];
         }
         }

+ 3 - 3
application/common/model/ArticleIntro.php

@@ -10,7 +10,7 @@ class ArticleIntro extends Model
             ->where('is_deleted',0)
             ->where('is_deleted',0)
             ->where('status',1)
             ->where('status',1)
             ->where('release_time','< time',date("Y-m-d H:i:s"))
             ->where('release_time','< time',date("Y-m-d H:i:s"))
-            ->field('id,article_id,user_id,cover,is_vip,sort,transmit_num,read_num,title,images,content,content_type,pdf,video_id,video_item,datum_id,datum_item,author,desc,desc_text,goods_id,comment_switch,pdf_clear');
+            ->field('id,release_time,article_id,user_id,cover,is_vip,sort,transmit_num,read_num,title,images,content,content_type,pdf,video_id,video_item,datum_id,datum_item,author,desc,desc_text,goods_id,comment_switch,pdf_clear');
            // ->order('sort desc,read_num desc');
            // ->order('sort desc,read_num desc');
     }
     }
 
 
@@ -18,7 +18,7 @@ class ArticleIntro extends Model
         return $this->hasMany('ArticleItem','article_id')
         return $this->hasMany('ArticleItem','article_id')
             ->where('is_deleted',0)
             ->where('is_deleted',0)
             ->where('release_time','< time',date("Y-m-d H:i:s"))
             ->where('release_time','< time',date("Y-m-d H:i:s"))
-            ->field('id,article_id,user_id,cover,is_vip,sort,transmit_num,read_num,title,images,content,content_type,pdf,video_id,video_item,datum_id,datum_item,author,desc,desc_text,goods_id,comment_switch,pdf_clear');
+            ->field('id,article_id,release_time,user_id,cover,is_vip,sort,transmit_num,read_num,title,images,content,content_type,pdf,video_id,video_item,datum_id,datum_item,author,desc,desc_text,goods_id,comment_switch,pdf_clear');
         // ->order('sort desc,read_num desc');
         // ->order('sort desc,read_num desc');
     }
     }
 
 
@@ -27,7 +27,7 @@ class ArticleIntro extends Model
             ->where('is_deleted',0)
             ->where('is_deleted',0)
             ->where('status',1)
             ->where('status',1)
             ->where('release_time','< time',date("Y-m-d H:i:s"))
             ->where('release_time','< time',date("Y-m-d H:i:s"))
-            ->field('id,article_id,user_id,cover,is_vip,sort,transmit_num,read_num,title,images,content_type,pdf,video_id,video_item,datum_id,datum_item,author,desc,desc_text,goods_id,comment_switch,pdf_clear');
+            ->field('id,article_id,release_time,user_id,cover,is_vip,sort,transmit_num,read_num,title,images,content_type,pdf,video_id,video_item,datum_id,datum_item,author,desc,desc_text,goods_id,comment_switch,pdf_clear');
         // ->order('sort desc,read_num desc');
         // ->order('sort desc,read_num desc');
     }
     }
 
 

+ 1 - 1
application/common/model/DatumIntro.php

@@ -6,7 +6,7 @@ class DatumIntro extends Model
 {
 {
     public function urlArr()
     public function urlArr()
     {
     {
-        return $this->hasMany('DatumUrl','datum_id')->field('id,datum_id,user_id,title,url,is_encrypt,pdf_clear,sort,is_vip,transmit_num,down_num,read_num,is_down,comment_switch')
+        return $this->hasMany('DatumUrl','datum_id')->field('id,release_time,datum_id,user_id,title,url,is_encrypt,pdf_clear,sort,is_vip,transmit_num,down_num,read_num,is_down,comment_switch')
             ->where('release_time','< time',date("Y-m-d H:i:s"))->where('is_deleted',0)->where('status',1);
             ->where('release_time','< time',date("Y-m-d H:i:s"))->where('is_deleted',0)->where('status',1);
     }
     }
 
 

+ 1 - 1
application/common/model/GoodsOrder.php

@@ -7,7 +7,7 @@ class GoodsOrder extends Model
     protected $name='store_order';
     protected $name='store_order';
     public function orderItem()
     public function orderItem()
     {
     {
-        return $this->hasMany('GoodsOrderItem','order_id');
+        return $this->hasMany('GoodsOrderItem','order_id')->field('id,user_id,order_id,goods_id,goods_spec,goods_name,spec_id,cover,pay_price,num');
     }
     }
 
 
     public function orderBill()
     public function orderBill()

+ 0 - 1
application/common/model/GoodsOrderItem.php

@@ -16,5 +16,4 @@ class GoodsOrderItem extends Model
 
 
 
 
 
 
-
 }
 }

+ 15 - 0
application/common/model/ShoppingTrolley.php

@@ -20,7 +20,22 @@ class ShoppingTrolley extends Model
     public function goodsInfo()
     public function goodsInfo()
     {
     {
         return $this->belongsTo('StoreGoods','goods_id')->field('id,name,cover');
         return $this->belongsTo('StoreGoods','goods_id')->field('id,name,cover');
+    }
+
 
 
+    //获取购物车列表
+    public static function getTrolleyList($where)
+    {
+        $list = static::field('t.id,t.goods_id,t.spec_id,t.goods_no,t.num,goods_spec')
+            ->alias('t')
+            ->leftJoin('StoreGoodsItem i','i.id = t.spec_id')
+            ->where($where)->order('t.id desc')->select()->toArray();
+        array_walk($list,function (&$v){
+            $v['goods_spec'] = str_replace(['::',';;'],[':',';'],$v['goods_spec']);
+        });
+        return $list;
     }
     }
 
 
+
+
 }
 }

+ 6 - 1
application/common/model/StoreGoodsItem.php

@@ -5,6 +5,11 @@ use think\Model;
 class StoreGoodsItem extends Model
 class StoreGoodsItem extends Model
 {
 {
 
 
-
+    // 商品库存变更
+    public static function stockChange($spec_id,$goods_id,$num,$type = -1)
+    {
+        static ::where('id',$spec_id)->setInc('stock',$num * $type);
+        StoreGoods ::where('id',$goods_id)->setInc('stock',$num * $type);
+    }
 
 
 }
 }

+ 95 - 0
application/common/model/TopSearch.php

@@ -1,8 +1,103 @@
 <?php
 <?php
 namespace app\common\model;
 namespace app\common\model;
+use library\tools\Data;
 use think\Model;
 use think\Model;
+use function Symfony\Component\String\b;
+
 // 商品热搜
 // 商品热搜
 class TopSearch extends Model
 class TopSearch extends Model
 {
 {
 
 
+    // 保存更新热搜数据
+    public static function saveData($id,$module='')
+    {
+        $data = [];
+        switch ($module)
+        {
+            case 'video':
+                $info = VideoUrl::where('id',$id)->find()->toArray();
+                if(!empty($info)) $data['series_id'] = $info['video_id'];
+                break;
+            case 'article':
+                $info = ArticleItem::where('id',$id)->find()->toArray();
+                if(!empty($info)) $data['series_id'] = $info['article_id'];
+                break;
+            case 'datum':
+                $info = DatumUrl::where('id',$id)->find()->toArray();
+                if(!empty($info)) $data['series_id'] = $info['datum_id'];
+                break;
+            case 'press':
+                $info = Press::where('id',$id)->find()->toArray();
+                break;
+            case "forum":
+                $info = UserForum::where('id',$id)->find()->toArray();
+                break;
+            case 'activity':
+                $info = Activity::where('id',$id)->find()->toArray();
+                break;
+            case 'demand':
+                $info = PlatformDemand::where('id',$id)->find()->toArray();
+                break;
+            case 'recruit':
+                $info = Recruit::where('id',$id)->find()->toArray();
+                break;
+            case 'supplier_goods':
+                $info = SupplierGoods::where('id',$id)->find()->toArray();
+                break;
+            case 'goods':
+                $info = StoreGoods::where('id',$id)->find()->toArray();
+                break;
+        }
+        if(empty($info)) return false;
+        $data['title'] = isset($info['title']) ? $info['title'] : $info['name'];
+        $data['status'] = isset($info['status']) ? $info['status'] : 1;
+        $data['is_deleted'] = isset($info['is_deleted']) ? $info['is_deleted'] :0;
+        if(isset($info['create_at'])) $data['create_at'] = $info['create_at'] ;
+        if(isset($info['release_time'])) $data['release_time'] = $info['release_time'] ;
+        if(isset($info['hot_time'])) $data['hot_time'] = $info['hot_time'] ;
+
+        $data['hot_num'] = isset($info['hot_num']) ? $info['hot_num'] :0;
+        $data['module'] = $module;
+        $data['rel_id'] = $info['id'];
+        Data::save('TopSearch',$data,'module',['module'=>$module,'rel_id'=>$data['rel_id']]);
+    }
+
+    //  增加热搜阅读量
+    public static function seIncHotNum($rel_id,$module,$num = 1)
+    {
+        switch ($module) {
+            case 'video':
+               VideoUrl::where('id',$rel_id)->setInc('hot_num',$num);
+                break;
+            case 'article':
+                ArticleItem::where('id',$rel_id)->setInc('hot_num',$num);
+                break;
+            case 'datum':
+                DatumUrl::where('id',$rel_id)->setInc('hot_num',$num);
+                break;
+            case 'press':
+                Press::where('id',$rel_id)->setInc('hot_num',$num);
+                break;
+            case "forum":
+                UserForum::where('id',$rel_id)->setInc('hot_num',$num);
+                break;
+            case 'activity':
+                Activity::where('id',$rel_id)->setInc('hot_num',$num);
+                break;
+            case 'demand':
+                PlatformDemand::where('id',$rel_id)->setInc('hot_num',$num);
+                break;
+            case 'recruit':
+                Recruit::where('id',$rel_id)->setInc('hot_num',$num);
+                break;
+            case 'supplier_goods':
+               SupplierGoods::where('id',$rel_id)->setInc('hot_num',$num);
+                break;
+            case 'goods':
+                StoreGoods::where('id',$rel_id)->setInc('hot_num',$num);
+                break;
+        }
+        static::where(['rel_id'=>$rel_id,'module'=>$module])->setInc('hot_num',$num);
+    }
+
 }
 }

+ 2 - 0
application/common/model/UserFacility.php

@@ -10,6 +10,7 @@ class UserFacility extends Model
     {
     {
         if(!in_array($type,[1,2,3,4])) return true;
         if(!in_array($type,[1,2,3,4])) return true;
         $check_info = self::where(['user_id'=>$user_id,'type'=>$type])->find();
         $check_info = self::where(['user_id'=>$user_id,'type'=>$type])->find();
+
         if(empty($check_info) || $check_info->facility  == '') {
         if(empty($check_info) || $check_info->facility  == '') {
             Data::save('UserFacility',
             Data::save('UserFacility',
                 [
                 [
@@ -22,6 +23,7 @@ class UserFacility extends Model
                 'user_id',['user_id'=>$user_id,'type'=>$type]);
                 'user_id',['user_id'=>$user_id,'type'=>$type]);
             return  true;
             return  true;
         }
         }
+
         return $check_info->facility == $facility ? true : false;
         return $check_info->facility == $facility ? true : false;
 
 
     }
     }

+ 20 - 0
application/common/model/UserLoginLog.php

@@ -0,0 +1,20 @@
+<?php
+namespace app\common\model;
+use library\tools\Data;
+use think\Model;
+// 登录记录
+class UserLoginLog extends Model
+{
+
+    public static function creatLog($user_id,$type,$facility,$account = '',$token = '')
+    {
+        static::create([
+            'user_id' => $user_id,
+            'type' => $type,
+            'facility' => $facility,
+            'account' => $account,
+            'token' => $token,
+        ]);
+    }
+
+}

+ 6 - 5
application/common/model/UserMessage.php

@@ -74,7 +74,7 @@ class UserMessage extends Model
             1=>['title'=>'反馈内容回复','msg'=>['平台回复了您的反馈'],'channel'=>['xiaomi'=>"108237",'huawei'=>'IM','oppo'=>'news']],
             1=>['title'=>'反馈内容回复','msg'=>['平台回复了您的反馈'],'channel'=>['xiaomi'=>"108237",'huawei'=>'IM','oppo'=>'news']],
         ],// 会员管理
         ],// 会员管理
         'recruit'=>[
         'recruit'=>[
-            5=>['title'=>'需求订阅','msg'=>['您订阅的招聘有更新'],'channel'=>['xiaomi'=>"108237",'huawei'=>'SUBSCRIPTION','oppo'=>'subscribe']],
+            5=>['title'=>'订阅消息','msg'=>['您订阅的招聘有更新'],'channel'=>['xiaomi'=>"108237",'huawei'=>'SUBSCRIPTION','oppo'=>'subscribe']],
         ],// 招聘
         ],// 招聘
     ];
     ];
 
 
@@ -94,6 +94,7 @@ class UserMessage extends Model
     public static function sendUserMessage($to_user,$module,$type,$msg_key,$from_user,$rel_id,$content = '',$children_id= 0,$series_id=0)
     public static function sendUserMessage($to_user,$module,$type,$msg_key,$from_user,$rel_id,$content = '',$children_id= 0,$series_id=0)
     {
     {
         if($to_user == 1 || !$to_user) return true;
         if($to_user == 1 || !$to_user) return true;
+
         $message = [
         $message = [
             'user_id'=>$to_user,
             'user_id'=>$to_user,
             'from_user'=>$from_user,
             'from_user'=>$from_user,
@@ -109,14 +110,14 @@ class UserMessage extends Model
         $from_name = User::where('id',$from_user)->value('name');
         $from_name = User::where('id',$from_user)->value('name');
         switch ($module) {
         switch ($module) {
             case 'video':
             case 'video':
-                if((in_array($type,[3,4]) && PlatformSwitch::checkSwitch($to_user,$children_id,7)) || (in_array($type,[5])  && PlatformSwitch::checkSwitch($to_user,$children_id,2)) ) {
+                if((in_array($type,[3,4]) && PlatformSwitch::checkSwitch($to_user,$children_id,7)) || (in_array($type,[5])  && PlatformSwitch::checkSwitch($to_user,$series_id,2)) ) {
                     $message['jg_type'] = 1;
                     $message['jg_type'] = 1;
                     $res = static::Jpush($to_user,$message['content'],$module,$type,$series_id,$children_id,static::$type_desc[$module][$type]['channel'],['title'=>static::$type_desc[$module][$type]['title']]);
                     $res = static::Jpush($to_user,$message['content'],$module,$type,$series_id,$children_id,static::$type_desc[$module][$type]['channel'],['title'=>static::$type_desc[$module][$type]['title']]);
                     $message['jg_res']  = is_array($res) ? json_encode($res) :$res;
                     $message['jg_res']  = is_array($res) ? json_encode($res) :$res;
                 }
                 }
                 break;
                 break;
             case 'article':
             case 'article':
-                if((in_array($type,[3,4]) && PlatformSwitch::checkSwitch($to_user,$children_id,8)) || (in_array($type,[5])  && PlatformSwitch::checkSwitch($to_user,$children_id,3)))
+                if((in_array($type,[3,4]) && PlatformSwitch::checkSwitch($to_user,$children_id,8)) || (in_array($type,[5])  && PlatformSwitch::checkSwitch($to_user,$series_id,3)))
                 {
                 {
                     $message['jg_type'] = 1;
                     $message['jg_type'] = 1;
                     $res = static::Jpush($to_user,$message['content'],$module,$type,$series_id,$children_id,static::$type_desc[$module][$type]['channel'],['title'=>static::$type_desc[$module][$type]['title']]);
                     $res = static::Jpush($to_user,$message['content'],$module,$type,$series_id,$children_id,static::$type_desc[$module][$type]['channel'],['title'=>static::$type_desc[$module][$type]['title']]);
@@ -125,7 +126,7 @@ class UserMessage extends Model
 
 
                 break;
                 break;
             case 'datum':
             case 'datum':
-                if((in_array($type,[3,4]) && PlatformSwitch::checkSwitch($to_user,$children_id,9)) || (in_array($type,[5])  && PlatformSwitch::checkSwitch($to_user,$children_id,4)) ) {
+                if((in_array($type,[3,4]) && PlatformSwitch::checkSwitch($to_user,$children_id,9)) || (in_array($type,[5])  && PlatformSwitch::checkSwitch($to_user,$series_id,4)) ) {
                     $message['jg_type'] = 1;
                     $message['jg_type'] = 1;
                     $res =  static::Jpush($to_user,$message['content'],$module,$type,$series_id,$children_id,static::$type_desc[$module][$type]['channel'],['title'=>static::$type_desc[$module][$type]['title']]);
                     $res =  static::Jpush($to_user,$message['content'],$module,$type,$series_id,$children_id,static::$type_desc[$module][$type]['channel'],['title'=>static::$type_desc[$module][$type]['title']]);
                     $message['jg_res']  = is_array($res) ? json_encode($res) :$res;
                     $message['jg_res']  = is_array($res) ? json_encode($res) :$res;
@@ -140,7 +141,7 @@ class UserMessage extends Model
 
 
                 break;
                 break;
             case 'supplier':
             case 'supplier':
-                if((in_array($type,[3,4]) && PlatformSwitch::checkSwitch($to_user,$rel_id,11)) || (in_array($type,[5])  && PlatformSwitch::checkSwitch($to_user,$rel_id,5))) {
+                if((in_array($type,[3,4]) && PlatformSwitch::checkSwitch($to_user,$rel_id,11)) || (in_array($type,[5])  && PlatformSwitch::checkSwitch($to_user,$series_id,5))) {
                     $message['jg_type'] = 1;
                     $message['jg_type'] = 1;
                     $res =  static::Jpush($to_user,$message['content'],$module,$type,$rel_id,$children_id,static::$type_desc[$module][$type]['channel'],['title'=>static::$type_desc[$module][$type]['title']]);
                     $res =  static::Jpush($to_user,$message['content'],$module,$type,$rel_id,$children_id,static::$type_desc[$module][$type]['channel'],['title'=>static::$type_desc[$module][$type]['title']]);
                     $message['jg_res']  = is_array($res) ? json_encode($res) :$res;
                     $message['jg_res']  = is_array($res) ? json_encode($res) :$res;

+ 3 - 2
application/common/model/UserSearch.php

@@ -28,12 +28,13 @@ class UserSearch extends Model
      */
      */
     public static function saveSearchTitle($user_id,$title,$type = 0){
     public static function saveSearchTitle($user_id,$title,$type = 0){
         Data::save('UserSearch',['user_id'=>$user_id,'title'=>$title,'type'=>$type,'create_at'=>date('Y-m-d H:i:s')],'user_id',['user_id'=>$user_id,'type'=>$type,'title'=>$title]);
         Data::save('UserSearch',['user_id'=>$user_id,'title'=>$title,'type'=>$type,'create_at'=>date('Y-m-d H:i:s')],'user_id',['user_id'=>$user_id,'type'=>$type,'title'=>$title]);
-        $stat = TopSearch::where('title','like','%'.$title.'%')->where('type','=',$type)->value('id');
+       /* $stat = TopSearch::where('title','like','%'.$title.'%')->where('type','=',$type)->value('id');
         if($stat) {
         if($stat) {
             TopSearch::where('id',$stat)->setInc('num');
             TopSearch::where('id',$stat)->setInc('num');
         }else{
         }else{
             TopSearch::create(['title'=>$title,'type'=>$type,'num'=>1]);
             TopSearch::create(['title'=>$title,'type'=>$type,'num'=>1]);
-        }
+        }*/
+
     }
     }
 
 
 
 

+ 2 - 2
application/common/service/CheckPower.php

@@ -105,9 +105,9 @@ class CheckPower
             case 'mall':
             case 'mall':
                 $item = StoreGoods::where('id',$first_id)->where('status',1)->where('is_deleted',0)->find();
                 $item = StoreGoods::where('id',$first_id)->where('status',1)->where('is_deleted',0)->find();
                 if(!$item) return 0;
                 if(!$item) return 0;
-                $cate = GoodsCate::where('id','in',[$item->first_classify,$item->second_classify])
+              /*  $cate = GoodsCate::where('id','in',[$item->first_classify,$item->second_classify])
                     ->where('status',1)->where('is_deleted',0)->count();
                     ->where('status',1)->where('is_deleted',0)->count();
-                if($cate != 2) return 0;
+                if($cate != 2) return 0;*/
                 break;
                 break;
             case 'supplier':
             case 'supplier':
                 $item = SupplierGoods::where('id',$first_id)->where('status',1)->where('is_deleted',0)->find();
                 $item = SupplierGoods::where('id',$first_id)->where('status',1)->where('is_deleted',0)->find();

+ 3 - 1
application/common/service/Elastic.php

@@ -127,6 +127,7 @@ class Elastic
                     'collect_num'=>['type'=>'integer'],
                     'collect_num'=>['type'=>'integer'],
                     'down_num'=>['type'=>'integer'],
                     'down_num'=>['type'=>'integer'],
                     'is_over'=>['type'=>'integer'],
                     'is_over'=>['type'=>'integer'],
+                    'city'=>['type'=>'keyword'],
                 ];
                 ];
                 break;
                 break;
         }
         }
@@ -158,7 +159,8 @@ class Elastic
             "index"=>$module,
             "index"=>$module,
             "body"=>[
             "body"=>[
                // "properties"=>['level' => ['type'=>'integer']]
                // "properties"=>['level' => ['type'=>'integer']]
-               "properties"=>['is_over' => ['type'=>'integer']]
+              // "properties"=>['is_over' => ['type'=>'integer']]
+               "properties"=>['city' => ['type'=>'keyword']]
             ]
             ]
         ];
         ];
         $response = $client->indices()->putMapping($index);
         $response = $client->indices()->putMapping($index);

+ 3 - 1
application/common/service/OrderCallback.php

@@ -169,7 +169,9 @@ class OrderCallback
                     $qrCode->writeFile($filename);
                     $qrCode->writeFile($filename);
                     $url='http://'.$_SERVER['SERVER_NAME']."/code/".$iv['id'].'.png';
                     $url='http://'.$_SERVER['SERVER_NAME']."/code/".$iv['id'].'.png';
                     ActivityApplyItem::where('id',$iv['id'])->update(['status'=>1,'qr_code'=>$url,'qr_content'=>$qr_content]);
                     ActivityApplyItem::where('id',$iv['id'])->update(['status'=>1,'qr_code'=>$url,'qr_content'=>$qr_content]);
-                    UserMessage::sendUserMessage($iv['user_id'],'activity',1,0,0,$iv['id'],'',$iv['id']);
+                    $act_title = \app\common\model\Activity::where('id',$iv['act_id'])->value('title');
+                    $content = '您已成功报名"'.$act_title.'"';
+                    UserMessage::sendUserMessage($iv['user_id'],'activity',1,0,0,$iv['id'],$content,$iv['id']);
                     UserSynth::ticketSend($iv['id']);
                     UserSynth::ticketSend($iv['id']);
                 }else{
                 }else{
                     ActivityApplyItem::where('id',$iv['id'])->update(['status'=>1]);
                     ActivityApplyItem::where('id',$iv['id'])->update(['status'=>1]);

+ 45 - 9
application/common/service/UserSynth.php

@@ -8,6 +8,7 @@ use app\common\model\ActivityApplyItem;
 use app\common\model\ActivitySponsor;
 use app\common\model\ActivitySponsor;
 use app\common\model\ArticleIntro;
 use app\common\model\ArticleIntro;
 use app\common\model\ArticleItem;
 use app\common\model\ArticleItem;
+use app\common\model\ArticleLike;
 use app\common\model\BillApply;
 use app\common\model\BillApply;
 use app\common\model\BillHeader;
 use app\common\model\BillHeader;
 use app\common\model\DatumIntro;
 use app\common\model\DatumIntro;
@@ -219,55 +220,61 @@ class UserSynth extends SerBase
                 'type'=> 1,
                 'type'=> 1,
                 'table'=>'dd_video_url',
                 'table'=>'dd_video_url',
                 'index_field'=>'title',
                 'index_field'=>'title',
-                'select_field'=>' a.id,a.title,a.cover,a.user_id,a.is_vip,a.create_at,a.ali_vid,a.video_id,a.duration ',
+                'select_field'=>' a.id,a.title,a.cover,a.user_id,a.is_vip,a.create_at,a.ali_vid,a.video_id,a.duration ,a.release_time,a.read_num',
             ],
             ],
             'article'=>[
             'article'=>[
                 'type'=> 2,
                 'type'=> 2,
                 'table'=>'dd_article_item',
                 'table'=>'dd_article_item',
                 'index_field'=>'title',
                 'index_field'=>'title',
-                'select_field'=>' a.id,a.title,a.cover,a.content_type,a.pdf,a.images,a.create_at,a.user_id,a.is_vip,a.read_num,a.article_id ,a.author ',
+                'select_field'=>' a.id,a.title,a.cover,a.content_type,a.pdf,a.images,a.create_at,a.user_id,a.is_vip,a.read_num,a.article_id ,a.author,a.release_time,a.desc ',
             ],
             ],
             'datum'=>[
             'datum'=>[
                 'type'=> 3,
                 'type'=> 3,
                 'table'=>'dd_datum_url',
                 'table'=>'dd_datum_url',
                 'index_field'=>'title',
                 'index_field'=>'title',
-                'select_field'=>' a.id,a.title,a.user_id,a.create_at,a.down_num,a.read_num,a.is_vip,a.datum_id,a.url ,a.is_encrypt,a.pdf_clear  ',
+                'select_field'=>' a.id,a.title,a.user_id,a.create_at,a.down_num,a.read_num,a.is_vip,a.datum_id,a.url ,a.is_encrypt,a.pdf_clear ,a.release_time ',
             ],
             ],
             'forum'=>[
             'forum'=>[
                 'type'=> 6,
                 'type'=> 6,
                 'table'=>'dd_user_forum',
                 'table'=>'dd_user_forum',
                 'index_field'=>'title',
                 'index_field'=>'title',
-                'select_field'=>'  a.id,a.title,a.content,a.label,a.level,a.browse_num,a.sort,a.create_at,u.name,u.headimg ',
+                'select_field'=>'  a.id,a.title,a.content,a.label,a.level,a.browse_num,a.sort,a.create_at,u.name,u.headimg ,a.release_time',
             ],
             ],
             'activity'=>[
             'activity'=>[
                 'type'=> 11,
                 'type'=> 11,
                 'table'=>'dd_activity',
                 'table'=>'dd_activity',
                 'index_field'=>'title',
                 'index_field'=>'title',
-                'select_field'=>'  a.id,cover,a.user_id,a.province,a.city,a.county,a.address,title,a.status,address,a.read_num,a.label,a.start_time,a.end_time',
+                'select_field'=>'  a.id,cover,a.user_id,a.province,a.city,a.county,a.address,title,a.status,address,a.read_num,a.label,a.start_time,a.end_time,a.release_time',
             ],
             ],
             'demand'=>[
             'demand'=>[
                 'type'=> 5,
                 'type'=> 5,
                 'table'=>'dd_platform_demand',
                 'table'=>'dd_platform_demand',
                 'index_field'=>'title',
                 'index_field'=>'title',
-                'select_field'=>' a.id,a.cover,a.money,a.user_id,a.label,a.title,a.read_num,a.is_over,a.content ',
+                'select_field'=>' a.id,a.cover,a.money,a.user_id,a.label,a.title,a.read_num,a.is_over,a.content ,a.release_time',
             ],
             ],
             'press'=>[
             'press'=>[
                   'type'=> 4,
                   'type'=> 4,
                   'table'=>'dd_press',
                   'table'=>'dd_press',
                   'index_field'=>'title',
                   'index_field'=>'title',
-                  'select_field'=>'a.id,a.title,a.label,a.images,a.read_num,a.transmit_num,a.user_id,a.create_at',
+                  'select_field'=>'a.id,a.title,a.label,a.images,a.read_num,a.transmit_num,a.user_id,a.create_at,a.release_time',
               ],
               ],
             'recruit'=>[
             'recruit'=>[
                 'type'=> 8,
                 'type'=> 8,
                 'table'=>'dd_recruit',
                 'table'=>'dd_recruit',
                 'index_field'=>'title',
                 'index_field'=>'title',
-                'select_field'=>'a.id,title,a.user_id,label,salary,principal,hr_headimg,address,price_min,price_max,company,education,experience_min,experience_max,welfare,province,city,county ',
+                'select_field'=>'a.id,title,a.user_id,label,salary,principal,hr_headimg,address,price_min,price_max,company,education,experience_min,experience_max,welfare,province,city,county ,a.release_time,a.company_intro,a.is_ss,a.scale',
             ],
             ],
             "supplier"=>[
             "supplier"=>[
                 'type'=> 11,
                 'type'=> 11,
                 'table'=>'dd_supplier_goods',
                 'table'=>'dd_supplier_goods',
                 'index_field'=>'name',
                 'index_field'=>'name',
-                'select_field'=>'a.id,a.supplier_id,a.name,a.label,a.cover,a.read_num,k.title supplier_name,k.logo supplier_logo',
+                'select_field'=>'a.id,a.supplier_id,a.name,a.label,a.cover,a.read_num,k.title supplier_name,k.logo supplier_logo,a.release_time',
+            ],
+            'goods'=>[
+                'type'=> 7,
+                'table'=>'dd_store_goods',
+                'index_field'=>'name',
+                'select_field'=>'a.id,name,cover,low_price,a.label,a.release_time,sale_num,a.user_id',
             ]
             ]
           ];
           ];
         $search_log =  UserSearch::getSearchTitle($user_id,$module_set[$module]['type']);
         $search_log =  UserSearch::getSearchTitle($user_id,$module_set[$module]['type']);
@@ -312,6 +319,7 @@ class UserSynth extends SerBase
                     $info_auth = VideoUrl::getVideoAuth($v['user_id'],APPNAME,APPLOGO);
                     $info_auth = VideoUrl::getVideoAuth($v['user_id'],APPNAME,APPLOGO);
                     $v['app_name'] = $info_auth['app_name'];
                     $v['app_name'] = $info_auth['app_name'];
                     $v['app_logo'] = $info_auth['app_logo'];
                     $v['app_logo'] = $info_auth['app_logo'];
+                    $v['read_num'] = numTransform($v['read_num']);
                 });
                 });
                 break;
                 break;
             case "article":
             case "article":
@@ -346,6 +354,10 @@ class UserSynth extends SerBase
                     $v['images_arr'] = $v['images'] ? explode('|',$v['images']):null;
                     $v['images_arr'] = $v['images'] ? explode('|',$v['images']):null;
                     $v['create_at'] = substr($v['create_at'],0,10);
                     $v['create_at'] = substr($v['create_at'],0,10);
                     $v['is_release'] = UserLearn::checkRelease($user_id,3,$v['id']);
                     $v['is_release'] = UserLearn::checkRelease($user_id,3,$v['id']);
+                    $v['is_collect']= UserCollect::checkCollectByType($user_id,3,$v['article_id'],$v['id']);
+                    $v['is_like'] = ArticleLike::where(['user_id'=>$user_id,'article_id'=>$v['article_id'],'item_id'=>$v['id']])->count();
+                    $v['like_num'] = ArticleLike::where(['article_id'=>$v['article_id'],'item_id'=>$v['id']])->count();
+                    $v['collect_num']  = UserCollect::getCollectNum(3,$v['article_id'],$v['id']);
                 });
                 });
                 break;
                 break;
             case "datum":
             case "datum":
@@ -582,6 +594,30 @@ class UserSynth extends SerBase
                     $v['cover_arr'] = $v['cover']? explode('|',trim($v['cover'],'|')):null;
                     $v['cover_arr'] = $v['cover']? explode('|',trim($v['cover'],'|')):null;
                 });
                 });
                 break;
                 break;
+            case "goods":
+                if($page == 1) {
+                    // 查询推荐id sql
+                    $recommend_query = "SELECT a.id FROM " .$module_set[$module]['table'] . " a LEFT JOIN ( SELECT id,IF(id,1,1) is_recommend FROM ".$module_set[$module]['table']." b WHERE ( $where_str )) AS c ON c.id = a.id WHERE a.is_deleted = 0 AND a.status = 1 AND is_recommend = 1 AND a.release_time < '".$time_str."'";
+                    $all_recommend = Db::query($recommend_query);
+                    $recommend_ids = array_column($all_recommend,'id');// 推荐的
+                    $un_recommend =  \app\common\model\StoreGoods::where([['status','=',1],['is_deleted','=',0],['id','not in',$recommend_ids],['release_time','< time',$time_str]])->column('id');
+                    $redis->set($redis_set[0],implode(',',$recommend_ids),$redis_time);
+                    $redis->set($redis_set[2],implode(',',$un_recommend),$redis_time);
+                    $redis->set($redis_set[4],count($recommend_ids) + count($un_recommend),$redis_time);
+                }else{
+                    $recommend_ids = $redis->get($redis_set[0]);// 所有推荐的id
+                    $recommend_ids = $recommend_ids ? explode(',',$recommend_ids) : [];
+                    $un_recommend  = $redis->get($redis_set[2]);// 所有非推荐的id
+                    $un_recommend = $un_recommend ? explode(',',$un_recommend) : [];
+                }
+                $list1 =  \app\common\model\StoreGoods::field($module_set[$module]['select_field'])->alias('a')->where('id','in',$recommend_ids)->orderRand('rand()')->limit($page_num)->select()->toArray();
+                $num2 = $page_num - count($list1);
+                $list2 = $num2 <=0 ? [] :  \app\common\model\StoreGoods::field($module_set[$module]['select_field'])->alias('a')->where('id','in',$un_recommend)->orderRand('rand()')->limit($num2)->select()->toArray();
+                $list = array_merge($list1,$list2);
+                array_walk($list,function (&$v,$k)use ($user_id){
+                    $v['label_name'] = $v['label'] ?  explode(',',trim($v['label'],',')): null;
+                });
+                break;
         }
         }
         if(!empty($list1)) {
         if(!empty($list1)) {
             $select1 = array_column($list1,'id');// 本次查询出推荐的id
             $select1 = array_column($list1,'id');// 本次查询出推荐的id

+ 12 - 0
application/mall/controller/Banner.php

@@ -33,10 +33,16 @@ class Banner extends Controller
         $this->title = '轮播图列表';
         $this->title = '轮播图列表';
         $this->place_desc =  [
         $this->place_desc =  [
             ''=>'--',
             ''=>'--',
+            'service' => '客服',
             'video'=>'视频',
             'video'=>'视频',
             'datum'=>'资料',
             'datum'=>'资料',
             'article'=>'图文',
             'article'=>'图文',
             'supplier'=>'供应商商品',
             'supplier'=>'供应商商品',
+            'press'=>'新闻',
+            'demand'=>'需求',
+            'recruit'=>'招聘',
+            'activity'=>'活动',
+            'forum'=>'问题',
         ];
         ];
         $query = $this->_query($this->table)->where('is_deleted',0);
         $query = $this->_query($this->table)->where('is_deleted',0);
         $query->like('name');
         $query->like('name');
@@ -146,10 +152,16 @@ class Banner extends Controller
         $data['create_at'] = date('Y-m-d H:i:s');
         $data['create_at'] = date('Y-m-d H:i:s');
         $this->place_desc = [
         $this->place_desc = [
             ''=>'全部',
             ''=>'全部',
+            'service' => '客服',
             'video'=>'视频',
             'video'=>'视频',
             'datum'=>'资料',
             'datum'=>'资料',
             'article'=>'图文',
             'article'=>'图文',
             'supplier'=>'供应商商品',
             'supplier'=>'供应商商品',
+            'press'=>'新闻',
+            'demand'=>'需求',
+            'recruit'=>'招聘',
+            'activity'=>'活动',
+            'forum'=>'问题',
         ];
         ];
         $this->module_list= UserSynth::getAllModuleTitle();
         $this->module_list= UserSynth::getAllModuleTitle();
     }
     }

+ 41 - 25
application/mall/controller/GoodsCate.php

@@ -47,7 +47,7 @@ class GoodsCate extends Controller
     public function index()
     public function index()
     {
     {
         $this->title = '分类管理';
         $this->title = '分类管理';
-        $query = $this->_query($this->table)->where('is_deleted',0)->order('id desc ,id asc')->page(false);
+        $query = $this->_query($this->table)->where('is_deleted',0)->where('pid',0)->order('id desc ,id asc')->page(false);
     }
     }
 
 
     /**
     /**
@@ -98,31 +98,9 @@ class GoodsCate extends Controller
      * @throws \think\db\exception\ModelNotFoundException
      * @throws \think\db\exception\ModelNotFoundException
      * @throws \think\exception\DbException
      * @throws \think\exception\DbException
      */
      */
-    protected function _form_filter(&$vo)
+    protected function _form_filter(&$data)
     {
     {
-        if ($this->request->isGet()) {
-            // 读取系统功能节点
-            $this->nodes = MenuService::instance()->getList();
-            // 选择自己的上级分类
-            if (empty($vo['pid']) && $this->request->get('pid', '0')) $vo['pid'] = $this->request->get('pid', '0');
-            // 列出可选上级分类
-            $menus = Db::name($this->table)->where(['status' => '1','is_deleted'=>0])->order('sort desc,id asc')->column('id,pid,title,logo');
-            $this->menus = Data::arr2table(array_merge($menus, [['id' => '0', 'pid' => '-1', 'title' => '顶部分类']]));
-            if (isset($vo['id'])) foreach ($this->menus as $key => $menu) if ($menu['id'] === $vo['id']) $vo = $menu;
-            foreach ($this->menus as $key => &$menu) {
-                if ($menu['spt'] >= 2) unset($this->menus[$key]);
-                if (isset($vo['spt']) && $vo['spt'] <= $menu['spt']) unset($this->menus[$key]);
-            }
-        }
-        if($this->request->isPost() && in_array($this->request->action(),['add','edit'])){
-            if(!isset($vo['id']) && $vo['pid']){
-                $plev = Db::name($this->table)->where('id',$vo['pid'])->value('lev');
-                $vo['lev'] = $plev + 1;
-            }else if(isset($vo['id'])){
-                $pid = Db::name($this->table)->where('id',$vo['id'])->value('pid');
-                $vo['lev'] =  Db::name($this->table)->where('id',$pid)->value('lev') + 1;
-            }
-        }
+        if($this->request->action() == 'edit') unset($data['pid']);
     }
     }
 
 
     /**
     /**
@@ -158,4 +136,42 @@ class GoodsCate extends Controller
         $this->_delete($this->table);
         $this->_delete($this->table);
     }
     }
 
 
+
+    /**
+     * 二级分类列表
+     * @auth true
+     * @menu true
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function second(){
+        $this->title ='二级分类';
+        $pid = input('pid');
+        $list = $this->_query('GoodsCate')
+            ->where(['is_deleted'=>0,'pid'=>$pid])
+            ->like('title')
+            ->order('id desc')->page();
+        $this->assign('list',$list);
+        $this->fetch('');
+    }
+
+    /**
+     * 三级分类列表
+     * @auth true
+     * @menu true
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function third(){
+        $this->title ='三级分类';
+        $pid = input('pid');
+        $list = $this->_query('GoodsCate')
+            ->where(['is_deleted'=>0,'pid'=>$pid])
+            ->like('title')
+            ->order('id desc')->page();
+        $this->assign('list',$list);
+        $this->fetch('');
+    }
+
+
 }
 }

+ 7 - 5
application/mall/view/banner/form.html

@@ -17,7 +17,7 @@
             </div>
             </div>
 
 
             <div class="layui-form-item">
             <div class="layui-form-item">
-                <label class="layui-form-label label-required">模块</label>
+                <label class="layui-form-label label-required">跳转模块</label>
                 <div class="layui-input-block">
                 <div class="layui-input-block">
                     <select class="layui-select" name="place" id ='place' lay-filter="place">
                     <select class="layui-select" name="place" id ='place' lay-filter="place">
                         {foreach $place_desc as $pk=>$pv}
                         {foreach $place_desc as $pk=>$pv}
@@ -32,8 +32,8 @@
             </div>
             </div>
 
 
 
 
-            <div class="layui-form-item">
-                <label class="layui-form-label label-required">链接详情</label>
+            <div class="layui-form-item jump_div">
+                <label class="layui-form-label ">跳转详情</label>
                 <div class="layui-input-inline">
                 <div class="layui-input-inline">
                     <select name="first_id" id="first_id" lay-filter ="first_id">
                     <select name="first_id" id="first_id" lay-filter ="first_id">
 
 
@@ -98,12 +98,13 @@
             $(".second_div").hide();
             $(".second_div").hide();
         }
         }
         var cl_html = '<option value="0">请选择</option>';
         var cl_html = '<option value="0">请选择</option>';
-        if(sel_module == '') {
+        if(sel_module == '' || sel_module == 'service') {
             $("select[name='first_id']").html(cl_html);
             $("select[name='first_id']").html(cl_html);
             $("select[name='second_id']").html(cl_html);
             $("select[name='second_id']").html(cl_html);
+            $(".jump_div").hide();
             window.form.render();
             window.form.render();
             return true;
             return true;
-        }else{
+        }else {
             $.each(module_list,function (ck,cv) {
             $.each(module_list,function (ck,cv) {
                 if(cv.module == sel_module) {
                 if(cv.module == sel_module) {
                     if(source == 1 && sel_first == cv.id) {
                     if(source == 1 && sel_first == cv.id) {
@@ -115,6 +116,7 @@
             })
             })
             $("select[name='first_id']").html(cl_html);
             $("select[name='first_id']").html(cl_html);
             $("select[name='second_id']").html('');
             $("select[name='second_id']").html('');
+            $(".jump_div").show();
         }
         }
         second(source);
         second(source);
         window.form.render();
         window.form.render();

+ 9 - 34
application/mall/view/goods_cate/form.html

@@ -1,40 +1,27 @@
 <form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
 <form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
     <div class="layui-card-body">
     <div class="layui-card-body">
-        <div class="layui-form-item">
-            <label class="layui-form-label">上级分类</label>
-            <div class="layui-input-block">
-                <select name='pid' class='layui-select' lay-search {if isset($vo.id)}disabled{/if}>
-                    <!--{foreach $menus as $menu}-->
-                    <!--{eq name='menu.id' value='$vo.pid|default=0'}-->
-                    <option selected value='{$menu.id}'>{$menu.spl|raw}{$menu.title}</option>
-                    <!--{else}-->
-                    <option value='{$menu.id}'>{$menu.spl|raw}{$menu.title}</option>
-                    <!--{/eq}-->
-                    <!--{/foreach}-->
-                </select>
-                <p class="help-block">必选,请选择上级分类或顶级分类(目前最多支持四级分类)</p>
-            </div>
-        </div>
 
 
         <div class="layui-form-item">
         <div class="layui-form-item">
-            <label class="layui-form-label">分类Logo</label>
+            <label class="layui-form-label">分类名称</label>
             <div class="layui-input-block">
             <div class="layui-input-block">
-                <input name="logo" type="hidden" value="{$vo.logo|default=''}">
+                <input name="title" value='{$vo.title|default=""}' required placeholder="请输入分类名称" class="layui-input">
+                <p class="help-block">必填,请填写分类名称,建议字符不要太长,一般4-6个汉字</p>
             </div>
             </div>
         </div>
         </div>
 
 
+        {if $Think.get.lev == 3 || (isset($vo.lev) && $vo.lev == 3) }
         <div class="layui-form-item">
         <div class="layui-form-item">
-            <label class="layui-form-label">分类名称</label>
+            <label class="layui-form-label ">LOGO</label>
             <div class="layui-input-block">
             <div class="layui-input-block">
-                <input name="title" value='{$vo.title|default=""}' required placeholder="请输入分类名称" class="layui-input">
-                <p class="help-block">必填,请填写分类名称,建议字符不要太长,一般4-6个汉字</p>
+                <input name="logo" type="hidden" value="{$vo.logo|default=''}">
             </div>
             </div>
         </div>
         </div>
-
+        {/if}
     </div>
     </div>
 
 
-    <div class="hr-line-dashed"></div>
     {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
     {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
+    <input type='hidden' value='{$Think.get.pid|default="0"}' name='pid'>
+    <input type='hidden' value='{$Think.get.lev|default="1"}' name='lev'>
 
 
     <div class="layui-form-item text-center" style="margin-top: 100px">
     <div class="layui-form-item text-center" style="margin-top: 100px">
         <button class="layui-btn" type='submit'>保存数据</button>
         <button class="layui-btn" type='submit'>保存数据</button>
@@ -47,17 +34,5 @@
 <script>
 <script>
     window.form.render();
     window.form.render();
     $('[name="logo"]').uploadOneImage();
     $('[name="logo"]').uploadOneImage();
-    require(['jquery.autocompleter'], function () {
-        form.render();
-        $('[name="icon"]').on('change', function () {
-            $(this).parent().next().find('i').get(0).className = this.value
-        });
-        $('input[name=url]').autocompleter({
-            limit: 6, highlightMatches: true, template: '{{ label }} <span> {{ title }} </span>', source: (function (subjects, data) {
-                for (var i in subjects) data.push({value: subjects[i].node, label: subjects[i].node, title: subjects[i].title});
-                return data;
-            })(JSON.parse('{$nodes|raw|json_encode}'), [])
-        });
-    });
 </script>
 </script>
 {/block}
 {/block}

+ 65 - 51
application/mall/view/goods_cate/index.html

@@ -1,73 +1,87 @@
 {extend name='admin@main'}
 {extend name='admin@main'}
-{block name="button"}
 
 
-{if auth("add")}
-<button data-modal='{:url("add")}' data-title="添加分类" class='layui-btn layui-btn-sm layui-btn-primary'>添加分类</button>
-{/if}
+{block name="button"}
+<button data-action='{:url("remove")}'  data-confirm="确定要删除吗?" data-csrf="{:systoken('remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
 
 
-{if auth("remove")}
-<button data-action='{:url("remove")}' data-csrf="{:systoken('remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除分类</button>
-{/if}
+<button data-modal='{:url("add")}&lev=1' data-title="添加分类" class='layui-btn layui-btn-sm layui-btn-primary'>添加分类</button>
 
 
 {/block}
 {/block}
 
 
 {block name="content"}
 {block name="content"}
 <div class="think-box-shadow">
 <div class="think-box-shadow">
-    {empty name='list'}
-    <blockquote class="layui-elem-quote">没 有 记 录 哦!</blockquote>
-    {else}
-    <table class="layui-table" lay-skin="line">
+    <fieldset>
+        <legend>条件搜索</legend>
+        <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
+            <div class="layui-form-item layui-inline">
+                <label class="layui-form-label">名称</label>
+                <div class="layui-input-inline">
+                    <input name="title" value="{$Think.get.title|default=''}" placeholder="请输入分类名称" class="layui-input">
+                </div>
+            </div>
+            <div class="layui-form-item layui-inline">
+                <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
+            </div>
+        </form>
+        <script>form.render()</script>
+    </fieldset>
+    <table class="layui-table margin-top-20" lay-skin="line">
         <thead>
         <thead>
         <tr>
         <tr>
-            <th class='list-table-check-td think-checkbox'>
-                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
-            </th>
-            <th class='list-table-sort-td'>
-                <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
-            </th>
-            <th style="width:360px"></th>
-            <th style="width:260px"></th>
-            <th class='layui-hide-xs' style="width:180px"></th>
-            <th colspan="2"></th>
+            <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
+            <th class='list-table-sort-td'><button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button></th>
+            <th class='text-left nowrap'>ID</th>
+            <th class='text-left nowrap'>名称</th>
+            <th class='text-left nowrap'>状态</th>
+            <th class="text-left" style="width: 20%">操作</th>
         </tr>
         </tr>
         </thead>
         </thead>
         <tbody>
         <tbody>
         {foreach $list as $key=>$vo}
         {foreach $list as $key=>$vo}
-        <tr data-dbclick>
-            <td class='list-table-check-td think-checkbox'>
-                <input class="list-check-box" value='{$vo.ids}' type='checkbox'>
-            </td>
-            <td class='list-table-sort-td'>
-                <input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
-            </td>
-            <td class="nowrap"><span class="color-desc">{$vo.spl|raw}</span>{$vo.title}</td>
-            <td class="nowrap"><img data-tips-image="{$vo.logo|default=''}"  src="{$vo.logo|default=''}" width="35px"></td>
-            <td class='text-center nowrap'>{eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{else}<span class="color-green">使用中</span>{/eq}</td>
-            <td class='text-center nowrap notselect'>
-                {if auth("add")}
-                <span class="text-explode">|</span>
-                <!--{if $vo.spt < 1}-->
-                <a class="layui-btn layui-btn-xs layui-btn-primary" data-title="添加子分类" data-modal='{:url("add")}?pid={$vo.id}'>添 加</a>
-                <!--{else}-->
-                <a class="layui-btn layui-btn-xs layui-btn-disabled">添 加</a>
-                <!--{/if}-->
-                {/if}
-                {if auth("edit")}
-                <a data-dbclick class="layui-btn layui-btn-xs" data-title="编辑分类" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
-                {/if}
-                {if $vo.status eq 1 and auth("forbid")}
-                <a class="layui-btn layui-btn-warm layui-btn-xs" data-confirm="确定要禁用分类吗?" data-action="{:url('forbid')}" data-value="id#{$vo.ids};status#0" data-csrf="{:systoken('forbid')}">禁 用</a>
-                {elseif auth("resume")}
-                <a class="layui-btn layui-btn-warm layui-btn-xs" data-action="{:url('resume')}" data-value="id#{$vo.ids};status#1" data-csrf="{:systoken('resume')}">启 用</a>
-                {/if}
-                {if auth("remove")}
-                <a class="layui-btn layui-btn-danger layui-btn-xs" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.ids}" data-csrf="{:systoken('remove')}">删 除</a>
+        <tr>
+            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
+            <td class='list-table-sort-td'><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></td>
+            <td class='text-left nowrap'>{$vo.id|default=''}</td>
+            <td class='text-left nowrap'>{$vo.title|default=''}</td>
+            <td class='text-left nowrap'>{$vo.status == 1 ?'已启用' :'已禁用'}</td>
+            <td class='text-left' style="width: 20%">
+                <a data-title="编辑分类" class="layui-btn layui-btn-xs" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
+                {if $vo.pid == 0}  <a data-title="查看" class="layui-btn layui-btn-xs" data-open='{:url("second")}?pid={$vo.id}'>二级分类</a>{/if}
+                {if $vo.status == 1}
+                <span class="layui-btn layui-btn-xs  layui-btn-warm"  onclick="btn_confirm('禁用','forbid','{$vo.id}');" >禁 用</span>
+                {else}
+                <span class="layui-btn layui-btn-xs layui-btn-xs"  onclick="btn_confirm('启用','resume','{$vo.id}');">启 用</span>
                 {/if}
                 {/if}
+                <span class="layui-btn layui-btn-xs layui-btn-danger" onclick="btn_confirm('删除','remove','{$vo.id}');">删 除</span>
             </td>
             </td>
         </tr>
         </tr>
         {/foreach}
         {/foreach}
         </tbody>
         </tbody>
     </table>
     </table>
-    {/empty}
+    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
 </div>
 </div>
+<script>
+    function btn_confirm(msg,fun,id) {
+        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
+            var url = "/mall/goods_cate/"+fun;
+            layer.closeAll();
+            $.ajax({
+                type: "post",
+                url: url,
+                data: {id:id},
+                dataType: "json",
+                async: false,
+                success: function (data) {
+                    layer.msg(data.info);
+                    setTimeout(function () {
+                        window.location.reload();
+                    },1000)
+                }
+            });
+        });
+    }
+
+</script>
 {/block}
 {/block}
+
+
+

+ 88 - 0
application/mall/view/goods_cate/second.html

@@ -0,0 +1,88 @@
+{extend name='admin@main'}
+
+{block name="button"}
+<button data-action='{:url("remove")}'  data-confirm="确定要删除吗?" data-csrf="{:systoken('remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
+
+<a href="javascript:history.go(-1);"  data-title="返 回" class='layui-btn layui-btn-sm layui-btn-primary'>返 回</a>
+
+<button data-modal='{:url("add")}?pid={$Think.get.pid|default="0"}&lev=2' data-title="添加分类" class='layui-btn layui-btn-sm layui-btn-primary'>添加分类</button>
+{/block}
+
+{block name="content"}
+<div class="think-box-shadow">
+    <fieldset>
+        <legend>条件搜索</legend>
+        <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
+            <div class="layui-form-item layui-inline">
+                <label class="layui-form-label">名称</label>
+                <div class="layui-input-inline">
+                    <input name="title" value="{$Think.get.title|default=''}" placeholder="请输入分类名称" class="layui-input">
+                </div>
+            </div>
+            <div class="layui-form-item layui-inline">
+                <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
+            </div>
+        </form>
+        <script>form.render()</script>
+    </fieldset>
+    <table class="layui-table margin-top-20" lay-skin="line">
+        <thead>
+        <tr>
+            <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
+            <th class='list-table-sort-td'><button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button></th>
+            <th class='text-left nowrap'>ID</th>
+            <th class='text-left nowrap'>名称</th>
+            <th class='text-left nowrap'>状态</th>
+            <th class="text-left" style="width: 20%">操作</th>
+        </tr>
+        </thead>
+        <tbody>
+        {foreach $list as $key=>$vo}
+        <tr>
+            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
+            <td class='list-table-sort-td'><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></td>
+            <td class='text-left nowrap'>{$vo.id|default=''}</td>
+            <td class='text-left nowrap'>{$vo.title|default=''}</td>
+            <td class='text-left nowrap'>{$vo.status == 1 ?'已启用' :'已禁用'}</td>
+            <td class='text-left' style="width: 20%">
+                <a data-title="编辑分类" class="layui-btn layui-btn-xs" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
+                {if $vo.lev == 2}  <a data-title="查看" class="layui-btn layui-btn-xs" data-open='{:url("third")}?pid={$vo.id}'>三级分类</a>{/if}
+                {if $vo.status == 1}
+                <span class="layui-btn layui-btn-xs  layui-btn-warm"  onclick="btn_confirm('禁用','forbid','{$vo.id}');" >禁 用</span>
+                {else}
+                <span class="layui-btn layui-btn-xs layui-btn-xs"  onclick="btn_confirm('启用','resume','{$vo.id}');">启 用</span>
+                {/if}
+                <span class="layui-btn layui-btn-xs layui-btn-danger" onclick="btn_confirm('删除','remove','{$vo.id}');">删 除</span>
+            </td>
+        </tr>
+        {/foreach}
+        </tbody>
+    </table>
+    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
+</div>
+<script>
+    function btn_confirm(msg,fun,id) {
+        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
+            var url = "/operate/recruit_cate/"+fun;
+            layer.closeAll();
+            $.ajax({
+                type: "post",
+                url: url,
+                data: {id:id},
+                dataType: "json",
+                async: false,
+                success: function (data) {
+                    layer.msg(data.info);
+                    setTimeout(function () {
+                        window.location.reload();
+                    },1000)
+                }
+            });
+        });
+    }
+
+</script>
+{/block}
+
+
+

+ 87 - 0
application/mall/view/goods_cate/third.html

@@ -0,0 +1,87 @@
+{extend name='admin@main'}
+
+{block name="button"}
+<button data-action='{:url("remove")}'  data-confirm="确定要删除吗?" data-csrf="{:systoken('remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
+
+<a href="javascript:history.go(-1);"  data-title="返 回" class='layui-btn layui-btn-sm layui-btn-primary'>返 回</a>
+
+<button data-modal='{:url("add")}?pid={$Think.get.pid|default="0"}&lev=3' data-title="添加分类" class='layui-btn layui-btn-sm layui-btn-primary'>添加分类</button>
+{/block}
+
+{block name="content"}
+<div class="think-box-shadow">
+    <fieldset>
+        <legend>条件搜索</legend>
+        <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
+            <div class="layui-form-item layui-inline">
+                <label class="layui-form-label">名称</label>
+                <div class="layui-input-inline">
+                    <input name="title" value="{$Think.get.title|default=''}" placeholder="请输入分类名称" class="layui-input">
+                </div>
+            </div>
+            <div class="layui-form-item layui-inline">
+                <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
+            </div>
+        </form>
+        <script>form.render()</script>
+    </fieldset>
+    <table class="layui-table margin-top-20" lay-skin="line">
+        <thead>
+        <tr>
+            <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
+            <th class='list-table-sort-td'><button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button></th>
+            <th class='text-left nowrap'>ID</th>
+            <th class='text-left nowrap'>名称</th>
+            <th class='text-left nowrap'>状态</th>
+            <th class="text-left" style="width: 20%">操作</th>
+        </tr>
+        </thead>
+        <tbody>
+        {foreach $list as $key=>$vo}
+        <tr>
+            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
+            <td class='list-table-sort-td'><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></td>
+            <td class='text-left nowrap'>{$vo.id|default=''}</td>
+            <td class='text-left nowrap'>{$vo.title|default=''}</td>
+            <td class='text-left nowrap'>{$vo.status == 1 ?'已启用' :'已禁用'}</td>
+            <td class='text-left' style="width: 20%">
+                <a data-title="编辑分类" class="layui-btn layui-btn-xs" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
+                {if $vo.status == 1}
+                <span class="layui-btn layui-btn-xs  layui-btn-warm"  onclick="btn_confirm('禁用','forbid','{$vo.id}');" >禁 用</span>
+                {else}
+                <span class="layui-btn layui-btn-xs layui-btn-xs"  onclick="btn_confirm('启用','resume','{$vo.id}');">启 用</span>
+                {/if}
+                <span class="layui-btn layui-btn-xs layui-btn-danger" onclick="btn_confirm('删除','remove','{$vo.id}');">删 除</span>
+            </td>
+        </tr>
+        {/foreach}
+        </tbody>
+    </table>
+    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
+</div>
+<script>
+    function btn_confirm(msg,fun,id) {
+        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
+            var url = "/operate/recruit_cate/"+fun;
+            layer.closeAll();
+            $.ajax({
+                type: "post",
+                url: url,
+                data: {id:id},
+                dataType: "json",
+                async: false,
+                success: function (data) {
+                    layer.msg(data.info);
+                    setTimeout(function () {
+                        window.location.reload();
+                    },1000)
+                }
+            });
+        });
+    }
+
+</script>
+{/block}
+
+
+

+ 55 - 5
application/mall/view/store_goods/form.html

@@ -46,6 +46,14 @@
                                 <input name="phone"  class="layui-input" placeholder="请输入会员账号" value="{$vo.phone|default=''}">
                                 <input name="phone"  class="layui-input" placeholder="请输入会员账号" value="{$vo.phone|default=''}">
                             </label>
                             </label>
                         </div>
                         </div>
+
+                        <div class="layui-form-item layui-row layui-col-space15">
+                            <label class="layui-col-xs9 relative">
+                                <span class="color-green">标签</span>
+                                <textarea placeholder="请输入标签" maxlength="100" class="layui-textarea" name="label">{$vo.label|default=''}</textarea>
+                                <span >多个用逗号隔开(半角)</span>
+                            </label>
+                        </div>
                        <!-- 商品分类-->
                        <!-- 商品分类-->
                         <div class="layui-form-item layui-row layui-col-space15">
                         <div class="layui-form-item layui-row layui-col-space15">
                             <label class="layui-col-xs9 relative" style="width: 100%;">
                             <label class="layui-col-xs9 relative" style="width: 100%;">
@@ -71,8 +79,14 @@
 
 
                                     </select>
                                     </select>
                                 </div>
                                 </div>
+                                <div style="width: 15%;float: left">
+                                    <select class="layui-select"  id="third_classify" name="third_classify" lay-filter="third_classify" lay-search>
+
+                                    </select>
+                                </div>
                                 <input type="hidden" id="first"  value="{$vo.first_classify|default='-1'}"/>
                                 <input type="hidden" id="first"  value="{$vo.first_classify|default='-1'}"/>
                                 <input type="hidden" id="second" value="{$vo.second_classify|default='-1'}"/>
                                 <input type="hidden" id="second" value="{$vo.second_classify|default='-1'}"/>
+                                <input type="hidden" id="third"  value="{$vo.third_classify|default='-1'}"/>
                             </div>
                             </div>
                         </div>
                         </div>
 
 
@@ -82,7 +96,7 @@
                                 <thead>
                                 <thead>
                                 <tr>
                                 <tr>
                                     <th class="text-center">LOGO</th>
                                     <th class="text-center">LOGO</th>
-                                    <th class="text-left">展示图片</th>
+                                    <th class="text-left">轮播图</th>
                                 </tr>
                                 </tr>
                                 <tr>
                                 <tr>
                                     <td width="90px" class="text-center"><input name="cover" type="hidden" value="{$vo.cover|default=''}"></td>
                                     <td width="90px" class="text-center"><input name="cover" type="hidden" value="{$vo.cover|default=''}"></td>
@@ -98,10 +112,6 @@
                             <table class="layui-table">
                             <table class="layui-table">
                                 <thead>
                                 <thead>
                                 <tr>
                                 <tr>
-
-                                    <th class="text-left">展示图片</th>
-                                </tr>
-                                <tr>
                                     <td width="auto" class="text-left"><input name="content" type="hidden" value="{$vo.content|default=''}"></td>
                                     <td width="auto" class="text-left"><input name="content" type="hidden" value="{$vo.content|default=''}"></td>
                                 </tr>
                                 </tr>
                                 </thead>
                                 </thead>
@@ -490,9 +500,11 @@
         var first_key = $("select[name='first_classify']").find("option:selected").data("first_key")
         var first_key = $("select[name='first_classify']").find("option:selected").data("first_key")
         $("#first").val(first_key);
         $("#first").val(first_key);
         $("select[name='second_classify']").html('');
         $("select[name='second_classify']").html('');
+        $("select[name='third_classify']").html('');
         // 没有下级不继续
         // 没有下级不继续
         if(first_key == -1 || !("children" in goods_spec[first_key])){
         if(first_key == -1 || !("children" in goods_spec[first_key])){
             $("#second").val(-1);
             $("#second").val(-1);
+            $("#third").val(-1);
             window.form.render();
             window.form.render();
             return true;
             return true;
         }else{
         }else{
@@ -507,9 +519,36 @@
                 }
                 }
             })
             })
             $("select[name='second_classify']").html(second_html);
             $("select[name='second_classify']").html(second_html);
+            second(source)
             window.form.render();
             window.form.render();
         }
         }
     }
     }
+    function second(source){
+        var first_key  = $("select[name='first_classify']").find("option:selected").data("first_key");
+        var second_key  = $("select[name='second_classify']").find("option:selected").data("second_key");
+        // 将其他选择框置空
+        $("#second").val(second_key);
+        $("select[name='third_classify']").html('');
+        // 没有下级不继续
+        if(second_key == -1 ||  !("children" in  goods_spec[first_key]['children'][second_key])){
+            $("#third").val(-1);
+            window.form.render();
+            return true;
+        }
+        var to_each = goods_spec[first_key]['children'][second_key]['children'];
+        var third_html = '<option data-third_key="-1" selected value="0">请选择分类</option>';
+        $.each(to_each,function (ck,cv) {
+            if(source == 1 && sel_third == cv.id){
+                third_html +='<option selected data-third_key="'+ck+'" value="'+cv.id+'">'+cv.title+'</option>';
+                $("#third").val(ck);
+            }else{
+                third_html +='<option data-third_key="'+ck+'" value="'+cv.id+'">'+cv.title+'</option>';
+            }
+
+        })
+        $("select[name='third_classify']").html(third_html);
+        window.form.render();
+    }
     // 一级分类监听
     // 一级分类监听
     form.on('select(first_classify)', function(data){
     form.on('select(first_classify)', function(data){
         var first_key =  data.elem[data.elem.selectedIndex].dataset.first_key;
         var first_key =  data.elem[data.elem.selectedIndex].dataset.first_key;
@@ -519,6 +558,17 @@
         }
         }
         first(2);
         first(2);
     })
     })
+    // 二级分类监听
+    form.on('select(second_classify)', function(data){
+        var second_key  = data.elem[data.elem.selectedIndex].dataset.second_key;
+        //与之前选择的一样不处理
+        if($("#second").val() == second_key){
+            return true;
+        }
+        second(2)
+    })
+
+
     // 分类end
     // 分类end
     require(['ckeditor', 'angular'], function () {
     require(['ckeditor', 'angular'], function () {
         window.createEditor('[name="detail"]', {
         window.createEditor('[name="detail"]', {

+ 7 - 1
application/nutrition/controller/ArticleItem.php

@@ -39,7 +39,7 @@ class ArticleItem extends Controller
         $sel_where[] = ['is_deleted','=',0];
         $sel_where[] = ['is_deleted','=',0];
         $sel_where[] = ['article_id','=',$this->article_id];
         $sel_where[] = ['article_id','=',$this->article_id];
         $query = $this->_query($this->table);
         $query = $this->_query($this->table);
-        $query->where($sel_where)->order('sort desc,id asc')->page(false);
+        $query->where($sel_where)->order('sort desc,id desc')->page(false);
     }
     }
 
 
     /**
     /**
@@ -109,6 +109,7 @@ class ArticleItem extends Controller
         ArticleIntro::where('id',$article_id)->setDec('item_num');
         ArticleIntro::where('id',$article_id)->setDec('item_num');
         \app\common\model\ArticleItem::where('id',input('id'))->update(['is_deleted'=>1]);
         \app\common\model\ArticleItem::where('id',input('id'))->update(['is_deleted'=>1]);
         \app\common\model\ArticleItem::esAdd(input('id'));
         \app\common\model\ArticleItem::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'article');
         $this->success('已删除!');
         $this->success('已删除!');
     }
     }
 
 
@@ -130,6 +131,7 @@ class ArticleItem extends Controller
             ArticleIntro::where('id',$article_id)->setDec('item_num');
             ArticleIntro::where('id',$article_id)->setDec('item_num');
             \app\common\model\ArticleItem::where('id',$id)->update(['is_deleted'=>1]);
             \app\common\model\ArticleItem::where('id',$id)->update(['is_deleted'=>1]);
             \app\common\model\ArticleItem::esAdd($id);
             \app\common\model\ArticleItem::esAdd($id);
+            \app\common\model\TopSearch::saveData($id,'article');
         }
         }
         $this->success('已删除!');
         $this->success('已删除!');
     }
     }
@@ -161,6 +163,7 @@ class ArticleItem extends Controller
             if(empty($data['images'])) $this->error('请上传图片');
             if(empty($data['images'])) $this->error('请上传图片');
             $data['cover'] =  explode('|',$data['images'])[0];
             $data['cover'] =  explode('|',$data['images'])[0];
             if(!$data['release_time']) $data['release_time'] = date("Y-m-d H:i:s");
             if(!$data['release_time']) $data['release_time'] = date("Y-m-d H:i:s");
+            if($data['hot_num'] != $data['hot_num_old']) $data['hot_time'] = date("Y-m-d H:i:s");
             if(!empty($data['phone'])) {
             if(!empty($data['phone'])) {
                 $user_id = User::where('phone|email',$data['phone'])->value('id');
                 $user_id = User::where('phone|email',$data['phone'])->value('id');
                 if(!$user_id) $this->error('账号未注册');
                 if(!$user_id) $this->error('账号未注册');
@@ -189,6 +192,7 @@ class ArticleItem extends Controller
         $up['read_num'] = array_sum(array_column($article_num,'read_num'));
         $up['read_num'] = array_sum(array_column($article_num,'read_num'));
         ArticleIntro::where('id',$this->request->post('article_id'))->update($up);
         ArticleIntro::where('id',$this->request->post('article_id'))->update($up);
         \app\common\model\ArticleItem::esAdd($result);
         \app\common\model\ArticleItem::esAdd($result);
+        \app\common\model\TopSearch::saveData($result,'article');
         if($this->request->action() == 'add') PlatformSwitch::followMsg(3,$this->request->post('article_id'),$article_info['title'],$this->request->post('title'),$result);
         if($this->request->action() == 'add') PlatformSwitch::followMsg(3,$this->request->post('article_id'),$article_info['title'],$this->request->post('title'),$result);
         $this->success('操作成功', 'javascript:history.back()');
         $this->success('操作成功', 'javascript:history.back()');
     }
     }
@@ -207,6 +211,7 @@ class ArticleItem extends Controller
     {
     {
         \app\common\model\ArticleItem::where('id',input('id'))->update(['status'=>0]);
         \app\common\model\ArticleItem::where('id',input('id'))->update(['status'=>0]);
         \app\common\model\ArticleItem::esAdd(input('id'));
         \app\common\model\ArticleItem::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'article');
         $this->success('已禁用!');
         $this->success('已禁用!');
     }
     }
 
 
@@ -224,6 +229,7 @@ class ArticleItem extends Controller
     {
     {
         \app\common\model\ArticleItem::where('id',input('id'))->update(['status'=>1]);
         \app\common\model\ArticleItem::where('id',input('id'))->update(['status'=>1]);
         \app\common\model\ArticleItem::esAdd(input('id'));
         \app\common\model\ArticleItem::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'article');
         $this->success('已启用!');
         $this->success('已启用!');
     }
     }
 
 

+ 7 - 1
application/nutrition/controller/DatumUrl.php

@@ -39,7 +39,7 @@ class DatumUrl extends Controller
         $sel_where[] = ['is_deleted','=',0];
         $sel_where[] = ['is_deleted','=',0];
         $sel_where[] = ['datum_id','=',$this->datum_id];
         $sel_where[] = ['datum_id','=',$this->datum_id];
         $query = $this->_query($this->table);
         $query = $this->_query($this->table);
-        $query->where($sel_where)->order('sort desc,id asc')->page(false);
+        $query->where($sel_where)->order('sort desc,id desc')->page(false);
     }
     }
 
 
     /**
     /**
@@ -109,6 +109,7 @@ class DatumUrl extends Controller
         DatumIntro::where('id',$datum_id)->setDec('url_num');
         DatumIntro::where('id',$datum_id)->setDec('url_num');
         \app\common\model\DatumUrl::where('id',input('id'))->update(['is_deleted'=>1]);
         \app\common\model\DatumUrl::where('id',input('id'))->update(['is_deleted'=>1]);
         \app\common\model\DatumUrl::esAdd(input('id'));
         \app\common\model\DatumUrl::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'datum');
         $this->success('删除成功!');
         $this->success('删除成功!');
     }
     }
 
 
@@ -130,6 +131,7 @@ class DatumUrl extends Controller
             DatumIntro::where('id',$datum_id)->setDec('url_num');
             DatumIntro::where('id',$datum_id)->setDec('url_num');
             \app\common\model\DatumUrl::where('id',$id)->update(['is_deleted'=>1]);
             \app\common\model\DatumUrl::where('id',$id)->update(['is_deleted'=>1]);
             \app\common\model\DatumUrl::esAdd($id);
             \app\common\model\DatumUrl::esAdd($id);
+            \app\common\model\TopSearch::saveData($id,'datum');
         }
         }
         $this->success('删除成功!');
         $this->success('删除成功!');
     }
     }
@@ -159,6 +161,7 @@ class DatumUrl extends Controller
             if(!$post['is_encrypt'] && !strstr($post['url'],'https')) $this->error('请重新上传文件');
             if(!$post['is_encrypt'] && !strstr($post['url'],'https')) $this->error('请重新上传文件');
             if($post['is_encrypt'] && strstr($post['url'],'https')) $this->error('请重新上传文件');
             if($post['is_encrypt'] && strstr($post['url'],'https')) $this->error('请重新上传文件');
             if(!$data['release_time']) $data['release_time'] = date("Y-m-d H:i:s");
             if(!$data['release_time']) $data['release_time'] = date("Y-m-d H:i:s");
+            if($data['hot_num'] != $data['hot_num_old']) $data['hot_time'] = date("Y-m-d H:i:s");
             if(!empty($post['phone'])) {
             if(!empty($post['phone'])) {
                 $user_id = User::where('phone|email',$post['phone'])->value('id');
                 $user_id = User::where('phone|email',$post['phone'])->value('id');
                 if(!$user_id) $this->error('账号未注册');
                 if(!$user_id) $this->error('账号未注册');
@@ -176,6 +179,7 @@ class DatumUrl extends Controller
         $url_num = \app\common\model\DatumUrl::where(['datum_id'=>$this->request->post('datum_id'),'is_deleted'=>0])->count();
         $url_num = \app\common\model\DatumUrl::where(['datum_id'=>$this->request->post('datum_id'),'is_deleted'=>0])->count();
         DatumIntro::where('id',$this->request->post('datum_id'))->update(['url_num'=>$url_num]);
         DatumIntro::where('id',$this->request->post('datum_id'))->update(['url_num'=>$url_num]);
         \app\common\model\DatumUrl::esAdd($result);
         \app\common\model\DatumUrl::esAdd($result);
+        \app\common\model\TopSearch::saveData($result,'datum');
         if($this->request->action() == 'add'){
         if($this->request->action() == 'add'){
             $datum_info = DatumIntro::where('id',$this->request->post('datum_id'))->find()->toArray();
             $datum_info = DatumIntro::where('id',$this->request->post('datum_id'))->find()->toArray();
             PlatformSwitch::followMsg(4,$this->request->post('datum_id'),$datum_info['title'],$this->request->post('title'),$result);
             PlatformSwitch::followMsg(4,$this->request->post('datum_id'),$datum_info['title'],$this->request->post('title'),$result);
@@ -198,6 +202,7 @@ class DatumUrl extends Controller
     {
     {
         \app\common\model\DatumUrl::where('id',input('id'))->update(['status'=>0]);
         \app\common\model\DatumUrl::where('id',input('id'))->update(['status'=>0]);
         \app\common\model\DatumUrl::esAdd(input('id'));
         \app\common\model\DatumUrl::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'datum');
         $this->success('已禁用!');
         $this->success('已禁用!');
     }
     }
 
 
@@ -216,6 +221,7 @@ class DatumUrl extends Controller
     {
     {
         \app\common\model\DatumUrl::where('id',input('id'))->update(['status'=>1]);
         \app\common\model\DatumUrl::where('id',input('id'))->update(['status'=>1]);
         \app\common\model\DatumUrl::esAdd(input('id'));
         \app\common\model\DatumUrl::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'datum');
         $this->success('已启用!');
         $this->success('已启用!');
     }
     }
 
 

+ 1 - 1
application/nutrition/controller/SeriesArticle.php

@@ -48,7 +48,7 @@ class SeriesArticle extends Controller
         $query->where($sel_where)
         $query->where($sel_where)
             ->when($in_ids,function ($query)use ($in_ids){
             ->when($in_ids,function ($query)use ($in_ids){
                 if(!empty($in_ids)) $query->where('id','in',$in_ids);
                 if(!empty($in_ids)) $query->where('id','in',$in_ids);
-            })->order('sort desc,id asc')->page();
+            })->order('sort desc,id desc')->page();
 
 
     }
     }
 
 

+ 1 - 1
application/nutrition/controller/SeriesDatum.php

@@ -45,7 +45,7 @@ class SeriesDatum extends Controller
         if($id = $this->request->get('id')) $sel_where[] = ['id','=',$id];
         if($id = $this->request->get('id')) $sel_where[] = ['id','=',$id];
         if($title = $this->request->get('title')) $sel_where[] = ['title','like','%'.$title.'%'];
         if($title = $this->request->get('title')) $sel_where[] = ['title','like','%'.$title.'%'];
         $query = $this->_query($this->table);
         $query = $this->_query($this->table);
-        $query->where($sel_where)->order('sort desc,id asc')->page();
+        $query->where($sel_where)->order('sort desc,id desc')->page();
     }
     }
 
 
     /**
     /**

+ 2 - 0
application/nutrition/controller/UserArticle.php

@@ -192,6 +192,7 @@ class UserArticle extends Controller
                 'title'=>$user_article['title'],
                 'title'=>$user_article['title'],
                 'user_id' => $user_article['user_id'],
                 'user_id' => $user_article['user_id'],
                 'phone' => $user_phone,
                 'phone' => $user_phone,
+                'release_time' => date("Y-m-d H:i:s"),
             ]);
             ]);
             ArticleIntro::where('id',$series_id)->setInc('item_num');
             ArticleIntro::where('id',$series_id)->setInc('item_num');
             $this->success('添加成功!');
             $this->success('添加成功!');
@@ -236,6 +237,7 @@ class UserArticle extends Controller
                 'rel_id' => $user_article_id,
                 'rel_id' => $user_article_id,
                 'user_id' => $user_article['user_id'],
                 'user_id' => $user_article['user_id'],
                 'phone' => $user_phone,
                 'phone' => $user_phone,
+                'release_time' => date("Y-m-d H:i:s"),
             ];
             ];
             Data::save('ArticleItem',$article_item,'article_id',['article_id' => $result->id]);
             Data::save('ArticleItem',$article_item,'article_id',['article_id' => $result->id]);
             $this->success('创建成功');
             $this->success('创建成功');

+ 7 - 1
application/nutrition/controller/VideoUrl.php

@@ -41,7 +41,7 @@ class VideoUrl extends Controller
         $sel_where[] = ['is_deleted','=',0];
         $sel_where[] = ['is_deleted','=',0];
         $sel_where[] = ['video_id','=',$this->video_id];
         $sel_where[] = ['video_id','=',$this->video_id];
         $query = $this->_query($this->table);
         $query = $this->_query($this->table);
-        $query->where($sel_where)->order('sort desc,id asc')->page(false);
+        $query->where($sel_where)->order('sort desc,id desc')->page(false);
     }
     }
 
 
     /**
     /**
@@ -111,6 +111,7 @@ class VideoUrl extends Controller
         VideoIntro::where('id',$video_id)->setDec('url_num');
         VideoIntro::where('id',$video_id)->setDec('url_num');
         \app\common\model\VideoUrl::where('id',input('id'))->update(['is_deleted'=>1]);
         \app\common\model\VideoUrl::where('id',input('id'))->update(['is_deleted'=>1]);
         \app\common\model\VideoUrl::esAdd(input('id'));
         \app\common\model\VideoUrl::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'video');
         $this->success('删除成功!');
         $this->success('删除成功!');
     }
     }
 
 
@@ -132,6 +133,7 @@ class VideoUrl extends Controller
             VideoIntro::where('id',$video_id)->setDec('url_num');
             VideoIntro::where('id',$video_id)->setDec('url_num');
             \app\common\model\VideoUrl::where('id',input('id'))->update(['is_deleted'=>1]);
             \app\common\model\VideoUrl::where('id',input('id'))->update(['is_deleted'=>1]);
             \app\common\model\VideoUrl::esAdd($id);
             \app\common\model\VideoUrl::esAdd($id);
+            \app\common\model\TopSearch::saveData($id,'video');
         }
         }
         $this->success('删除成功!');
         $this->success('删除成功!');
     }
     }
@@ -168,6 +170,7 @@ class VideoUrl extends Controller
             $data['duration_str'] = $vid_info['duration_str'];
             $data['duration_str'] = $vid_info['duration_str'];
             if(!$data['ppt']) $data['pdf_clear'] = '';
             if(!$data['ppt']) $data['pdf_clear'] = '';
             if(!$data['release_time']) $data['release_time'] = date("Y-m-d H:i:s");
             if(!$data['release_time']) $data['release_time'] = date("Y-m-d H:i:s");
+            if($data['hot_num'] != $data['hot_num_old']) $data['hot_time'] = date("Y-m-d H:i:s");
             if(!empty($post['phone'])) {
             if(!empty($post['phone'])) {
                 $user_id = User::where('phone|email',$post['phone'])->value('id');
                 $user_id = User::where('phone|email',$post['phone'])->value('id');
                 if(!$user_id) $this->error('账号未注册');
                 if(!$user_id) $this->error('账号未注册');
@@ -196,6 +199,7 @@ class VideoUrl extends Controller
         if(!$video_info['datum_item'])  $up['datum_item'] = $this->request->post('datum_item');
         if(!$video_info['datum_item'])  $up['datum_item'] = $this->request->post('datum_item');
         VideoIntro::where('id',$this->request->post('video_id'))->update($up);
         VideoIntro::where('id',$this->request->post('video_id'))->update($up);
         \app\common\model\VideoUrl::esAdd($result);
         \app\common\model\VideoUrl::esAdd($result);
+        \app\common\model\TopSearch::saveData($result,'video');
         if($this->request->action() == 'add') PlatformSwitch::followMsg(2,$this->request->post('video_id'),$video_info['title'],$this->request->post('title'),$result);
         if($this->request->action() == 'add') PlatformSwitch::followMsg(2,$this->request->post('video_id'),$video_info['title'],$this->request->post('title'),$result);
         $this->success('操作成功', 'javascript:history.back()');
         $this->success('操作成功', 'javascript:history.back()');
     }
     }
@@ -214,6 +218,7 @@ class VideoUrl extends Controller
     {
     {
         \app\common\model\VideoUrl::where('id',input('id'))->update(['status'=>0]);
         \app\common\model\VideoUrl::where('id',input('id'))->update(['status'=>0]);
         \app\common\model\VideoUrl::esAdd(input('id'));
         \app\common\model\VideoUrl::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'video');
         $this->success('已禁用!');
         $this->success('已禁用!');
     }
     }
 
 
@@ -232,6 +237,7 @@ class VideoUrl extends Controller
     {
     {
         \app\common\model\VideoUrl::where('id',input('id'))->update(['status'=>1]);
         \app\common\model\VideoUrl::where('id',input('id'))->update(['status'=>1]);
         \app\common\model\VideoUrl::esAdd(input('id'));
         \app\common\model\VideoUrl::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'video');
         $this->success('已启用!');
         $this->success('已启用!');
     }
     }
 
 

+ 8 - 0
application/nutrition/view/article_item/form.html

@@ -172,6 +172,14 @@
             </div>
             </div>
 
 
             <div class="layui-form-item">
             <div class="layui-form-item">
+                <label class="layui-form-label ">热搜阅读量</label>
+                <div class="layui-input-block">
+                    <input name="hot_num"   value='{$vo.hot_num|default=""}' placeholder="请输入热搜阅读量" class="layui-input">
+                    <input name="hot_num_old"  type="hidden" value='{$vo.hot_num|default=""}'  class="layui-input">
+                </div>
+            </div>
+
+            <div class="layui-form-item">
                 <label class="layui-form-label ">排序</label>
                 <label class="layui-form-label ">排序</label>
                 <div class="layui-input-block">
                 <div class="layui-input-block">
                     <input type="number" name="sort"  value='{$vo.sort|default=""}' placeholder="请输入排序号" class="layui-input">
                     <input type="number" name="sort"  value='{$vo.sort|default=""}' placeholder="请输入排序号" class="layui-input">

+ 7 - 0
application/nutrition/view/datum_url/form.html

@@ -46,6 +46,13 @@
                 </div>
                 </div>
             </div>
             </div>
 
 
+            <div class="layui-form-item">
+                <label class="layui-form-label ">热搜阅读量</label>
+                <div class="layui-input-block">
+                    <input name="hot_num"   value='{$vo.hot_num|default=""}' placeholder="请输入热搜阅读量" class="layui-input">
+                    <input name="hot_num_old"  type="hidden" value='{$vo.hot_num|default=""}'  class="layui-input">
+                </div>
+            </div>
 
 
             <div class="layui-form-item">
             <div class="layui-form-item">
                 <label class="layui-form-label label-required">标签</label>
                 <label class="layui-form-label label-required">标签</label>

+ 1 - 1
application/nutrition/view/user_article/index.html

@@ -42,7 +42,7 @@
                 {else}
                 {else}
                 <a data-title="查看" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>查 看</a>
                 <a data-title="查看" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>查 看</a>
                 {eq name='vo.status' value='1'}
                 {eq name='vo.status' value='1'}
-                    <a data-title="加入系列" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("series")}?id={$vo.id}'>加入系列</a>
+                  <!--  <a data-title="加入系列" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("series")}?id={$vo.id}'>加入系列</a>-->
                  <!--   <a data-title="新建图文" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("new_article")}?id={$vo.id}'>新建图文</a>-->
                  <!--   <a data-title="新建图文" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("new_article")}?id={$vo.id}'>新建图文</a>-->
                 {/eq}
                 {/eq}
                 {/if}
                 {/if}

+ 1 - 1
application/nutrition/view/user_datum/index.html

@@ -41,7 +41,7 @@
                 {else}
                 {else}
                 <a data-title="查看" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>查 看</a>
                 <a data-title="查看" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>查 看</a>
                     {eq name='vo.status' value='1'}
                     {eq name='vo.status' value='1'}
-                    <a data-title="加入系列" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("series")}?id={$vo.id}'>加入系列</a>
+                 <!--   <a data-title="加入系列" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("series")}?id={$vo.id}'>加入系列</a>-->
                    <!-- <span class="layui-btn layui-btn-sm layui-btn-warm" onclick="btn_confirm('新建资料','new_datum','{$vo.id}');">新建资料</span>-->
                    <!-- <span class="layui-btn layui-btn-sm layui-btn-warm" onclick="btn_confirm('新建资料','new_datum','{$vo.id}');">新建资料</span>-->
                     {/eq}
                     {/eq}
                 {/if}
                 {/if}

+ 1 - 1
application/nutrition/view/user_video/index.html

@@ -54,7 +54,7 @@
                 {else}
                 {else}
                 <a data-title="查看" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>查 看</a>
                 <a data-title="查看" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>查 看</a>
                 {eq name='vo.status' value='1'}
                 {eq name='vo.status' value='1'}
-                <a data-title="加入系列" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("series")}?id={$vo.id}'>加入系列</a>
+               <!-- <a data-title="加入系列" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("series")}?id={$vo.id}'>加入系列</a>-->
               <!--  <a data-title="新建视频" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("new_video")}?id={$vo.id}'>新建视频</a>-->
               <!--  <a data-title="新建视频" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("new_video")}?id={$vo.id}'>新建视频</a>-->
                 {/eq}
                 {/eq}
                 {/if}
                 {/if}

+ 9 - 0
application/nutrition/view/video_url/form.html

@@ -135,6 +135,15 @@
             </div>
             </div>
 
 
             <div class="layui-form-item">
             <div class="layui-form-item">
+                <label class="layui-form-label ">热搜阅读量</label>
+                <div class="layui-input-block">
+                    <input name="hot_num"   value='{$vo.hot_num|default=""}' placeholder="请输入热搜阅读量" class="layui-input">
+                    <input name="hot_num_old"  type="hidden" value='{$vo.hot_num|default=""}'  class="layui-input">
+                </div>
+            </div>
+
+
+            <div class="layui-form-item">
                 <label class="layui-form-label ">PDF</label>
                 <label class="layui-form-label ">PDF</label>
                 <label class="layui-col-xs10 relative">
                 <label class="layui-col-xs10 relative">
                     <label class="layui-col-xs9 think-form-group-left">
                     <label class="layui-col-xs9 think-form-group-left">

+ 23 - 1
application/operate/controller/Activity.php

@@ -85,6 +85,7 @@ class Activity extends Controller
 
 
         \app\common\model\Activity::where('id',input('id'))->update(['is_deleted'=>1]);
         \app\common\model\Activity::where('id',input('id'))->update(['is_deleted'=>1]);
         \app\common\model\Activity::esAdd(input('id'));
         \app\common\model\Activity::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'activity');
         $this->success('删除成功');
         $this->success('删除成功');
     }
     }
 
 
@@ -100,6 +101,7 @@ class Activity extends Controller
         foreach (explode(',',$ids) as $id) {
         foreach (explode(',',$ids) as $id) {
             \app\common\model\Activity::where('id',$id)->update(['is_deleted'=>1]);
             \app\common\model\Activity::where('id',$id)->update(['is_deleted'=>1]);
             \app\common\model\Activity::esAdd($id);
             \app\common\model\Activity::esAdd($id);
+            \app\common\model\TopSearch::saveData($id,'activity');
         }
         }
         $this->success('删除成功');
         $this->success('删除成功');
     }
     }
@@ -151,10 +153,26 @@ class Activity extends Controller
                 $data['user_id'] = '';
                 $data['user_id'] = '';
             }
             }
             if(!$post['release_time'])  $data['release_time'] = date("Y-m-d H:i:s");
             if(!$post['release_time'])  $data['release_time'] = date("Y-m-d H:i:s");
+            if($data['hot_num'] != $data['hot_num_old']) $data['hot_time'] = date("Y-m-d H:i:s");
             //郵箱 和短信
             //郵箱 和短信
             if($this->request->action()== 'edit' && isset($data['push_switch']) && $data['push_switch'] == 1)
             if($this->request->action()== 'edit' && isset($data['push_switch']) && $data['push_switch'] == 1)
             {
             {
-                \app\common\model\Activity::activityChange($data['id'],$data['title'],['end_time'=>$data['end_time'],'start_time'=>$data['start_time'],'address'=>$data['address']]);
+                //\app\common\model\Activity::activityChange($data['id'],$data['title'],['end_time'=>$data['end_time'],'start_time'=>$data['start_time'],'address'=>$data['address']]);
+
+                $before_act = \app\common\model\Activity::where('id',$data['id'])->find()->toArray();
+                // 活动时间变更
+                if(($before_act['start_time'] != $data['start_time'] || $before_act['end_time'] != $data['end_time']) && $before_act['address'] == $data['address'] ) {
+                    \app\common\model\Activity::activityChange($data['id'],$data['title'],['end_time'=>$data['end_time'],'start_time'=>$data['start_time'],'address'=>$data['address']]);
+                }
+                // 活动地址变更
+                else if($before_act['start_time'] == $data['start_time'] && $before_act['end_time'] == $data['end_time'] &&  $before_act['address'] != $data['address']){
+                    \app\common\model\Activity::activityChange($data['id'],$data['title'],['end_time'=>$data['end_time'],'start_time'=>$data['start_time'],'address'=>$data['address']]);
+                }
+                // 活动地址与时间变更
+                else if($before_act['start_time'] != $data['start_time'] || $before_act['end_time'] != $data['end_time'] ||  $before_act['address'] != $data['address'] ) {
+                    \app\common\model\Activity::activityChange($data['id'],$data['title'],['end_time'=>$data['end_time'],'start_time'=>$data['start_time'],'address'=>$data['address']]);
+                }
+
             }
             }
         }else{
         }else{
             if (!empty($data)){
             if (!empty($data)){
@@ -210,6 +228,7 @@ class Activity extends Controller
     {
     {
         \app\common\model\Activity::where('id',input('id'))->update(['status'=>1]);
         \app\common\model\Activity::where('id',input('id'))->update(['status'=>1]);
         \app\common\model\Activity::esAdd(input('id'));
         \app\common\model\Activity::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'activity');
         $this->success('已上架!');
         $this->success('已上架!');
     }
     }
 
 
@@ -227,6 +246,7 @@ class Activity extends Controller
     {
     {
         \app\common\model\Activity::where('id',input('id'))->update(['status'=>0]);
         \app\common\model\Activity::where('id',input('id'))->update(['status'=>0]);
         \app\common\model\Activity::esAdd(input('id'));
         \app\common\model\Activity::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'activity');
         $this->success('已下架!');
         $this->success('已下架!');
     }
     }
 
 
@@ -245,6 +265,7 @@ class Activity extends Controller
     {
     {
         \app\common\model\Activity::where('id',input('id'))->update(['status'=>2]);
         \app\common\model\Activity::where('id',input('id'))->update(['status'=>2]);
         \app\common\model\Activity::esAdd(input('id'));
         \app\common\model\Activity::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'activity');
         \app\common\model\Activity::activityCancel(input('id'));
         \app\common\model\Activity::activityCancel(input('id'));
         $this->success('已取消!');
         $this->success('已取消!');
     }
     }
@@ -330,6 +351,7 @@ class Activity extends Controller
         }
         }
         ActivityPrice::priceSet($id,$ladder_data);
         ActivityPrice::priceSet($id,$ladder_data);
         \app\common\model\Activity::esAdd($id);
         \app\common\model\Activity::esAdd($id);
+        \app\common\model\TopSearch::saveData($id,'activity');
         // 站內信和極光
         // 站內信和極光
         if(isset($post['push_switch']) && $post['push_switch'] == 1) \app\common\service\Activity::activityChange($id);
         if(isset($post['push_switch']) && $post['push_switch'] == 1) \app\common\service\Activity::activityChange($id);
         $this->success('操作成功', 'javascript:history.back()');
         $this->success('操作成功', 'javascript:history.back()');

+ 4 - 5
application/operate/controller/ActivityApplyItem.php

@@ -131,6 +131,9 @@ class ActivityApplyItem extends Controller
                         $url='http://'.$_SERVER['SERVER_NAME']."/code/".$ticket_info['id'].'.png';
                         $url='http://'.$_SERVER['SERVER_NAME']."/code/".$ticket_info['id'].'.png';
                         \app\common\model\ActivityApplyItem::where('id',$ticket_info['id'])->update(['qr_code'=>$url,'qr_content'=>$qr_content]);
                         \app\common\model\ActivityApplyItem::where('id',$ticket_info['id'])->update(['qr_code'=>$url,'qr_content'=>$qr_content]);
                     }
                     }
+                    $act_title = \app\common\model\Activity::where('id',$ticket_info['act_id'])->value('title');
+                    $message = '您已成功报名"'.$act_title.'"';//点击<a href=\"$info_url\">查看详情及点子门票</a>";
+                    UserMessage::sendUserMessage($ticket_info['user_id'],'activity',1,1,0,$ticket_info['id'],$message,$ticket_info['id']);
                     UserSynth::ticketSend($ticket_info['id']);
                     UserSynth::ticketSend($ticket_info['id']);
                 }
                 }
 
 
@@ -141,9 +144,6 @@ class ActivityApplyItem extends Controller
                             'url'=>'dist/#/activity_ticket_info?id='.$ticket_info['id'],
                             'url'=>'dist/#/activity_ticket_info?id='.$ticket_info['id'],
                         ]);
                         ]);
                     $info_url = 'https://'.$_SERVER['HTTP_HOST'].'/dist/#/activity_ticket_info?id='.$ticket_info['id'];
                     $info_url = 'https://'.$_SERVER['HTTP_HOST'].'/dist/#/activity_ticket_info?id='.$ticket_info['id'];
-                    $act_title = \app\common\model\Activity::where('id',$ticket_info['act_id'])->value('title');
-                    $message = '您已成功报名《'.$act_title."》活动";//点击<a href=\"$info_url\">查看详情及点子门票</a>";
-                    UserMessage::sendUserMessage($ticket_info['user_id'],'activity',1,1,0,$ticket_info['id'],$message,$ticket_info['id']);
                 }
                 }
             }
             }
 
 
@@ -153,9 +153,8 @@ class ActivityApplyItem extends Controller
                 $res =  \app\common\service\Activity:: orderApplyRefund($order_id,$data['id'],2,1);
                 $res =  \app\common\service\Activity:: orderApplyRefund($order_id,$data['id'],2,1);
                 $info_url = 'https://'.$_SERVER['HTTP_HOST'].'/dist/#/activity-detail?id='.$ticket_info['act_id'];
                 $info_url = 'https://'.$_SERVER['HTTP_HOST'].'/dist/#/activity-detail?id='.$ticket_info['act_id'];
                 $act_title = \app\common\model\Activity::where('id',$ticket_info['act_id'])->value('title');
                 $act_title = \app\common\model\Activity::where('id',$ticket_info['act_id'])->value('title');
-                $message = '很抱歉,您报名的《'.$act_title."》活动审核未通过";//,点击<a href=\"$info_url\">重新报名</a>";
+                $message = '很抱歉,您报名的"'.$act_title.'"审核未通过';//,点击<a href=\"$info_url\">重新报名</a>";
                 UserMessage::sendUserMessage($ticket_info['user_id'],'activity',1,1,0,$ticket_info['id'],$message,$ticket_info['id']);
                 UserMessage::sendUserMessage($ticket_info['user_id'],'activity',1,1,0,$ticket_info['id'],$message,$ticket_info['id']);
-
             }
             }
         }
         }
 
 

+ 15 - 4
application/operate/controller/Forum.php

@@ -95,8 +95,10 @@ class Forum extends Controller
      */
      */
     public function del()
     public function del()
     {
     {
+        UserForum::where('id',input('id'))->update(['is_deleted' => '1']);
         UserForum::esAdd(input('id'));
         UserForum::esAdd(input('id'));
-        $this->_save($this->table, ['is_deleted' => '1']);
+        \app\common\model\TopSearch::saveData(input('id'),'forum');
+        $this->success('已删除!');
     }
     }
 
 
 
 
@@ -110,9 +112,11 @@ class Forum extends Controller
     {
     {
         $ids = input('id');
         $ids = input('id');
         foreach (explode(',',$ids) as $id) {
         foreach (explode(',',$ids) as $id) {
-            UserForum::esAdd($id);
+            UserForum::where('id',$id)->update(['is_deleted' => '1']);
+            UserForum::esAdd( $id);
+            \app\common\model\TopSearch::saveData($id,'forum');
         }
         }
-        $this->_save($this->table, ['is_deleted' => '1']);
+        $this->success('已删除!');
     }
     }
 
 
 
 
@@ -192,6 +196,7 @@ class Forum extends Controller
     protected function _form_result(&$data)
     protected function _form_result(&$data)
     {
     {
         UserForum::esAdd($data);
         UserForum::esAdd($data);
+        \app\common\model\TopSearch::saveData($data,'forum');
         $this->success('操作成功', 'javascript:history.back()');
         $this->success('操作成功', 'javascript:history.back()');
     }
     }
 
 
@@ -199,6 +204,9 @@ class Forum extends Controller
     protected function _form_filter(&$data)
     protected function _form_filter(&$data)
     {
     {
         $this->level_arr = UserLevel::column('name','id');
         $this->level_arr = UserLevel::column('name','id');
+        if($this->request->isPost()){
+            if($data['hot_num'] != $data['hot_num_old']) $data['hot_time'] = date("Y-m-d H:i:s");
+        }
     }
     }
 
 
 
 
@@ -259,6 +267,7 @@ class Forum extends Controller
     {
     {
         UserForum::where('id',input('id'))->update(['status'=>0]);
         UserForum::where('id',input('id'))->update(['status'=>0]);
         UserForum::esAdd(input('id'));
         UserForum::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'forum');
         $this->success('已禁用!');
         $this->success('已禁用!');
     }
     }
 
 
@@ -275,8 +284,9 @@ class Forum extends Controller
      */
      */
     public function enable()
     public function enable()
     {
     {
-        UserForum::esAdd(input('id'));
         UserForum::where('id',input('id'))->update(['status'=>1]);
         UserForum::where('id',input('id'))->update(['status'=>1]);
+        UserForum::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'forum');
         $this->success('已启用!');
         $this->success('已启用!');
     }
     }
 
 
@@ -338,6 +348,7 @@ class Forum extends Controller
             $success_num++;
             $success_num++;
             $forum_info = UserForum::create($add_data)->toArray();
             $forum_info = UserForum::create($add_data)->toArray();
             UserForum::esAdd($forum_info['id']);
             UserForum::esAdd($forum_info['id']);
+            \app\common\model\TopSearch::saveData($forum_info['id'],'forum');
         }
         }
         $this->success('成功导入记录条数:'.$success_num);
         $this->success('成功导入记录条数:'.$success_num);
 
 

+ 7 - 0
application/operate/controller/PlatformDemand.php

@@ -49,6 +49,7 @@ class PlatformDemand extends Controller
     {
     {
         \app\common\model\PlatformDemand::where('id',input('id'))->update(['is_deleted'=>1]);
         \app\common\model\PlatformDemand::where('id',input('id'))->update(['is_deleted'=>1]);
         \app\common\model\PlatformDemand::esAdd(input('id'));
         \app\common\model\PlatformDemand::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'demand');
         $this->success('已删除!');
         $this->success('已删除!');
     }
     }
     /**
     /**
@@ -63,6 +64,7 @@ class PlatformDemand extends Controller
         foreach (explode(',',$ids) as $id) {
         foreach (explode(',',$ids) as $id) {
             \app\common\model\PlatformDemand::where('id',$id)->update(['is_deleted'=>1]);
             \app\common\model\PlatformDemand::where('id',$id)->update(['is_deleted'=>1]);
             \app\common\model\PlatformDemand::esAdd($id);
             \app\common\model\PlatformDemand::esAdd($id);
+            \app\common\model\TopSearch::saveData($id,'demand');
         }
         }
         $this->success('已删除!');
         $this->success('已删除!');
     }
     }
@@ -115,6 +117,7 @@ class PlatformDemand extends Controller
     {
     {
         \app\common\model\PlatformDemand::where('id',input('id'))->update(['status'=>1]);
         \app\common\model\PlatformDemand::where('id',input('id'))->update(['status'=>1]);
         \app\common\model\PlatformDemand::esAdd(input('id'));
         \app\common\model\PlatformDemand::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'demand');
         $this->success('已上架!');
         $this->success('已上架!');
     }
     }
 
 
@@ -132,6 +135,7 @@ class PlatformDemand extends Controller
     {
     {
         \app\common\model\PlatformDemand::where('id',input('id'))->update(['status'=>0]);
         \app\common\model\PlatformDemand::where('id',input('id'))->update(['status'=>0]);
         \app\common\model\PlatformDemand::esAdd(input('id'));
         \app\common\model\PlatformDemand::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'demand');
         $this->success('已下架!');
         $this->success('已下架!');
     }
     }
 
 
@@ -146,6 +150,8 @@ class PlatformDemand extends Controller
         if($this->request->isGet() && $this->request->action() == 'edit') $this->user_info  = Db::name('store_member')->find($data['user_id']);
         if($this->request->isGet() && $this->request->action() == 'edit') $this->user_info  = Db::name('store_member')->find($data['user_id']);
         if($this->request->isPost())
         if($this->request->isPost())
         {
         {
+            if(!$data['release_time']) $data['release_time'] = date("Y-m-d H:i:s");
+            if($data['hot_num'] != $data['hot_num_old']) $data['hot_time'] = date("Y-m-d H:i:s");
             if(!empty($data['phone'])) {
             if(!empty($data['phone'])) {
                 $user_id = User::where('phone|email',$data['phone'])->value('id');
                 $user_id = User::where('phone|email',$data['phone'])->value('id');
                 if(!$user_id) $this->error('该账号未注册');
                 if(!$user_id) $this->error('该账号未注册');
@@ -159,6 +165,7 @@ class PlatformDemand extends Controller
 
 
     protected function  _form_result($result){
     protected function  _form_result($result){
         \app\common\model\PlatformDemand::esAdd($result);
         \app\common\model\PlatformDemand::esAdd($result);
+        \app\common\model\TopSearch::saveData($result,'demand');
         $this->success('操作成功', 'javascript:history.back()');
         $this->success('操作成功', 'javascript:history.back()');
     }
     }
 
 

+ 7 - 34
application/operate/controller/Press.php

@@ -79,6 +79,7 @@ class Press extends Controller
     {
     {
         \app\common\model\Press::where('id',input('id'))->update(['is_deleted'=>1]);
         \app\common\model\Press::where('id',input('id'))->update(['is_deleted'=>1]);
         \app\common\model\Press::esAdd(input('id'));
         \app\common\model\Press::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'press');
         $this->success('已删除!');
         $this->success('已删除!');
     }
     }
 
 
@@ -94,6 +95,7 @@ class Press extends Controller
         foreach (explode(',',$ids) as $id) {
         foreach (explode(',',$ids) as $id) {
             \app\common\model\Press::where('id',$id)->update(['is_deleted'=>1]);
             \app\common\model\Press::where('id',$id)->update(['is_deleted'=>1]);
             \app\common\model\Press::esAdd($id);
             \app\common\model\Press::esAdd($id);
+            \app\common\model\TopSearch::saveData($id,'press');
         }
         }
         $this->success('已删除!');
         $this->success('已删除!');
     }
     }
@@ -126,38 +128,10 @@ class Press extends Controller
     {
     {
         \app\common\model\Press::where('id',input('id'))->update(['status'=>0]);
         \app\common\model\Press::where('id',input('id'))->update(['status'=>0]);
         \app\common\model\Press::esAdd(input('id'));
         \app\common\model\Press::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'press');
         $this->success('已下架!');
         $this->success('已下架!');
     }
     }
 
 
-    /**
-     * 回复
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-
-    public function reply()
-    {
-        $this->title = '回复列表';
-        $where = [];
-        $where[] = ['r.is_deleted','=',0];
-        $where[] = ['r.forum_id','=',input('id')];
-        if($title = input('content')) $where[] = ['r.content','like','%'.$title.'%'];
-        if($name = input('name')) $where[] = ['u.name','like','%'.$name.'%'];
-        if($phone = input('phone')) $where[] = ['u.phone','=',$phone];
-        $list = $this->_query('forum_reply')
-            ->alias('r')
-            ->field('r.*,u.name,u.phone,u.headimg')
-            ->leftJoin('store_member u','u.id = r.user_id')
-            ->where($where)
-            ->order('r.id desc')->page();
-        $this->assign('list',$list);
-        $this->fetch('');
-    }
 
 
 
 
     protected function _form_filter(&$data){
     protected function _form_filter(&$data){
@@ -181,6 +155,8 @@ class Press extends Controller
         {
         {
             if(empty($data['title']))$this->error('请输入标题');
             if(empty($data['title']))$this->error('请输入标题');
             if(empty($data['images']))$this->error('请上传封面');
             if(empty($data['images']))$this->error('请上传封面');
+            if(!$data['release_time']) $data['release_time'] = date("Y-m-d H:i:s");
+            if($data['hot_num'] != $data['hot_num_old']) $data['hot_time'] = date("Y-m-d H:i:s");
             if(!empty($data['phone'])) {
             if(!empty($data['phone'])) {
                 $user_id = User::where('phone|email',$data['phone'])->value('id');
                 $user_id = User::where('phone|email',$data['phone'])->value('id');
                 if(!$user_id) $this->error('账号未注册');
                 if(!$user_id) $this->error('账号未注册');
@@ -191,15 +167,12 @@ class Press extends Controller
         }
         }
     }
     }
 
 
-    public function del_reply()
-    {
-        Db::name('forum_reply')->where('id',input('id'))->update(['is_deleted'=>1]);
-        $this->success('删除成功');
-    }
+
 
 
     protected function _form_result(&$data)
     protected function _form_result(&$data)
     {
     {
        \app\common\model\Press::esAdd($data);
        \app\common\model\Press::esAdd($data);
+        \app\common\model\TopSearch::saveData($data,'press');
         $this->success('操作成功', 'javascript:history.back()');
         $this->success('操作成功', 'javascript:history.back()');
     }
     }
 
 

+ 34 - 34
application/operate/controller/Recruit.php

@@ -83,7 +83,28 @@ class Recruit extends Controller
      */
      */
     public function del()
     public function del()
     {
     {
-        $this->_save($this->table, ['is_deleted' => '1']);
+        \app\common\model\Recruit::where('id',input('id'))->update(['is_deleted'=>1]);
+        \app\common\model\Recruit::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'recruit');
+        $this->success('操作成功');
+    }
+
+
+    /**
+     * 删除
+     * @auth true
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function remove()
+    {
+        $ids = input('id');
+        foreach (explode(',',$ids) as $id) {
+            \app\common\model\Recruit::where('id',$id)->update(['is_deleted'=>1]);
+            \app\common\model\Recruit::esAdd($id);
+            \app\common\model\TopSearch::saveData($id,'recruit');
+        }
+        $this->success('已删除!');
     }
     }
 
 
     /**
     /**
@@ -123,6 +144,8 @@ class Recruit extends Controller
         {
         {
             list($post,$ladder_data) = [$this->request->post(),[]];
             list($post,$ladder_data) = [$this->request->post(),[]];
             if(!$data['longitude'] || !$data['latitude']) $this->error('请选择地图坐标');
             if(!$data['longitude'] || !$data['latitude']) $this->error('请选择地图坐标');
+            if(!$data['release_time']) $data['release_time'] = date("Y-m-d H:i:s");
+            if($data['hot_num'] != $data['hot_num_old']) $data['hot_time'] = date("Y-m-d H:i:s");
             if(!empty($post['user_phone'])) {
             if(!empty($post['user_phone'])) {
                 $user_id = User::where('phone|email',$post['user_phone'])->value('id');
                 $user_id = User::where('phone|email',$post['user_phone'])->value('id');
                 if(!$user_id) $this->error('账号未注册');
                 if(!$user_id) $this->error('账号未注册');
@@ -135,43 +158,14 @@ class Recruit extends Controller
 
 
     }
     }
 
 
-    /**
-     * 报名记录
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function apply()
-    {
-        $id = $this->request->get('act_id');
-        $name = $this->request->get('name');
-        $phone = $this->request->get('phone');
-        $this->title = '报名记录';
-        $where = [];
-        $where[]= ['a.act_id','=' ,$id];
-        $where[]= ['a.is_deleted','=' ,0];
-        $where[]= ['a.status','=' ,1];
-        $where[]= ['a.status','=' ,1];
-        if($name)  $where[]= ['a.name','like' ,'%'.$name.'%'];
-        if($phone)  $where[]= ['a.phone','like' ,'%'.$phone.'%'];
-        $query = $this->_query('activity_apply')
-            ->alias('a')
-            ->field('a.*,u.name user_name,u.headimg')
-            ->where($where)
-            ->leftJoin('store_member u','u.id = a.user_id')
-            ->order('a.id desc')->page();
-        $this->fetch();
-    }
 
 
 
 
 
 
 
 
     protected function _form_result(&$data)
     protected function _form_result(&$data)
     {
     {
+        \app\common\model\Recruit::esAdd($data);
+        \app\common\model\TopSearch::saveData($data,'recruit');
         $this->success('操作成功', 'javascript:history.back()');
         $this->success('操作成功', 'javascript:history.back()');
     }
     }
 
 
@@ -188,7 +182,10 @@ class Recruit extends Controller
      */
      */
     public function up()
     public function up()
     {
     {
-        $this->_save($this->table, ['status' => '1']);
+        \app\common\model\Recruit::where('id',input('id'))->update(['status'=>1]);
+        \app\common\model\Recruit::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'recruit');
+        $this->success('操作成功');
     }
     }
 
 
     /**
     /**
@@ -203,7 +200,10 @@ class Recruit extends Controller
      */
      */
     public function down()
     public function down()
     {
     {
-        $this->_save($this->table, ['status' => '2']);
+        \app\common\model\Recruit::where('id',input('id'))->update(['status'=>0]);
+        \app\common\model\Recruit::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'recruit');
+        $this->success('操作成功');
     }
     }
 
 
 
 

+ 6 - 0
application/operate/controller/SupplierGoods.php

@@ -123,6 +123,7 @@ class SupplierGoods extends Controller
     {
     {
         \app\common\model\SupplierGoods::where('id',input('id'))->update(['status'=>1]);
         \app\common\model\SupplierGoods::where('id',input('id'))->update(['status'=>1]);
         \app\common\model\SupplierGoods::esAdd(input('id'));
         \app\common\model\SupplierGoods::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'supplier_goods');
         $this->success('已上架!');
         $this->success('已上架!');
     }
     }
 
 
@@ -140,6 +141,7 @@ class SupplierGoods extends Controller
     {
     {
         \app\common\model\SupplierGoods::where('id',input('id'))->update(['status'=>0]);
         \app\common\model\SupplierGoods::where('id',input('id'))->update(['status'=>0]);
         \app\common\model\SupplierGoods::esAdd(input('id'));
         \app\common\model\SupplierGoods::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'supplier_goods');
         $this->success('已下架!');
         $this->success('已下架!');
     }
     }
 
 
@@ -154,6 +156,7 @@ class SupplierGoods extends Controller
     {
     {
         \app\common\model\SupplierGoods::where('id',input('id'))->update(['is_deleted'=>1]);
         \app\common\model\SupplierGoods::where('id',input('id'))->update(['is_deleted'=>1]);
         \app\common\model\SupplierGoods::esAdd(input('id'));
         \app\common\model\SupplierGoods::esAdd(input('id'));
+        \app\common\model\TopSearch::saveData(input('id'),'supplier_goods');
         $this->success('已删除!');
         $this->success('已删除!');
     }
     }
 
 
@@ -169,6 +172,7 @@ class SupplierGoods extends Controller
         foreach (explode(',',$ids) as $id) {
         foreach (explode(',',$ids) as $id) {
             \app\common\model\SupplierGoods::where('id',$id)->update(['is_deleted'=>1]);
             \app\common\model\SupplierGoods::where('id',$id)->update(['is_deleted'=>1]);
             \app\common\model\SupplierGoods::esAdd($id);
             \app\common\model\SupplierGoods::esAdd($id);
+            \app\common\model\TopSearch::saveData($id,'supplier_goods');
         }
         }
         $this->success('已删除!');
         $this->success('已删除!');
     }
     }
@@ -216,6 +220,7 @@ class SupplierGoods extends Controller
         if($this->request->isPost()) {
         if($this->request->isPost()) {
             list($post) = [$this->request->post()];
             list($post) = [$this->request->post()];
             if(!$data['release_time']) $data['release_time'] = date("Y-m-d H:i:s");
             if(!$data['release_time']) $data['release_time'] = date("Y-m-d H:i:s");
+            if($data['hot_num'] != $data['hot_num_old']) $data['hot_time'] = date("Y-m-d H:i:s");
             if(!empty($post['phone'])) {
             if(!empty($post['phone'])) {
                 $user_id = User::where('phone|email',$post['phone'])->value('id');
                 $user_id = User::where('phone|email',$post['phone'])->value('id');
                 if(!$user_id) $this->error('账号未注册');
                 if(!$user_id) $this->error('账号未注册');
@@ -234,6 +239,7 @@ class SupplierGoods extends Controller
             if($supplier_name)PlatformSwitch::followMsg(5,$this->request->post('supplier_id'),$supplier_name,$this->request->post('title'),$id);
             if($supplier_name)PlatformSwitch::followMsg(5,$this->request->post('supplier_id'),$supplier_name,$this->request->post('title'),$id);
         }
         }
         \app\common\model\SupplierGoods::esAdd($id);
         \app\common\model\SupplierGoods::esAdd($id);
+        \app\common\model\TopSearch::saveData($id,'supplier_goods');
         $this->success('操作成功', 'javascript:history.back()');
         $this->success('操作成功', 'javascript:history.back()');
     }
     }
 
 

+ 8 - 0
application/operate/view/activity/form.html

@@ -157,6 +157,14 @@
                     </div>
                     </div>
 
 
                     <div class="layui-form-item layui-row layui-col-space15">
                     <div class="layui-form-item layui-row layui-col-space15">
+                        <label class="layui-col-xs3 relative">
+                            <span class="color-green">热搜阅读量</span>
+                            <input name="hot_num"   value='{$vo.hot_num|default=""}' placeholder="请输入热搜阅读量" class="layui-input">
+                            <input name="hot_num_old"  type="hidden" value='{$vo.hot_num|default=""}'  class="layui-input">
+                        </label>
+                    </div>
+
+                    <div class="layui-form-item layui-row layui-col-space15">
 
 
                         <label class="layui-col-xs3 relative">
                         <label class="layui-col-xs3 relative">
                             <span class="color-green">开始时间</span>
                             <span class="color-green">开始时间</span>

+ 7 - 0
application/operate/view/forum/form.html

@@ -63,6 +63,13 @@
                     </div>
                     </div>
                 </div>
                 </div>
 
 
+                <div class="layui-form-item">
+                    <label class="layui-form-label ">热搜阅读量</label>
+                    <div class="layui-input-block">
+                        <input name="hot_num"   value='{$vo.hot_num|default=""}' placeholder="请输入热搜阅读量" class="layui-input">
+                        <input name="hot_num_old"  type="hidden" value='{$vo.hot_num|default=""}'  class="layui-input">
+                    </div>
+                </div>
 
 
                <!-- <div class="layui-form-item">
                <!-- <div class="layui-form-item">
                     <label class="layui-form-label label-required">封面</label>
                     <label class="layui-form-label label-required">封面</label>

+ 17 - 0
application/operate/view/platform_demand/form.html

@@ -129,6 +129,22 @@
                     </div>
                     </div>
                 </div>
                 </div>
 
 
+
+                <div class="layui-form-item">
+                    <label class="layui-form-label">热搜阅读量</label>
+                    <div class="layui-input-block">
+                        <input type="number" name="hot_num"  value='{$vo.hot_num|default=""}' placeholder="请输入热搜阅读量" class="layui-input">
+                        <input type="hidden" name="hot_num_old"  value='{$vo.hot_num|default=""}'>
+                    </div>
+                </div>
+
+                <div class="layui-form-item">
+                    <label class="layui-form-label ">上架时间</label>
+                    <div class="layui-input-block">
+                        <input name="release_time"   value='{$vo.release_time|default=""}'  class="layui-input">
+                    </div>
+                </div>
+
                 <div class="layui-form-item">
                 <div class="layui-form-item">
                     <label class="layui-form-label">发布方电话</label>
                     <label class="layui-form-label">发布方电话</label>
                     <div class="layui-input-block">
                     <div class="layui-input-block">
@@ -183,6 +199,7 @@
     $('[name="cover"]').uploadOneImage();
     $('[name="cover"]').uploadOneImage();
     $('[name="solve_qrcode"]').uploadOneImage();
     $('[name="solve_qrcode"]').uploadOneImage();
     $('[name="images"]').uploadMultipleImage();
     $('[name="images"]').uploadMultipleImage();
+    laydate.render({type: 'datetime', elem: '[name="release_time"]'})
     $('[name="company_logo"]').uploadOneImage();
     $('[name="company_logo"]').uploadOneImage();
     require(['ckeditor', 'angular'], function () {
     require(['ckeditor', 'angular'], function () {
         window.createEditor('[name="content"]', {
         window.createEditor('[name="content"]', {

+ 18 - 0
application/operate/view/press/form.html

@@ -64,6 +64,20 @@
                         </label>
                         </label>
                     </div>
                     </div>
 
 
+                    <div class="layui-form-item layui-row layui-col-space15">
+                        <label class="layui-col-xs3 relative">
+                            <span class="color-green">热搜阅读量</span>
+                            <input name="hot_num"   value='{$vo.hot_num|default=""}' placeholder="请输入热搜阅读量" class="layui-input">
+                            <input name="hot_num_old"  type="hidden" value='{$vo.hot_num|default=""}'  class="layui-input">
+                        </label>
+
+                        <label class="layui-col-xs3 relative">
+                            <span class="color-green">上架时间</span>
+                            <input name="release_time" id="release_time"   class="layui-input" placeholder="" value="{$vo.release_time|default=''}">
+                        </label>
+                    </div>
+
+
 
 
                     <div class="layui-form-item layui-row layui-col-space15">
                     <div class="layui-form-item layui-row layui-col-space15">
                         <label class="layui-col-xs12 relative">
                         <label class="layui-col-xs12 relative">
@@ -194,6 +208,10 @@
             height: 500,
             height: 500,
         });
         });
     })
     })
+    laydate.render({
+        elem: '#release_time'
+        ,type: 'datetime'
+    });
 
 
     // 文章监听
     // 文章监听
     form.on('select(article_id)', function(data){
     form.on('select(article_id)', function(data){

+ 49 - 12
application/operate/view/recruit/form.html

@@ -102,22 +102,28 @@
                         </label>
                         </label>
                     </div>
                     </div>
 
 
+
+
                     <div class="layui-form-item layui-row layui-col-space15">
                     <div class="layui-form-item layui-row layui-col-space15">
-                        <label class="layui-col-xs9 relative">
+                        <label class="layui-col-xs3 relative">
                             <span class="color-green">排序</span>
                             <span class="color-green">排序</span>
                             <input name="sort"  class="layui-input" placeholder="请输入排序号" value="{$vo.sort|default=''}">
                             <input name="sort"  class="layui-input" placeholder="请输入排序号" value="{$vo.sort|default=''}">
                         </label>
                         </label>
-                    </div>
-
-
-                    <div class="layui-form-item layui-row layui-col-space15">
-                        <label class="layui-col-xs9 relative">
+                        <label class="layui-col-xs3 relative">
                             <span class="color-green">阅读量</span>
                             <span class="color-green">阅读量</span>
                             <input name="read_num"  class="layui-input" placeholder="请输入阅读量" value="{$vo.read_num|default=''}">
                             <input name="read_num"  class="layui-input" placeholder="请输入阅读量" value="{$vo.read_num|default=''}">
                         </label>
                         </label>
+
+                        <label class="layui-col-xs3 relative">
+                            <span class="color-green">热搜阅读量</span>
+                            <input name="hot_num"   value='{$vo.hot_num|default=""}' placeholder="请输入热搜阅读量" class="layui-input">
+                            <input name="hot_num_old"  type="hidden" value='{$vo.hot_num|default=""}'  class="layui-input">
+                        </label>
+
                     </div>
                     </div>
 
 
 
 
+
                     <div class="layui-form-item layui-row layui-col-space15">
                     <div class="layui-form-item layui-row layui-col-space15">
                         <label class="layui-col-xs3 relative">
                         <label class="layui-col-xs3 relative">
                             <span class="color-green">学历</span>
                             <span class="color-green">学历</span>
@@ -132,6 +138,10 @@
                             <span class="color-green">招聘人数</span>
                             <span class="color-green">招聘人数</span>
                             <input name="num" required class="layui-input" placeholder="请输入招聘人数" value="{$vo.num|default=''}">
                             <input name="num" required class="layui-input" placeholder="请输入招聘人数" value="{$vo.num|default=''}">
                         </label>
                         </label>
+                        <label class="layui-col-xs3 relative">
+                            <span class="color-green">上架时间</span>
+                            <input name="release_time" id="release_time"   class="layui-input" placeholder="" value="{$vo.release_time|default=''}">
+                        </label>
 
 
                     </div>
                     </div>
 
 
@@ -217,21 +227,44 @@
                         </label>
                         </label>
                     </div>
                     </div>
 
 
-
                     <div class="layui-form-item layui-row layui-col-space15">
                     <div class="layui-form-item layui-row layui-col-space15">
-                        <label class="layui-col-xs3 relative">
-                            <span class="color-green">公司名称-状态-规模</span>
-                            <input name="company" required class="layui-input" placeholder="请输入公司名称-状态-规模" value="{$vo.company|default=''}">
+                        <label class="layui-col-xs2 relative">
+                            <span class="color-green">公司名称</span>
+                            <input name="company" required class="layui-input" placeholder="请输入公司名称" value="{$vo.company|default=''}">
                         </label>
                         </label>
+
                         <label class="layui-col-xs2 relative">
                         <label class="layui-col-xs2 relative">
+                            <span class="color-green">是否上市</span>
+                            <select class="layui-select"  name="is_ss" id="is_ss"  lay-filter="is_ss" lay-search>
+                                <option  {if isset($vo.is_ss) && $vo.is_ss == 1 }selected{/if} value="1">是</option>
+                                <option  {if isset($vo.is_ss) && $vo.is_ss == 0 }selected{/if} value="0">否</option>
+                            </select>
+                        </label>
+
+                        <label class="layui-col-xs2 relative">
+                            <span class="color-green">公司规模</span>
+                            <input name="scale"  class="layui-input" placeholder="请输入公司人数" value="{$vo.scale|default=''}">
+                        </label>
+
+                        <label class="layui-col-xs2 relative">
+                            <span class="color-green">公司简介</span>
+                            <input name="company_intro"  class="layui-input" placeholder="请输入公司简介" value="{$vo.company_intro|default=''}">
+                        </label>
+
+                    </div>
+
+
+                    <div class="layui-form-item layui-row layui-col-space15">
+
+                        <label class="layui-col-xs3 relative">
                             <span class="color-green">联系人</span>
                             <span class="color-green">联系人</span>
                             <input name="principal"  required class="layui-input" placeholder="请输入联系人" value="{$vo.principal|default=''}">
                             <input name="principal"  required class="layui-input" placeholder="请输入联系人" value="{$vo.principal|default=''}">
                         </label>
                         </label>
-                        <label class="layui-col-xs2 relative">
+                        <label class="layui-col-xs3 relative">
                             <span class="color-green">邮箱</span>
                             <span class="color-green">邮箱</span>
                             <input name="email"  required class="layui-input" placeholder="请输入邮箱" value="{$vo.email|default=''}">
                             <input name="email"  required class="layui-input" placeholder="请输入邮箱" value="{$vo.email|default=''}">
                         </label>
                         </label>
-                        <label class="layui-col-xs2 relative">
+                        <label class="layui-col-xs3 relative">
                             <span class="color-green">电话</span>
                             <span class="color-green">电话</span>
                             <input name="phone"  required class="layui-input" placeholder="请输入电话" value="{$vo.phone|default=''}">
                             <input name="phone"  required class="layui-input" placeholder="请输入电话" value="{$vo.phone|default=''}">
                         </label>
                         </label>
@@ -511,6 +544,10 @@
             ,type: 'datetime'
             ,type: 'datetime'
         });
         });
     })
     })
+    laydate.render({
+        elem: '#release_time'
+        ,type: 'datetime'
+    });
 
 
     layui.use('element', function(){
     layui.use('element', function(){
         var $ = layui.jquery
         var $ = layui.jquery

+ 1 - 1
application/operate/view/recruit/index.html

@@ -1,7 +1,7 @@
 {extend name='admin@main'}
 {extend name='admin@main'}
 
 
 {block name="button"}
 {block name="button"}
-<button data-action='{:url("del")}'  data-confirm="确定要删除吗?" data-csrf="{:systoken('del')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
+<button data-action='{:url("del")}'  data-confirm="确定要删除吗?" data-csrf="{:systoken('remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
 
 
 <button data-open='{:url("add")}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
 <button data-open='{:url("add")}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
 
 

+ 10 - 10
application/operate/view/supplier_goods/form.html

@@ -219,27 +219,27 @@
 
 
 
 
                     <div class="layui-form-item layui-row layui-col-space15">
                     <div class="layui-form-item layui-row layui-col-space15">
-                        <label class="layui-col-xs9 relative">
+                        <label class="layui-col-xs2 relative">
                             <span class="color-green">排序</span>
                             <span class="color-green">排序</span>
                             <input name="sort" required class="layui-input" placeholder="请输入排序号" value="{$vo.sort|default='0'}">
                             <input name="sort" required class="layui-input" placeholder="请输入排序号" value="{$vo.sort|default='0'}">
                         </label>
                         </label>
-                    </div>
-
-
-                    <div class="layui-form-item layui-row layui-col-space15">
-                        <label class="layui-col-xs9 relative">
+                        <label class="layui-col-xs2 relative">
                             <span class="color-green">阅读量</span>
                             <span class="color-green">阅读量</span>
                             <input name="read_num" required class="layui-input" placeholder="请输入阅读量" value="{$vo.read_num|default='0'}">
                             <input name="read_num" required class="layui-input" placeholder="请输入阅读量" value="{$vo.read_num|default='0'}">
                         </label>
                         </label>
-                    </div>
-
-                    <div class="layui-form-item layui-row layui-col-space15">
-                        <label class="layui-col-xs9 relative">
+                        <label class="layui-col-xs2 relative">
                             <span class="color-green">转发量</span>
                             <span class="color-green">转发量</span>
                             <input name="transmit_num" required class="layui-input" placeholder="请输入转发量" value="{$vo.transmit_num|default='0'}">
                             <input name="transmit_num" required class="layui-input" placeholder="请输入转发量" value="{$vo.transmit_num|default='0'}">
                         </label>
                         </label>
+                        <label class="layui-col-xs2 relative">
+                            <span class="color-green">热搜阅读量</span>
+                            <input name="hot_num"   value='{$vo.hot_num|default=""}' placeholder="请输入热搜阅读量" class="layui-input">
+                            <input name="hot_num_old"  type="hidden" value='{$vo.hot_num|default=""}'  class="layui-input">
+                        </label>
                     </div>
                     </div>
 
 
+
+
                     <div class="layui-form-item layui-row layui-col-space15">
                     <div class="layui-form-item layui-row layui-col-space15">
                         <label class="layui-col-xs9 relative">
                         <label class="layui-col-xs9 relative">
                             <span class="color-green">产品详情</span>
                             <span class="color-green">产品详情</span>

BIN
public/pc/Pig.pdf


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/app.bb4c0933.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/app.df7e7843.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/app.e4339fb2.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-0158d0f2.3416a8f9.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-02c759ec.20ac07ed.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-045205de.dd157d2b.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-04c77c26.d0c995ca.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-07dac8b8.a87ff257.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-09b9cff4.3bd17d86.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-0ae9193a.ccc79207.css


+ 1 - 0
public/pc/css/chunk-0b8b2ded.5d936607.css

@@ -0,0 +1 @@
+.wrap[data-v-2df3a304]{width:100vw;height:100%;position:relative}.box[data-v-2df3a304]{width:100vw;height:100%;border:none;margin:0;padding:0;overflow:hidden}.loading[data-v-2df3a304]{width:100%;height:100%;background:#fff;position:absolute;top:0;left:0;z-index:999;display:flex;flex-direction:column;justify-content:center;align-items:center}@keyframes auto-down-animate-bfa7d880{0%{opacity:0;top:0}50%{opacity:1;top:13px}to{opacity:0;top:27px}}@-moz-keyframes auto-down-animate-bfa7d880{0%{-moz-transform:rotate(0deg)}50%{-moz-transform:rotate(180deg)}to{-moz-transform:rotate(1turn)}}@-webkit-keyframes auto-down-animate-bfa7d880{0%{-webkit-transform:rotate(0deg)}50%{-webkit-transform:rotate(180deg)}to{-webkit-transform:rotate(1turn)}}@-o-keyframes auto-down-animate-bfa7d880{0%{-o-transform:rotate(0deg)}50%{-o-transform:rotate(180deg)}to{-o-transform:rotate(1turn)}}@keyframes out-glow-bfa7d880{0%{opacity:0;transform:scale(0)}50%{opacity:1}to{opacity:0;transform:scale(1.5)}}@-moz-keyframes out-glow-bfa7d880{0%{opacity:0;-moz-transform:scale(0)}50%{opacity:1}to{opacity:0;-moz-transform:scale(1.5)}}@-webkit-keyframes out-glow-bfa7d880{0%{opacity:0;-webkit-transform:scale(0)}50%{opacity:1}to{opacity:0;-webkit-transform:scale(1.5)}}@-o-keyframes out-glow-bfa7d880{0%{opacity:0;-o-transform:scale(0)}50%{opacity:1}to{opacity:0;-o-transform:scale(1.5)}}[data-v-bfa7d880]::-webkit-scrollbar{background:#fff;border-radius:0;width:8px;height:8px}[data-v-bfa7d880]::-webkit-scrollbar-thumb{background:#cfcfcf;border-radius:0}[data-v-bfa7d880]::-webkit-scrollbar-thumb:hover{background:#aaa}.wrap[data-v-bfa7d880]{margin-top:-80px;height:calc(100vh - 15px)}.wrap .iframeContent[data-v-bfa7d880]{width:100%;min-height:calc(100vh - 44px);border:none}

File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-0c4b0974.6d92e530.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-0f052369.c22c38b8.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-0f4e2198.c069e1be.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-11b83018.64d2c153.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-142f2a8f.7a017b81.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-151f9851.f3fce80b.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-156976a6.da6c5d17.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-15d93c3c.180103d2.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-16630f24.be324a63.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-16d5a58a.5b42e85b.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-175f9fc9.0dac2cad.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-18b09c82.74a4073f.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-198202c2.7d9decc0.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-19f2bbfe.998b3af1.css


File diff suppressed because it is too large
+ 0 - 0
public/pc/css/chunk-1a4da306.82c0151c.css


Some files were not shown because too many files changed in this diff