ShopAdminController.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace pt\controllers;
  3. use biz\admin\classes\AdminClass;
  4. use biz\shop\classes\ShopAdminClass;
  5. use bizHd\admin\services\ShopAdminService;
  6. use bizHd\saas\classes\ApplyClass;
  7. use common\components\util;
  8. use Yii;
  9. class ShopAdminController extends BaseController
  10. {
  11. //员工列表 ssh 2019.12.8
  12. public function actionList()
  13. {
  14. $where = [];
  15. $where['delStatus'] = 0;
  16. $list = ShopAdminService::getAdminList($where);
  17. util::success($list);
  18. }
  19. //删除员工、商家、和申请信息 shish
  20. public function actionDelete()
  21. {
  22. util::complete();
  23. $id = Yii::$app->request->get('id');
  24. $admin = ShopAdminClass::getAdminInfo($id);
  25. if (empty($admin)) {
  26. util::fail('没有找到员工');
  27. }
  28. $adminId = $admin['adminId'] ?? 0;
  29. $sjId = $admin['merchantId'] ?? 0;
  30. ApplyClass::deleteByCondition(['sjId' => $sjId]);
  31. AdminClass::deleteById($adminId);
  32. ShopAdminClass::deleteById($id);
  33. util::complete();
  34. }
  35. }