Sellerlogout.php 1.7 KB

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