ShopAdminController.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. $id = Yii::$app->request->get('id');
  23. $admin = ShopAdminClass::getAdminInfo($id);
  24. if (empty($admin)) {
  25. util::fail('没有找到员工');
  26. }
  27. $adminId = $admin['adminId'] ?? 0;
  28. $sjId = $admin['merchantId'] ?? 0;
  29. ApplyClass::deleteByCondition(['sjId' => $sjId]);
  30. AdminClass::deleteById($adminId);
  31. ShopAdminClass::deleteById($id);
  32. util::complete();
  33. }
  34. }