Sellerlogout.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace app\api\controller;
  3. /**
  4. * ============================================================================
  5. *
  6. * ============================================================================
  7. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  8. * 网站地址: https://www.valimart.net/
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 卖家登出控制器
  13. */
  14. class Sellerlogout extends MobileSeller {
  15. public function initialize() {
  16. parent::initialize();
  17. }
  18. /**
  19. * @api {POST} api/Sellerlogout/group_edit 注销
  20. * @apiVersion 1.0.0
  21. * @apiGroup Sellerlogout
  22. *
  23. * @apiHeader {String} X-DS-KEY 卖家授权token
  24. *
  25. * @apiParam {String} seller_name 卖家账号
  26. * @apiParam {String} client 客户端类型 android wap wechat ios windows jswechat
  27. *
  28. * @apiSuccess {String} code 返回码,10000为成功
  29. * @apiSuccess {String} message 返回消息
  30. * @apiSuccess {Object} result 返回数据
  31. */
  32. public function index() {
  33. if (empty(input('post.seller_name')) || !in_array(input('post.client'), $this->client_type_array)) {
  34. ds_json_encode(10001, lang('param_error'));
  35. }
  36. $mbsellertoken_model = model('mbsellertoken');
  37. if ($this->seller_info['seller_name'] == input('post.seller_name')) {
  38. $condition = array();
  39. $condition[] = array('seller_id','=',$this->seller_info['seller_id']);
  40. $mbsellertoken_model->delMbsellertoken($condition);
  41. ds_json_encode(10000, '', 1);
  42. } else {
  43. ds_json_encode(10001, lang('param_error'));
  44. }
  45. }
  46. }