From 23f8715a95043d0f08062ca5d58982aa183c43f1 Mon Sep 17 00:00:00 2001 From: 15090180611 <215509543@qq.com> Date: Mon, 18 Nov 2024 19:01:04 +0800 Subject: [PATCH] =?UTF-8?q?1=EF=BC=8C=E5=AE=8C=E5=96=84=E6=9C=BA=E6=9E=84?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=20=E4=B8=A4=E4=B8=AA=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E7=9A=84=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD=202=EF=BC=8C?= =?UTF-8?q?=E7=AB=99=E5=86=85=E4=BF=A1=E6=8E=A5=E5=8F=A3=203=EF=BC=8C?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=A1=A8=E6=8E=A5=E5=8F=A3=204=EF=BC=8C?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=80=BB=E5=90=8E=E5=8F=B0/=E5=88=86?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=AE=A1=E7=90=86=EF=BC=88=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E4=B8=AD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/manystore/Index.php | 62 +++++- .../controller/school/classes/ClassesLib.php | 7 +- .../school/classes/Verification.php | 202 ++++++++++++++++- .../lang/zh-cn/school/classes/order/order.php | 1 + .../model/school/classes/Verification.php | 13 +- .../admin/view/manystore/index/index.html | 10 + .../view/school/classes/classes_lib/add.html | 4 +- .../view/school/classes/order/order/edit.html | 47 ++-- .../school/classes/order/order/index.html | 18 +- .../view/school/classes/verification/add.html | 16 +- .../school/classes/verification/edit.html | 14 +- .../common/controller/ManystoreBase.php | 12 +- .../listener/classeshourorder/OrderHook.php | 2 +- .../common/model/dyqc/ManystoreShop.php | 15 ++ .../manystore/controller/general/Profile.php | 2 + .../controller/school/classes/ClassesLib.php | 6 +- .../school/classes/Verification.php | 209 +++++++++++++++++- application/manystore/lang/zh-cn.php | 5 +- .../manystore/lang/zh-cn/general/profile.php | 31 ++- application/manystore/library/Auth.php | 47 ++++ .../model/school/classes/Verification.php | 18 +- application/manystore/view/common/header.html | 6 +- application/manystore/view/common/menu.html | 6 +- .../manystore/view/dashboard/index.html | 16 ++ .../manystore/view/general/profile/index.html | 116 +++++++++- .../school/classes/classes_lib/index.html | 10 + .../view/school/classes/verification/add.html | 17 +- .../school/classes/verification/edit.html | 17 +- public/assets/js/backend/manystore/index.js | 129 ++++++++++- .../js/backend/school/classes/classes_lib.js | 8 +- .../js/backend/school/classes/verification.js | 22 +- .../manystore/school/classes/classes_lib.js | 7 +- .../manystore/school/classes/verification.js | 54 +++-- 33 files changed, 1010 insertions(+), 139 deletions(-) diff --git a/application/admin/controller/manystore/Index.php b/application/admin/controller/manystore/Index.php index 5e15cb5..4f638d2 100644 --- a/application/admin/controller/manystore/Index.php +++ b/application/admin/controller/manystore/Index.php @@ -4,7 +4,9 @@ namespace app\admin\controller\manystore; use app\admin\model\User; use app\common\model\school\classes\Order; + use app\manystore\model\Manystore; +use app\manystore\model\ManystoreLog; use app\manystore\model\ManystoreShop; use app\manystore\model\ManystoreAuthGroup; use app\manystore\model\ManystoreAuthGroupAccess; @@ -12,6 +14,7 @@ use app\common\controller\Backend; use fast\Random; use fast\Tree; use think\Exception; +use think\Hook; use think\Validate; /** @@ -35,7 +38,7 @@ class Index extends Backend //不用审核允许修改的字段 - protected $no_auth_fields = ['image','images','address_city','province',"city","district","address","address_detail", + protected $no_auth_fields = [ "name",'image','images','address_city','province',"city","district","address","address_detail", "longitude","latitude","content","desc" ]; @@ -57,6 +60,55 @@ class Index extends Backend $this->view->assign("typeList", $this->shopModel->getTypeList()); } + + + /** + * 免登录进入机构后台 + * @return string + * @throws \think\Exception + * @throws \think\db\exception\BindParamException + * @throws \think\exception\DbException + * @throws \think\exception\PDOException + */ + public function free($ids = ''){ + $param = $this->request->param(); + if($this->request->isPost()){ +// try{ + if(isset($param['ids']))$ids = $param['ids']; + //机构登录 + //如果存在登录,先退出登录 + $auth = \app\manystore\library\Auth::instance(); + if($auth->isLogin()){ + $auth->logout(); + Hook::listen("manystore_logout_after", $this->request); + } + //执行登录 + ManystoreLog::setTitle(__('Login')); + $result = $auth->freelogin($ids, 0); + if ($result === true) { + Hook::listen("admin_login_after", $this->request); + $this->success(__('Login successful'), null, [ 'id' => $auth->id, 'avatar' => $auth->avatar]); + } else { + $msg = $auth->getError(); + $msg = $msg ? $msg : __('Username or password is incorrect'); + $this->error($msg, null, ['token' => $this->request->token()]); + } + + + +// }catch (\Exception $e){ +// $this->error($e->getMessage()); +// } + + } + $row = $this->model->get($ids); + $this->view->assign('vo', $row); + return $this->view->fetch(); + } + + + + /** * 查看 */ @@ -135,9 +187,13 @@ class Index extends Backend //审核通过 if($this->success_auth){ //如果是平台下架,则更新成正常下架 - if($params["status"] == 'hidden') $params["status"] = 'normal'; + if($params["status"] == 'hidden')$params["status"] = 'normal'; + + //当前密码 + $password = $params['password'] ? $params['password'] : \app\common\model\dyqc\ManystoreShop::getDefaultPassword($params["type"],$params["user_id"],$params); + //调用通过事件 - $data = ['shop' => $row]; + $data = ['shop' => $row,"password"=>$password]; \think\Hook::listen('shop_auth_success_after', $data); diff --git a/application/admin/controller/school/classes/ClassesLib.php b/application/admin/controller/school/classes/ClassesLib.php index c2c2391..a82012f 100644 --- a/application/admin/controller/school/classes/ClassesLib.php +++ b/application/admin/controller/school/classes/ClassesLib.php @@ -22,6 +22,10 @@ use think\exception\ValidateException; class ClassesLib extends Backend { + protected $qSwitch = true; + protected $qFields = ["teacher_id","user_id","shop_id","manystore_id"]; + + /** * ClassesLib模型对象 * @var \app\admin\model\school\classes\ClassesLib @@ -39,8 +43,9 @@ class ClassesLib extends Backend public function _initialize() { - parent::_initialize(); $this->model = new \app\admin\model\school\classes\ClassesLib; + parent::_initialize(); + $this->view->assign("addTypeList", $this->model->getAddTypeList()); $this->view->assign("typeList", $this->model->getTypeList()); $this->view->assign("addressTypeList", $this->model->getAddressTypeList()); diff --git a/application/admin/controller/school/classes/Verification.php b/application/admin/controller/school/classes/Verification.php index 4dc78bd..1eb3121 100644 --- a/application/admin/controller/school/classes/Verification.php +++ b/application/admin/controller/school/classes/Verification.php @@ -3,6 +3,15 @@ namespace app\admin\controller\school\classes; use app\common\controller\Backend; +use app\common\model\User; +use app\manystore\model\Manystore; +use think\Db; +use think\db\exception\DataNotFoundException; +use think\db\exception\ModelNotFoundException; +use think\Exception; +use think\exception\DbException; +use think\exception\PDOException; +use think\exception\ValidateException; /** * 机构核销员 @@ -18,10 +27,14 @@ class Verification extends Backend */ protected $model = null; + protected $qSwitch = true; + protected $qFields = ["manystore_id","shop_id"]; + public function _initialize() { - parent::_initialize(); $this->model = new \app\admin\model\school\classes\Verification; + parent::_initialize(); + $this->view->assign("statusList", $this->model->getStatusList()); } @@ -70,4 +83,191 @@ class Verification extends Backend return $this->view->fetch(); } + + + protected function updateCheck($id,$params=[],$row=null){ + + // 课程存在售后订单则不允许操作 + } + + + protected function update_check(&$params,$row=null) + { + + $shop_id = $params["shop_id"]; + $manystore = Manystore::where("shop_id",$shop_id)->find(); + if(!$manystore){ + $this->error("店铺不存在"); + } + //用户不存在 + $user_id = $params["user_id"]; + $user = User::where("id",$user_id)->find(); + if(!$user){ + $this->error("用户不存在"); + } + + //修改 + if($row){ + //用户已是其他的教师(搜索) + $teacher_user = $this->model->where("user_id",$user_id)->where("id","<>",$row["id"])->find(); + if($teacher_user){ + $this->error("用户已存在或已是其他授权机构核销员!"); + } + }else{ + //新增 + //用户已是教师(搜索) + $teacher_user = $this->model->where("user_id",$user_id)->find(); + if($teacher_user){ + $this->error("用户已存在或已是其他授权机构核销员!"); + } + } + + + + + + + + $params["manystore_id"] = $manystore["id"]; + } + + + /** + * 添加 + * + * @return string + * @throws \think\Exception + */ + public function add() + { + if (false === $this->request->isPost()) { + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params = $this->preExcludeFields($params); + + if ($this->dataLimit && $this->dataLimitFieldAutoFill) { + $params[$this->dataLimitField] = $this->auth->id; + } + $result = false; + Db::startTrans(); + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; + $this->model->validateFailException()->validate($validate); + } + $this->update_check($params,$row=null); + $result = $this->model->allowField(true)->save($params); + Db::commit(); + } catch (ValidateException|PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if ($result === false) { + $this->error(__('No rows were inserted')); + } + $this->success(); + } + + /** + * 编辑 + * + * @param $ids + * @return string + * @throws DbException + * @throws \think\Exception + */ + public function edit($ids = null) + { + $row = $this->model->get($ids); + if (!$row) { + $this->error(__('No Results were found')); + } + $adminIds = $this->getDataLimitAdminIds(); + if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) { + $this->error(__('You have no permission')); + } + if (false === $this->request->isPost()) { + $this->view->assign('row', $row); + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params = $this->preExcludeFields($params); + $result = false; + Db::startTrans(); + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate; + $row->validateFailException()->validate($validate); + } + $this->update_check($params,$row); + $result = $row->allowField(true)->save($params); + Db::commit(); + } catch (ValidateException|PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if (false === $result) { + $this->error(__('No rows were updated')); + } + $this->success(); + } + + /** + * 删除 + * + * @param $ids + * @return void + * @throws DbException + * @throws DataNotFoundException + * @throws ModelNotFoundException + */ + public function del($ids = null) + { + if (false === $this->request->isPost()) { + $this->error(__("Invalid parameters")); + } + $ids = $ids ?: $this->request->post("ids"); + if (empty($ids)) { + $this->error(__('Parameter %s can not be empty', 'ids')); + } + $pk = $this->model->getPk(); + $adminIds = $this->getDataLimitAdminIds(); + if (is_array($adminIds)) { + $this->model->where($this->dataLimitField, 'in', $adminIds); + } + $list = $this->model->where($pk, 'in', $ids)->select(); + foreach ($list as $item) { + $this->updateCheck($item->id); + } + + + $count = 0; + Db::startTrans(); + try { + foreach ($list as $item) { + $count += $item->delete(); + } + Db::commit(); + } catch (PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if ($count) { + $this->success(); + } + $this->error(__('No rows were deleted')); + } + + } diff --git a/application/admin/lang/zh-cn/school/classes/order/order.php b/application/admin/lang/zh-cn/school/classes/order/order.php index e9bd221..5affc8c 100644 --- a/application/admin/lang/zh-cn/school/classes/order/order.php +++ b/application/admin/lang/zh-cn/school/classes/order/order.php @@ -2,6 +2,7 @@ return [ 'Order_no' => '订单号', + 'Edit'=>'订单详情', 'Pay_no' => '微信支付单号', 'User_id' => '下单人id', 'Manystore_id' => '机构账号id', diff --git a/application/admin/model/school/classes/Verification.php b/application/admin/model/school/classes/Verification.php index 18bcc47..8884c91 100644 --- a/application/admin/model/school/classes/Verification.php +++ b/application/admin/model/school/classes/Verification.php @@ -25,8 +25,19 @@ class Verification extends Model // 追加属性 protected $append = [ - 'status_text' + 'status_text', + 'classes_title' ]; + + + public function getClassesTitleAttr($value, $data) + { + $classes_lib_ids = (isset($data['classes_lib_ids']) ? $data['classes_lib_ids'] : ''); + if(!$classes_lib_ids) return ''; + //$classes_cate_ids 查询分类表 names 已逗号拼接返回 + $classes_cate_title = ClassesLib::where('id','in',$classes_lib_ids)->column('title'); + return implode(',',$classes_cate_title); + } diff --git a/application/admin/view/manystore/index/index.html b/application/admin/view/manystore/index/index.html index 98b0428..6d4c4d4 100644 --- a/application/admin/view/manystore/index/index.html +++ b/application/admin/view/manystore/index/index.html @@ -15,6 +15,16 @@
{:build_toolbar('refresh,add')} + + + + + + + + + +
- +
@@ -21,7 +21,7 @@
- +
diff --git a/application/admin/view/school/classes/order/order/edit.html b/application/admin/view/school/classes/order/order/edit.html index a2303d8..7f14f59 100644 --- a/application/admin/view/school/classes/order/order/edit.html +++ b/application/admin/view/school/classes/order/order/edit.html @@ -3,44 +3,39 @@
- +
- +
- -
-
-
- -
- +
+
- +
- +
- +
@@ -54,7 +49,7 @@
- +
@@ -67,40 +62,40 @@
- -
-
-
- -
- +
+ + + + + +
- +
- +
- +
- {foreach name="payTypeList" item="vo"} - + {/foreach} @@ -112,7 +107,7 @@
{foreach name="statusList" item="vo"} - + {/foreach}
diff --git a/application/admin/view/school/classes/order/order/index.html b/application/admin/view/school/classes/order/order/index.html index 66368ad..032527d 100644 --- a/application/admin/view/school/classes/order/order/index.html +++ b/application/admin/view/school/classes/order/order/index.html @@ -17,19 +17,19 @@
- {:__('Add')} + {:__('Edit')} {:__('Delete')} - + + + + + + + + {:__('Recycle bin')}
diff --git a/application/admin/view/school/classes/verification/add.html b/application/admin/view/school/classes/verification/add.html index 84c52c7..9fcdc8b 100644 --- a/application/admin/view/school/classes/verification/add.html +++ b/application/admin/view/school/classes/verification/add.html @@ -1,21 +1,21 @@
-
- -
- -
-
+ + + + + +
- +
- +
diff --git a/application/admin/view/school/classes/verification/edit.html b/application/admin/view/school/classes/verification/edit.html index 4b07d6a..ee5ca46 100644 --- a/application/admin/view/school/classes/verification/edit.html +++ b/application/admin/view/school/classes/verification/edit.html @@ -1,11 +1,11 @@ -
- -
- -
-
+ + + + + +
@@ -15,7 +15,7 @@
- +
diff --git a/application/common/controller/ManystoreBase.php b/application/common/controller/ManystoreBase.php index 4f26628..393526f 100644 --- a/application/common/controller/ManystoreBase.php +++ b/application/common/controller/ManystoreBase.php @@ -271,6 +271,11 @@ class ManystoreBase extends Controller } + if(!defined('SHOP_AUTH_TYPE_TEXT')) { + define('SHOP_AUTH_TYPE_TEXT', $manystoreShop->type_text ?? "个人认证"); + } + + if(!defined('STORE_ID')) { define('STORE_ID', $this->auth->id); } @@ -329,7 +334,8 @@ class ManystoreBase extends Controller 'referer' => Session::get("referer"), 'shop_id' => $this->auth->shop_id, 'store_id' => $this->auth->id, - 'shop_user_id' => $manystoreShop->user_id ?:0, + 'shop_user_id' => $manystoreShop->user_id ??0, + 'auth_type_text' => $manystoreShop->type_text ?? "个人认证", ]; $config = array_merge($config, Config::get("view_replace_str")); @@ -352,8 +358,8 @@ class ManystoreBase extends Controller $this->assign('shop_id', $this->auth->shop_id); $this->assign('store_id', $this->auth->id); - $this->assign('shop_user_id', $manystoreShop->user_id ?:0 ); - + $this->assign('shop_user_id', $manystoreShop->user_id ??0 ); + $this->assign( 'auth_type_text' , $manystoreShop->type_text ?? "个人认证"); // if(!defined('SHOP_ID')){ // define('SHOP_ID', $this->auth->shop_id); // } diff --git a/application/common/listener/classeshourorder/OrderHook.php b/application/common/listener/classeshourorder/OrderHook.php index d585354..b471cb1 100644 --- a/application/common/listener/classeshourorder/OrderHook.php +++ b/application/common/listener/classeshourorder/OrderHook.php @@ -6,7 +6,7 @@ class OrderHook public function classeshourOrderCreateBefore(&$params) { - + } diff --git a/application/common/model/dyqc/ManystoreShop.php b/application/common/model/dyqc/ManystoreShop.php index 2fc5f47..a3eb1a5 100644 --- a/application/common/model/dyqc/ManystoreShop.php +++ b/application/common/model/dyqc/ManystoreShop.php @@ -34,12 +34,27 @@ class ManystoreShop extends BaseModel // 追加属性 protected $append = [ + 'type_text', 'status_text', 'auth_time_text', 'create_time_text', 'update_time_text' ]; + public function getTypeList() + { + return ['1' => __('Type 1'), '2' => __('Type 2')]; + } + + public function getTypeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); + $list = $this->getTypeList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + // 拼音对象 protected static $pinyin = null; diff --git a/application/manystore/controller/general/Profile.php b/application/manystore/controller/general/Profile.php index 74b1c03..824c33f 100644 --- a/application/manystore/controller/general/Profile.php +++ b/application/manystore/controller/general/Profile.php @@ -26,6 +26,8 @@ class Profile extends ManystoreBase $shopModel = new ManystoreShop(); $shop_info = $shopModel->where(array('id'=>SHOP_ID))->find(); $this->view->assign('statusList',[0=>'待审核',1=>'审核通过',2=>'审核拒绝']); + $this->view->assign('typeList',$shop_info->getTypeList()); + $this->view->assign('shop_info',$shop_info); return $this->view->fetch(); } diff --git a/application/manystore/controller/school/classes/ClassesLib.php b/application/manystore/controller/school/classes/ClassesLib.php index ab6cfe5..f214ba9 100644 --- a/application/manystore/controller/school/classes/ClassesLib.php +++ b/application/manystore/controller/school/classes/ClassesLib.php @@ -23,6 +23,9 @@ use think\exception\ValidateException; class ClassesLib extends ManystoreBase { + protected $qSwitch = true; + protected $qFields = ["teacher_id","user_id","shop_id","manystore_id"]; + /** * ClassesLib模型对象 * @var \app\manystore\model\school\classes\ClassesLib @@ -40,8 +43,9 @@ class ClassesLib extends ManystoreBase public function _initialize() { - parent::_initialize(); $this->model = new \app\manystore\model\school\classes\ClassesLib; + parent::_initialize(); + $this->view->assign("addTypeList", $this->model->getAddTypeList()); $this->view->assign("typeList", $this->model->getTypeList()); $this->view->assign("addressTypeList", $this->model->getAddressTypeList()); diff --git a/application/manystore/controller/school/classes/Verification.php b/application/manystore/controller/school/classes/Verification.php index 33889dd..7997138 100644 --- a/application/manystore/controller/school/classes/Verification.php +++ b/application/manystore/controller/school/classes/Verification.php @@ -3,6 +3,12 @@ namespace app\manystore\controller\school\classes; use app\common\controller\ManystoreBase; +use app\common\model\User; +use app\manystore\model\Manystore; +use think\Db; +use think\Exception; +use think\exception\PDOException; +use think\exception\ValidateException; /** * 机构核销员 @@ -17,12 +23,16 @@ class Verification extends ManystoreBase * @var \app\manystore\model\school\classes\Verification */ protected $model = null; + protected $qSwitch = true; + protected $qFields = ["manystore_id","shop_id"]; public function _initialize() { - parent::_initialize(); $this->model = new \app\manystore\model\school\classes\Verification; + parent::_initialize(); $this->view->assign("statusList", $this->model->getStatusList()); + + } public function import() @@ -73,4 +83,201 @@ class Verification extends ManystoreBase return $this->view->fetch(); } + + + protected function updateCheck($id,$params=[],$row=null){ + + // 课程存在售后订单则不允许操作 + } + + + protected function update_check(&$params,$row=null) + { + + $shop_id = SHOP_ID; + $manystore = Manystore::where("shop_id", $shop_id)->find(); + if (!$manystore) { + $this->error("店铺不存在"); + } + $params["manystore_id"] = $manystore["id"]; + $params["shop_id"] = $shop_id; + $user = User::where("nickname|realname|mobile", $params["user_id"])->find(); + if(!$user) $this->error("未找到用户请先让用户登录小程序再提交表单"); + $params["user_id"] = $user["id"]; + + $user_id = $params["user_id"]; + //修改 + if($row){ + //用户已是其他的教师(搜索) + $teacher_user = $this->model->where("user_id",$user_id)->where("id","<>",$row["id"])->find(); + if($teacher_user){ + $this->error("用户已存在或已是其他授权机构核销员!"); + } + }else{ + //新增 + //用户已是教师(搜索) + $teacher_user = $this->model->where("user_id",$user_id)->find(); + if($teacher_user){ + $this->error("用户已存在或已是其他授权机构核销员!"); + } + } + + + } + + + + /** + * 添加 + * + * @return string + * @throws \think\Exception + */ + public function add() + { + if ($this->request->isPost()) { + $params = $this->request->post("row/a"); + if ($params) { + $params = $this->preExcludeFields($params); + + if($this->storeIdFieldAutoFill && STORE_ID ){ + $params['store_id'] = STORE_ID; + } + + if($this->shopIdAutoCondition && SHOP_ID){ + $params['shop_id'] = SHOP_ID; + } + + $result = false; + Db::startTrans(); + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; + $this->model->validateFailException(true)->validate($validate); + } + $this->update_check($params,$row=null); + $result = $this->model->allowField(true)->save($params); + Db::commit(); + } catch (ValidateException $e) { + Db::rollback(); + $this->error($e->getMessage()); + } catch (PDOException $e) { + Db::rollback(); + $this->error($e->getMessage()); + } catch (Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if ($result !== false) { + $this->success(); + } else { + $this->error(__('No rows were inserted')); + } + } + $this->error(__('Parameter %s can not be empty', '')); + } + return $this->view->fetch(); + } + + /** + * 编辑 + */ + public function edit($ids = null) + { + if($this->shopIdAutoCondition){ + $this->model->where(array('shop_id'=>SHOP_ID)); + } + $row = $this->model->where(array('id'=>$ids))->find(); + if (!$row) { + $this->error(__('No Results were found')); + } + + if ($this->request->isPost()) { + $params = $this->request->post("row/a"); + if ($params) { + $params = $this->preExcludeFields($params); + $result = false; + Db::startTrans(); + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate; + $row->validateFailException(true)->validate($validate); + } + $this->update_check($params,$row); + + + $result = $row->allowField(true)->save($params); + Db::commit(); + } catch (ValidateException $e) { + Db::rollback(); + $this->error($e->getMessage()); + } catch (PDOException $e) { + Db::rollback(); + $this->error($e->getMessage()); + } catch (Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if ($result !== false) { + $this->success(); + } else { + $this->error(__('No rows were updated')); + } + } + $this->error(__('Parameter %s can not be empty', '')); + } + + + $user = User::where("id", $row["user_id"])->find(); +// if(!$user) $this->error("未找到用户请先让用户登录小程序再提交表单"); + $row["user_id"] = $user["mobile"]?? ""; //nickname|realname|mobile + $this->view->assign("row", $row); + return $this->view->fetch(); + } + + /** + * 删除 + */ + public function del($ids = "") + { + if (!$this->request->isPost()) { + $this->error(__("Invalid parameters")); + } + $ids = $ids ? $ids : $this->request->post("ids"); + if ($ids) { + $pk = $this->model->getPk(); + if($this->shopIdAutoCondition){ + $this->model->where(array('shop_id'=>SHOP_ID)); + } + $list = $this->model->where($pk, 'in', $ids)->select(); + foreach ($list as $item) { + $this->updateCheck($item->id); + } + $count = 0; + Db::startTrans(); + try { + foreach ($list as $k => $v) { + $count += $v->delete(); + } + Db::commit(); + } catch (PDOException $e) { + Db::rollback(); + $this->error($e->getMessage()); + } catch (Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if ($count) { + $this->success(); + } else { + $this->error(__('No rows were deleted')); + } + } + $this->error(__('Parameter %s can not be empty', 'ids')); + } + } diff --git a/application/manystore/lang/zh-cn.php b/application/manystore/lang/zh-cn.php index 0bc9de4..3e60b07 100644 --- a/application/manystore/lang/zh-cn.php +++ b/application/manystore/lang/zh-cn.php @@ -180,4 +180,7 @@ return [ 'Admin log tips' => '管理员可以查看自己所拥有的权限的管理员日志', 'Group tips' => '角色组可以有多个,角色有上下级层级关系,如果子角色有角色组和管理员的权限则可以派生属于自己组别的下级角色组或管理员', 'Rule tips' => '规则通常对应一个控制器的方法,同时左侧的菜单栏数据也从规则中体现,通常建议通过命令行进行生成规则节点', -]; + + 'Type 1' => '个人认证', + 'Type 2' => '机构认证', + ]; diff --git a/application/manystore/lang/zh-cn/general/profile.php b/application/manystore/lang/zh-cn/general/profile.php index 3ba4a2a..c32b746 100644 --- a/application/manystore/lang/zh-cn/general/profile.php +++ b/application/manystore/lang/zh-cn/general/profile.php @@ -8,23 +8,36 @@ return [ 'Please input correct nickname' => '昵称仅支持输入中文、英文字母(大小写)、数字、下划线', 'Please input length nickname' => '昵称请最多填写10个字符', + 'Front_idcard_image' => '身份证正面', + 'Reverse_idcard_image' => '身份证反面', + 'Auth_time' => '审核时间', + 'Admin_id' => '审核管理员id', + 'Type' => '认证类型', + 'Type 1' => '个人认证', + 'Type 2' => '机构认证', + 'Desc' => '申请备注', + 'user_id' => '申请用户', + 'User.nickname' => '昵称', + 'User.mobile' => '手机号', + 'User.avatar' => '头像', - 'Logo' => '商家Logo', - 'Name' => '店铺名称', - 'Image' => '店铺封面图', - 'Images' => '店铺环境图片', + 'Logo' => 'Logo', + 'Name' => '申请人姓名|机构名称', + 'Image' => '封面图', + 'Images' => '环境图片', 'Address_city' => '城市选择', 'Province' => '省编号', 'City' => '市编号', 'District' => '县区编号', - 'Address' => '店铺地址', - 'Address_detail' => '店铺详细地址', + 'Address' => '地址', + 'Address_detail' => '详细地址', 'Longitude' => '经度', 'Latitude' => '纬度', - 'Yyzzdm' => '营业执照', - 'Yyzz_images' => '营业执照照片', + 'Yyzzdm' => '营业执照(个人认证不需要)', + 'Yyzz_images' => '营业执照照片(个人认证不需要)', + 'hidden' => '禁用', 'Tel' => '服务电话', - 'Content' => '店铺详情', + 'Content' => '详情', 'Status' => '审核状态', 'Status 0' => '待审核', 'Status 1' => '审核通过', diff --git a/application/manystore/library/Auth.php b/application/manystore/library/Auth.php index 3846169..e4a97a5 100644 --- a/application/manystore/library/Auth.php +++ b/application/manystore/library/Auth.php @@ -2,6 +2,7 @@ namespace app\manystore\library; +use app\common\model\User; use app\manystore\model\Manystore; use fast\Random; use fast\Tree; @@ -28,6 +29,44 @@ class Auth extends ManystoreAuth return Session::get('manystore.' . $name); } + + + + /** + * 免密登录 + * + * @param string $id 账号id + * @param int $keeptime 有效时长 + * @return boolean + */ + public function freelogin($id, $keeptime = 0) + { + $manystore = Manystore::where("id",$id)->find(); + if (!$manystore) { + $this->setError('Username is incorrect'); + return false; + } + if ($manystore['status'] == 'hidden') { + $this->setError('Admin is forbidden'); + return false; + } + if (Config::get('fastadmin.login_failure_retry') && $manystore->loginfailure >= 10 && time() - $manystore->updatetime < 86400) { + $this->setError('Please try again after 1 day'); + return false; + } + $manystore->loginfailure = 0; + $manystore->logintime = time(); + $manystore->loginip = request()->ip(); + $manystore->token = Random::uuid(); + $manystore->save(); + Session::set("manystore", $manystore->toArray()); + $this->keeplogin($keeptime); + return true; + } + + + + /** * 管理员登录 * @@ -39,6 +78,14 @@ class Auth extends ManystoreAuth public function login($username, $password, $keeptime = 0) { $manystore = Manystore::get(['username' => $username]); + + if (!$manystore) { + $user = User::where("mobile",$username)->find(); + if($user){ + $manystore = Manystore::get(['user_id' => $user["id"]]); + } + } + if (!$manystore) { $this->setError('Username is incorrect'); return false; diff --git a/application/manystore/model/school/classes/Verification.php b/application/manystore/model/school/classes/Verification.php index 7e36c1a..a1280ec 100644 --- a/application/manystore/model/school/classes/Verification.php +++ b/application/manystore/model/school/classes/Verification.php @@ -25,11 +25,23 @@ class Verification extends Model // 追加属性 protected $append = [ - 'status_text' + 'status_text', + 'classes_title' ]; - - + + public function getClassesTitleAttr($value, $data) + { + $classes_lib_ids = (isset($data['classes_lib_ids']) ? $data['classes_lib_ids'] : ''); + if(!$classes_lib_ids) return ''; + //$classes_cate_ids 查询分类表 names 已逗号拼接返回 + $classes_cate_title = ClassesLib::where('id','in',$classes_lib_ids)->column('title'); + return implode(',',$classes_cate_title); + } + + + + public function getStatusList() { return ['1' => __('Status 1'), '2' => __('Status 2')]; diff --git a/application/manystore/view/common/header.html b/application/manystore/view/common/header.html index 1a97897..4d61d5f 100644 --- a/application/manystore/view/common/header.html +++ b/application/manystore/view/common/header.html @@ -3,7 +3,7 @@ {$site.name|mb_substr=0,4,'utf-8'|mb_strtoupper='utf-8'|htmlentities} - 多样青春机构管理 + 多样青春用户后台管理 @@ -59,7 +59,9 @@
+ + +
+ +
+
+ +
+ + +
+ +
+
    +
    +
    + + + + +
    + +
    +
    + +
    + + +
    + +
    +
      +
      +
      + + +
      @@ -269,13 +369,7 @@ cols="50">{$shop_info.content}
      -
      - -
      - -
      -
      +
      diff --git a/application/manystore/view/school/classes/classes_lib/index.html b/application/manystore/view/school/classes/classes_lib/index.html index 01a15a2..3b07afe 100644 --- a/application/manystore/view/school/classes/classes_lib/index.html +++ b/application/manystore/view/school/classes/classes_lib/index.html @@ -15,6 +15,16 @@
      + +
      + 温馨提示
      + 如果您无法设置价格,说明您是个人认证用户(如果您已是机构认证则无限制)
      + 个人认证用户只能开设基于公益性质的免费课程
      + 机构认证身份可设置付费课程 +
      + + +
      {:__('Add')} diff --git a/application/manystore/view/school/classes/verification/add.html b/application/manystore/view/school/classes/verification/add.html index 590a5da..09882e6 100644 --- a/application/manystore/view/school/classes/verification/add.html +++ b/application/manystore/view/school/classes/verification/add.html @@ -1,21 +1,22 @@ -
      - -
      - -
      -
      + + + + + +
      - + + (请先让对方登录小程序,之后输入小程序端用户:手机号,昵称 或 姓名 )
      - +
      diff --git a/application/manystore/view/school/classes/verification/edit.html b/application/manystore/view/school/classes/verification/edit.html index 84fab95..96ace03 100644 --- a/application/manystore/view/school/classes/verification/edit.html +++ b/application/manystore/view/school/classes/verification/edit.html @@ -1,21 +1,22 @@ -
      - -
      - -
      -
      + + + + + +
      - + + (请先让对方登录小程序,之后输入小程序端用户:手机号,昵称 或 姓名 )
      - +
      diff --git a/public/assets/js/backend/manystore/index.js b/public/assets/js/backend/manystore/index.js index d93bb29..cdffda4 100644 --- a/public/assets/js/backend/manystore/index.js +++ b/public/assets/js/backend/manystore/index.js @@ -9,6 +9,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin add_url: 'manystore/index/add', edit_url: 'manystore/index/edit', del_url: 'manystore/index/del', + free_url: 'manystore/index/free', multi_url: 'manystore/index/multi', } }); @@ -24,8 +25,115 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin columns: [ [ {checkbox: true}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - , + {field: 'operate', title: __('Operate'),width:700, table: table , buttons: [ + {name: 'free', + text: '免登录进入机构后台', + icon: 'fa fa-sign-in', + classname: 'btn btn-xs btn-warning btn-magic btn-ajax', + url: $.fn.bootstrapTable.defaults.extend.free_url, + confirm: '确认免登录进入机构后台?如果已登录其他机构,对方账号将被强制退出。', + success: function (data, ret) { + Layer.alert(ret.msg ); + $(".btn-refresh").trigger("click"); + //js获取当前域名 + + + window.open("https://"+window.location.host + "/manystore", '_blank'); + }, + error: function (data, ret) { + Layer.alert(ret.msg); + return false; + }, + visible: function (row) { + //显示条件 只能待入住订单 + // if((row.status == 2 || row.status == 3) && row.mock_type == "base" && row.add_mock_status == "1" ){ + return true; + // } + // return false; + }}, + { + name: 'classes_spec', + text: __('机构课程'), + title: __('机构课程'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: classes_spec_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + + { + name: 'teacher', + text: __('主讲老师信息'), + title: __('主讲老师信息'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: teacher_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + { + name: 'verification', + text: __('核销员信息'), + title: __('核销员信息'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: verification_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + { + name: 'virtual_user', + text: __('机构虚拟参与者'), + title: __('机构虚拟参与者'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: virtual_user_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + + // + // {name: 'unsetmockauth', + // text: '取消加圈资格', + // icon: 'fa fa-sign-in', + // classname: 'btn btn-xs btn-danger btn-magic btn-ajax', + // url: $.fn.bootstrapTable.defaults.extend.unsetmockauth_url, + // confirm: '(分车版本)确认取消用户加圈资格!', + // success: function (data, ret) { + // Layer.alert(ret.msg ); + // $(".btn-refresh").trigger("click"); + // }, + // error: function (data, ret) { + // Layer.alert(ret.msg); + // return false; + // }, + // visible: function (row) { + // //显示条件 只能待入住订单 + // if((row.status == 2 || row.status == 3) && row.mock_type == "base" && row.add_mock_status == "2"){ + // return true; + // } + // return false; + // }}, + + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + {field: 'id', title: 'ID'}, {field: 'username', title: __('Username')}, @@ -108,5 +216,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin Form.api.bindevent($("form[role=form]")); } }; + + + var classes_spec_url = function (row,dom) { + return 'school/classes/classes_lib/index?shop_id='+row.shop_id; + } + + var virtual_user_url = function (row,dom) { + return 'school/classes/virtual_user/index?shop_id='+row.shop_id; + } + var teacher_url = function (row,dom) { + return 'school/classes/teacher/index?shop_id='+row.shop_id; + } + + + var verification_url = function (row,dom) { + return 'school/classes/verification/index?shop_id='+row.shop_id; + } return Controller; }); diff --git a/public/assets/js/backend/school/classes/classes_lib.js b/public/assets/js/backend/school/classes/classes_lib.js index cd8da3c..d77023c 100644 --- a/public/assets/js/backend/school/classes/classes_lib.js +++ b/public/assets/js/backend/school/classes/classes_lib.js @@ -6,8 +6,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin Table.api.init({ extend: { index_url: 'school/classes/classes_lib/index' + location.search, - add_url: 'school/classes/classes_lib/add', - edit_url: 'school/classes/classes_lib/edit', + add_url: 'school/classes/classes_lib/add'+ location.search, + edit_url: 'school/classes/classes_lib/edit'+ location.search, del_url: 'school/classes/classes_lib/del', multi_url: 'school/classes/classes_lib/multi', import_url: 'school/classes/classes_lib/import', @@ -97,6 +97,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, {field: 'id', title: __('Id')}, + {field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status}, + + {field: 'feel', title: __('是否免费'), searchList: {"0":__('付费课程'),"1":__('免费课程')}, formatter: Table.api.formatter.normal}, {field: 'classes_cate_title', title: __('Classes_cate_ids'), operate: false, formatter: Table.api.formatter.flag}, @@ -109,7 +112,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'headimage', title: __('Headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, - {field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status}, {field: 'reason', title: __('Reason'), operate: 'LIKE' }, {field: 'auth_time', title: __('Auth_time'), operate:'RANGE',visible:false, addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, diff --git a/public/assets/js/backend/school/classes/verification.js b/public/assets/js/backend/school/classes/verification.js index 5228a72..bd0d678 100644 --- a/public/assets/js/backend/school/classes/verification.js +++ b/public/assets/js/backend/school/classes/verification.js @@ -6,8 +6,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin Table.api.init({ extend: { index_url: 'school/classes/verification/index' + location.search, - add_url: 'school/classes/verification/add', - edit_url: 'school/classes/verification/edit', + add_url: 'school/classes/verification/add'+ location.search, + edit_url: 'school/classes/verification/edit'+ location.search, del_url: 'school/classes/verification/del', multi_url: 'school/classes/verification/multi', import_url: 'school/classes/verification/import', @@ -29,7 +29,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'manystore_id', title: __('Manystore_id')}, {field: 'shop_id', title: __('Shop_id')}, {field: 'user_id', title: __('User_id')}, - {field: 'classes_lib_ids', title: __('Classes_lib_ids'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + + {field: 'classes_title', title: __('Classes_lib_ids'), operate: false, formatter: Table.api.formatter.flag}, + + {field: 'classes_lib_ids', title: __('Classes_lib_ids'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + + {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, @@ -63,6 +68,17 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin }, api: { bindevent: function () { + + //老师必须是上面机构中的 + $("#c-classes_lib_ids").data("params", function (obj) { + //obj为SelectPage对象 + return {custom: {shop_id: $("#c-shop_id").val()}}; + }); + //机构清除老师也要清除 + $("#c-shop_id").change(function () { + $("#c-classes_lib_ids").selectPageClear(); + }); + Form.api.bindevent($("form[role=form]")); } } diff --git a/public/assets/js/manystore/school/classes/classes_lib.js b/public/assets/js/manystore/school/classes/classes_lib.js index e75722f..ff386df 100644 --- a/public/assets/js/manystore/school/classes/classes_lib.js +++ b/public/assets/js/manystore/school/classes/classes_lib.js @@ -6,8 +6,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin Table.api.init({ extend: { index_url: 'school/classes/classes_lib/index' + location.search, - add_url: 'school/classes/classes_lib/add', - edit_url: 'school/classes/classes_lib/edit', + add_url: 'school/classes/classes_lib/add'+ location.search, + edit_url: 'school/classes/classes_lib/edit'+ location.search, del_url: 'school/classes/classes_lib/del', multi_url: 'school/classes/classes_lib/multi', import_url: 'school/classes/classes_lib/import', @@ -95,6 +95,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, {field: 'id', title: __('Id')}, + {field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status}, + {field: 'feel', title: __('是否免费'), searchList: {"0":__('付费课程'),"1":__('免费课程')}, formatter: Table.api.formatter.normal}, @@ -109,7 +111,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'headimage', title: __('Headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, - {field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status}, {field: 'reason', title: __('Reason'), operate: 'LIKE' }, {field: 'auth_time', title: __('Auth_time'), operate:'RANGE',visible:false, addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, diff --git a/public/assets/js/manystore/school/classes/verification.js b/public/assets/js/manystore/school/classes/verification.js index 438d92b..cf55475 100644 --- a/public/assets/js/manystore/school/classes/verification.js +++ b/public/assets/js/manystore/school/classes/verification.js @@ -6,8 +6,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin Table.api.init({ extend: { index_url: 'school/classes/verification/index' + location.search, - add_url: 'school/classes/verification/add', - edit_url: 'school/classes/verification/edit', + add_url: 'school/classes/verification/add'+ location.search, + edit_url: 'school/classes/verification/edit'+ location.search, del_url: 'school/classes/verification/del', multi_url: 'school/classes/verification/multi', import_url: 'school/classes/verification/import', @@ -26,27 +26,34 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'manystore_id', title: __('Manystore_id')}, - {field: 'shop_id', title: __('Shop_id')}, - {field: 'user_id', title: __('User_id')}, - {field: 'classes_lib_ids', title: __('Classes_lib_ids'), operate: 'LIKE'}, + {field: 'manystore_id', title: __('Manystore_id'),visible:false}, + {field: 'shop_id', title: __('Shop_id'),visible:false}, + {field: 'user_id', title: __('User_id'),visible:false}, + {field: 'classes_title', title: __('Classes_lib_ids'), operate: false, formatter: Table.api.formatter.flag}, + + {field: 'classes_lib_ids', title: __('Classes_lib_ids'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + + {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, + {field: 'user.realname', title: __('User.realname'), operate: 'LIKE'}, + {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, + + + + {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, {field: 'createtime', title: __('Createtime')}, {field: 'updatetime', title: __('Updatetime')}, - {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, - {field: 'manystore.avatar', title: __('Manystore.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'}, - {field: 'manystoreshop.image', title: __('Manystoreshop.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'manystoreshop.address_city', title: __('Manystoreshop.address_city'), operate: 'LIKE'}, - {field: 'manystoreshop.province', title: __('Manystoreshop.province')}, - {field: 'manystoreshop.city', title: __('Manystoreshop.city')}, - {field: 'manystoreshop.district', title: __('Manystoreshop.district')}, - {field: 'manystoreshop.address', title: __('Manystoreshop.address'), operate: 'LIKE'}, - {field: 'manystoreshop.address_detail', title: __('Manystoreshop.address_detail'), operate: 'LIKE'}, - {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, - {field: 'user.realname', title: __('User.realname'), operate: 'LIKE'}, - {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, - {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + // {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, + // {field: 'manystore.avatar', title: __('Manystore.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + // {field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'}, + // {field: 'manystoreshop.image', title: __('Manystoreshop.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + // {field: 'manystoreshop.address_city', title: __('Manystoreshop.address_city'), operate: 'LIKE'}, + // {field: 'manystoreshop.province', title: __('Manystoreshop.province')}, + // {field: 'manystoreshop.city', title: __('Manystoreshop.city')}, + // {field: 'manystoreshop.district', title: __('Manystoreshop.district')}, + // {field: 'manystoreshop.address', title: __('Manystoreshop.address'), operate: 'LIKE'}, + // {field: 'manystoreshop.address_detail', title: __('Manystoreshop.address_detail'), operate: 'LIKE'}, {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] @@ -63,6 +70,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin }, api: { bindevent: function () { + //老师必须是上面机构中的 + $("#c-classes_lib_ids").data("params", function (obj) { + //obj为SelectPage对象 + return {custom: {shop_id: Config.shop_id}}; + }); + + Form.api.bindevent($("form[role=form]")); } }