diff --git a/application/admin/controller/manystore/Index.php b/application/admin/controller/manystore/Index.php index ee985dd..ef5af57 100644 --- a/application/admin/controller/manystore/Index.php +++ b/application/admin/controller/manystore/Index.php @@ -8,8 +8,11 @@ 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\Evaluate; use app\common\model\school\classes\Order; +use app\common\model\school\classes\order\OrderDetail; +use app\common\model\school\classes\order\ServiceOrder; use app\manystore\model\Manystore; use app\manystore\model\ManystoreLog; use app\manystore\model\ManystoreShop; @@ -305,16 +308,16 @@ class Index extends Backend //有课程不允许删 $classesLib = ClassesLib::where("manystore_id",$id)->find(); if($classesLib)throw new \Exception("请先删除课程后再删除机构!"); - //有老师不允许删 - $teacher = Teacher::where("manystore_id",$id)->find(); - if($teacher)throw new \Exception("请先删除老师后再删除机构!"); - //有核销员不允许删 - $verification = Verification::where("manystore_id",$id)->find(); - if($verification)throw new \Exception("请先删除核销员后再删除机构!"); - $shop_id = Manystore::where("id",$id)->value("shop_id"); - //有授权用户不允许删 - $auth = \app\common\model\manystore\UserAuth::where("shop_id",$shop_id)->find(); - if($auth)throw new \Exception("请先删除授权用户后再删除机构!"); +// //有老师不允许删 +// $teacher = Teacher::where("manystore_id",$id)->find(); +// if($teacher)throw new \Exception("请先删除老师后再删除机构!"); +// //有核销员不允许删 +// $verification = Verification::where("manystore_id",$id)->find(); +// if($verification)throw new \Exception("请先删除核销员后再删除机构!"); +// $shop_id = Manystore::where("id",$id)->value("shop_id"); +// //有授权用户不允许删 +// $auth = \app\common\model\manystore\UserAuth::where("shop_id",$shop_id)->find(); +// if($auth)throw new \Exception("请先删除授权用户后再删除机构!"); } @@ -622,6 +625,22 @@ class Index extends Backend exception('账号信息删除失败'); } $result = $this->shopModel->where(array('id'=>$row['shop_id']))->delete(); + \app\common\model\manystore\UserAuth::where(array('shop_id'=>$row['shop_id']))->delete(); + \app\common\model\school\classes\Teacher::where(array('shop_id'=>$row['shop_id']))->delete(); + \app\common\model\school\classes\Verification::where(array('shop_id'=>$row['shop_id']))->delete(); + Order::where(array('shop_id'=>$row['shop_id']))->delete(); + OrderDetail::where(array('shop_id'=>$row['shop_id']))->delete(); + \app\admin\model\school\classes\hour\Order::where(array('shop_id'=>$row['shop_id']))->delete(); + ServiceOrder::where(array('shop_id'=>$row['shop_id']))->delete(); + $classesLibs = \app\common\model\school\classes\ClassesLib::where(array('shop_id'=>$row['shop_id']))->select(); + foreach( $classesLibs as $lib){ + $specs = $lib->specs; + foreach ($specs as $spec){ + $spec->delete(); + } + $lib->delete(); + } + Evaluate::where(array('shop_id'=>$row['shop_id']))->delete(); if(!$result){ exception('商家信息删除失败'); } diff --git a/application/admin/controller/school/classes/ClassesLib.php b/application/admin/controller/school/classes/ClassesLib.php index 7461776..027f465 100644 --- a/application/admin/controller/school/classes/ClassesLib.php +++ b/application/admin/controller/school/classes/ClassesLib.php @@ -2,11 +2,13 @@ namespace app\admin\controller\school\classes; +use app\admin\model\Admin; use app\admin\model\dyqc\ManystoreShop; use app\common\controller\Backend; use app\common\model\school\classes\lib\Spec; use app\common\model\school\classes\Order; use app\manystore\model\Manystore; +use fast\Tree; use think\Db; use think\db\exception\DataNotFoundException; use think\db\exception\ModelNotFoundException; @@ -14,6 +16,8 @@ use think\Exception; use think\exception\DbException; use think\exception\PDOException; use think\exception\ValidateException; +use think\Loader; +use think\Model; /** * 机构课程库 @@ -247,6 +251,10 @@ class ClassesLib extends Backend protected function update_check(&$params,$row=null) { + if($row){ + if(empty($params["shop_id"]))$params["shop_id"] = $row["shop_id"]; + if(empty($params["teacher_id"]))$params["teacher_id"] = $row["teacher_id"]; + } // try { $classesLib = new \app\common\model\school\classes\ClassesLib(); @@ -374,7 +382,7 @@ class ClassesLib extends Backend * @return string * @throws \think\Exception */ - public function addnew() + public function addnew($row=null) { if (false === $this->request->isPost()) { return $this->view->fetch(); @@ -388,6 +396,14 @@ class ClassesLib extends Backend if ($this->dataLimit && $this->dataLimitFieldAutoFill) { $params[$this->dataLimitField] = $this->auth->id; } + unset($params["id"]); + if($row){ + //如果走的复制 + if(empty($params["shop_id"]))$params["shop_id"] = $row["shop_id"]; + if(empty($params["teacher_id"]))$params["teacher_id"] = $row["teacher_id"]; + } + + $result = false; Db::startTrans(); try { @@ -406,7 +422,8 @@ class ClassesLib extends Backend //添加课程规格 foreach ($spec as $k=>$v){ $v["classes_lib_id"] = $this->model["id"]; - \app\common\model\school\classes\ClassesSpec::create($v); + unset($v["id"]); + (new \app\common\model\school\classes\ClassesSpec)->allowField(true)->save($v); } //因为是批量添加,所有规格重新进行检测,防止出现时间重叠 @@ -622,4 +639,431 @@ class ClassesLib extends Backend } + + + + /** + * 复制课程 + * + * @param $ids + * @return string + * @throws DbException + * @throws \think\Exception + */ + public function copy($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()) { + $spec = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row["id"])->field("id,classes_lib_id,name,start_time,end_time,limit_num,status,weigh")->order('weigh desc,id desc')->select(); + foreach ($spec as $k=>&$v){ + $v["time"] = date("Y/m/d H:i",$v["start_time"])." - ".date("Y/m/d H:i",$v["end_time"]); + } + $row["spec"] = json_encode($spec); + $this->view->assign('row', $row); + return $this->view->fetch(); + } + + $this->addnew($row); + } + + + + + + /** + * Selectpage的实现方法 + * + * 当前方法只是一个比较通用的搜索匹配,请按需重载此方法来编写自己的搜索逻辑,$where按自己的需求写即可 + * 这里示例了所有的参数,所以比较复杂,实现上自己实现只需简单的几行即可 + * + */ + protected function selectpage() + { + //设置过滤方法 + $this->request->filter(['trim', 'strip_tags', 'htmlspecialchars']); + + //搜索关键词,客户端输入以空格分开,这里接收为数组 + $word = (array)$this->request->request("q_word/a"); + //当前页 + $page = $this->request->request("pageNumber"); + //分页大小 + $pagesize = $this->request->request("pageSize"); + //搜索条件 + $andor = $this->request->request("andOr", "and", "strtoupper"); + //排序方式 + $orderby = (array)$this->request->request("orderBy/a"); + //显示的字段 + $field = $this->request->request("showField"); + //主键 + $primarykey = $this->request->request("keyField"); + //主键值 + $primaryvalue = $this->request->request("keyValue"); + //搜索字段 + $searchfield = (array)$this->request->request("searchField/a"); + //自定义搜索条件 + $custom = (array)$this->request->request("custom/a"); + //是否返回树形结构 + $istree = $this->request->request("isTree", 0); + $ishtml = $this->request->request("isHtml", 0); + if ($istree) { + $word = []; + $pagesize = 999999; + } + $order = []; + foreach ($orderby as $k => $v) { + $order[$v[0]] = $v[1]; + } + $field = $field ? $field : 'name'; + + //如果有primaryvalue,说明当前是初始化传值 + if ($primaryvalue !== null) { + $where = [$primarykey => ['in', $primaryvalue]]; + $pagesize = 999999; + } else { + $where = function ($query) use ($word, $andor, $field, $searchfield, $custom) { + $logic = $andor == 'AND' ? '&' : '|'; + $searchfield = is_array($searchfield) ? implode($logic, $searchfield) : $searchfield; + $searchfield = str_replace(',', $logic, $searchfield); + $word = array_filter(array_unique($word)); + if (count($word) == 1) { + $query->where($searchfield, "like", "%" . reset($word) . "%"); + } else { + $query->where(function ($query) use ($word, $searchfield) { + foreach ($word as $index => $item) { + $query->whereOr(function ($query) use ($item, $searchfield) { + $query->where($searchfield, "like", "%{$item}%"); + }); + } + }); + } + if ($custom && is_array($custom)) { + foreach ($custom as $k => $v) { + if (is_array($v) && 2 == count($v)) { + $query->where($k, trim($v[0]), $v[1]); + } else { + $query->where($k, '=', $v); + } + } + } + }; + } + $adminIds = $this->getDataLimitAdminIds(); + if (is_array($adminIds)) { + $this->model->where($this->dataLimitField, 'in', $adminIds); + } + if($this->shopIdAutoCondition){ + + //判断省市区编码是否在授权列表内 + ["provinces" =>$provinces,"citys"=> $citys, "districts"=>$districts,"address_citys"=>$address_citys] = Admin::getHaveCity($this->auth->id); + + if(is_array($provinces)){ + $this->model->where('province',"in",$provinces); + } + if(is_array($citys)){ + $this->model->where('city',"in",$citys); + } + if(is_array($districts)){ + $this->model->where('district',"in",$districts); + } + + } + + $list = []; + $total = $this->model->where($where)->count(); + if ($total > 0) { + if($this->shopIdAutoCondition){ + //判断省市区编码是否在授权列表内 + ["provinces" =>$provinces,"citys"=> $citys, "districts"=>$districts,"address_citys"=>$address_citys] = Admin::getHaveCity($this->auth->id); + + if(is_array($provinces)){ + $this->model->where('province',"in",$provinces); + } + if(is_array($citys)){ + $this->model->where('city',"in",$citys); + } + if(is_array($districts)){ + $this->model->where('district',"in",$districts); + } + } + + if (is_array($adminIds)) { + $this->model->where($this->dataLimitField, 'in', $adminIds); + } + + $fields = is_array($this->selectpageFields) ? $this->selectpageFields : ($this->selectpageFields && $this->selectpageFields != '*' ? explode(',', $this->selectpageFields) : []); + + //如果有primaryvalue,说明当前是初始化传值,按照选择顺序排序 + if ($primaryvalue !== null && preg_match("/^[a-z0-9_\-]+$/i", $primarykey)) { + $primaryvalue = array_unique(is_array($primaryvalue) ? $primaryvalue : explode(',', $primaryvalue)); + //修复自定义data-primary-key为字符串内容时,给排序字段添加上引号 + $primaryvalue = array_map(function ($value) { + return '\'' . $value . '\''; + }, $primaryvalue); + + $primaryvalue = implode(',', $primaryvalue); + + $this->model->orderRaw("FIELD(`{$primarykey}`, {$primaryvalue})"); + } else { + $this->model->order($order); + } + + $datalist = $this->model->where($where) + ->page($page, $pagesize) + ->select(); + + foreach ($datalist as $index => $item) { + unset($item['password'], $item['salt']); + if ($this->selectpageFields == '*') { + $result = [ + $primarykey => $item[$primarykey] ?? '', + $field => $item[$field] ?? '', + ]; + } else { + $result = array_intersect_key(($item instanceof Model ? $item->toArray() : (array)$item), array_flip($fields)); + } + $result['pid'] = isset($item['pid']) ? $item['pid'] : (isset($item['parent_id']) ? $item['parent_id'] : 0); + $list[] = $result; + } + if ($istree && !$primaryvalue) { + $tree = Tree::instance(); + $tree->init(collection($list)->toArray(), 'pid'); + $list = $tree->getTreeList($tree->getTreeArray(0), $field); + if (!$ishtml) { + foreach ($list as &$item) { + $item = str_replace(' ', ' ', $item); + } + unset($item); + } + } + } + //这里一定要返回有list这个字段,total是可选的,如果total<=list的数量,则会隐藏分页按钮 + return json(['list' => $list, 'total' => $total]); + } + + + + /** + * 生成查询所需要的条件,排序方式 + * @param mixed $searchfields 快速查询的字段 + * @param boolean $relationSearch 是否关联查询 + * @return array + */ + protected function buildparams($searchfields = null, $relationSearch = null,$excludefields = []) + { + $searchfields = is_null($searchfields) ? $this->searchFields : $searchfields; + $relationSearch = is_null($relationSearch) ? $this->relationSearch : $relationSearch; + $search = $this->request->get("search", ''); + $filter = $this->request->get("filter", ''); + $op = $this->request->get("op", '', 'trim'); + $sort = $this->request->get("sort", !empty($this->model) && $this->model->getPk() ? $this->model->getPk() : 'id'); + $order = $this->request->get("order", "DESC"); + $offset = max(0, $this->request->get("offset/d", 0)); + $limit = max(0, $this->request->get("limit/d", 0)); + $limit = $limit ?: 999999; + //新增自动计算页码 + $page = $limit ? intval($offset / $limit) + 1 : 1; + if ($this->request->has("page")) { + $page = max(0, $this->request->get("page/d", 1)); + } + $this->request->get([config('paginate.var_page') => $page]); + $filter = (array)json_decode($filter, true); + $op = (array)json_decode($op, true); + $filter = $filter ? $filter : []; + $where = []; + $excludearray = []; + $alias = []; + $bind = []; + $name = ''; + $aliasName = ''; + if (!empty($this->model) && $relationSearch) { + $name = $this->model->getTable(); + $alias[$name] = Loader::parseName(basename(str_replace('\\', '/', get_class($this->model)))); + $aliasName = $alias[$name] . '.'; + } + $sortArr = explode(',', $sort); + foreach ($sortArr as $index => & $item) { + $item = stripos($item, ".") === false ? $aliasName . trim($item) : $item; + } + unset($item); + $sort = implode(',', $sortArr); + + if($this->shopIdAutoCondition){ + //判断省市区编码是否在授权列表内 + ["provinces" =>$provinces,"citys"=> $citys, "districts"=>$districts,"address_citys"=>$address_citys] = Admin::getHaveCity($this->auth->id); + + if(is_array($provinces)){ + $where[] = [$aliasName.'province','in',$provinces]; + } + if(is_array($citys)){ + $where[] = [$aliasName.'city','in',$citys]; + } + if(is_array($districts)){ + $where[] = [$aliasName.'district','in',$districts]; + } + } + + + $adminIds = $this->getDataLimitAdminIds(); + if (is_array($adminIds)) { + $where[] = [$aliasName . $this->dataLimitField, 'in', $adminIds]; + } + if ($search) { + $searcharr = is_array($searchfields) ? $searchfields : explode(',', $searchfields); + foreach ($searcharr as $k => &$v) { + $v = stripos($v, ".") === false ? $aliasName . $v : $v; + } + unset($v); + $where[] = [implode("|", $searcharr), "LIKE", "%{$search}%"]; + } + $index = 0; + foreach ($filter as $k => $v) { + if (!preg_match('/^[a-zA-Z0-9_\-\.]+$/', $k)) { + continue; + } + $sym = $op[$k] ?? '='; + //忽略的查询条件出现在忽略数组中 2022年9月6日18:55:17 + if(in_array($k, $excludefields)){ + $excludearray[$k]['value'] = $v; + $excludearray[$k]['op'] = $sym; + + if (stripos($k, ".") === false) { + $excludearray[$k]['alias'] = $aliasName; + } + unset($filter[$k]); + unset($op[$k]); + continue; + } + + if (stripos($k, ".") === false) { + $k = $aliasName . $k; + } + $v = !is_array($v) ? trim($v) : $v; + $sym = strtoupper($op[$k] ?? $sym); + //null和空字符串特殊处理 + if (!is_array($v)) { + if (in_array(strtoupper($v), ['NULL', 'NOT NULL'])) { + $sym = strtoupper($v); + } + if (in_array($v, ['""', "''"])) { + $v = ''; + $sym = '='; + } + } + + switch ($sym) { + case '=': + case '<>': + $where[] = [$k, $sym, (string)$v]; + break; + case 'LIKE': + case 'NOT LIKE': + case 'LIKE %...%': + case 'NOT LIKE %...%': + $where[] = [$k, trim(str_replace('%...%', '', $sym)), "%{$v}%"]; + break; + case '>': + case '>=': + case '<': + case '<=': + $where[] = [$k, $sym, intval($v)]; + break; + case 'FINDIN': + case 'FINDINSET': + case 'FIND_IN_SET': + $v = is_array($v) ? $v : explode(',', str_replace(' ', ',', $v)); + $findArr = array_values($v); + foreach ($findArr as $idx => $item) { + $bindName = "item_" . $index . "_" . $idx; + $bind[$bindName] = $item; + $where[] = "FIND_IN_SET(:{$bindName}, `" . str_replace('.', '`.`', $k) . "`)"; + } + break; + case 'IN': + case 'IN(...)': + case 'NOT IN': + case 'NOT IN(...)': + $where[] = [$k, str_replace('(...)', '', $sym), is_array($v) ? $v : explode(',', $v)]; + break; + case 'BETWEEN': + case 'NOT BETWEEN': + $arr = array_slice(explode(',', $v), 0, 2); + if (stripos($v, ',') === false || !array_filter($arr, function ($v) { + return $v != '' && $v !== false && $v !== null; + })) { + continue 2; + } + //当出现一边为空时改变操作符 + if ($arr[0] === '') { + $sym = $sym == 'BETWEEN' ? '<=' : '>'; + $arr = $arr[1]; + } elseif ($arr[1] === '') { + $sym = $sym == 'BETWEEN' ? '>=' : '<'; + $arr = $arr[0]; + } + $where[] = [$k, $sym, $arr]; + break; + case 'RANGE': + case 'NOT RANGE': + $v = str_replace(' - ', ',', $v); + $arr = array_slice(explode(',', $v), 0, 2); + if (stripos($v, ',') === false || !array_filter($arr)) { + continue 2; + } + //当出现一边为空时改变操作符 + if ($arr[0] === '') { + $sym = $sym == 'RANGE' ? '<=' : '>'; + $arr = $arr[1]; + } elseif ($arr[1] === '') { + $sym = $sym == 'RANGE' ? '>=' : '<'; + $arr = $arr[0]; + } + $tableArr = explode('.', $k); + if (count($tableArr) > 1 && $tableArr[0] != $name && !in_array($tableArr[0], $alias) + && !empty($this->model) && $this->relationSearch) { + //修复关联模型下时间无法搜索的BUG + $relation = Loader::parseName($tableArr[0], 1, false); + $alias[$this->model->$relation()->getTable()] = $tableArr[0]; + } + $where[] = [$k, str_replace('RANGE', 'BETWEEN', $sym) . ' TIME', $arr]; + break; + case 'NULL': + case 'IS NULL': + case 'NOT NULL': + case 'IS NOT NULL': + $where[] = [$k, strtolower(str_replace('IS ', '', $sym))]; + break; + default: + break; + } + $index++; + } + if (!empty($this->model)) { + $this->model->alias($alias); + } + $model = $this->model; + $where = function ($query) use ($where, $alias, $bind, &$model) { + if (!empty($model)) { + $model->alias($alias); + $model->bind($bind); + } + foreach ($where as $k => $v) { + if (is_array($v)) { + call_user_func_array([$query, 'where'], $v); + } else { + $query->where($v); + } + } + }; + return [$where, $sort, $order, $offset, $limit, $page, $alias, $bind,$excludearray]; + } + + + } diff --git a/application/admin/controller/school/classes/Teacher.php b/application/admin/controller/school/classes/Teacher.php index 1506895..0cd190e 100644 --- a/application/admin/controller/school/classes/Teacher.php +++ b/application/admin/controller/school/classes/Teacher.php @@ -81,7 +81,6 @@ class Teacher extends Backend ->paginate($limit); foreach ($list as $row) { - $row->getRelation('user')->visible(['nickname','realname','avatar','mobile']); $row->getRelation('manystore')->visible(['nickname']); $row->getRelation('shop')->visible(['name','logo','image','address_city','province','city','district','address','address_detail']); diff --git a/application/admin/view/general/attachment/select.html b/application/admin/view/general/attachment/select.html index fdc14f2..3094b13 100644 --- a/application/admin/view/general/attachment/select.html +++ b/application/admin/view/general/attachment/select.html @@ -31,7 +31,7 @@
{:build_toolbar('refresh')} - + {if request()->get('multiple') == 'true'} {:__('Choose')} {/if} diff --git a/application/admin/view/school/classes/classes_lib/copy.html b/application/admin/view/school/classes/classes_lib/copy.html new file mode 100644 index 0000000..d0e74cc --- /dev/null +++ b/application/admin/view/school/classes/classes_lib/copy.html @@ -0,0 +1,461 @@ +
+ + + + + + + + +
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+ {foreach name="authStatusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+ +


+ + + + + + {eq name="check_auth_data.address_citys" value="*"} +
+ +
+ + + + + + (没找到机构则点击按钮创建机构后重新下拉框选机构) + {:__('Add')} + + +
+
+ + + + + + + +
+ +
+ + + + (没找到讲师则点击按钮创建讲师后重新下拉框选讲师) + {:__('Add')} + + +
+
+ {/eq} + +
+ +
+ + + + (没找到类型则点击按钮创建类型后重新下拉框选类型) + {:__('Add')} + + + +
+
+ + + +
+ +
+ + + + (没找到{:__('Classes_cate_ids')}则点击按钮创建{:__('Classes_cate_ids')}后重新下拉框选{:__('Classes_cate_ids')}) + {:__('Add')} + + +
+
+
+ +
+ + + + (没找到{:__('Classes_label_ids')}则点击按钮创建{:__('Classes_label_ids')}后重新下拉框选{:__('Classes_label_ids')}) + {:__('Add')} + + +
+
+ + + + + + + +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+ +
+
+ +
+ + +
+ +
+
    +
    +
    +
    + +
    +
    + +
    + + +
    + +
    +
      +
      +
      +
      + +
      + + + +
      +
      +
      + +
      + + (填写几节意味着客户购买课程后能预约上课核销几次,即购买本课程的课程节数) + +
      +
      + + + + + + +
      + +
      + + + + + + + + + + + + + + +
      每节课名开始结束时间限定人数上架状态
      追加
      + (每个课时规格为当前课程的一节课,课程总共多少节课就需要上多少个课时规格,每个课时的开始和结束时间不能有重叠,单节课开始结束时间必须在同一天,后续有变更将触发审核机制!) + + +
      +
      + + + + + + + +
      + +
      +
      + {foreach name="addressTypeList" item="vo"} + + {/foreach} + ( 如果选独立位置需填写具体位置信息! ) +
      +
      +
      + + + + + + + + +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      + + + + + + + + + + + + +
      + +
      + + ( 如果填零则为免费课程,课程下单后无需支付,直接可去预约课时! ) +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      + +
      + +
      + +
      +
      + + + + + + + + + + +
      + +
      + +
      +
      +
      + +
      + + + +
      +
      +
      + +
      + + + +
      +
      +
      + +
      + + + +
      +
      +
      + +
      + + + +
      +
      + + + + + +
      diff --git a/application/admin/view/school/classes/classes_lib/edit.html b/application/admin/view/school/classes/classes_lib/edit.html index 9ee0acf..0954d1b 100644 --- a/application/admin/view/school/classes/classes_lib/edit.html +++ b/application/admin/view/school/classes/classes_lib/edit.html @@ -44,7 +44,7 @@ - + {eq name="check_auth_data.address_citys" value="*"}
      @@ -78,7 +78,7 @@
      - + {/eq}
      diff --git a/application/common/controller/Backend.php b/application/common/controller/Backend.php index 2c3cb89..5559744 100644 --- a/application/common/controller/Backend.php +++ b/application/common/controller/Backend.php @@ -243,6 +243,7 @@ class Backend extends Controller protected function getAuthMsg(){ $this->assign('check_auth_msg', Admin::checkAuthMsg($this->auth->id)); + $this->assign('check_auth_data', Admin::getHaveCity($this->auth->id)); } diff --git a/application/common/model/school/classes/ClassesLib.php b/application/common/model/school/classes/ClassesLib.php index 5b21361..ecdc403 100644 --- a/application/common/model/school/classes/ClassesLib.php +++ b/application/common/model/school/classes/ClassesLib.php @@ -1348,6 +1348,7 @@ $user_unpaid_order = $user_paid_order =null; foreach ($spec as $k=>&$v){ unset($v["limit"]); unset($v["status_name"]); + unset($v["id"]); $v["classes_lib_id"] = 0; (new ClassesSpec)->specCheck($v,$shop_id,null,true,$oper_type,$oper_id); } @@ -1557,7 +1558,8 @@ $user_unpaid_order = $user_paid_order =null; //添加课程规格 foreach ($spec as $k=>$v){ $v["classes_lib_id"] = $model["id"]; - \app\common\model\school\classes\ClassesSpec::create($v); + unset($v["id"]); + (new \app\common\model\school\classes\ClassesSpec)->allowField(true)->save($v); } //因为是批量添加,所有规格重新进行检测,防止出现时间重叠 diff --git a/application/manystore/controller/school/classes/ClassesLib.php b/application/manystore/controller/school/classes/ClassesLib.php index 36e345d..371941d 100644 --- a/application/manystore/controller/school/classes/ClassesLib.php +++ b/application/manystore/controller/school/classes/ClassesLib.php @@ -316,12 +316,13 @@ class ClassesLib extends ManystoreBase * @return string * @throws \think\Exception */ - public function addnew() + public function addnew($row=null) { if ($this->request->isPost()) { $params = $this->request->post("row/a"); if ($params) { $params = $this->preExcludeFields($params); + unset($params["id"]); if($this->storeIdFieldAutoFill && STORE_ID ){ $params['store_id'] = STORE_ID; @@ -330,6 +331,12 @@ class ClassesLib extends ManystoreBase if($this->shopIdAutoCondition && SHOP_ID){ $params['shop_id'] = SHOP_ID; } + if($row){ + //如果走的复制 + if(empty($params["teacher_id"]))$params["teacher_id"] = $row["teacher_id"]; + } + + //是否采用模型验证 if ($this->modelValidate) { $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); @@ -351,8 +358,9 @@ class ClassesLib extends ManystoreBase \app\common\model\school\classes\ClassesLib::add_virtual_init($this->model["id"]); //添加课程规格 foreach ($spec as $k=>$v){ + unset($v["id"]); $v["classes_lib_id"] = $this->model["id"]; - \app\common\model\school\classes\ClassesSpec::create($v); + (new \app\common\model\school\classes\ClassesSpec)->allowField(true)->save($v); } //因为是批量添加,所有规格重新进行检测,防止出现时间重叠 @@ -608,4 +616,33 @@ class ClassesLib extends ManystoreBase } + + + /** + * 复制课程 + */ + public function copy($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()) { + $this->addnew($row); + } + + $spec = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row["id"])->field("id,classes_lib_id,name,start_time,end_time,limit_num,status,weigh")->order('weigh desc,id desc')->select(); + foreach ($spec as $k=>&$v){ + $v["time"] = date("Y/m/d H:i",$v["start_time"])." - ".date("Y/m/d H:i",$v["end_time"]); + } + $row["spec"] = json_encode($spec, JSON_UNESCAPED_UNICODE);//不转义任何字符串 + $this->view->assign("row", $row); + return $this->view->fetch(); + } + + } diff --git a/application/manystore/view/general/attachment/select.html b/application/manystore/view/general/attachment/select.html index d51f6fb..446c65f 100644 --- a/application/manystore/view/general/attachment/select.html +++ b/application/manystore/view/general/attachment/select.html @@ -35,7 +35,7 @@
      {:build_toolbar('refresh')} - + {if request()->get('multiple') == 'true'} {:__('Choose')} {/if} diff --git a/application/manystore/view/school/classes/classes_lib/copy.html b/application/manystore/view/school/classes/classes_lib/copy.html new file mode 100644 index 0000000..619b313 --- /dev/null +++ b/application/manystore/view/school/classes/classes_lib/copy.html @@ -0,0 +1,445 @@ +
      + +
      + +
      + +
      + {foreach name="authStatusList" item="vo"} + + {/foreach} +
      + {if ( $row.auth_status == 2) } + (不通过原因:{$row.reason}) + {else /} + + {/if} + +
      +
      + + + + +
      + +
      + +
      + {foreach name="statusList" item="vo"} + + {/foreach} +
      + +
      +
      + +


      + + + + + + + + + + + + + + + + + + + + +
      + +
      + + +

      + (没找到讲师则点击按钮创建讲师后重新下拉框选讲师) + {:__('Add')} + +
      +
      +
      + +
      + +
      + + + +
      +
      + +
      + +
      + +
      +
      +
      + +
      + +
      +
      + + + + + +
      + +
      + +
      +
      + + + + + + + + + + + + + + + + + + +
      + +
      + +
      +
      +
      + +
      +
      + +
      + + +
      + +
      +
        +
        +
        +
        + +
        +
        + +
        + + +
        + +
        +
          +
          +
          +
          + +
          + + + +
          +
          +
          + +
          + + (填写几节意味着客户购买课程后能预约上课核销几次,即购买本课程的课程节数) + +
          +
          + + + +
          + +
          + + + + + + + + + + + + + + +
          每节课名开始结束时间限定人数上架状态
          追加
          + (每个课时规格为当前课程的一节课,课程总共多少节课就需要上多少个课时规格,每个课时的开始和结束时间不能有重叠,单节课开始结束时间必须在同一天,后续有变更将触发审核机制!) + + +
          +
          + + + + + + + + +
          + +
          +
          + {foreach name="addressTypeList" item="vo"} + + {/foreach} + ( 如果选独立位置需填写具体位置信息! ) +
          +
          +
          + + + + + + + + +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          + + + + + + + + + + + + +
          + +
          + + ( 如果填零则为免费课程,课程下单后无需支付,直接可去预约课时! ) +
          +
          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + +
          + + + +
          +
          + + + + + +
          + \ No newline at end of file diff --git a/public/assets/js/backend/manystore/index.js b/public/assets/js/backend/manystore/index.js index f832399..305b798 100644 --- a/public/assets/js/backend/manystore/index.js +++ b/public/assets/js/backend/manystore/index.js @@ -112,7 +112,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('机构课程'), title: __('机构课程'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-leanpub', dropdown : '更多', url: classes_spec_url, callback: function (data) { @@ -128,7 +128,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('主讲老师信息'), title: __('主讲老师信息'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-user', dropdown : '更多', url: teacher_url, callback: function (data) { @@ -143,7 +143,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('核销员信息'), title: __('核销员信息'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-user', dropdown : '更多', url: verification_url, callback: function (data) { @@ -158,7 +158,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('机构虚拟参与者'), title: __('机构虚拟参与者'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-user', dropdown : '更多', url: virtual_user_url, callback: function (data) { @@ -173,7 +173,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('机构课程购买订单'), title: __('机构课程购买订单'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-cart-arrow-down', dropdown : '更多', url: order_url, callback: function (data) { @@ -188,7 +188,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('机构课时预约记录'), title: __('机构课时预约记录'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-calendar', dropdown : '更多', url: hourorder_url, callback: function (data) { @@ -203,7 +203,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('机构授权用户'), title: __('机构授权用户'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-user', dropdown : '更多', url: user_auth_url, callback: function (data) { @@ -213,6 +213,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // return row.status == '2'||row.status == '3'; // } }, + { + name: 'evaluate', + text: __('查看用户评价'), + title: __('查看用户评价'), + classname: 'btn btn-dialog', + icon: 'fa fa-handshake-o', + dropdown : '更多', + url: evaluate_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.classes_evaluate_id; + // } + }, // // {name: 'unsetmockauth', // text: '取消加圈资格', @@ -377,7 +392,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin return 'manystore/user_auth/index?shop_id='+row.id; } - + var evaluate_url= function (row,dom) { + return 'school/classes/evaluate/index?shop_id='+row.id; + } diff --git a/public/assets/js/backend/school/classes/classes_lib.js b/public/assets/js/backend/school/classes/classes_lib.js index 18d3686..bb166e9 100644 --- a/public/assets/js/backend/school/classes/classes_lib.js +++ b/public/assets/js/backend/school/classes/classes_lib.js @@ -9,6 +9,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin add_url: 'school/classes/classes_lib/addnew'+ location.search, addnew_url: 'school/classes/classes_lib/addnew'+ location.search, edit_url: 'school/classes/classes_lib/edit'+ location.search, + copy_url: 'school/classes/classes_lib/copy'+ location.search, del_url: 'school/classes/classes_lib/del', multi_url: 'school/classes/classes_lib/multi', import_url: 'school/classes/classes_lib/import', @@ -124,12 +125,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'operate', title: __('Operate'), table: table , buttons: [ + { + name: 'classes_spec', + text: __('复制并创建课程'), + title: __('复制课程信息并创建成新课程'), + classname: 'btn btn-dialog', + icon: 'fa fa-files-o', + dropdown : '更多', + url: $.fn.bootstrapTable.defaults.extend.copy_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, { name: 'classes_spec', text: __('课时查看'), title: __('课时查看'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-calendar-check-o', dropdown : '更多', url: classes_spec_url, callback: function (data) { @@ -144,7 +160,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('设置虚拟参与者'), title: __('设置虚拟参与者'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-user', dropdown : '更多', url: virtual_user_url, callback: function (data) { @@ -162,7 +178,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('主讲老师信息'), title: __('主讲老师信息'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-user', dropdown : '更多', url: teacher_url, callback: function (data) { @@ -177,7 +193,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('课程订单查看'), title: __('课程订单查看'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-cart-arrow-down', dropdown : '更多', url: order_url, callback: function (data) { @@ -192,7 +208,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('课时预约记录'), title: __('课时预约记录'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-calendar', dropdown : '更多', url: classes_hourorder_url, callback: function (data) { @@ -207,7 +223,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('查看用户评价'), title: __('查看用户评价'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-handshake-o', dropdown : '更多', url: evaluate_url, callback: function (data) { @@ -406,6 +422,41 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin }); + Controller.api.bindevent(); + }, + copy: function () { + + //因为日期选择框不会触发change事件,导致无法刷新textarea,所以加上判断 + $(document).on("dp.change", "#edit-form .datetimerange", function () { + $(this).parent().prev().find("input").trigger("change"); + }); + + $(document).on("dp.change", "#edit-form .datetimepicker", function () { + $(this).parent().prev().find("input").trigger("change"); + }); + + $(document).on("fa.event.appendfieldlist", "#edit-form .btn-append", function (e, obj) { + // Form.api.bindevent($("form[role=form]")); + // // //绑定动态下拉组件 + Form.events.selectpage(obj); + // // //绑定日期组件 + Form.events.daterangepicker(obj); + Form.events.datetimepicker(obj); + Form.events.selectpicker(obj); + // Form.events.switcher(obj); + + // // Form.events.datetimerange(obj); + // Form.api.bindevent(this); + // //绑定上传组件 + // Form.events.faupload(obj); + + // //上传成功回调事件,变更按钮的背景 + // $(".upload-image", obj).data("upload-success", function (data) { + // $(this).css("background-image", "url('" + Fast.api.cdnurl(data.url) + "')"); + // }) + }); + + Controller.api.bindevent(); }, api: { diff --git a/public/assets/js/backend/school/classes/teacher.js b/public/assets/js/backend/school/classes/teacher.js index 0c7f27c..3be727c 100644 --- a/public/assets/js/backend/school/classes/teacher.js +++ b/public/assets/js/backend/school/classes/teacher.js @@ -69,7 +69,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('讲师的课程'), title: __('讲师的课程'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-leanpub', dropdown : '更多', url: classes_url, callback: function (data) { @@ -84,7 +84,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('查看用户评价'), title: __('查看用户评价'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-handshake-o', dropdown : '更多', url: evaluate_url, callback: function (data) { diff --git a/public/assets/js/backend/user/user.js b/public/assets/js/backend/user/user.js index 7f5e7b8..2e58b3f 100644 --- a/public/assets/js/backend/user/user.js +++ b/public/assets/js/backend/user/user.js @@ -88,7 +88,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('设置成老师'), title: __('设置成老师'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-user', dropdown : '更多', url: teacher_url, callback: function (data) { @@ -106,7 +106,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('设置成核销员'), title: __('设置成核销员'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-user', dropdown : '更多', url: verification_url, callback: function (data) { @@ -123,7 +123,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('三方账号信息'), title: __('三方账号信息'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-user', dropdown : '更多', url: third_url, callback: function (data) { @@ -140,7 +140,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('课程购买单'), title: __('课程购买单'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-cart-arrow-down', dropdown : '更多', url: classes_order_url, callback: function (data) { @@ -156,7 +156,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('课时预约单'), title: __('课时预约单'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-calendar', dropdown : '更多', url: classes_hourorder_url, callback: function (data) { @@ -166,6 +166,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // return row.status == '2'||row.status == '3'; // } }, + { + name: 'evaluate', + text: __('查看用户评价'), + title: __('查看用户评价'), + classname: 'btn btn-dialog', + icon: 'fa fa-handshake-o', + dropdown : '更多', + url: evaluate_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.classes_evaluate_id; + // } + }, ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, @@ -251,5 +266,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin } + var evaluate_url= function (row,dom) { + return 'school/classes/evaluate/index?user_id='+row.id; + } + + return Controller; }); \ No newline at end of file diff --git a/public/assets/js/manystore/school/classes/classes_lib.js b/public/assets/js/manystore/school/classes/classes_lib.js index 01b6a4c..12ec019 100644 --- a/public/assets/js/manystore/school/classes/classes_lib.js +++ b/public/assets/js/manystore/school/classes/classes_lib.js @@ -7,8 +7,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin extend: { index_url: 'school/classes/classes_lib/index' + location.search, add_url: 'school/classes/classes_lib/addnew'+ location.search, - addnew_url: 'school/classes/classes_lib/addnew'+ location.search, + addnew_url: 'school/classes/classes_lib/addnew'+ location.search, edit_url: 'school/classes/classes_lib/edit'+ location.search, + copy_url: 'school/classes/classes_lib/copy'+ location.search, del_url: 'school/classes/classes_lib/del', multi_url: 'school/classes/classes_lib/multi', import_url: 'school/classes/classes_lib/import', @@ -134,11 +135,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'operate', title: __('Operate'), table: table , buttons: [ { + name: 'classes_spec', + text: __('复制并创建课程'), + title: __('复制课程信息并创建成新课程'), + classname: 'btn btn-dialog', + icon: 'fa fa-files-o', + dropdown : '更多', + url: $.fn.bootstrapTable.defaults.extend.copy_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + + { name: 'classes_spec', text: __('课时查看'), title: __('课时查看'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-calendar-check-o', dropdown : '更多', url: classes_spec_url, callback: function (data) { @@ -167,7 +184,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('主讲老师信息'), title: __('主讲老师信息'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-user', dropdown : '更多', url: teacher_url, callback: function (data) { @@ -182,7 +199,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('课程订单查看'), title: __('课程订单查看'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-cart-arrow-down', dropdown : '更多', url: order_url, callback: function (data) { @@ -197,7 +214,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('课时预约记录'), title: __('课时预约记录'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-calendar', dropdown : '更多', url: classes_hourorder_url, callback: function (data) { @@ -212,7 +229,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('查看用户评价'), title: __('查看用户评价'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-handshake-o', dropdown : '更多', url: evaluate_url, callback: function (data) { @@ -413,6 +430,38 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin }); + Controller.api.bindevent(); + }, + copy: function () { + + //因为日期选择框不会触发change事件,导致无法刷新textarea,所以加上判断 + $(document).on("dp.change", "#edit-form .datetimerange", function () { + $(this).parent().prev().find("input").trigger("change"); + }); + + $(document).on("dp.change", "#edit-form .datetimepicker", function () { + $(this).parent().prev().find("input").trigger("change"); + }); + + $(document).on("fa.event.appendfieldlist", "#edit-form .btn-append", function (e, obj) { + // Form.api.bindevent($("form[role=form]")); + // // //绑定动态下拉组件 + Form.events.selectpage(obj); + // // //绑定日期组件 + Form.events.daterangepicker(obj); + Form.events.datetimepicker(obj); + // // Form.events.datetimerange(obj); + // Form.api.bindevent(this); + // //绑定上传组件 + // Form.events.faupload(obj); + + // //上传成功回调事件,变更按钮的背景 + // $(".upload-image", obj).data("upload-success", function (data) { + // $(this).css("background-image", "url('" + Fast.api.cdnurl(data.url) + "')"); + // }) + }); + + Controller.api.bindevent(); }, api: { diff --git a/public/assets/js/manystore/school/classes/order/order.js b/public/assets/js/manystore/school/classes/order/order.js index 21c56e8..fecc450 100644 --- a/public/assets/js/manystore/school/classes/order/order.js +++ b/public/assets/js/manystore/school/classes/order/order.js @@ -130,7 +130,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('课时使用情况'), title: __('课时使用情况'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-calendar', dropdown : '更多', url: order_detail_url, callback: function (data) { @@ -162,7 +162,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('课时预约发起'), title: __('课时预约发起'), classname: 'btn btn-xs btn-danger btn-magic btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-calendar', url: order_url, callback: function (data) { @@ -192,7 +192,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('查看用户评价'), title: __('查看用户评价'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-handshake-o', dropdown : '更多', url: evaluate_url, callback: function (data) { diff --git a/public/assets/js/manystore/school/classes/teacher.js b/public/assets/js/manystore/school/classes/teacher.js index fa62818..cbdec02 100644 --- a/public/assets/js/manystore/school/classes/teacher.js +++ b/public/assets/js/manystore/school/classes/teacher.js @@ -70,7 +70,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('讲师的课程'), title: __('讲师的课程'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-leanpub', dropdown : '更多', url: classes_url, callback: function (data) { @@ -85,7 +85,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('查看用户评价'), title: __('查看用户评价'), classname: 'btn btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-handshake-o', dropdown : '更多', url: evaluate_url, callback: function (data) { diff --git a/public/assets/js/manystore/user/user.js b/public/assets/js/manystore/user/user.js index cf16453..2745dc4 100644 --- a/public/assets/js/manystore/user/user.js +++ b/public/assets/js/manystore/user/user.js @@ -71,7 +71,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('课程购买记录'), title: __('课程购买记录'), classname: 'btn btn-xs btn-danger btn-magic btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-cart-arrow-down', url: classes_order_url, callback: function (data) { @@ -86,7 +86,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin text: __('课时预约记录'), title: __('课时预约记录'), classname: 'btn btn-xs btn-danger btn-magic btn-dialog', - icon: 'fa fa-list', + icon: 'fa fa-calendar', url: classes_hourorder_url, callback: function (data) { @@ -95,6 +95,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // return row.status == '2'||row.status == '3'; // } }, + { + name: 'evaluate', + text: __('查看用户评价'), + title: __('查看用户评价'), + classname: 'btn btn-dialog', + icon: 'fa fa-handshake-o', + dropdown : '更多', + url: evaluate_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.classes_evaluate_id; + // } + }, ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, @@ -129,5 +144,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin return 'school/classes/hourorder/order/index?user_id='+row.id; } + var evaluate_url= function (row,dom) { + return 'school/classes/evaluate/index?user_id='+row.id; + } + return Controller; }); \ No newline at end of file