diff --git a/application/admin/controller/auth/Admin.php b/application/admin/controller/auth/Admin.php index 4dad0d2..065108e 100644 --- a/application/admin/controller/auth/Admin.php +++ b/application/admin/controller/auth/Admin.php @@ -5,6 +5,7 @@ namespace app\admin\controller\auth; use app\admin\model\AuthGroup; use app\admin\model\AuthGroupAccess; use app\common\controller\Backend; +use app\common\model\dyqc\ManystoreShop; use fast\Random; use fast\Tree; use think\Db; @@ -298,4 +299,34 @@ class Admin extends Backend $this->dataLimitField = 'id'; return parent::selectpage(); } + + + + /** + * 后台生成默认机构 + * @return string + * @throws \think\Exception + * @throws \think\db\exception\BindParamException + * @throws \think\exception\DbException + * @throws \think\exception\PDOException + */ + public function createshop($ids = ''){ + $param = $this->request->param(); + if($this->request->isPost()){ + try{ + if(isset($param['ids']))$ids = $param['ids']; + //设置模拟资格 + $model = new ManystoreShop; + $model->adminshopadd($ids,true); + + + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + $this->success('生成机构成功!'); + } + $row = $this->model->get($ids); + $this->view->assign('vo', $row); + return $this->view->fetch(); + } } diff --git a/application/admin/controller/dyqc/ManystoreShop.php b/application/admin/controller/dyqc/ManystoreShop.php index 5856d3f..02de5ca 100644 --- a/application/admin/controller/dyqc/ManystoreShop.php +++ b/application/admin/controller/dyqc/ManystoreShop.php @@ -226,4 +226,32 @@ class ManystoreShop extends Backend return json(['list' => $list, 'total' => $total]); } + + + /** + * 跳转链接 + * @return string + * @throws \think\Exception + * @throws \think\db\exception\BindParamException + * @throws \think\exception\DbException + * @throws \think\exception\PDOException + */ + public function url($ids = ''){ + $param = $this->request->param(); + if($this->request->isPost()){ + try{ + if(isset($param['ids']))$ids = $param['ids']; + //设置模拟资格 + $url = \app\common\model\dyqc\ManystoreShop::getPath($ids); + + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + $this->success($url); + } + $row = $this->model->get($ids); + $this->view->assign('vo', $row); + return $this->view->fetch(); + } + } diff --git a/application/admin/controller/manystore/Index.php b/application/admin/controller/manystore/Index.php index 2af08ea..b9aefb0 100644 --- a/application/admin/controller/manystore/Index.php +++ b/application/admin/controller/manystore/Index.php @@ -8,6 +8,7 @@ use app\admin\model\school\classes\Teacher; use app\admin\model\school\classes\Verification; use app\admin\model\User; use app\common\model\manystore\Shop; +use app\common\model\school\classes\activity\Activity; use app\common\model\school\classes\Evaluate; use app\common\model\school\classes\Order; @@ -308,6 +309,15 @@ class Index extends Backend //有课程不允许删 $classesLib = ClassesLib::where("manystore_id",$id)->find(); if($classesLib)throw new \Exception("请先删除课程后再删除机构!"); + + + // 课程存在售后订单则不允许操作 + $order = \app\common\model\school\classes\activity\order\Order::where("manystore_id",$id)->where("status","not in","-3,6,9")->find(); + if($order)throw new \Exception("存在正在使用中的活动订单报名学员,无法继续操作!"); + + $activity = Activity::where("manystore_id",$id)->find(); + if($activity)throw new \Exception("请先删除活动后再删除机构!"); + // //有老师不允许删 // $teacher = Teacher::where("manystore_id",$id)->find(); // if($teacher)throw new \Exception("请先删除老师后再删除机构!"); @@ -640,6 +650,26 @@ class Index extends Backend } $lib->delete(); } + //删除活动及其规格 + $activitys = \app\common\model\school\classes\activity\Activity::where(array('shop_id'=>$row['shop_id']))->select(); + foreach ($activitys as $activity){ + $specs = $activity->items; + foreach ($specs as $spec){ + $spec->delete(); + } + $activity->delete(); + } + $activityauths = \app\common\model\school\classes\activity\ActivityAuth::where(array('shop_id'=>$row['shop_id']))->select(); + foreach ($activityauths as $activity){ + $specs = $activity->itemauths; + foreach ($specs as $spec){ + $spec->delete(); + } + $activity->delete(); + } + + Admin::where(array('admin_shop_id'=>$row['shop_id']))->update(['admin_shop_id'=>0]); + Evaluate::where(array('shop_id'=>$row['shop_id']))->delete(); if(!$result){ exception('商家信息删除失败'); @@ -674,4 +704,31 @@ class Index extends Backend $this->dataLimitField = 'id'; return parent::selectpage(); } + + + /** + * 跳转链接 + * @return string + * @throws \think\Exception + * @throws \think\db\exception\BindParamException + * @throws \think\exception\DbException + * @throws \think\exception\PDOException + */ + public function url($ids = ''){ + $param = $this->request->param(); + if($this->request->isPost()){ + try{ + if(isset($param['ids']))$ids = $param['ids']; + //设置模拟资格 + $url = \app\common\model\dyqc\ManystoreShop::getPath($ids); + + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + $this->success($url); + } + $row = $this->model->get($ids); + $this->view->assign('vo', $row); + return $this->view->fetch(); + } } diff --git a/application/admin/controller/school/classes/ClassesLib.php b/application/admin/controller/school/classes/ClassesLib.php index 88ae2a9..31f8bf6 100644 --- a/application/admin/controller/school/classes/ClassesLib.php +++ b/application/admin/controller/school/classes/ClassesLib.php @@ -1053,4 +1053,31 @@ class ClassesLib extends Backend + /** + * 跳转链接 + * @return string + * @throws \think\Exception + * @throws \think\db\exception\BindParamException + * @throws \think\exception\DbException + * @throws \think\exception\PDOException + */ + public function url($ids = ''){ + $param = $this->request->param(); + if($this->request->isPost()){ + try{ + if(isset($param['ids']))$ids = $param['ids']; + //设置模拟资格 + $url = \app\common\model\school\classes\ClassesLib::getPath($ids); + + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + $this->success($url); + } + $row = $this->model->get($ids); + $this->view->assign('vo', $row); + return $this->view->fetch(); + } + + } diff --git a/application/admin/controller/school/classes/Teacher.php b/application/admin/controller/school/classes/Teacher.php index 0cd190e..658dd68 100644 --- a/application/admin/controller/school/classes/Teacher.php +++ b/application/admin/controller/school/classes/Teacher.php @@ -314,4 +314,32 @@ class Teacher extends Backend } + + /** + * 跳转链接 + * @return string + * @throws \think\Exception + * @throws \think\db\exception\BindParamException + * @throws \think\exception\DbException + * @throws \think\exception\PDOException + */ + public function url($ids = ''){ + $param = $this->request->param(); + if($this->request->isPost()){ + try{ + if(isset($param['ids']))$ids = $param['ids']; + //设置模拟资格 + $url = \app\common\model\school\classes\Teacher::getPath($ids); + + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + $this->success($url); + } + $row = $this->model->get($ids); + $this->view->assign('vo', $row); + return $this->view->fetch(); + } + + } diff --git a/application/admin/controller/school/classes/activity/Activity.php b/application/admin/controller/school/classes/activity/Activity.php index 548c4fa..145ee84 100644 --- a/application/admin/controller/school/classes/activity/Activity.php +++ b/application/admin/controller/school/classes/activity/Activity.php @@ -429,4 +429,31 @@ class Activity extends Backend } + /** + * 跳转链接 + * @return string + * @throws \think\Exception + * @throws \think\db\exception\BindParamException + * @throws \think\exception\DbException + * @throws \think\exception\PDOException + */ + public function url($ids = ''){ + $param = $this->request->param(); + if($this->request->isPost()){ + try{ + if(isset($param['ids']))$ids = $param['ids']; + //设置模拟资格 + $url = \app\common\model\school\classes\activity\Activity::getPath($ids); + + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + $this->success($url); + } + $row = $this->model->get($ids); + $this->view->assign('vo', $row); + return $this->view->fetch(); + } + + } diff --git a/application/admin/controller/school/classes/activity/order/Order.php b/application/admin/controller/school/classes/activity/order/Order.php index 35e1930..3c99be7 100644 --- a/application/admin/controller/school/classes/activity/order/Order.php +++ b/application/admin/controller/school/classes/activity/order/Order.php @@ -134,7 +134,7 @@ class Order extends Backend $model = (new \app\common\model\school\classes\activity\order\Order); $model->examine($params["id"],$auth_status,$reason,0,true,'admin',$this->auth->id,true); - }catch (\Exception $e){ + }catch (\Throwable $e){ $this->error($e->getMessage()); } diff --git a/application/admin/view/index/login.html b/application/admin/view/index/login.html index b2b0322..17a9ed6 100644 --- a/application/admin/view/index/login.html +++ b/application/admin/view/index/login.html @@ -13,6 +13,12 @@ a { color: #444; } + .container{ + margin-right: inherit; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; + } .login-screen { @@ -59,6 +65,7 @@ } .login-form { + margin: 250px 30px; padding: 40px 30px; position: relative; z-index: 99; @@ -81,7 +88,9 @@ {if $background} {/if} @@ -93,10 +102,10 @@