Sellerlogout.php 1.5 KB

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