Shoping.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. *
  4. * @copyright ©2020 点小铺
  5. * @author hanj
  6. * @link: https://dyuit.com
  7. * Created by VSCode
  8. */
  9. namespace app\store\controller\apps\wow;
  10. use app\store\controller\Controller;
  11. use app\store\model\wow\Shoping as ShopingModel;
  12. use app\common\service\wechat\wow\Shoping as WowService;
  13. /**
  14. * 好物圈-商品收藏
  15. * Class Shoping
  16. * @package app\store\controller\apps\wow
  17. */
  18. class Shoping extends Controller
  19. {
  20. /**
  21. * 商品收藏记录
  22. * @param string $search
  23. * @return mixed
  24. * @throws \think\exception\DbException
  25. */
  26. public function index($search = '')
  27. {
  28. $model = new ShopingModel;
  29. $list = $model->getList($search);
  30. return $this->fetch('index', compact('list'));
  31. }
  32. /**
  33. * 取消同步
  34. * @param $id
  35. * @return array|bool
  36. * @throws \app\common\exception\BaseException
  37. * @throws \think\exception\DbException
  38. */
  39. public function delete($id)
  40. {
  41. // 删除微信好物圈收藏
  42. $WechatWow = new WowService($this->getWxappId());
  43. $WechatWow->delete($id);
  44. return $this->renderSuccess('操作成功');
  45. }
  46. }