Shoping.php 1.0 KB

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