Solution.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace app\api\controller;
  3. use app\admin\model\Goods;
  4. use app\common\controller\Api;
  5. use app\common\model\SolutionShop;
  6. use app\common\model\SolutionForeign;
  7. use app\common\model\SolutionKnowledge;
  8. /**
  9. * 解决方案
  10. */
  11. class Solution extends Api
  12. {
  13. protected $noNeedLogin = ['*'];
  14. /**
  15. * 门店解决方案
  16. */
  17. public function solution_shop(){
  18. $res = SolutionShop::all(function ($query){
  19. $query->field('id,name,content,image');
  20. });
  21. array_push($res,Goods::get(['id'=>4]));
  22. $this->success('请求成功',$res);
  23. }
  24. /**
  25. * 外贸解决方案
  26. */
  27. public function solution_foreign(){
  28. $res = SolutionForeign::all(function ($query){
  29. $query->field('id,name,content,image');
  30. });
  31. array_push($res,Goods::get(['id'=>5]));
  32. $this->success('请求成功',$res);
  33. }
  34. /**
  35. * 知识付费解决方案
  36. */
  37. public function solution_knowledge(){
  38. $res = SolutionKnowledge::all(function ($query){
  39. $query->field('id,name,content,image');
  40. });
  41. array_push($res,Goods::get(['id'=>6]));
  42. $this->success('请求成功',$res);
  43. }
  44. }