diff --git a/application/admin/controller/school/classes/activity/Activity.php b/application/admin/controller/school/classes/activity/Activity.php
new file mode 100644
index 0000000..b57a1c5
--- /dev/null
+++ b/application/admin/controller/school/classes/activity/Activity.php
@@ -0,0 +1,375 @@
+model = new \app\admin\model\school\classes\activity\Activity;
+ $this->itemmodel = new \app\admin\model\school\classes\activity\ActivityItem();
+ parent::_initialize();
+ $this->view->assign("addressTypeList", $this->model->getAddressTypeList());
+ $this->view->assign("statusList", $this->model->getStatusList());
+ $this->view->assign("recommendList", $this->model->getRecommendList());
+ $this->view->assign("hotList", $this->model->getHotList());
+ $this->view->assign("newList", $this->model->getNewList());
+ $this->view->assign("selfhotList", $this->model->getSelfhotList());
+ $this->view->assign("expirestatusList", $this->model->getExpirestatusList());
+ $this->view->assign("addTypeList", $this->model->getAddTypeList());
+
+
+
+ $this->getCity();
+ $this->getAuthMsg();
+
+ $this->view->assign("itemStatusList", $this->itemmodel->getStatusList());
+ $this->view->assign("sexList", $this->itemmodel->getSexList());
+ }
+
+
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ //当前是否为关联查询
+ $this->relationSearch = true;
+ //设置过滤方法
+ $this->request->filter(['strip_tags', 'trim']);
+ if ($this->request->isAjax()) {
+ //如果发送的来源是Selectpage,则转发到Selectpage
+ if ($this->request->request('keyField')) {
+ return $this->selectpage();
+ }
+ list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $list = $this->model
+ ->with(['manystore','shop'])
+ ->where($where)
+ ->order($sort, $order)
+ ->paginate($limit);
+
+ foreach ($list as $row) {
+
+ $row->getRelation('manystore')->visible(['nickname']);
+ $row->getRelation('shop')->visible(['name','logo']);
+ }
+
+ $result = array("total" => $list->total(), "rows" => $list->items());
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+
+ protected function update_classes($classes_activity_id){
+
+ }
+
+
+
+
+ protected function updateCheck($id,$params=[],$row=null){
+ if($params && $row){
+// var_dump($this->no_auth_fields_check($params,$row));
+ if(!$this->no_auth_fields_check($params,$row)){
+ return true;
+ }
+ }
+
+ // 课程存在售后订单则不允许操作
+ $order = Order::where("classes_activity_item_id",$id)->where("status","not in","-3,6,9")->find();
+ if($order)throw new \Exception("{$order['name']}存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!");
+ }
+
+
+ protected function update_check(&$params,$row=null)
+ {
+
+ if($row){
+ if(empty($params["shop_id"]))$params["shop_id"] = $row["shop_id"];
+ }
+
+ try {
+ $classesLib = new \app\common\model\school\classes\activity\Activity();
+ $classesLib->no_auth_fields = $this->no_auth_fields;
+ $classesLib->need_auth = $this->need_auth;
+ $classesLib->have_auth = $this->have_auth;
+
+ $classesLib->activityCheck($params,null,$row);
+
+ $this->need_auth = $classesLib->need_auth;
+ $this->have_auth = $classesLib->have_auth;
+
+ }catch (\Exception $e){
+ $this->error($e->getMessage());
+ }
+
+
+
+
+
+
+ //修改
+ if($row){
+
+ }else{
+ //新增
+ //新增
+ $params["add_type"] = '2';
+ $params["add_id"] = $this->auth->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);
+ $spec = $params["item_json"];
+ unset($params["item_json"]);
+ $result = $this->model->allowField(true)->save($params);
+ //添加课程规格
+ foreach ($spec as $k=>$v){
+ $v["classes_activity_id"] = $this->model["id"];
+ $v["manystore_id"] = $this->model["manystore_id"];
+ $v["shop_id"] = $this->model["shop_id"];
+
+ unset($v["id"]);
+ (new \app\common\model\school\classes\activity\ActivityItem())->allowField(true)->save($v);
+ }
+
+ //因为是批量添加,所有规格重新进行检测,防止出现时间重叠
+ $specss = \app\common\model\school\classes\activity\ActivityItem::where("classes_activity_id",$this->model["id"])->select();
+ foreach ($specss as $k=>$specs){
+ $params =$specs;
+ (new \app\common\model\school\classes\activity\ActivityItem)->specCheck($params,null,$specs);
+ }
+
+
+ $this->update_classes($this->model["id"]);
+ Db::commit();
+ } catch (ValidateException|PDOException|Exception $e) {
+ Db::rollback();
+ $this->error($e->getMessage().$e->getFile().$e->getLine());
+ }
+ 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()) {
+
+ $spec = \app\common\model\school\classes\activity\ActivityItem::where("classes_activity_id",$row["id"])->field("id,classes_activity_id,name,price,age,sex,limit_num,status,weigh")->order('weigh desc,id desc')->select();
+
+ $row["item_json"] = json_encode($spec);
+
+ $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);
+ $spec = $params["item_json"] ?? [];
+
+// var_dump($spec);
+
+ $delete_spec_ids = $params["delete_spec_ids"] ?? [];
+ unset($params["item_json"]);
+ unset($params["delete_spec_ids"]);
+
+ $result = $row->allowField(true)->save($params);
+
+ //添加课程规格
+ foreach ($spec as $k=>$v){
+ $v["classes_activity_id"] = $row["id"];
+ $v["manystore_id"] = $row["manystore_id"];
+ $v["shop_id"] = $row["shop_id"];
+ //有id更新,否则新增
+ if(isset($v["id"]) && $v["id"]){
+ \app\common\model\school\classes\activity\ActivityItem::update((new \app\common\model\school\classes\activity\ActivityItem)->checkAssemblyParameters($v));
+ }else{
+
+ \app\common\model\school\classes\activity\ActivityItem::create((new \app\common\model\school\classes\activity\ActivityItem)->checkAssemblyParameters($v));
+ }
+
+ }
+ //删除规格
+ foreach ($delete_spec_ids as $k=>$delete_spec){
+
+
+// (new \app\common\model\school\classes\activity\ActivityItem)->updateCheck($delete_spec["id"]);
+
+ $delete_spec->delete();
+ }
+
+ //因为是批量添加,所有规格重新进行检测,防止出现时间重叠
+ $specss = \app\common\model\school\classes\activity\ActivityItem::where("classes_activity_id",$row["id"])->select();
+ foreach ($specss as $k=>$specs){
+
+ $params =$specs;
+ (new \app\common\model\school\classes\activity\ActivityItem)->specCheck($params,null,$specs);
+ }
+
+
+ $this->update_classes($row["id"]);
+ 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) {
+ //删除课程规格
+ \app\common\model\school\classes\activity\ActivityItem::where("classes_activity_id",$item->id)->delete();
+
+ $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/controller/school/classes/activity/ActivityAuth.php b/application/admin/controller/school/classes/activity/ActivityAuth.php
new file mode 100644
index 0000000..2505e3f
--- /dev/null
+++ b/application/admin/controller/school/classes/activity/ActivityAuth.php
@@ -0,0 +1,81 @@
+model = new \app\admin\model\school\classes\activity\ActivityAuth;
+ $this->view->assign("addressTypeList", $this->model->getAddressTypeList());
+ $this->view->assign("statusList", $this->model->getStatusList());
+ $this->view->assign("recommendList", $this->model->getRecommendList());
+ $this->view->assign("hotList", $this->model->getHotList());
+ $this->view->assign("newList", $this->model->getNewList());
+ $this->view->assign("selfhotList", $this->model->getSelfhotList());
+ $this->view->assign("authStatusList", $this->model->getAuthStatusList());
+ $this->view->assign("expirestatusList", $this->model->getExpirestatusList());
+ $this->view->assign("addTypeList", $this->model->getAddTypeList());
+ }
+
+
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ //当前是否为关联查询
+ $this->relationSearch = true;
+ //设置过滤方法
+ $this->request->filter(['strip_tags', 'trim']);
+ if ($this->request->isAjax()) {
+ //如果发送的来源是Selectpage,则转发到Selectpage
+ if ($this->request->request('keyField')) {
+ return $this->selectpage();
+ }
+ list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $list = $this->model
+ ->with(['activity','manystore','shop'])
+ ->where($where)
+ ->order($sort, $order)
+ ->paginate($limit);
+
+ foreach ($list as $row) {
+
+ $row->getRelation('activity')->visible(['id']);
+ $row->getRelation('manystore')->visible(['nickname']);
+ $row->getRelation('shop')->visible(['name','logo']);
+ }
+
+ $result = array("total" => $list->total(), "rows" => $list->items());
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+}
diff --git a/application/admin/controller/school/classes/activity/ActivityItem.php b/application/admin/controller/school/classes/activity/ActivityItem.php
new file mode 100644
index 0000000..705f91a
--- /dev/null
+++ b/application/admin/controller/school/classes/activity/ActivityItem.php
@@ -0,0 +1,74 @@
+model = new \app\admin\model\school\classes\activity\ActivityItem;
+ $this->view->assign("statusList", $this->model->getStatusList());
+ $this->view->assign("sexList", $this->model->getSexList());
+ }
+
+
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ //当前是否为关联查询
+ $this->relationSearch = true;
+ //设置过滤方法
+ $this->request->filter(['strip_tags', 'trim']);
+ if ($this->request->isAjax()) {
+ //如果发送的来源是Selectpage,则转发到Selectpage
+ if ($this->request->request('keyField')) {
+ return $this->selectpage();
+ }
+ list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $list = $this->model
+ ->with(['manystore','shop','activity'])
+ ->where($where)
+ ->order($sort, $order)
+ ->paginate($limit);
+
+ foreach ($list as $row) {
+
+ $row->getRelation('manystore')->visible(['nickname']);
+ $row->getRelation('shop')->visible(['name','logo']);
+ $row->getRelation('activity')->visible(['title','headimage']);
+ }
+
+ $result = array("total" => $list->total(), "rows" => $list->items());
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+}
diff --git a/application/admin/controller/school/classes/activity/ActivityItemAuth.php b/application/admin/controller/school/classes/activity/ActivityItemAuth.php
new file mode 100644
index 0000000..1c5d1ee
--- /dev/null
+++ b/application/admin/controller/school/classes/activity/ActivityItemAuth.php
@@ -0,0 +1,74 @@
+model = new \app\admin\model\school\classes\activity\ActivityItemAuth;
+ $this->view->assign("statusList", $this->model->getStatusList());
+ $this->view->assign("sexList", $this->model->getSexList());
+ }
+
+
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ //当前是否为关联查询
+ $this->relationSearch = true;
+ //设置过滤方法
+ $this->request->filter(['strip_tags', 'trim']);
+ if ($this->request->isAjax()) {
+ //如果发送的来源是Selectpage,则转发到Selectpage
+ if ($this->request->request('keyField')) {
+ return $this->selectpage();
+ }
+ list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $list = $this->model
+ ->with(['manystore','shop','activity'])
+ ->where($where)
+ ->order($sort, $order)
+ ->paginate($limit);
+
+ foreach ($list as $row) {
+
+ $row->getRelation('manystore')->visible(['nickname']);
+ $row->getRelation('shop')->visible(['name','logo']);
+ $row->getRelation('activity')->visible(['title','headimage']);
+ }
+
+ $result = array("total" => $list->total(), "rows" => $list->items());
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+}
diff --git a/application/admin/controller/school/classes/activity/order/Order.php b/application/admin/controller/school/classes/activity/order/Order.php
new file mode 100644
index 0000000..800bccc
--- /dev/null
+++ b/application/admin/controller/school/classes/activity/order/Order.php
@@ -0,0 +1,79 @@
+model = new \app\admin\model\school\classes\activity\order\Order;
+ $this->view->assign("payTypeList", $this->model->getPayTypeList());
+ $this->view->assign("statusList", $this->model->getStatusList());
+ $this->view->assign("beforeStatusList", $this->model->getBeforeStatusList());
+ $this->view->assign("serverStatusList", $this->model->getServerStatusList());
+ $this->view->assign("authStatusList", $this->model->getAuthStatusList());
+ }
+
+
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ //当前是否为关联查询
+ $this->relationSearch = true;
+ //设置过滤方法
+ $this->request->filter(['strip_tags', 'trim']);
+ if ($this->request->isAjax()) {
+ //如果发送的来源是Selectpage,则转发到Selectpage
+ if ($this->request->request('keyField')) {
+ return $this->selectpage();
+ }
+ list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $list = $this->model
+ ->with(['user','manystore','shop','activity','detail'])
+ ->where($where)
+ ->order($sort, $order)
+ ->paginate($limit);
+
+ foreach ($list as $row) {
+
+ $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']);
+ $row->getRelation('manystore')->visible(['nickname']);
+ $row->getRelation('shop')->visible(['name','logo']);
+ $row->getRelation('activity')->visible(['title','headimage']);
+ $row->getRelation('detail')->visible(['title','headimage']);
+ }
+
+ $result = array("total" => $list->total(), "rows" => $list->items());
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+}
diff --git a/application/admin/controller/school/classes/activity/order/OrderDetail.php b/application/admin/controller/school/classes/activity/order/OrderDetail.php
new file mode 100644
index 0000000..5af42c5
--- /dev/null
+++ b/application/admin/controller/school/classes/activity/order/OrderDetail.php
@@ -0,0 +1,82 @@
+model = new \app\admin\model\school\classes\activity\order\OrderDetail;
+ $this->view->assign("addressTypeList", $this->model->getAddressTypeList());
+ $this->view->assign("statusList", $this->model->getStatusList());
+ $this->view->assign("recommendList", $this->model->getRecommendList());
+ $this->view->assign("hotList", $this->model->getHotList());
+ $this->view->assign("newList", $this->model->getNewList());
+ $this->view->assign("selfhotList", $this->model->getSelfhotList());
+ $this->view->assign("expirestatusList", $this->model->getExpirestatusList());
+ $this->view->assign("addTypeList", $this->model->getAddTypeList());
+ }
+
+
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ //当前是否为关联查询
+ $this->relationSearch = true;
+ //设置过滤方法
+ $this->request->filter(['strip_tags', 'trim']);
+ if ($this->request->isAjax()) {
+ //如果发送的来源是Selectpage,则转发到Selectpage
+ if ($this->request->request('keyField')) {
+ return $this->selectpage();
+ }
+ list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $list = $this->model
+ ->with(['activityorder','activity','manystore','shop','user'])
+ ->where($where)
+ ->order($sort, $order)
+ ->paginate($limit);
+
+ foreach ($list as $row) {
+
+ $row->getRelation('activityorder')->visible(['order_no','pay_no']);
+ $row->getRelation('activity')->visible(['title','headimage']);
+ $row->getRelation('manystore')->visible(['nickname']);
+ $row->getRelation('shop')->visible(['name','logo']);
+ $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']);
+ }
+
+ $result = array("total" => $list->total(), "rows" => $list->items());
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+}
diff --git a/application/admin/controller/school/classes/activity/order/OrderLog.php b/application/admin/controller/school/classes/activity/order/OrderLog.php
new file mode 100644
index 0000000..db1efcf
--- /dev/null
+++ b/application/admin/controller/school/classes/activity/order/OrderLog.php
@@ -0,0 +1,71 @@
+model = new \app\admin\model\school\classes\activity\order\OrderLog;
+ $this->view->assign("statusList", $this->model->getStatusList());
+ }
+
+
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ //当前是否为关联查询
+ $this->relationSearch = true;
+ //设置过滤方法
+ $this->request->filter(['strip_tags', 'trim']);
+ if ($this->request->isAjax()) {
+ //如果发送的来源是Selectpage,则转发到Selectpage
+ if ($this->request->request('keyField')) {
+ return $this->selectpage();
+ }
+ list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $list = $this->model
+ ->with(['activityorder'])
+ ->where($where)
+ ->order($sort, $order)
+ ->paginate($limit);
+
+ foreach ($list as $row) {
+
+ $row->getRelation('activityorder')->visible(['order_no','pay_no']);
+ }
+
+ $result = array("total" => $list->total(), "rows" => $list->items());
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+}
diff --git a/application/admin/lang/zh-cn/school/classes/activity/activity.php b/application/admin/lang/zh-cn/school/classes/activity/activity.php
new file mode 100644
index 0000000..5d051a1
--- /dev/null
+++ b/application/admin/lang/zh-cn/school/classes/activity/activity.php
@@ -0,0 +1,71 @@
+ '机构账号id',
+ 'Shop_id' => '机构店铺id',
+ 'Title' => '标题',
+ 'Headimage' => '头图',
+ 'Images' => '轮播图',
+ 'Address_type' => '地址类型',
+ 'Address_type 1' => '按机构',
+ 'Address_type 2' => '独立位置',
+ 'Address_city' => '城市选择',
+ 'Province' => '省编号',
+ 'City' => '市编号',
+ 'District' => '县区编号',
+ 'Address' => '活动地址',
+ 'Address_detail' => '活动详细地址',
+ 'Longitude' => '经度',
+ 'Latitude' => '纬度',
+ 'Start_time' => '活动开始时间',
+ 'End_time' => '活动结束时间',
+ 'Sign_start_time' => '报名开始时间',
+ 'Sign_end_time' => '报名结束时间',
+ 'Price' => '报名费用',
+ 'People_num' => '活动人数',
+ 'Item' => '活动项目',
+ 'Content' => '活动详情',
+ 'Status' => '状态',
+ 'Status 1' => '上架',
+ 'Set status to 1' => '设为上架',
+ 'Status 2' => '下架',
+ 'Set status to 2' => '设为下架',
+ 'Status 3' => '平台下架',
+ 'Set status to 3' => '设为平台下架',
+ 'Weigh' => '权重',
+ 'Recommend' => '平台推荐',
+ 'Recommend 0' => '否',
+ 'Recommend 1' => '是',
+ 'Hot' => '平台热门',
+ 'Hot 0' => '否',
+ 'Hot 1' => '是',
+ 'New' => '平台最新',
+ 'New 0' => '否',
+ 'New 1' => '是',
+ 'Selfhot' => '机构热门',
+ 'Selfhot 0' => '否',
+ 'Selfhot 1' => '是',
+ 'Sale' => '总销量',
+ 'Stock' => '限制总人数',
+ 'Views' => '浏览量',
+ 'Expirestatus' => '过期状态',
+ 'Expirestatus 1' => '进行中',
+ 'Expirestatus 2' => '已过期',
+ 'Add_type' => '添加人类型',
+ 'Add_type 1' => '机构',
+ 'Add_type 2' => '总后台',
+ 'Add_id' => '添加人id',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间',
+ 'Manystore.nickname' => '昵称',
+ 'Shop.name' => '店铺名称',
+ 'Shop.logo' => '品牌LOGO',
+ 'Sex' => '性别限制',
+ 'Sex 1' => '男',
+ 'Sex 2' => '女',
+ 'Sex 3' => '男女不限',
+ 'Limit_num' => '本项目限定人数',
+ 'Age' => '年龄限制描述',
+ 'Item_json' => '活动项目',
+];
diff --git a/application/admin/lang/zh-cn/school/classes/activity/activity_auth.php b/application/admin/lang/zh-cn/school/classes/activity/activity_auth.php
new file mode 100644
index 0000000..b5cafcc
--- /dev/null
+++ b/application/admin/lang/zh-cn/school/classes/activity/activity_auth.php
@@ -0,0 +1,72 @@
+ '课程活动id',
+ 'Manystore_id' => '机构账号id',
+ 'Shop_id' => '机构店铺id',
+ 'Title' => '标题',
+ 'Headimage' => '头图',
+ 'Images' => '轮播图',
+ 'Address_type' => '地址类型',
+ 'Address_type 1' => '按机构',
+ 'Address_type 2' => '独立位置',
+ 'Address_city' => '城市选择',
+ 'Province' => '省编号',
+ 'City' => '市编号',
+ 'District' => '县区编号',
+ 'Address' => '活动地址',
+ 'Address_detail' => '活动详细地址',
+ 'Longitude' => '经度',
+ 'Latitude' => '纬度',
+ 'Start_time' => '活动开始时间',
+ 'End_time' => '活动结束时间',
+ 'Sign_start_time' => '报名开始时间',
+ 'Sign_end_time' => '报名结束时间',
+ 'Price' => '报名费用',
+ 'People_num' => '活动人数',
+ 'Item' => '活动项目',
+ 'Content' => '活动详情',
+ 'Status' => '状态',
+ 'Status 1' => '上架',
+ 'Status 2' => '下架',
+ 'Status 3' => '平台下架',
+ 'Weigh' => '权重',
+ 'Recommend' => '平台推荐',
+ 'Recommend 0' => '否',
+ 'Recommend 1' => '是',
+ 'Hot' => '平台热门',
+ 'Hot 0' => '否',
+ 'Hot 1' => '是',
+ 'New' => '平台最新',
+ 'New 0' => '否',
+ 'New 1' => '是',
+ 'Selfhot' => '机构热门',
+ 'Selfhot 0' => '否',
+ 'Selfhot 1' => '是',
+ 'Auth_status' => '审核状态',
+ 'Auth_status 0' => '待审核',
+ 'Set auth_status to 0'=> '设为待审核',
+ 'Auth_status 1' => '审核通过',
+ 'Set auth_status to 1'=> '设为审核通过',
+ 'Auth_status 2' => '审核不通过',
+ 'Set auth_status to 2'=> '设为审核不通过',
+ 'Reason' => '审核不通过原因',
+ 'Sale' => '总销量',
+ 'Stock' => '限制总人数',
+ 'Views' => '浏览量',
+ 'Expirestatus' => '过期状态',
+ 'Expirestatus 1' => '进行中',
+ 'Expirestatus 2' => '已过期',
+ 'Add_type' => '添加人类型',
+ 'Add_type 1' => '机构',
+ 'Add_type 2' => '总后台',
+ 'Add_id' => '添加人id',
+ 'Admin_id' => '审核管理员id',
+ 'Auth_time' => '审核时间',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间',
+ 'Manystore.nickname' => '昵称',
+ 'Shop.name' => '店铺名称',
+ 'Shop.logo' => '品牌LOGO'
+];
diff --git a/application/admin/lang/zh-cn/school/classes/activity/activity_item.php b/application/admin/lang/zh-cn/school/classes/activity/activity_item.php
new file mode 100644
index 0000000..1e2876a
--- /dev/null
+++ b/application/admin/lang/zh-cn/school/classes/activity/activity_item.php
@@ -0,0 +1,31 @@
+ '机构账号id',
+ 'Shop_id' => '机构店铺id',
+ 'Classes_activity_id' => '课程活动id',
+ 'Name' => '活动项名称',
+ 'Price' => '项目价格(0为免费)',
+ 'Limit_num' => '本项目限定人数',
+ 'Age' => '年龄限制描述',
+ 'Status' => '状态',
+ 'Status 1' => '上架',
+ 'Set status to 1' => '设为上架',
+ 'Status 2' => '下架',
+ 'Set status to 2' => '设为下架',
+ 'Sex' => '性别限制',
+ 'Sex 1' => '男',
+ 'Sex 2' => '女',
+ 'Sex 3' => '男女不限',
+ 'Weigh' => '权重',
+ 'Sign_num' => '已报名人数',
+ 'Verification_num' => '已核销人数',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间',
+ 'Manystore.nickname' => '昵称',
+ 'Shop.name' => '店铺名称',
+ 'Shop.logo' => '品牌LOGO',
+ 'Activity.title' => '标题',
+ 'Activity.headimage' => '头图'
+];
diff --git a/application/admin/lang/zh-cn/school/classes/activity/activity_item_auth.php b/application/admin/lang/zh-cn/school/classes/activity/activity_item_auth.php
new file mode 100644
index 0000000..1e2876a
--- /dev/null
+++ b/application/admin/lang/zh-cn/school/classes/activity/activity_item_auth.php
@@ -0,0 +1,31 @@
+ '机构账号id',
+ 'Shop_id' => '机构店铺id',
+ 'Classes_activity_id' => '课程活动id',
+ 'Name' => '活动项名称',
+ 'Price' => '项目价格(0为免费)',
+ 'Limit_num' => '本项目限定人数',
+ 'Age' => '年龄限制描述',
+ 'Status' => '状态',
+ 'Status 1' => '上架',
+ 'Set status to 1' => '设为上架',
+ 'Status 2' => '下架',
+ 'Set status to 2' => '设为下架',
+ 'Sex' => '性别限制',
+ 'Sex 1' => '男',
+ 'Sex 2' => '女',
+ 'Sex 3' => '男女不限',
+ 'Weigh' => '权重',
+ 'Sign_num' => '已报名人数',
+ 'Verification_num' => '已核销人数',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间',
+ 'Manystore.nickname' => '昵称',
+ 'Shop.name' => '店铺名称',
+ 'Shop.logo' => '品牌LOGO',
+ 'Activity.title' => '标题',
+ 'Activity.headimage' => '头图'
+];
diff --git a/application/admin/lang/zh-cn/school/classes/activity/order/order.php b/application/admin/lang/zh-cn/school/classes/activity/order/order.php
new file mode 100644
index 0000000..2c327da
--- /dev/null
+++ b/application/admin/lang/zh-cn/school/classes/activity/order/order.php
@@ -0,0 +1,81 @@
+ '订单号',
+ 'Pay_no' => '微信支付单号',
+ 'User_id' => '下单人用户id',
+ 'Manystore_id' => '机构账号id',
+ 'Shop_id' => '机构id',
+ 'Code' => '核销码',
+ 'Codeimage' => '核销二维码图片',
+ 'Codeoneimage' => '核销一维码图片',
+ 'Classes_activity_id' => '课程活动id',
+ 'Activity_order_detail_id' => '订单课程活动id',
+ 'Beforeprice' => '订单优惠前金额',
+ 'Totalprice' => '订单应付金额',
+ 'Payprice' => '订单实付金额',
+ 'Pay_type' => '支付方式',
+ 'Pay_type yue' => '余额',
+ 'Pay_type wechat' => '微信',
+ 'Status' => '订单状态',
+ 'Status -3' => '已取消',
+ 'Set status to -3' => '设为已取消',
+ 'Status 0' => '待支付',
+ 'Set status to 0' => '设为待支付',
+ 'Status 2' => '已报名待审核',
+ 'Set status to 2' => '设为已报名待审核',
+ 'Status 3' => '已预约',
+ 'Set status to 3' => '设为已预约',
+ 'Status 4' => '售后中',
+ 'Set status to 4' => '设为售后中',
+ 'Status 6' => '已退款',
+ 'Set status to 6' => '设为已退款',
+ 'Status 9' => '已完成',
+ 'Set status to 9' => '设为已完成',
+ 'Before_status' => '售后前状态',
+ 'Before_status -3' => '已取消',
+ 'Before_status 0' => '未售后',
+ 'Before_status 2' => '已报名待审核',
+ 'Before_status 3' => '已预约',
+ 'Before_status 4' => '售后中',
+ 'Before_status 6' => '已退款',
+ 'Before_status 9' => '已完成',
+ 'Server_status' => '售后订单状态',
+ 'Server_status 0' => '正常',
+ 'Server_status 3' => '售后中',
+ 'Server_status 6' => '售后完成',
+ 'Canceltime' => '取消时间',
+ 'Paytime' => '支付时间',
+ 'Auth_time' => '审核时间',
+ 'Reservation_time' => '预约时间',
+ 'Finishtime' => '完成时间',
+ 'Refundtime' => '退款时间',
+ 'Total_refundprice' => '应退款金额',
+ 'Real_refundprice' => '实际退款金额',
+ 'Sub_refundprice' => '剩余未退金额',
+ 'Pay_json' => '三方支付信息json',
+ 'Platform' => '支付平台',
+ 'Verification_user_id' => '核销人用户id',
+ 'Verification_type' => '核销用户类型',
+ 'Reason' => '审核不通过原因',
+ 'Auth_status' => '审核状态',
+ 'Auth_status 0' => '待审核',
+ 'Auth_status 1' => '审核通过',
+ 'Auth_status 2' => '审核失败',
+ 'Auth_user_id' => '审核用户id',
+ 'Auth_type' => '审核用户类型',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间',
+ 'User.nickname' => '昵称',
+ 'User.realname' => '真实姓名',
+ 'User.mobile' => '手机号',
+ 'User.avatar' => '头像',
+ 'Manystore.nickname' => '昵称',
+ 'Shop.name' => '店铺名称',
+ 'Shop.logo' => '品牌LOGO',
+ 'Activity.title' => '标题',
+ 'Activity.headimage' => '头图',
+ 'Detail.title' => '标题',
+ 'Detail.headimage' => '头图'
+];
diff --git a/application/admin/lang/zh-cn/school/classes/activity/order/order_detail.php b/application/admin/lang/zh-cn/school/classes/activity/order/order_detail.php
new file mode 100644
index 0000000..7860377
--- /dev/null
+++ b/application/admin/lang/zh-cn/school/classes/activity/order/order_detail.php
@@ -0,0 +1,75 @@
+ '课程活动订单id',
+ 'Classes_activity_id' => '课程活动id',
+ 'Manystore_id' => '机构账号id',
+ 'Shop_id' => '机构id',
+ 'User_id' => '下单用户id',
+ 'Title' => '标题',
+ 'Headimage' => '头图',
+ 'Images' => '轮播图',
+ 'Address_type' => '地址类型',
+ 'Address_type 1' => '按机构',
+ 'Address_type 2' => '独立位置',
+ 'Address_city' => '城市选择',
+ 'Province' => '省编号',
+ 'City' => '市编号',
+ 'District' => '县区编号',
+ 'Address' => '活动地址',
+ 'Address_detail' => '活动详细地址',
+ 'Longitude' => '经度',
+ 'Latitude' => '纬度',
+ 'Start_time' => '活动开始时间',
+ 'End_time' => '活动结束时间',
+ 'Sign_start_time' => '报名开始时间',
+ 'Sign_end_time' => '报名结束时间',
+ 'Price' => '报名费用',
+ 'People_num' => '活动人数',
+ 'Item' => '活动项目',
+ 'Content' => '活动详情',
+ 'Status' => '状态',
+ 'Status 1' => '上架',
+ 'Set status to 1' => '设为上架',
+ 'Status 2' => '下架',
+ 'Set status to 2' => '设为下架',
+ 'Status 3' => '平台下架',
+ 'Set status to 3' => '设为平台下架',
+ 'Weigh' => '权重',
+ 'Recommend' => '平台推荐',
+ 'Recommend 0' => '否',
+ 'Recommend 1' => '是',
+ 'Hot' => '平台热门',
+ 'Hot 0' => '否',
+ 'Hot 1' => '是',
+ 'New' => '平台最新',
+ 'New 0' => '否',
+ 'New 1' => '是',
+ 'Selfhot' => '机构热门',
+ 'Selfhot 0' => '否',
+ 'Selfhot 1' => '是',
+ 'Sale' => '总销量',
+ 'Stock' => '限制总人数',
+ 'Views' => '浏览量',
+ 'Expirestatus' => '过期状态',
+ 'Expirestatus 1' => '进行中',
+ 'Expirestatus 2' => '已过期',
+ 'Add_type' => '添加人类型',
+ 'Add_type 1' => '机构',
+ 'Add_type 2' => '总后台',
+ 'Add_id' => '添加人id',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间',
+ 'Order.order_no' => '订单号',
+ 'Order.pay_no' => '微信支付单号',
+ 'Activity.title' => '标题',
+ 'Activity.headimage' => '头图',
+ 'Manystore.nickname' => '昵称',
+ 'Shop.name' => '店铺名称',
+ 'Shop.logo' => '品牌LOGO',
+ 'User.nickname' => '昵称',
+ 'User.realname' => '真实姓名',
+ 'User.mobile' => '手机号',
+ 'User.avatar' => '头像'
+];
diff --git a/application/admin/lang/zh-cn/school/classes/activity/order/order_log.php b/application/admin/lang/zh-cn/school/classes/activity/order/order_log.php
new file mode 100644
index 0000000..97a87fd
--- /dev/null
+++ b/application/admin/lang/zh-cn/school/classes/activity/order/order_log.php
@@ -0,0 +1,28 @@
+ '课程活动订单id',
+ 'Status' => '订单状态',
+ 'Status -3' => '已取消',
+ 'Set status to -3' => '设为已取消',
+ 'Status 0' => '待支付',
+ 'Set status to 0' => '设为待支付',
+ 'Status 2' => '已报名待审核',
+ 'Set status to 2' => '设为已报名待审核',
+ 'Status 3' => '已预约',
+ 'Set status to 3' => '设为已预约',
+ 'Status 4' => '售后中',
+ 'Set status to 4' => '设为售后中',
+ 'Status 6' => '已退款',
+ 'Set status to 6' => '设为已退款',
+ 'Status 9' => '已完成',
+ 'Set status to 9' => '设为已完成',
+ 'Log_text' => '记录内容',
+ 'Oper_type' => '记录人类型',
+ 'Oper_id' => '记录人id',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间',
+ 'Order.order_no' => '订单号',
+ 'Order.pay_no' => '微信支付单号'
+];
diff --git a/application/admin/model/school/classes/activity/Activity.php b/application/admin/model/school/classes/activity/Activity.php
new file mode 100644
index 0000000..76eedab
--- /dev/null
+++ b/application/admin/model/school/classes/activity/Activity.php
@@ -0,0 +1,219 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ }
+ });
+ }
+
+
+ public function getAddressTypeList()
+ {
+ return ['1' => __('Address_type 1'), '2' => __('Address_type 2')];
+ }
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')];
+ }
+
+ public function getRecommendList()
+ {
+ return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
+ }
+
+ public function getHotList()
+ {
+ return ['0' => __('Hot 0'), '1' => __('Hot 1')];
+ }
+
+ public function getNewList()
+ {
+ return ['0' => __('New 0'), '1' => __('New 1')];
+ }
+
+ public function getSelfhotList()
+ {
+ return ['0' => __('Selfhot 0'), '1' => __('Selfhot 1')];
+ }
+
+ public function getExpirestatusList()
+ {
+ return ['1' => __('Expirestatus 1'), '2' => __('Expirestatus 2')];
+ }
+
+ public function getAddTypeList()
+ {
+ return ['1' => __('Add_type 1'), '2' => __('Add_type 2')];
+ }
+
+
+ public function getAddressTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['address_type']) ? $data['address_type'] : '');
+ $list = $this->getAddressTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_start_time']) ? $data['sign_start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_end_time']) ? $data['sign_end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getRecommendTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['recommend']) ? $data['recommend'] : '');
+ $list = $this->getRecommendList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getHotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['hot']) ? $data['hot'] : '');
+ $list = $this->getHotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getNewTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['new']) ? $data['new'] : '');
+ $list = $this->getNewList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSelfhotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['selfhot']) ? $data['selfhot'] : '');
+ $list = $this->getSelfhotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getExpirestatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['expirestatus']) ? $data['expirestatus'] : '');
+ $list = $this->getExpirestatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAddTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : '');
+ $list = $this->getAddTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+ protected function setStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function shop()
+ {
+ return $this->belongsTo(Shop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/admin/model/school/classes/activity/ActivityAuth.php b/application/admin/model/school/classes/activity/ActivityAuth.php
new file mode 100644
index 0000000..d0924bc
--- /dev/null
+++ b/application/admin/model/school/classes/activity/ActivityAuth.php
@@ -0,0 +1,252 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ }
+ });
+ }
+
+
+ public function getAddressTypeList()
+ {
+ return ['1' => __('Address_type 1'), '2' => __('Address_type 2')];
+ }
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')];
+ }
+
+ public function getRecommendList()
+ {
+ return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
+ }
+
+ public function getHotList()
+ {
+ return ['0' => __('Hot 0'), '1' => __('Hot 1')];
+ }
+
+ public function getNewList()
+ {
+ return ['0' => __('New 0'), '1' => __('New 1')];
+ }
+
+ public function getSelfhotList()
+ {
+ return ['0' => __('Selfhot 0'), '1' => __('Selfhot 1')];
+ }
+
+ public function getAuthStatusList()
+ {
+ return ['0' => __('Auth_status 0'), '1' => __('Auth_status 1'), '2' => __('Auth_status 2')];
+ }
+
+ public function getExpirestatusList()
+ {
+ return ['1' => __('Expirestatus 1'), '2' => __('Expirestatus 2')];
+ }
+
+ public function getAddTypeList()
+ {
+ return ['1' => __('Add_type 1'), '2' => __('Add_type 2')];
+ }
+
+
+ public function getAddressTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['address_type']) ? $data['address_type'] : '');
+ $list = $this->getAddressTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_start_time']) ? $data['sign_start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_end_time']) ? $data['sign_end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getRecommendTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['recommend']) ? $data['recommend'] : '');
+ $list = $this->getRecommendList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getHotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['hot']) ? $data['hot'] : '');
+ $list = $this->getHotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getNewTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['new']) ? $data['new'] : '');
+ $list = $this->getNewList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSelfhotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['selfhot']) ? $data['selfhot'] : '');
+ $list = $this->getSelfhotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAuthStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['auth_status']) ? $data['auth_status'] : '');
+ $list = $this->getAuthStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getExpirestatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['expirestatus']) ? $data['expirestatus'] : '');
+ $list = $this->getExpirestatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAddTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : '');
+ $list = $this->getAddTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAuthTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['auth_time']) ? $data['auth_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+ protected function setStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setAuthTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+
+ public function activity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function shop()
+ {
+ return $this->belongsTo(Shop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/admin/model/school/classes/activity/ActivityItem.php b/application/admin/model/school/classes/activity/ActivityItem.php
new file mode 100644
index 0000000..a708c5d
--- /dev/null
+++ b/application/admin/model/school/classes/activity/ActivityItem.php
@@ -0,0 +1,91 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ }
+ });
+ }
+
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2')];
+ }
+
+ public function getSexList()
+ {
+ return ['1' => __('Sex 1'), '2' => __('Sex 2'), '3' => __('Sex 3')];
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSexTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sex']) ? $data['sex'] : '');
+ $list = $this->getSexList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function shop()
+ {
+ return $this->belongsTo(Shop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function activity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/admin/model/school/classes/activity/ActivityItemAuth.php b/application/admin/model/school/classes/activity/ActivityItemAuth.php
new file mode 100644
index 0000000..6d821e9
--- /dev/null
+++ b/application/admin/model/school/classes/activity/ActivityItemAuth.php
@@ -0,0 +1,91 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ }
+ });
+ }
+
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2')];
+ }
+
+ public function getSexList()
+ {
+ return ['1' => __('Sex 1'), '2' => __('Sex 2'), '3' => __('Sex 3')];
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSexTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sex']) ? $data['sex'] : '');
+ $list = $this->getSexList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function shop()
+ {
+ return $this->belongsTo(Shop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function activity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/admin/model/school/classes/activity/Order.php b/application/admin/model/school/classes/activity/Order.php
new file mode 100644
index 0000000..8ced43c
--- /dev/null
+++ b/application/admin/model/school/classes/activity/Order.php
@@ -0,0 +1,12 @@
+ __('Pay_type yue'), 'wechat' => __('Pay_type wechat')];
+ }
+
+ public function getStatusList()
+ {
+ return ['-3' => __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4'), '6' => __('Status 6'), '9' => __('Status 9')];
+ }
+
+ public function getBeforeStatusList()
+ {
+ return ['-3' => __('Before_status -3'), '0' => __('Before_status 0'), '2' => __('Before_status 2'), '3' => __('Before_status 3'), '4' => __('Before_status 4'), '6' => __('Before_status 6'), '9' => __('Before_status 9')];
+ }
+
+ public function getServerStatusList()
+ {
+ return ['0' => __('Server_status 0'), '3' => __('Server_status 3'), '6' => __('Server_status 6')];
+ }
+
+ public function getAuthStatusList()
+ {
+ return ['0' => __('Auth_status 0'), '1' => __('Auth_status 1'), '2' => __('Auth_status 2')];
+ }
+
+
+ public function getPayTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['pay_type']) ? $data['pay_type'] : '');
+ $list = $this->getPayTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getBeforeStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['before_status']) ? $data['before_status'] : '');
+ $list = $this->getBeforeStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getServerStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['server_status']) ? $data['server_status'] : '');
+ $list = $this->getServerStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getCanceltimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['canceltime']) ? $data['canceltime'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getPaytimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['paytime']) ? $data['paytime'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getAuthTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['auth_time']) ? $data['auth_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getReservationTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['reservation_time']) ? $data['reservation_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getFinishtimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['finishtime']) ? $data['finishtime'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getRefundtimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['refundtime']) ? $data['refundtime'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getAuthStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['auth_status']) ? $data['auth_status'] : '');
+ $list = $this->getAuthStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+ protected function setCanceltimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setPaytimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setAuthTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setReservationTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setFinishtimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setRefundtimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+
+ public function user()
+ {
+ return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function shop()
+ {
+ return $this->belongsTo(Shop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function activity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function detail()
+ {
+ return $this->belongsTo(OrderDetail::class, 'activity_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/admin/model/school/classes/activity/order/OrderDetail.php b/application/admin/model/school/classes/activity/order/OrderDetail.php
new file mode 100644
index 0000000..f30663a
--- /dev/null
+++ b/application/admin/model/school/classes/activity/order/OrderDetail.php
@@ -0,0 +1,238 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ }
+ });
+ }
+
+
+ public function getAddressTypeList()
+ {
+ return ['1' => __('Address_type 1'), '2' => __('Address_type 2')];
+ }
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')];
+ }
+
+ public function getRecommendList()
+ {
+ return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
+ }
+
+ public function getHotList()
+ {
+ return ['0' => __('Hot 0'), '1' => __('Hot 1')];
+ }
+
+ public function getNewList()
+ {
+ return ['0' => __('New 0'), '1' => __('New 1')];
+ }
+
+ public function getSelfhotList()
+ {
+ return ['0' => __('Selfhot 0'), '1' => __('Selfhot 1')];
+ }
+
+ public function getExpirestatusList()
+ {
+ return ['1' => __('Expirestatus 1'), '2' => __('Expirestatus 2')];
+ }
+
+ public function getAddTypeList()
+ {
+ return ['1' => __('Add_type 1'), '2' => __('Add_type 2')];
+ }
+
+
+ public function getAddressTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['address_type']) ? $data['address_type'] : '');
+ $list = $this->getAddressTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_start_time']) ? $data['sign_start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_end_time']) ? $data['sign_end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getRecommendTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['recommend']) ? $data['recommend'] : '');
+ $list = $this->getRecommendList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getHotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['hot']) ? $data['hot'] : '');
+ $list = $this->getHotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getNewTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['new']) ? $data['new'] : '');
+ $list = $this->getNewList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSelfhotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['selfhot']) ? $data['selfhot'] : '');
+ $list = $this->getSelfhotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getExpirestatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['expirestatus']) ? $data['expirestatus'] : '');
+ $list = $this->getExpirestatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAddTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : '');
+ $list = $this->getAddTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+ protected function setStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+
+ public function activityorder()
+ {
+ return $this->belongsTo(Order::class, 'classes_activity_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function activity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function shop()
+ {
+ return $this->belongsTo(Shop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function user()
+ {
+ return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/admin/model/school/classes/activity/order/OrderLog.php b/application/admin/model/school/classes/activity/order/OrderLog.php
new file mode 100644
index 0000000..74e71e0
--- /dev/null
+++ b/application/admin/model/school/classes/activity/order/OrderLog.php
@@ -0,0 +1,53 @@
+ __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4'), '6' => __('Status 6'), '9' => __('Status 9')];
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+
+
+ public function activityorder()
+ {
+ return $this->belongsTo(Order::class, 'classes_activity_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/admin/validate/school/classes/activity/Activity.php b/application/admin/validate/school/classes/activity/Activity.php
new file mode 100644
index 0000000..f952d96
--- /dev/null
+++ b/application/admin/validate/school/classes/activity/Activity.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/admin/validate/school/classes/activity/ActivityAuth.php b/application/admin/validate/school/classes/activity/ActivityAuth.php
new file mode 100644
index 0000000..d548348
--- /dev/null
+++ b/application/admin/validate/school/classes/activity/ActivityAuth.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/admin/validate/school/classes/activity/ActivityItem.php b/application/admin/validate/school/classes/activity/ActivityItem.php
new file mode 100644
index 0000000..671f350
--- /dev/null
+++ b/application/admin/validate/school/classes/activity/ActivityItem.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/admin/validate/school/classes/activity/ActivityItemAuth.php b/application/admin/validate/school/classes/activity/ActivityItemAuth.php
new file mode 100644
index 0000000..054f032
--- /dev/null
+++ b/application/admin/validate/school/classes/activity/ActivityItemAuth.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/admin/validate/school/classes/activity/order/Order.php b/application/admin/validate/school/classes/activity/order/Order.php
new file mode 100644
index 0000000..d988f61
--- /dev/null
+++ b/application/admin/validate/school/classes/activity/order/Order.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/admin/validate/school/classes/activity/order/OrderDetail.php b/application/admin/validate/school/classes/activity/order/OrderDetail.php
new file mode 100644
index 0000000..5583c92
--- /dev/null
+++ b/application/admin/validate/school/classes/activity/order/OrderDetail.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/admin/validate/school/classes/activity/order/OrderLog.php b/application/admin/validate/school/classes/activity/order/OrderLog.php
new file mode 100644
index 0000000..c009798
--- /dev/null
+++ b/application/admin/validate/school/classes/activity/order/OrderLog.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/admin/view/school/classes/activity/activity/add.html b/application/admin/view/school/classes/activity/activity/add.html
new file mode 100644
index 0000000..dfd92ee
--- /dev/null
+++ b/application/admin/view/school/classes/activity/activity/add.html
@@ -0,0 +1,302 @@
+
diff --git a/application/common/listener/classesorder/OrderHook.php b/application/common/listener/classesorder/OrderHook.php
index a452ddc..f979dcb 100644
--- a/application/common/listener/classesorder/OrderHook.php
+++ b/application/common/listener/classesorder/OrderHook.php
@@ -2,6 +2,7 @@
namespace app\common\listener\classesorder;
use app\common\model\school\classes\Evaluate;
use app\common\model\school\Message;
+use app\common\model\school\MessageConfig;
class OrderHook
{
@@ -18,27 +19,34 @@ class OrderHook
{
["order"=>$order] = $params;
$detail = $order->detail;
+ $user = $order->user;
//记录订单日志
-
- $desc = "课程{$detail["title"]}订单创建成功,等待【学员】支付";
-
- $title = "课程订单创建成功";
$mini_type = "order_notice";
- $to_type="user";
$to_id = $order["user_id"];
$status ="classes";
- $platform="user";
- $oper_id=0;
- $oper_type="system";
$params=[
"event"=>"classes_order_create_after",
"order_id"=>$order["id"],
"order_no"=>$order["order_no"],
"classes_lib_id"=>$order["classes_lib_id"],
];
- Message::$event_name = $params["event"];
- Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
+ $param = [
+ "title"=>$detail["title"],
+ "order_no" => $order["order_no"],
+ "nickname" => $user["nickname"],
+ "realname" => $user["realname"],
+ "mobile" => $user["mobile"],
+ "price" => $order["totalprice"],
+ ];
+ (new MessageConfig)
+ ->setTemplate($params["event"])
+ ->setTemplateData($param)
+ ->setToUid($to_id)
+ ->setMessageStatus($status)
+ ->setMessageMiniType($mini_type)
+ ->setMessageParams($params)
+ ->sendMessage();
}
@@ -50,25 +58,34 @@ class OrderHook
["order"=>$order] = $params;
$detail = $order->detail;
//记录订单日志
-
- $desc = "课程{$detail["title"]}订单支付成功,您可以正常约课了";
-
- $title = "课程订单支付成功";
+ $user = $order->user;
$mini_type = "order_notice";
- $to_type="user";
$to_id = $order["user_id"];
$status ="classes";
- $platform="user";
- $oper_id=0;
- $oper_type="system";
$params=[
"event"=>"classes_order_payed_after",
"order_id"=>$order["id"],
"order_no"=>$order["order_no"],
"classes_lib_id"=>$order["classes_lib_id"],
];
- Message::$event_name = $params["event"];
- Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
+
+ $param = [
+ "title"=>$detail["title"],
+ "order_no" => $order["order_no"],
+ "nickname" => $user["nickname"],
+ "realname" => $user["realname"],
+ "mobile" => $user["mobile"],
+ "price" => $order["payprice"],
+ ];
+
+ (new MessageConfig)
+ ->setTemplate($params["event"])
+ ->setTemplateData($param)
+ ->setToUid($to_id)
+ ->setMessageStatus($status)
+ ->setMessageMiniType($mini_type)
+ ->setMessageParams($params)
+ ->sendMessage();
}
@@ -79,27 +96,44 @@ class OrderHook
['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params;
$detail = $order->detail;
+ $user = $order->user;
if(!$user_id ||$order["user_id"] !=$user_id ){
- $desc = "[系统操作]课程{$detail["title"]}订单未支付取消成功";
+ $desc = "[系统操作]";
}else{
- $desc = "课程{$detail["title"]}订单未支付取消成功";
+ $desc = "";
}
- $title = "课程订单已取消";
+
$mini_type = "order_notice";
- $to_type="user";
+
$to_id = $order["user_id"];
$status ="classes";
- $platform="user";
- $oper_id=0;
- $oper_type="system";
+
$params=[
"event"=>"classes_order_cancel_after",
"order_id"=>$order["id"],
"order_no"=>$order["order_no"],
];
- Message::$event_name = $params["event"];
- Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
+
+ $param = [
+ "system"=> $desc,
+ "title"=> $detail["title"],
+ "order_no" => $order["order_no"],
+ "nickname" => $user["nickname"],
+ "realname" => $user["realname"],
+ "mobile" => $user["mobile"],
+ "price" => $order["payprice"],
+ ];
+
+ (new MessageConfig)
+ ->setTemplate($params["event"])
+ ->setTemplateData($param)
+ ->setToUid($to_id)
+ ->setMessageStatus($status)
+ ->setMessageMiniType($mini_type)
+ ->setMessageParams($params)
+ ->sendMessage();
+
}
diff --git a/application/common/model/school/MessageConfig.php b/application/common/model/school/MessageConfig.php
index 98dffce..3920ee8 100644
--- a/application/common/model/school/MessageConfig.php
+++ b/application/common/model/school/MessageConfig.php
@@ -2,6 +2,9 @@
namespace app\common\model\school;
+
+use bw\Common;
+use think\Cache;
use think\Model;
use traits\model\SoftDelete;
@@ -22,6 +25,72 @@ class MessageConfig extends Model
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
+ protected $messageTemplate = null;
+ protected $templateData = [];
+
+ protected $templateString = "";
+
+ protected $messageMiniType = "other";
+ protected $messagePlatform="user";
+ protected $messageOperId=0;
+ protected $messageOperType="system";
+ protected $messageToType="user";
+ protected $messageStatus = "system";
+ protected $messageParams = [];
+
+ //创建上面变量的get和set方法
+ public function setMessageMiniType($value){
+ $this->messageMiniType = $value;
+ return $this;
+ }
+ public function getMessageMiniType(){
+ return $this->messageMiniType;
+ }
+ public function setMessagePlatform($value){
+ $this->messagePlatform = $value;
+ return $this;
+ }
+ public function getMessagePlatform(){
+ return $this->messagePlatform;
+ }
+ public function setMessageOperId($value){
+ $this->messageOperId = $value;
+ return $this;
+ }
+ public function getMessageOperId(){
+ return $this->messageOperId;
+ }
+ public function setMessageOperType($value){
+ $this->messageOperType = $value;
+ return $this;
+ }
+ public function getMessageOperType(){
+ return $this->messageOperType;
+ }
+ public function setMessageToType($value){
+ $this->messageToType = $value;
+ return $this;
+ }
+ public function getMessageToType(){
+ return $this->messageToType;
+ }
+ public function setMessageStatus($value){
+ $this->messageStatus = $value;
+ return $this;
+ }
+ public function getMessageStatus(){
+ return $this->messageStatus;
+ }
+ public function setMessageParams($value){
+ $this->messageParams = $value;
+ return $this;
+ }
+ public function getMessageParams(){
+ return $this->messageParams;
+ }
+
+
+ protected $toUid = 0;
// 追加属性
protected $append = [
@@ -101,7 +170,97 @@ class MessageConfig extends Model
if (!empty($value)) return cdnurl($value, true);
}
+ public function setTemplate($event_name,$params=[],$to_uid=0){
+ $this->messageTemplate = MessageConfigItem::where("event_two",$event_name)->find();
+ if(!$this->messageTemplate) throw new \Exception("消息模板不存在");
+ //设置模板内容
+ if($params){
+ $this->setTemplateData($params);
+ }
+ if($to_uid)$this->setToUid($to_uid);
+ return $this;
+ }
+
+ public function setTemplateData( $params,$expression = '{{KEYWORD}}'){
+ $this->templateData = $params;
+ $this->setMessageContent($expression);
+ return $this;
+ }
+
+ public function getMessageContent(){
+ return $this->templateString;
+ }
+ public function getTemplate(){
+ return $this->messageTemplate;
+ }
+ public function getToUid(){
+ return $this->toUid;
+ }
+
+ public function setToUid($uid){
+ $this->toUid = $uid;
+ return $this;
+ }
+ /**
+ * 得到语音播报内容(讯飞语音)
+ */
+ public function setMessageContent($expression = '{{KEYWORD}}'){
+ $template = $this->messageTemplate;
+ $template_content = $template['selfmail_template_text'];
+ //解析获取文本内容
+ $this->templateString = Common::parsePrintTemplateString($template_content,$this->templateData,$expression);
+ return $this;
+ }
+
+
+ public function sendSelfmail($to_uid=0){
+ if($to_uid)$this->setToUid($to_uid);
+ $template = $this->messageTemplate;
+ if(!$template) return true;
+ if($template['selfmail'] == '1'){
+ if(!$this->toUid) throw new \Exception("发送对象不能为空");
+ $message_content = $this->getMessageContent();
+ $message_title = $template['selfmail_title'];
+ if(!$message_content || !$message_title)return false;
+ Message::$event_name = $template["event"];
+ Message::send($message_title,$message_content,$this->getMessageMiniType(),$this->toUid,$this->messageToType,$this->messageStatus,$this->messagePlatform,$this->messageParams,$this->messageOperId, $this->messageOperType);
+ }else{
+ return true;
+ }
+ }
+
+
+ public function sendWechatWap($to_uid=0){
+ if($to_uid)$this->setToUid($to_uid);
+ $template = $this->messageTemplate;
+ if(!$template) return true;
+ if($template['wechat_wap'] == '1'){
+ if(!$this->toUid) throw new \Exception("发送对象不能为空");
+
+ }else{
+ return true;
+ }
+ }
+
+ public function sendMobileMessage($to_uid=0){
+ if($to_uid)$this->setToUid($to_uid);
+ $template = $this->messageTemplate;
+ if(!$template) return true;
+ if($template['message'] == '1'){
+ if(!$this->toUid) throw new \Exception("发送对象不能为空");
+
+ }else{
+ return true;
+ }
+ }
+ public function sendMessage($to_uid=0){
+ $this->sendSelfmail($to_uid);
+ $this->sendMobileMessage($to_uid);
+ $this->sendWechatWap($to_uid);
+ return $this;
+ }
+
}
diff --git a/application/common/model/school/MessageConfigItem.php b/application/common/model/school/MessageConfigItem.php
new file mode 100644
index 0000000..cc933a9
--- /dev/null
+++ b/application/common/model/school/MessageConfigItem.php
@@ -0,0 +1,91 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ }
+ });
+ }
+
+
+ public function getWechatWapList()
+ {
+ return ['1' => __('Wechat_wap 1'), '2' => __('Wechat_wap 2')];
+ }
+
+ public function getMessageList()
+ {
+ return ['1' => __('Message 1'), '2' => __('Message 2')];
+ }
+
+ public function getSelfmailList()
+ {
+ return ['1' => __('Selfmail 1'), '2' => __('Selfmail 2')];
+ }
+
+
+ public function getWechatWapTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['wechat_wap']) ? $data['wechat_wap'] : '');
+ $list = $this->getWechatWapList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getMessageTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['message']) ? $data['message'] : '');
+ $list = $this->getMessageList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSelfmailTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['selfmail']) ? $data['selfmail'] : '');
+ $list = $this->getSelfmailList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+
+
+ public function config()
+ {
+ return $this->belongsTo(MessageConfig::class, 'event', 'event', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/common/model/school/classes/activity/Activity.php b/application/common/model/school/classes/activity/Activity.php
new file mode 100644
index 0000000..b9cf42f
--- /dev/null
+++ b/application/common/model/school/classes/activity/Activity.php
@@ -0,0 +1,561 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ }
+ });
+ }
+
+
+ public function getAddressTypeList()
+ {
+ return ['1' => __('Address_type 1'), '2' => __('Address_type 2')];
+ }
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')];
+ }
+
+ public function getRecommendList()
+ {
+ return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
+ }
+
+ public function getHotList()
+ {
+ return ['0' => __('Hot 0'), '1' => __('Hot 1')];
+ }
+
+ public function getNewList()
+ {
+ return ['0' => __('New 0'), '1' => __('New 1')];
+ }
+
+ public function getSelfhotList()
+ {
+ return ['0' => __('Selfhot 0'), '1' => __('Selfhot 1')];
+ }
+
+ public function getExpirestatusList()
+ {
+ return ['1' => __('Expirestatus 1'), '2' => __('Expirestatus 2')];
+ }
+
+ public function getAddTypeList()
+ {
+ return ['1' => __('Add_type 1'), '2' => __('Add_type 2')];
+ }
+
+
+ public function getAddressTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['address_type']) ? $data['address_type'] : '');
+ $list = $this->getAddressTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_start_time']) ? $data['sign_start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_end_time']) ? $data['sign_end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getRecommendTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['recommend']) ? $data['recommend'] : '');
+ $list = $this->getRecommendList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getHotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['hot']) ? $data['hot'] : '');
+ $list = $this->getHotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getNewTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['new']) ? $data['new'] : '');
+ $list = $this->getNewList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSelfhotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['selfhot']) ? $data['selfhot'] : '');
+ $list = $this->getSelfhotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getExpirestatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['expirestatus']) ? $data['expirestatus'] : '');
+ $list = $this->getExpirestatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAddTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : '');
+ $list = $this->getAddTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+ protected function setStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function shop()
+ {
+ return $this->belongsTo(ManystoreShop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+
+ public function activityCheck(&$params,$shop_id=null,$row=null,$oper_type='user',$oper_id=0)
+ {
+
+
+
+
+
+
+ $params["status"] = $params["status"] ?? '3';
+ if(!$shop_id)$shop_id = $params["shop_id"] ?? 0;
+ if(empty($params["weigh"]))$params["weigh"] = 0;
+
+
+ $manystore = Manystore::where("shop_id",$shop_id)->find();
+ if(!$manystore){
+ throw new \Exception("店铺不存在");
+ }
+ if(!(new \app\common\model\dyqc\ManystoreShop)->checkFull($shop_id))throw new \Exception("对方的认证信息未完善,请您先去帮忙完善!");
+
+
+ $params["manystore_id"] = $manystore["id"];
+
+
+//开始和结束时间不能为空
+ $time = $params["time"];
+
+ if(empty($time))throw new \Exception("{$params["title"]}请选择开始和结束时间".$time);
+ $split_line = " - ";
+ $time_arr = explode($split_line,$time);
+ $params["start_time"] = $time_arr[0] ;
+ $params["end_time"] = $time_arr[1];
+ unset($params["time"]);
+
+ $start_time = $params["start_time"];
+ $end_time = $params["end_time"];
+
+ if(empty($start_time) || empty($end_time)){
+ throw new \Exception("{$params["title"]}请选择开始和结束时间".$time);
+ }
+ //转化时间戳
+ $start_time = $params["start_time"] && !is_numeric($params["start_time"]) ? strtotime($params["start_time"]) : $params["start_time"];
+ $end_time = $params["end_time"] && !is_numeric($params["end_time"]) ? strtotime($params["end_time"]) : $params["end_time"];
+ //结束时间不能小于开始时间
+ if($end_time<=$start_time){
+ throw new \Exception("{$params["title"]}结束时间不能小于开始时间");
+ }
+
+
+
+
+
+
+ //开始和结束时间不能为空
+ $time = $params["sign_time"];
+
+ if(empty($time))throw new \Exception("{$params["title"]}请选择开始和结束时间".$time);
+ $split_line = " - ";
+ $time_arr = explode($split_line,$time);
+ $params["sign_start_time"] = $time_arr[0] ;
+ $params["sign_end_time"] = $time_arr[1];
+ unset($params["sign_time"]);
+
+ $start_time = $params["sign_start_time"];
+ $end_time = $params["sign_end_time"];
+
+ if(empty($start_time) || empty($end_time)){
+ throw new \Exception("{$params["title"]}请选择开始和结束时间".$time);
+ }
+ //转化时间戳
+ $start_time = $params["sign_start_time"] && !is_numeric($params["sign_start_time"]) ? strtotime($params["sign_start_time"]) : $params["sign_start_time"];
+ $end_time = $params["sign_end_time"] && !is_numeric($params["sign_end_time"]) ? strtotime($params["sign_end_time"]) : $params["sign_end_time"];
+ //结束时间不能小于开始时间
+ if($end_time<=$start_time){
+ throw new \Exception("{$params["title"]}结束时间不能小于开始时间");
+ }
+
+
+
+
+
+ //课时必须大于等于1
+// if($params["classes_num"] < 1) throw new \Exception("课时必须大于等于1");
+ if($params["price"] < 0) throw new \Exception("售价必须大于0");
+
+
+ //独立地点需传定位信息
+ if($params["address_type"] == "2"){
+
+ if(empty($params["address_city"])
+ && !empty($params["province"])
+ && !empty($params["city"])
+ && !empty($params["district"])){
+
+ $province_name = Area::where("id" ,$params['province'])->value("name");
+ if(!$province_name) throw new \Exception("省份不存在");
+ $city_name = Area::where("id" ,$params['city'])->value("name");
+ if(!$city_name) throw new \Exception("市不存在");
+ $district_name = Area::where("id" ,$params['district'])->value("name");
+ if(!$district_name) throw new \Exception("区县不存在");
+ $params['address_city'] = $province_name."/".$city_name."/".$district_name;
+ }
+
+
+
+ if(empty($params["address_city"])
+ || empty($params["province"])
+ || empty($params["city"])
+ || empty($params["district"])
+ || empty($params["longitude"])
+ || empty($params["latitude"])
+ || empty($params["address"])
+ || empty($params["address_detail"])
+ ) throw new \Exception("独立地点需传定位信息");
+
+ }else{
+ //地址取机构的
+ $shop = ManystoreShop::where("id",$shop_id)->find();
+ if(!$shop){
+ throw new \Exception("店铺不存在");
+ }
+ if(empty($shop["address_city"])
+ || empty($shop["province"])
+ || empty($shop["city"])
+ || empty($shop["district"])
+ || empty($shop["longitude"])
+ || empty($shop["latitude"])
+ || empty($shop["address"])
+ || empty($shop["address_detail"])
+ ) throw new \Exception("当前机构地址并未完善,请在机构处完善!");
+
+
+
+ $params["address_city"] = $shop["address_city"];
+ $params["province"] = $shop["province"];
+ $params["city"] = $shop["city"];
+ $params["district"] = $shop["district"];
+ $params["longitude"] = $shop["longitude"];
+ $params["latitude"] = $shop["latitude"];
+ $params["address"] = $shop["address"];
+ $params["address_detail"] = $shop["address_detail"];
+ //address
+// var_dump($params);
+ }
+
+ ;
+
+ //收费免费判断
+ if($params["price"]==0){
+ $params["feel"] = "1";
+ }else{
+
+ //个人认证无法下付费课程
+ $shop = ManystoreShop::where("id",$shop_id)->find();
+ if($shop["type"]=="1"){
+ throw new \Exception("这个机构属于个人认证,无法发布付费活动!");
+ }
+
+ $params["feel"] = "0";
+ }
+
+
+ $rule = [
+ 'manystore_id'=>'require',
+ 'shop_id'=>'require',
+ 'headimage' => 'require',
+ 'title' => 'require',
+ 'images' => 'require',
+ 'address' => 'require',
+ 'address_detail' => 'require',
+ 'longitude' => 'require',
+ 'latitude' => 'require',
+ 'province' => 'require',
+ 'city' => 'require',
+ 'district' => 'require',
+ 'address_city' => 'require',
+ 'address_type' => 'require',
+ 'content' => 'require',
+ 'price' => 'require',
+
+ ];
+
+
+ $rule_msg = [
+ "manystore_id.require"=>'机构id必填',
+ "shop_id.require"=>'机构id必填',
+ "headimage.require"=>'课程活动头图必填',
+ 'title.require' => '活动名称必须填写',
+ 'images.require' => '活动轮播图必须上传',
+ 'address.require' => '地址必填',
+ 'address_detail.require' => '详细地址必填',
+ 'longitude.require' => '经度必填',
+ 'latitude.require' => '纬度必填',
+ 'province.require' => '省编号必填',
+ 'city.require' => '市编号必填',
+ 'district.require' => '县区编号必填',
+ 'address_city.require' => '城市选择必填',
+ 'address_type.require'=> '地址类型必填',
+ 'content.require'=> '活动详情必填',
+ 'price.require'=> '活动售价必填',
+
+
+ ];
+
+ self::check($params,$rule,$rule_msg);
+
+
+
+
+
+ //更新
+ if($row){
+// $this->have_auth = false;
+// if($this->need_auth){
+// //判断更新的变动数据
+// $this->no_auth_fields_check($params,$row);
+// if($this->have_auth){
+// $params['status'] = "3";
+// }
+// }
+
+// $this->updateCheck($row->id,$params,$row);
+
+
+ //名称title不能与其他课程重复
+ $check_title = self::where('id','<>',$row["id"])->where('title',$params["title"])->find();
+ if($check_title){
+ throw new \Exception("活动名称已存在或被其他机构占用,请更改!");
+ }
+
+
+
+ //如果存在课程规格,验证每个课时规格的合法性
+ if(isset($params["item_json"])){
+ //如果存在"的HTML转义字符,先反转义再解析json
+ $params["item_json"] = html_entity_decode($params["item_json"]);
+ $spec = json_decode($params["item_json"],true);
+ if(empty($spec))throw new \Exception("请至少添加一个课时规格");
+
+ foreach ($spec as $k=>&$v){
+ unset($v["limit"]);
+ unset($v["status_name"]);
+ unset($v["visible"]);
+ $v["classes_activity_id"] = $row->id;
+ $v["manystore_id"] = $params["manystore_id"];
+ $v["shop_id"] = $shop_id;
+ //先不进行判定,交给提交后再判定
+ $classesSpec = new ActivityItem();
+ $classesSpec->specCheck($v,$shop_id,empty($v["id"])? null : ActivityItem::get($v["id"]),false,$oper_type,$oper_id);
+
+ }
+ $params["item_json"] = $spec;
+ }
+
+ }else{
+ //新增
+
+ //名称title不能重复
+ $check_title = self::where('title',$params["title"])->find();
+ if($check_title){
+ throw new \Exception("活动名称已存在或被其他机构占用,请更改!");
+ }
+
+
+ //如果存在课程规格,验证每个课时规格的合法性
+ if(isset($params["item_json"])){
+
+ //如果存在"的HTML转义字符,先反转义再解析json
+ $params["item_json"] = html_entity_decode($params["item_json"]);
+ $spec = json_decode($params["item_json"],true);
+ if(empty($spec))throw new \Exception("请至少添加一个课时规格");
+
+ foreach ($spec as $k=>&$v){
+ unset($v["limit"]);
+ unset($v["status_name"]);
+ unset($v["id"]);
+ $v["classes_activity_id"] = 0;
+ $v["manystore_id"] = $params["manystore_id"];
+ $v["shop_id"] = $shop_id;
+ (new ActivityItem)->specCheck($v,$shop_id,null,true,$oper_type,$oper_id);
+ }
+ $params["item_json"] = $spec;
+ }
+
+ }
+ $params["delete_spec_ids"] = [];
+ //按前端顺序分配显示权重
+ if(isset($params["item_json"]) && $params["item_json"]){
+ //数组倒过来
+ $params["item_json"] = array_reverse($params["item_json"]);
+ $insert_spec = [];
+ foreach ($params["item_json"] as $k=>&$v){
+ $v["weigh"] = $k + 1;
+ if(!empty($v["id"]))$insert_spec[] = $v["id"];
+ }
+ if($insert_spec && $row){
+ $params["delete_spec_ids"] = ActivityItem::where("classes_activity_id",$row->id)->where("id","not in",$insert_spec)->column("id");
+ }
+ }
+
+ //存在需要删除的规格则判断规格是否能删除
+ if($params["delete_spec_ids"] && $row){
+ $check_spec = ActivityItem::where("classes_activity_id",$row->id)->where("id","in",$params["delete_spec_ids"])->select();
+ foreach ($check_spec as $k=>$vv){
+ (new ActivityItem)->updateCheck($vv->id);
+ }
+ $params["delete_spec_ids"] = $check_spec;
+ }
+
+
+ //如果是上架,判断是否拥有课时规格,没有则无法上架
+ if(empty($params["item_json"])){
+ if(!$row)throw new \Exception("新添加的活动请先至少添加一个活动规格后再上架!");
+ //判断是否拥有课时规格,没有则无法上架
+ $check_spec = ActivityItem::where("classes_activity_id",$row->id)->count();
+ if(!$check_spec)throw new \Exception("新添加的活动请先至少添加一个活动规格后再上架!");
+ }
+
+ }
+
+ public function updateCheck($id,$params=[],$row=null){
+ if($params && $row){
+// var_dump($this->no_auth_fields_check($params,$row));
+ if(!$this->no_auth_fields_check($params,$row)){
+ return true;
+ }
+ }
+
+ // 课程存在售后订单则不允许操作
+ $order = Order::where("classes_activity_item_id",$id)->where("status","not in","-3,6,9")->find();
+ if($order)throw new \Exception("{$order['name']}存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!");
+ }
+
+
+
+}
diff --git a/application/common/model/school/classes/activity/ActivityAuth.php b/application/common/model/school/classes/activity/ActivityAuth.php
new file mode 100644
index 0000000..eac544c
--- /dev/null
+++ b/application/common/model/school/classes/activity/ActivityAuth.php
@@ -0,0 +1,253 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ }
+ });
+ }
+
+
+ public function getAddressTypeList()
+ {
+ return ['1' => __('Address_type 1'), '2' => __('Address_type 2')];
+ }
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')];
+ }
+
+ public function getRecommendList()
+ {
+ return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
+ }
+
+ public function getHotList()
+ {
+ return ['0' => __('Hot 0'), '1' => __('Hot 1')];
+ }
+
+ public function getNewList()
+ {
+ return ['0' => __('New 0'), '1' => __('New 1')];
+ }
+
+ public function getSelfhotList()
+ {
+ return ['0' => __('Selfhot 0'), '1' => __('Selfhot 1')];
+ }
+
+ public function getAuthStatusList()
+ {
+ return ['0' => __('Auth_status 0'), '1' => __('Auth_status 1'), '2' => __('Auth_status 2')];
+ }
+
+ public function getExpirestatusList()
+ {
+ return ['1' => __('Expirestatus 1'), '2' => __('Expirestatus 2')];
+ }
+
+ public function getAddTypeList()
+ {
+ return ['1' => __('Add_type 1'), '2' => __('Add_type 2')];
+ }
+
+
+ public function getAddressTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['address_type']) ? $data['address_type'] : '');
+ $list = $this->getAddressTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_start_time']) ? $data['sign_start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_end_time']) ? $data['sign_end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getRecommendTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['recommend']) ? $data['recommend'] : '');
+ $list = $this->getRecommendList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getHotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['hot']) ? $data['hot'] : '');
+ $list = $this->getHotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getNewTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['new']) ? $data['new'] : '');
+ $list = $this->getNewList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSelfhotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['selfhot']) ? $data['selfhot'] : '');
+ $list = $this->getSelfhotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAuthStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['auth_status']) ? $data['auth_status'] : '');
+ $list = $this->getAuthStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getExpirestatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['expirestatus']) ? $data['expirestatus'] : '');
+ $list = $this->getExpirestatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAddTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : '');
+ $list = $this->getAddTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAuthTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['auth_time']) ? $data['auth_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+ protected function setStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setAuthTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+
+ public function activity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function shop()
+ {
+ return $this->belongsTo(ManystoreShop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/common/model/school/classes/activity/ActivityItem.php b/application/common/model/school/classes/activity/ActivityItem.php
new file mode 100644
index 0000000..f00fc1a
--- /dev/null
+++ b/application/common/model/school/classes/activity/ActivityItem.php
@@ -0,0 +1,258 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ }
+ });
+ }
+
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2')];
+ }
+
+ public function getSexList()
+ {
+ return ['1' => __('Sex 1'), '2' => __('Sex 2'), '3' => __('Sex 3')];
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSexTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sex']) ? $data['sex'] : '');
+ $list = $this->getSexList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function shop()
+ {
+ return $this->belongsTo(ManystoreShop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function activity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function specCheck(&$params,$shop_id=null,$row=null,$check=true,$oper_type='user',$oper_id=0)
+ {
+
+ //限定人数必须大于0
+ $limit_num = $params["limit_num"];
+ if($limit_num<=0){
+ throw new \Exception("{$params["name"]}限定人数必须大于0");
+ }
+
+ //收费免费判断
+ if($params["price"]==0){
+ $params["feel"] = "1";
+ }else{
+
+ //个人认证无法下付费课程
+ $shop = ManystoreShop::where("id",$params["shop_id"] )->find();
+ if($shop["type"]=="1"){
+ throw new \Exception("这个机构属于个人认证,无法发布付费活动!");
+ }
+
+ $params["feel"] = "0";
+ }
+
+
+
+
+//开始和结束时间不能为空
+// $time = $params["time"];
+//
+// if(empty($time))throw new \Exception("{$params["name"]}请选择开始和结束时间".$time);
+// $split_line = " - ";
+// $time_arr = explode($split_line,$time);
+// $params["start_time"] = $time_arr[0] ;
+// $params["end_time"] = $time_arr[1];
+// unset($params["time"]);
+//
+// $start_time = $params["start_time"];
+// $end_time = $params["end_time"];
+//
+// if(empty($start_time) || empty($end_time)){
+// throw new \Exception("{$params["name"]}请选择开始和结束时间".$time);
+// }
+// //转化时间戳
+// $start_time = $params["start_time"] && !is_numeric($params["start_time"]) ? strtotime($params["start_time"]) : $params["start_time"];
+// $end_time = $params["end_time"] && !is_numeric($params["end_time"]) ? strtotime($params["end_time"]) : $params["end_time"];
+// //结束时间不能小于开始时间
+// if($end_time<=$start_time){
+// throw new \Exception("{$params["name"]}结束时间不能小于开始时间");
+// }
+//
+// //结束时间不能是已经过去的时间
+// $now_time = time();
+// if($end_time<=$now_time){
+// throw new \Exception("{$params["name"]}结束时间不能是已经过去的时间");
+// }
+
+// //如果是员工操作,则结束时间必须大于当前时间n秒
+// if($oper_type == "user" && $oper_id){
+// $classes_timeout_time = config("site.classes_timeout_time") ?:0;
+// if($classes_timeout_time > 0) {
+// $now_times = time() + $classes_timeout_time;
+// if($start_time<=$now_times){
+// //$now_time时间格式化
+// $now_time_text = date("Y-m-d H:i",$now_times);
+// throw new \Exception("{$params["name"]}开始时间必须在{$now_time_text}之后");
+// }
+// }
+//
+// }
+
+
+ //开始和结束时间必须是同一天
+// $start_time_date = date("Y-m-d",$start_time);
+// $end_time_date = date("Y-m-d",$end_time);
+// if($start_time_date!=$end_time_date){
+// throw new \Exception("{$params["name"]}开始和结束时间必须是同一天");
+// }
+
+
+//
+// $params["start_time"] = $start_time;
+// $params["end_time"] = $end_time;
+
+
+// $orderTimeTableName = (new ClassesSpec)->getWithAlisaName();
+ //修改
+ if($row){
+ //修复旧数据时间戳
+// $row["start_time"]= strtotime(date("Y-m-d H:i",$row["start_time"]));
+// $row["end_time"]= strtotime(date("Y-m-d H:i",$row["end_time"]));
+//
+ $this->updateCheck($row->id,$params,$row);
+
+ //规格名字不能一样(同课程下)
+ $spec_name = $params["name"];
+ $classes_lib_id = $params["classes_activity_id"];
+ $spec_name_exist = self::where("name",$spec_name)->where("classes_activity_id",$classes_lib_id)->where("id","<>",$row->id)->find();
+ if($spec_name_exist){
+ throw new \Exception("该活动下已存在该课时规格名称,请重新输入1");
+ }
+
+// //同课程下,各个课时的开始和结束时间不能有重叠(出现时间交叠也不行)
+// $spec_time_exist = ClassesSpec::where(function ($query) use ($orderTimeTableName,$start_time,$end_time) {
+// //兩個時間區間重合 存在任意交集 都不行
+// $query->where("start_time BETWEEN {$start_time} AND {$end_time}");
+// $query->whereOr("end_time BETWEEN {$start_time} AND {$end_time}");
+// $query->whereOr("start_time <= {$start_time} AND end_time >= {$end_time}");
+// $query->whereOr("start_time >= {$start_time} AND end_time <= {$end_time}");
+// })
+// ->where("classes_lib_id",$classes_lib_id)
+// ->where("id","<>",$row->id)->find();
+//
+// if($check && $spec_time_exist){
+// throw new \Exception("该课程下,{$spec_time_exist['name']}课时的开始和结束时间与你有重叠");
+// }
+
+ }else{
+
+ //规格名字不能一样(同课程下)
+ $spec_name = $params["name"];
+ $classes_lib_id = $params["classes_activity_id"];
+ $spec_name_exist = self::where("name",$spec_name)->where("classes_activity_id",$classes_lib_id)->find();
+ if($spec_name_exist){
+ throw new \Exception("该活动下已存在该课时规格名称,请重新输入2");
+ }
+
+// //同课程下,各个课时的开始和结束时间不能有重叠(出现时间交叠也不行)
+// $spec_time_exist = ClassesSpec::where(function ($query) use ($orderTimeTableName,$start_time,$end_time) {
+// //兩個時間區間重合 存在任意交集 都不行
+// $query->where("start_time BETWEEN {$start_time} AND {$end_time}");
+// $query->whereOr("end_time BETWEEN {$start_time} AND {$end_time}");
+// $query->whereOr("start_time <= {$start_time} AND end_time >= {$end_time}");
+// $query->whereOr("start_time >= {$start_time} AND end_time <= {$end_time}");
+// })
+// ->where("classes_lib_id",$classes_lib_id)
+// ->find();
+//
+// if($check && $spec_time_exist){
+// throw new \Exception("该课程下,{$spec_time_exist['name']}课时的开始和结束时间与你有重叠");
+// }
+
+ }
+
+
+ }
+
+
+ public function updateCheck($id,$params=[],$row=null){
+ if($params && $row){
+// var_dump($this->no_auth_fields_check($params,$row));
+ if(!$this->no_auth_fields_check($params,$row)){
+ return true;
+ }
+ }
+
+ // 课程存在售后订单则不允许操作
+ $order = Order::where("classes_activity_item_id",$id)->where("status","not in","-3,6,9")->find();
+ if($order)throw new \Exception("{$order['name']}存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!");
+ }
+
+
+}
diff --git a/application/common/model/school/classes/activity/ActivityItemAuth.php b/application/common/model/school/classes/activity/ActivityItemAuth.php
new file mode 100644
index 0000000..e604027
--- /dev/null
+++ b/application/common/model/school/classes/activity/ActivityItemAuth.php
@@ -0,0 +1,92 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ }
+ });
+ }
+
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2')];
+ }
+
+ public function getSexList()
+ {
+ return ['1' => __('Sex 1'), '2' => __('Sex 2'), '3' => __('Sex 3')];
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSexTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sex']) ? $data['sex'] : '');
+ $list = $this->getSexList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function shop()
+ {
+ return $this->belongsTo(ManystoreShop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function activity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/common/model/school/classes/activity/order/Order.php b/application/common/model/school/classes/activity/order/Order.php
new file mode 100644
index 0000000..2ace225
--- /dev/null
+++ b/application/common/model/school/classes/activity/order/Order.php
@@ -0,0 +1,213 @@
+ __('Pay_type yue'), 'wechat' => __('Pay_type wechat')];
+ }
+
+ public function getStatusList()
+ {
+ return ['-3' => __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4'), '6' => __('Status 6'), '9' => __('Status 9')];
+ }
+
+ public function getBeforeStatusList()
+ {
+ return ['-3' => __('Before_status -3'), '0' => __('Before_status 0'), '2' => __('Before_status 2'), '3' => __('Before_status 3'), '4' => __('Before_status 4'), '6' => __('Before_status 6'), '9' => __('Before_status 9')];
+ }
+
+ public function getServerStatusList()
+ {
+ return ['0' => __('Server_status 0'), '3' => __('Server_status 3'), '6' => __('Server_status 6')];
+ }
+
+ public function getAuthStatusList()
+ {
+ return ['0' => __('Auth_status 0'), '1' => __('Auth_status 1'), '2' => __('Auth_status 2')];
+ }
+
+
+ public function getPayTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['pay_type']) ? $data['pay_type'] : '');
+ $list = $this->getPayTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getBeforeStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['before_status']) ? $data['before_status'] : '');
+ $list = $this->getBeforeStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getServerStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['server_status']) ? $data['server_status'] : '');
+ $list = $this->getServerStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getCanceltimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['canceltime']) ? $data['canceltime'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getPaytimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['paytime']) ? $data['paytime'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getAuthTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['auth_time']) ? $data['auth_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getReservationTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['reservation_time']) ? $data['reservation_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getFinishtimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['finishtime']) ? $data['finishtime'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getRefundtimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['refundtime']) ? $data['refundtime'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getAuthStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['auth_status']) ? $data['auth_status'] : '');
+ $list = $this->getAuthStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+ protected function setCanceltimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setPaytimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setAuthTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setReservationTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setFinishtimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setRefundtimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+
+ public function user()
+ {
+ return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function shop()
+ {
+ return $this->belongsTo(ManystoreShop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function activity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function detail()
+ {
+ return $this->belongsTo(OrderDetail::class, 'activity_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/common/model/school/classes/activity/order/OrderDetail.php b/application/common/model/school/classes/activity/order/OrderDetail.php
new file mode 100644
index 0000000..ae545ba
--- /dev/null
+++ b/application/common/model/school/classes/activity/order/OrderDetail.php
@@ -0,0 +1,239 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ }
+ });
+ }
+
+
+ public function getAddressTypeList()
+ {
+ return ['1' => __('Address_type 1'), '2' => __('Address_type 2')];
+ }
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')];
+ }
+
+ public function getRecommendList()
+ {
+ return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
+ }
+
+ public function getHotList()
+ {
+ return ['0' => __('Hot 0'), '1' => __('Hot 1')];
+ }
+
+ public function getNewList()
+ {
+ return ['0' => __('New 0'), '1' => __('New 1')];
+ }
+
+ public function getSelfhotList()
+ {
+ return ['0' => __('Selfhot 0'), '1' => __('Selfhot 1')];
+ }
+
+ public function getExpirestatusList()
+ {
+ return ['1' => __('Expirestatus 1'), '2' => __('Expirestatus 2')];
+ }
+
+ public function getAddTypeList()
+ {
+ return ['1' => __('Add_type 1'), '2' => __('Add_type 2')];
+ }
+
+
+ public function getAddressTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['address_type']) ? $data['address_type'] : '');
+ $list = $this->getAddressTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_start_time']) ? $data['sign_start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_end_time']) ? $data['sign_end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getRecommendTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['recommend']) ? $data['recommend'] : '');
+ $list = $this->getRecommendList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getHotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['hot']) ? $data['hot'] : '');
+ $list = $this->getHotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getNewTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['new']) ? $data['new'] : '');
+ $list = $this->getNewList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSelfhotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['selfhot']) ? $data['selfhot'] : '');
+ $list = $this->getSelfhotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getExpirestatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['expirestatus']) ? $data['expirestatus'] : '');
+ $list = $this->getExpirestatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAddTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : '');
+ $list = $this->getAddTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+ protected function setStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+
+ public function activityorder()
+ {
+ return $this->belongsTo(Order::class, 'classes_activity_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function activity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function shop()
+ {
+ return $this->belongsTo(ManystoreShop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function user()
+ {
+ return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/common/model/school/classes/activity/order/OrderLog.php b/application/common/model/school/classes/activity/order/OrderLog.php
new file mode 100644
index 0000000..956263f
--- /dev/null
+++ b/application/common/model/school/classes/activity/order/OrderLog.php
@@ -0,0 +1,53 @@
+ __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4'), '6' => __('Status 6'), '9' => __('Status 9')];
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+
+
+ public function activityorder()
+ {
+ return $this->belongsTo(Order::class, 'classes_activity_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/manystore/controller/school/classes/activity/Activity.php b/application/manystore/controller/school/classes/activity/Activity.php
new file mode 100644
index 0000000..b30ba81
--- /dev/null
+++ b/application/manystore/controller/school/classes/activity/Activity.php
@@ -0,0 +1,354 @@
+model = new \app\manystore\model\school\classes\activity\Activity;
+ $this->itemmodel = new \app\manystore\model\school\classes\activity\ActivityItem();
+ parent::_initialize();
+ $this->view->assign("addressTypeList", $this->model->getAddressTypeList());
+ $this->view->assign("statusList", $this->model->getStatusList());
+ $this->view->assign("recommendList", $this->model->getRecommendList());
+ $this->view->assign("hotList", $this->model->getHotList());
+ $this->view->assign("newList", $this->model->getNewList());
+ $this->view->assign("selfhotList", $this->model->getSelfhotList());
+ $this->view->assign("expirestatusList", $this->model->getExpirestatusList());
+ $this->view->assign("addTypeList", $this->model->getAddTypeList());
+
+
+
+
+ $this->getCity();
+
+ $this->view->assign("itemStatusList", $this->itemmodel->getStatusList());
+ $this->view->assign("sexList", $this->itemmodel->getSexList());
+ }
+
+ public function import()
+ {
+ parent::import();
+ }
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ //当前是否为关联查询
+ $this->relationSearch = true;
+ //设置过滤方法
+ $this->request->filter(['strip_tags', 'trim']);
+ if ($this->request->isAjax()) {
+ //如果发送的来源是Selectpage,则转发到Selectpage
+ if ($this->request->request('keyField')) {
+ return $this->selectpage();
+ }
+ list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $list = $this->model
+ ->with(['manystore','manystoreshop'])
+ ->where($where)
+ ->order($sort, $order)
+ ->paginate($limit);
+
+ foreach ($list as $row) {
+
+ $row->getRelation('manystore')->visible(['nickname']);
+ $row->getRelation('manystoreshop')->visible(['name','logo']);
+ }
+
+ $result = array("total" => $list->total(), "rows" => $list->items());
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+ protected function update_classes($classes_activity_id){
+
+ }
+
+
+
+ protected function updateCheck($id,$params=[],$row=null){
+
+ // 课程存在售后订单则不允许操作
+ }
+
+
+ protected function update_check(&$params,$row=null)
+ {
+
+
+//开始和结束时间不能为空
+ $time = $params["time"];
+
+ if(empty($time))throw new \Exception("{$params["title"]}请选择开始和结束时间".$time);
+ $split_line = " - ";
+ $time_arr = explode($split_line,$time);
+ $params["start_time"] = $time_arr[0] ;
+ $params["end_time"] = $time_arr[1];
+ unset($params["time"]);
+
+ $start_time = $params["start_time"];
+ $end_time = $params["end_time"];
+
+ if(empty($start_time) || empty($end_time)){
+ throw new \Exception("{$params["title"]}请选择开始和结束时间".$time);
+ }
+ //转化时间戳
+ $start_time = $params["start_time"] && !is_numeric($params["start_time"]) ? strtotime($params["start_time"]) : $params["start_time"];
+ $end_time = $params["end_time"] && !is_numeric($params["end_time"]) ? strtotime($params["end_time"]) : $params["end_time"];
+ //结束时间不能小于开始时间
+ if($end_time<=$start_time){
+ throw new \Exception("{$params["title"]}结束时间不能小于开始时间");
+ }
+
+
+
+
+
+
+ //开始和结束时间不能为空
+ $time = $params["sign_time"];
+
+ if(empty($time))throw new \Exception("{$params["title"]}请选择开始和结束时间".$time);
+ $split_line = " - ";
+ $time_arr = explode($split_line,$time);
+ $params["sign_start_time"] = $time_arr[0] ;
+ $params["sign_end_time"] = $time_arr[1];
+ unset($params["sign_time"]);
+
+ $start_time = $params["sign_start_time"];
+ $end_time = $params["sign_end_time"];
+
+ if(empty($start_time) || empty($end_time)){
+ throw new \Exception("{$params["title"]}请选择开始和结束时间".$time);
+ }
+ //转化时间戳
+ $start_time = $params["sign_start_time"] && !is_numeric($params["sign_start_time"]) ? strtotime($params["sign_start_time"]) : $params["sign_start_time"];
+ $end_time = $params["sign_end_time"] && !is_numeric($params["sign_end_time"]) ? strtotime($params["sign_end_time"]) : $params["sign_end_time"];
+ //结束时间不能小于开始时间
+ if($end_time<=$start_time){
+ throw new \Exception("{$params["title"]}结束时间不能小于开始时间");
+ }
+
+
+
+
+ //修改
+ if($row){
+
+ }else{
+ //新增
+
+ }
+
+ }
+
+
+ /**
+ * 添加
+ *
+ * @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;
+ }
+
+ try {
+ $this->update_check($params,$row=null);
+ } catch (ValidateException|PDOException|Exception $e) {
+ $this->error($e->getMessage());
+ }
+ $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);
+ $this->update_classes($this->model["id"]);
+ 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;
+
+ try {
+ $this->update_check($params,$row);
+ } catch (ValidateException|PDOException|Exception $e) {
+ $this->error($e->getMessage());
+ }
+
+
+ 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);
+ $this->update_classes($row["id"]);
+ 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/controller/school/classes/activity/ActivityAuth.php b/application/manystore/controller/school/classes/activity/ActivityAuth.php
new file mode 100644
index 0000000..6aa1247
--- /dev/null
+++ b/application/manystore/controller/school/classes/activity/ActivityAuth.php
@@ -0,0 +1,84 @@
+model = new \app\manystore\model\school\classes\activity\ActivityAuth;
+ $this->view->assign("addressTypeList", $this->model->getAddressTypeList());
+ $this->view->assign("statusList", $this->model->getStatusList());
+ $this->view->assign("recommendList", $this->model->getRecommendList());
+ $this->view->assign("hotList", $this->model->getHotList());
+ $this->view->assign("newList", $this->model->getNewList());
+ $this->view->assign("selfhotList", $this->model->getSelfhotList());
+ $this->view->assign("authStatusList", $this->model->getAuthStatusList());
+ $this->view->assign("expirestatusList", $this->model->getExpirestatusList());
+ $this->view->assign("addTypeList", $this->model->getAddTypeList());
+ }
+
+ public function import()
+ {
+ parent::import();
+ }
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ //当前是否为关联查询
+ $this->relationSearch = true;
+ //设置过滤方法
+ $this->request->filter(['strip_tags', 'trim']);
+ if ($this->request->isAjax()) {
+ //如果发送的来源是Selectpage,则转发到Selectpage
+ if ($this->request->request('keyField')) {
+ return $this->selectpage();
+ }
+ list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $list = $this->model
+ ->with(['schoolclassesactivity','manystore','manystoreshop'])
+ ->where($where)
+ ->order($sort, $order)
+ ->paginate($limit);
+
+ foreach ($list as $row) {
+
+ $row->getRelation('schoolclassesactivity')->visible(['id']);
+ $row->getRelation('manystore')->visible(['nickname']);
+ $row->getRelation('manystoreshop')->visible(['name','logo']);
+ }
+
+ $result = array("total" => $list->total(), "rows" => $list->items());
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+}
diff --git a/application/manystore/controller/school/classes/activity/ActivityItem.php b/application/manystore/controller/school/classes/activity/ActivityItem.php
new file mode 100644
index 0000000..550eaed
--- /dev/null
+++ b/application/manystore/controller/school/classes/activity/ActivityItem.php
@@ -0,0 +1,77 @@
+model = new \app\manystore\model\school\classes\activity\ActivityItem;
+ $this->view->assign("statusList", $this->model->getStatusList());
+ $this->view->assign("sexList", $this->model->getSexList());
+ }
+
+ public function import()
+ {
+ parent::import();
+ }
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ //当前是否为关联查询
+ $this->relationSearch = true;
+ //设置过滤方法
+ $this->request->filter(['strip_tags', 'trim']);
+ if ($this->request->isAjax()) {
+ //如果发送的来源是Selectpage,则转发到Selectpage
+ if ($this->request->request('keyField')) {
+ return $this->selectpage();
+ }
+ list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $list = $this->model
+ ->with(['manystore','manystoreshop','schoolclassesactivity'])
+ ->where($where)
+ ->order($sort, $order)
+ ->paginate($limit);
+
+ foreach ($list as $row) {
+
+ $row->getRelation('manystore')->visible(['nickname']);
+ $row->getRelation('manystoreshop')->visible(['name','logo']);
+ $row->getRelation('schoolclassesactivity')->visible(['title','headimage']);
+ }
+
+ $result = array("total" => $list->total(), "rows" => $list->items());
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+}
diff --git a/application/manystore/controller/school/classes/activity/ActivityItemAuth.php b/application/manystore/controller/school/classes/activity/ActivityItemAuth.php
new file mode 100644
index 0000000..656eb44
--- /dev/null
+++ b/application/manystore/controller/school/classes/activity/ActivityItemAuth.php
@@ -0,0 +1,77 @@
+model = new \app\manystore\model\school\classes\activity\ActivityItemAuth;
+ $this->view->assign("statusList", $this->model->getStatusList());
+ $this->view->assign("sexList", $this->model->getSexList());
+ }
+
+ public function import()
+ {
+ parent::import();
+ }
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ //当前是否为关联查询
+ $this->relationSearch = true;
+ //设置过滤方法
+ $this->request->filter(['strip_tags', 'trim']);
+ if ($this->request->isAjax()) {
+ //如果发送的来源是Selectpage,则转发到Selectpage
+ if ($this->request->request('keyField')) {
+ return $this->selectpage();
+ }
+ list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $list = $this->model
+ ->with(['manystore','manystoreshop','schoolclassesactivity'])
+ ->where($where)
+ ->order($sort, $order)
+ ->paginate($limit);
+
+ foreach ($list as $row) {
+
+ $row->getRelation('manystore')->visible(['nickname']);
+ $row->getRelation('manystoreshop')->visible(['name','logo']);
+ $row->getRelation('schoolclassesactivity')->visible(['title','headimage']);
+ }
+
+ $result = array("total" => $list->total(), "rows" => $list->items());
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+}
diff --git a/application/manystore/controller/school/classes/activity/order/Order.php b/application/manystore/controller/school/classes/activity/order/Order.php
new file mode 100644
index 0000000..43f1b6b
--- /dev/null
+++ b/application/manystore/controller/school/classes/activity/order/Order.php
@@ -0,0 +1,82 @@
+model = new \app\manystore\model\school\classes\activity\order\Order;
+ $this->view->assign("payTypeList", $this->model->getPayTypeList());
+ $this->view->assign("statusList", $this->model->getStatusList());
+ $this->view->assign("beforeStatusList", $this->model->getBeforeStatusList());
+ $this->view->assign("serverStatusList", $this->model->getServerStatusList());
+ $this->view->assign("authStatusList", $this->model->getAuthStatusList());
+ }
+
+ public function import()
+ {
+ parent::import();
+ }
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ //当前是否为关联查询
+ $this->relationSearch = true;
+ //设置过滤方法
+ $this->request->filter(['strip_tags', 'trim']);
+ if ($this->request->isAjax()) {
+ //如果发送的来源是Selectpage,则转发到Selectpage
+ if ($this->request->request('keyField')) {
+ return $this->selectpage();
+ }
+ list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $list = $this->model
+ ->with(['user','manystore','manystoreshop','schoolclassesactivity','schoolclassesactivityorderdetail'])
+ ->where($where)
+ ->order($sort, $order)
+ ->paginate($limit);
+
+ foreach ($list as $row) {
+
+ $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']);
+ $row->getRelation('manystore')->visible(['nickname']);
+ $row->getRelation('manystoreshop')->visible(['name','logo']);
+ $row->getRelation('schoolclassesactivity')->visible(['title','headimage']);
+ $row->getRelation('schoolclassesactivityorderdetail')->visible(['title','headimage']);
+ }
+
+ $result = array("total" => $list->total(), "rows" => $list->items());
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+}
diff --git a/application/manystore/controller/school/classes/activity/order/OrderDetail.php b/application/manystore/controller/school/classes/activity/order/OrderDetail.php
new file mode 100644
index 0000000..f3b47ab
--- /dev/null
+++ b/application/manystore/controller/school/classes/activity/order/OrderDetail.php
@@ -0,0 +1,85 @@
+model = new \app\manystore\model\school\classes\activity\order\OrderDetail;
+ $this->view->assign("addressTypeList", $this->model->getAddressTypeList());
+ $this->view->assign("statusList", $this->model->getStatusList());
+ $this->view->assign("recommendList", $this->model->getRecommendList());
+ $this->view->assign("hotList", $this->model->getHotList());
+ $this->view->assign("newList", $this->model->getNewList());
+ $this->view->assign("selfhotList", $this->model->getSelfhotList());
+ $this->view->assign("expirestatusList", $this->model->getExpirestatusList());
+ $this->view->assign("addTypeList", $this->model->getAddTypeList());
+ }
+
+ public function import()
+ {
+ parent::import();
+ }
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ //当前是否为关联查询
+ $this->relationSearch = true;
+ //设置过滤方法
+ $this->request->filter(['strip_tags', 'trim']);
+ if ($this->request->isAjax()) {
+ //如果发送的来源是Selectpage,则转发到Selectpage
+ if ($this->request->request('keyField')) {
+ return $this->selectpage();
+ }
+ list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $list = $this->model
+ ->with(['schoolclassesactivityorder','schoolclassesactivity','manystore','manystoreshop','user'])
+ ->where($where)
+ ->order($sort, $order)
+ ->paginate($limit);
+
+ foreach ($list as $row) {
+
+ $row->getRelation('schoolclassesactivityorder')->visible(['order_no','pay_no']);
+ $row->getRelation('schoolclassesactivity')->visible(['title','headimage']);
+ $row->getRelation('manystore')->visible(['nickname']);
+ $row->getRelation('manystoreshop')->visible(['name','logo']);
+ $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']);
+ }
+
+ $result = array("total" => $list->total(), "rows" => $list->items());
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+}
diff --git a/application/manystore/controller/school/classes/activity/order/OrderLog.php b/application/manystore/controller/school/classes/activity/order/OrderLog.php
new file mode 100644
index 0000000..163f4e6
--- /dev/null
+++ b/application/manystore/controller/school/classes/activity/order/OrderLog.php
@@ -0,0 +1,74 @@
+model = new \app\manystore\model\school\classes\activity\order\OrderLog;
+ $this->view->assign("statusList", $this->model->getStatusList());
+ }
+
+ public function import()
+ {
+ parent::import();
+ }
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ //当前是否为关联查询
+ $this->relationSearch = true;
+ //设置过滤方法
+ $this->request->filter(['strip_tags', 'trim']);
+ if ($this->request->isAjax()) {
+ //如果发送的来源是Selectpage,则转发到Selectpage
+ if ($this->request->request('keyField')) {
+ return $this->selectpage();
+ }
+ list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+ $list = $this->model
+ ->with(['schoolclassesactivityorder'])
+ ->where($where)
+ ->order($sort, $order)
+ ->paginate($limit);
+
+ foreach ($list as $row) {
+
+ $row->getRelation('schoolclassesactivityorder')->visible(['order_no','pay_no']);
+ }
+
+ $result = array("total" => $list->total(), "rows" => $list->items());
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+}
diff --git a/application/manystore/lang/zh-cn/school/classes/activity/activity.php b/application/manystore/lang/zh-cn/school/classes/activity/activity.php
new file mode 100644
index 0000000..69d9a6b
--- /dev/null
+++ b/application/manystore/lang/zh-cn/school/classes/activity/activity.php
@@ -0,0 +1,68 @@
+ '机构账号id',
+ 'Shop_id' => '机构店铺id',
+ 'Title' => '标题',
+ 'Headimage' => '头图',
+ 'Images' => '轮播图',
+ 'Address_type' => '地址类型',
+ 'Address_type 1' => '按机构',
+ 'Address_type 2' => '独立位置',
+ 'Address_city' => '城市选择',
+ 'Province' => '省编号',
+ 'City' => '市编号',
+ 'District' => '县区编号',
+ 'Address' => '活动地址',
+ 'Address_detail' => '活动详细地址',
+ 'Longitude' => '经度',
+ 'Latitude' => '纬度',
+ 'Start_time' => '活动开始时间',
+ 'End_time' => '活动结束时间',
+ 'Sign_start_time' => '报名开始时间',
+ 'Sign_end_time' => '报名结束时间',
+ 'Price' => '报名费用',
+ 'People_num' => '活动人数',
+ 'Item' => '活动项目',
+ 'Content' => '活动详情',
+ 'Status' => '状态',
+ 'Status 1' => '上架',
+ 'Status 2' => '下架',
+ 'Status 3' => '平台下架',
+ 'Weigh' => '权重',
+ 'Recommend' => '平台推荐',
+ 'Recommend 0' => '否',
+ 'Recommend 1' => '是',
+ 'Hot' => '平台热门',
+ 'Hot 0' => '否',
+ 'Hot 1' => '是',
+ 'New' => '平台最新',
+ 'New 0' => '否',
+ 'New 1' => '是',
+ 'Selfhot' => '机构热门',
+ 'Selfhot 0' => '否',
+ 'Selfhot 1' => '是',
+ 'Sale' => '总销量',
+ 'Stock' => '限制总人数',
+ 'Views' => '浏览量',
+ 'Expirestatus' => '过期状态',
+ 'Expirestatus 1' => '进行中',
+ 'Expirestatus 2' => '已过期',
+ 'Add_type' => '添加人类型',
+ 'Add_type 1' => '机构',
+ 'Add_type 2' => '总后台',
+ 'Add_id' => '添加人id',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间',
+ 'Manystore.nickname' => '昵称',
+ 'Manystoreshop.name' => '店铺名称',
+ 'Manystoreshop.logo' => '品牌LOGO',
+ 'Sex' => '性别限制',
+ 'Sex 1' => '男',
+ 'Sex 2' => '女',
+ 'Sex 3' => '男女不限',
+ 'Limit_num' => '本项目限定人数',
+ 'Age' => '年龄限制描述',
+ 'Item_json' => '活动项目',
+];
diff --git a/application/manystore/lang/zh-cn/school/classes/activity/activity_auth.php b/application/manystore/lang/zh-cn/school/classes/activity/activity_auth.php
new file mode 100644
index 0000000..d76bc32
--- /dev/null
+++ b/application/manystore/lang/zh-cn/school/classes/activity/activity_auth.php
@@ -0,0 +1,69 @@
+ '课程活动id',
+ 'Manystore_id' => '机构账号id',
+ 'Shop_id' => '机构店铺id',
+ 'Title' => '标题',
+ 'Headimage' => '头图',
+ 'Images' => '轮播图',
+ 'Address_type' => '地址类型',
+ 'Address_type 1' => '按机构',
+ 'Address_type 2' => '独立位置',
+ 'Address_city' => '城市选择',
+ 'Province' => '省编号',
+ 'City' => '市编号',
+ 'District' => '县区编号',
+ 'Address' => '活动地址',
+ 'Address_detail' => '活动详细地址',
+ 'Longitude' => '经度',
+ 'Latitude' => '纬度',
+ 'Start_time' => '活动开始时间',
+ 'End_time' => '活动结束时间',
+ 'Sign_start_time' => '报名开始时间',
+ 'Sign_end_time' => '报名结束时间',
+ 'Price' => '报名费用',
+ 'People_num' => '活动人数',
+ 'Item' => '活动项目',
+ 'Content' => '活动详情',
+ 'Status' => '状态',
+ 'Status 1' => '上架',
+ 'Status 2' => '下架',
+ 'Status 3' => '平台下架',
+ 'Weigh' => '权重',
+ 'Recommend' => '平台推荐',
+ 'Recommend 0' => '否',
+ 'Recommend 1' => '是',
+ 'Hot' => '平台热门',
+ 'Hot 0' => '否',
+ 'Hot 1' => '是',
+ 'New' => '平台最新',
+ 'New 0' => '否',
+ 'New 1' => '是',
+ 'Selfhot' => '机构热门',
+ 'Selfhot 0' => '否',
+ 'Selfhot 1' => '是',
+ 'Auth_status' => '审核状态',
+ 'Auth_status 0' => '待审核',
+ 'Auth_status 1' => '审核通过',
+ 'Auth_status 2' => '审核不通过',
+ 'Reason' => '审核不通过原因',
+ 'Sale' => '总销量',
+ 'Stock' => '限制总人数',
+ 'Views' => '浏览量',
+ 'Expirestatus' => '过期状态',
+ 'Expirestatus 1' => '进行中',
+ 'Expirestatus 2' => '已过期',
+ 'Add_type' => '添加人类型',
+ 'Add_type 1' => '机构',
+ 'Add_type 2' => '总后台',
+ 'Add_id' => '添加人id',
+ 'Admin_id' => '审核管理员id',
+ 'Auth_time' => '审核时间',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间',
+ 'Manystore.nickname' => '昵称',
+ 'Manystoreshop.name' => '店铺名称',
+ 'Manystoreshop.logo' => '品牌LOGO'
+];
diff --git a/application/manystore/lang/zh-cn/school/classes/activity/activity_item.php b/application/manystore/lang/zh-cn/school/classes/activity/activity_item.php
new file mode 100644
index 0000000..8a40545
--- /dev/null
+++ b/application/manystore/lang/zh-cn/school/classes/activity/activity_item.php
@@ -0,0 +1,29 @@
+ '机构账号id',
+ 'Shop_id' => '机构店铺id',
+ 'Classes_activity_id' => '课程活动id',
+ 'Name' => '活动项名称',
+ 'Price' => '项目价格(0为免费)',
+ 'Limit_num' => '本项目限定人数',
+ 'Age' => '年龄限制描述',
+ 'Status' => '状态',
+ 'Status 1' => '上架',
+ 'Status 2' => '下架',
+ 'Sex' => '性别限制',
+ 'Sex 1' => '男',
+ 'Sex 2' => '女',
+ 'Sex 3' => '男女不限',
+ 'Weigh' => '权重',
+ 'Sign_num' => '已报名人数',
+ 'Verification_num' => '已核销人数',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间',
+ 'Manystore.nickname' => '昵称',
+ 'Manystoreshop.name' => '店铺名称',
+ 'Manystoreshop.logo' => '品牌LOGO',
+ 'Schoolclassesactivity.title' => '标题',
+ 'Schoolclassesactivity.headimage' => '头图'
+];
diff --git a/application/manystore/lang/zh-cn/school/classes/activity/activity_item_auth.php b/application/manystore/lang/zh-cn/school/classes/activity/activity_item_auth.php
new file mode 100644
index 0000000..8a40545
--- /dev/null
+++ b/application/manystore/lang/zh-cn/school/classes/activity/activity_item_auth.php
@@ -0,0 +1,29 @@
+ '机构账号id',
+ 'Shop_id' => '机构店铺id',
+ 'Classes_activity_id' => '课程活动id',
+ 'Name' => '活动项名称',
+ 'Price' => '项目价格(0为免费)',
+ 'Limit_num' => '本项目限定人数',
+ 'Age' => '年龄限制描述',
+ 'Status' => '状态',
+ 'Status 1' => '上架',
+ 'Status 2' => '下架',
+ 'Sex' => '性别限制',
+ 'Sex 1' => '男',
+ 'Sex 2' => '女',
+ 'Sex 3' => '男女不限',
+ 'Weigh' => '权重',
+ 'Sign_num' => '已报名人数',
+ 'Verification_num' => '已核销人数',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间',
+ 'Manystore.nickname' => '昵称',
+ 'Manystoreshop.name' => '店铺名称',
+ 'Manystoreshop.logo' => '品牌LOGO',
+ 'Schoolclassesactivity.title' => '标题',
+ 'Schoolclassesactivity.headimage' => '头图'
+];
diff --git a/application/manystore/lang/zh-cn/school/classes/activity/order/order.php b/application/manystore/lang/zh-cn/school/classes/activity/order/order.php
new file mode 100644
index 0000000..c9c1fd8
--- /dev/null
+++ b/application/manystore/lang/zh-cn/school/classes/activity/order/order.php
@@ -0,0 +1,74 @@
+ '订单号',
+ 'Pay_no' => '微信支付单号',
+ 'User_id' => '下单人用户id',
+ 'Manystore_id' => '机构账号id',
+ 'Shop_id' => '机构id',
+ 'Code' => '核销码',
+ 'Codeimage' => '核销二维码图片',
+ 'Codeoneimage' => '核销一维码图片',
+ 'Classes_activity_id' => '课程活动id',
+ 'Activity_order_detail_id' => '订单课程活动id',
+ 'Beforeprice' => '订单优惠前金额',
+ 'Totalprice' => '订单应付金额',
+ 'Payprice' => '订单实付金额',
+ 'Pay_type' => '支付方式',
+ 'Pay_type yue' => '余额',
+ 'Pay_type wechat' => '微信',
+ 'Status' => '订单状态',
+ 'Status -3' => '已取消',
+ 'Status 0' => '待支付',
+ 'Status 2' => '已报名待审核',
+ 'Status 3' => '已预约',
+ 'Status 4' => '售后中',
+ 'Status 6' => '已退款',
+ 'Status 9' => '已完成',
+ 'Before_status' => '售后前状态',
+ 'Before_status -3' => '已取消',
+ 'Before_status 0' => '未售后',
+ 'Before_status 2' => '已报名待审核',
+ 'Before_status 3' => '已预约',
+ 'Before_status 4' => '售后中',
+ 'Before_status 6' => '已退款',
+ 'Before_status 9' => '已完成',
+ 'Server_status' => '售后订单状态',
+ 'Server_status 0' => '正常',
+ 'Server_status 3' => '售后中',
+ 'Server_status 6' => '售后完成',
+ 'Canceltime' => '取消时间',
+ 'Paytime' => '支付时间',
+ 'Auth_time' => '审核时间',
+ 'Reservation_time' => '预约时间',
+ 'Finishtime' => '完成时间',
+ 'Refundtime' => '退款时间',
+ 'Total_refundprice' => '应退款金额',
+ 'Real_refundprice' => '实际退款金额',
+ 'Sub_refundprice' => '剩余未退金额',
+ 'Pay_json' => '三方支付信息json',
+ 'Platform' => '支付平台',
+ 'Verification_user_id' => '核销人用户id',
+ 'Verification_type' => '核销用户类型',
+ 'Reason' => '审核不通过原因',
+ 'Auth_status' => '审核状态',
+ 'Auth_status 0' => '待审核',
+ 'Auth_status 1' => '审核通过',
+ 'Auth_status 2' => '审核失败',
+ 'Auth_user_id' => '审核用户id',
+ 'Auth_type' => '审核用户类型',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间',
+ 'User.nickname' => '昵称',
+ 'User.realname' => '真实姓名',
+ 'User.mobile' => '手机号',
+ 'User.avatar' => '头像',
+ 'Manystore.nickname' => '昵称',
+ 'Manystoreshop.name' => '店铺名称',
+ 'Manystoreshop.logo' => '品牌LOGO',
+ 'Schoolclassesactivity.title' => '标题',
+ 'Schoolclassesactivity.headimage' => '头图',
+ 'Schoolclassesactivityorderdetail.title' => '标题',
+ 'Schoolclassesactivityorderdetail.headimage' => '头图'
+];
diff --git a/application/manystore/lang/zh-cn/school/classes/activity/order/order_detail.php b/application/manystore/lang/zh-cn/school/classes/activity/order/order_detail.php
new file mode 100644
index 0000000..895edd3
--- /dev/null
+++ b/application/manystore/lang/zh-cn/school/classes/activity/order/order_detail.php
@@ -0,0 +1,72 @@
+ '课程活动订单id',
+ 'Classes_activity_id' => '课程活动id',
+ 'Manystore_id' => '机构账号id',
+ 'Shop_id' => '机构id',
+ 'User_id' => '下单用户id',
+ 'Title' => '标题',
+ 'Headimage' => '头图',
+ 'Images' => '轮播图',
+ 'Address_type' => '地址类型',
+ 'Address_type 1' => '按机构',
+ 'Address_type 2' => '独立位置',
+ 'Address_city' => '城市选择',
+ 'Province' => '省编号',
+ 'City' => '市编号',
+ 'District' => '县区编号',
+ 'Address' => '活动地址',
+ 'Address_detail' => '活动详细地址',
+ 'Longitude' => '经度',
+ 'Latitude' => '纬度',
+ 'Start_time' => '活动开始时间',
+ 'End_time' => '活动结束时间',
+ 'Sign_start_time' => '报名开始时间',
+ 'Sign_end_time' => '报名结束时间',
+ 'Price' => '报名费用',
+ 'People_num' => '活动人数',
+ 'Item' => '活动项目',
+ 'Content' => '活动详情',
+ 'Status' => '状态',
+ 'Status 1' => '上架',
+ 'Status 2' => '下架',
+ 'Status 3' => '平台下架',
+ 'Weigh' => '权重',
+ 'Recommend' => '平台推荐',
+ 'Recommend 0' => '否',
+ 'Recommend 1' => '是',
+ 'Hot' => '平台热门',
+ 'Hot 0' => '否',
+ 'Hot 1' => '是',
+ 'New' => '平台最新',
+ 'New 0' => '否',
+ 'New 1' => '是',
+ 'Selfhot' => '机构热门',
+ 'Selfhot 0' => '否',
+ 'Selfhot 1' => '是',
+ 'Sale' => '总销量',
+ 'Stock' => '限制总人数',
+ 'Views' => '浏览量',
+ 'Expirestatus' => '过期状态',
+ 'Expirestatus 1' => '进行中',
+ 'Expirestatus 2' => '已过期',
+ 'Add_type' => '添加人类型',
+ 'Add_type 1' => '机构',
+ 'Add_type 2' => '总后台',
+ 'Add_id' => '添加人id',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间',
+ 'Schoolclassesactivityorder.order_no' => '订单号',
+ 'Schoolclassesactivityorder.pay_no' => '微信支付单号',
+ 'Schoolclassesactivity.title' => '标题',
+ 'Schoolclassesactivity.headimage' => '头图',
+ 'Manystore.nickname' => '昵称',
+ 'Manystoreshop.name' => '店铺名称',
+ 'Manystoreshop.logo' => '品牌LOGO',
+ 'User.nickname' => '昵称',
+ 'User.realname' => '真实姓名',
+ 'User.mobile' => '手机号',
+ 'User.avatar' => '头像'
+];
diff --git a/application/manystore/lang/zh-cn/school/classes/activity/order/order_log.php b/application/manystore/lang/zh-cn/school/classes/activity/order/order_log.php
new file mode 100644
index 0000000..15f53b3
--- /dev/null
+++ b/application/manystore/lang/zh-cn/school/classes/activity/order/order_log.php
@@ -0,0 +1,21 @@
+ '课程活动订单id',
+ 'Status' => '订单状态',
+ 'Status -3' => '已取消',
+ 'Status 0' => '待支付',
+ 'Status 2' => '已报名待审核',
+ 'Status 3' => '已预约',
+ 'Status 4' => '售后中',
+ 'Status 6' => '已退款',
+ 'Status 9' => '已完成',
+ 'Log_text' => '记录内容',
+ 'Oper_type' => '记录人类型',
+ 'Oper_id' => '记录人id',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间',
+ 'Schoolclassesactivityorder.order_no' => '订单号',
+ 'Schoolclassesactivityorder.pay_no' => '微信支付单号'
+];
diff --git a/application/manystore/model/school/classes/activity/Activity.php b/application/manystore/model/school/classes/activity/Activity.php
new file mode 100644
index 0000000..fff16cb
--- /dev/null
+++ b/application/manystore/model/school/classes/activity/Activity.php
@@ -0,0 +1,217 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ });
+ }
+
+
+ public function getAddressTypeList()
+ {
+ return ['1' => __('Address_type 1'), '2' => __('Address_type 2')];
+ }
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')];
+ }
+
+ public function getRecommendList()
+ {
+ return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
+ }
+
+ public function getHotList()
+ {
+ return ['0' => __('Hot 0'), '1' => __('Hot 1')];
+ }
+
+ public function getNewList()
+ {
+ return ['0' => __('New 0'), '1' => __('New 1')];
+ }
+
+ public function getSelfhotList()
+ {
+ return ['0' => __('Selfhot 0'), '1' => __('Selfhot 1')];
+ }
+
+ public function getExpirestatusList()
+ {
+ return ['1' => __('Expirestatus 1'), '2' => __('Expirestatus 2')];
+ }
+
+ public function getAddTypeList()
+ {
+ return ['1' => __('Add_type 1'), '2' => __('Add_type 2')];
+ }
+
+
+ public function getAddressTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['address_type']) ? $data['address_type'] : '');
+ $list = $this->getAddressTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_start_time']) ? $data['sign_start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_end_time']) ? $data['sign_end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getRecommendTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['recommend']) ? $data['recommend'] : '');
+ $list = $this->getRecommendList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getHotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['hot']) ? $data['hot'] : '');
+ $list = $this->getHotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getNewTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['new']) ? $data['new'] : '');
+ $list = $this->getNewList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSelfhotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['selfhot']) ? $data['selfhot'] : '');
+ $list = $this->getSelfhotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getExpirestatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['expirestatus']) ? $data['expirestatus'] : '');
+ $list = $this->getExpirestatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAddTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : '');
+ $list = $this->getAddTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+ protected function setStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystoreshop()
+ {
+ return $this->belongsTo(Shop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/manystore/model/school/classes/activity/ActivityAuth.php b/application/manystore/model/school/classes/activity/ActivityAuth.php
new file mode 100644
index 0000000..c2bdda4
--- /dev/null
+++ b/application/manystore/model/school/classes/activity/ActivityAuth.php
@@ -0,0 +1,250 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ });
+ }
+
+
+ public function getAddressTypeList()
+ {
+ return ['1' => __('Address_type 1'), '2' => __('Address_type 2')];
+ }
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')];
+ }
+
+ public function getRecommendList()
+ {
+ return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
+ }
+
+ public function getHotList()
+ {
+ return ['0' => __('Hot 0'), '1' => __('Hot 1')];
+ }
+
+ public function getNewList()
+ {
+ return ['0' => __('New 0'), '1' => __('New 1')];
+ }
+
+ public function getSelfhotList()
+ {
+ return ['0' => __('Selfhot 0'), '1' => __('Selfhot 1')];
+ }
+
+ public function getAuthStatusList()
+ {
+ return ['0' => __('Auth_status 0'), '1' => __('Auth_status 1'), '2' => __('Auth_status 2')];
+ }
+
+ public function getExpirestatusList()
+ {
+ return ['1' => __('Expirestatus 1'), '2' => __('Expirestatus 2')];
+ }
+
+ public function getAddTypeList()
+ {
+ return ['1' => __('Add_type 1'), '2' => __('Add_type 2')];
+ }
+
+
+ public function getAddressTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['address_type']) ? $data['address_type'] : '');
+ $list = $this->getAddressTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_start_time']) ? $data['sign_start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_end_time']) ? $data['sign_end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getRecommendTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['recommend']) ? $data['recommend'] : '');
+ $list = $this->getRecommendList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getHotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['hot']) ? $data['hot'] : '');
+ $list = $this->getHotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getNewTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['new']) ? $data['new'] : '');
+ $list = $this->getNewList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSelfhotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['selfhot']) ? $data['selfhot'] : '');
+ $list = $this->getSelfhotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAuthStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['auth_status']) ? $data['auth_status'] : '');
+ $list = $this->getAuthStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getExpirestatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['expirestatus']) ? $data['expirestatus'] : '');
+ $list = $this->getExpirestatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAddTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : '');
+ $list = $this->getAddTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAuthTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['auth_time']) ? $data['auth_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+ protected function setStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setAuthTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+
+ public function schoolclassesactivity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystoreshop()
+ {
+ return $this->belongsTo(Shop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/manystore/model/school/classes/activity/ActivityItem.php b/application/manystore/model/school/classes/activity/ActivityItem.php
new file mode 100644
index 0000000..5b41dc3
--- /dev/null
+++ b/application/manystore/model/school/classes/activity/ActivityItem.php
@@ -0,0 +1,89 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ });
+ }
+
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2')];
+ }
+
+ public function getSexList()
+ {
+ return ['1' => __('Sex 1'), '2' => __('Sex 2'), '3' => __('Sex 3')];
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSexTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sex']) ? $data['sex'] : '');
+ $list = $this->getSexList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystoreshop()
+ {
+ return $this->belongsTo(Shop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function schoolclassesactivity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/manystore/model/school/classes/activity/ActivityItemAuth.php b/application/manystore/model/school/classes/activity/ActivityItemAuth.php
new file mode 100644
index 0000000..6a439ef
--- /dev/null
+++ b/application/manystore/model/school/classes/activity/ActivityItemAuth.php
@@ -0,0 +1,89 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ });
+ }
+
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2')];
+ }
+
+ public function getSexList()
+ {
+ return ['1' => __('Sex 1'), '2' => __('Sex 2'), '3' => __('Sex 3')];
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSexTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sex']) ? $data['sex'] : '');
+ $list = $this->getSexList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystoreshop()
+ {
+ return $this->belongsTo(Shop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function schoolclassesactivity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/manystore/model/school/classes/activity/order/Order.php b/application/manystore/model/school/classes/activity/order/Order.php
new file mode 100644
index 0000000..27512a8
--- /dev/null
+++ b/application/manystore/model/school/classes/activity/order/Order.php
@@ -0,0 +1,212 @@
+ __('Pay_type yue'), 'wechat' => __('Pay_type wechat')];
+ }
+
+ public function getStatusList()
+ {
+ return ['-3' => __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4'), '6' => __('Status 6'), '9' => __('Status 9')];
+ }
+
+ public function getBeforeStatusList()
+ {
+ return ['-3' => __('Before_status -3'), '0' => __('Before_status 0'), '2' => __('Before_status 2'), '3' => __('Before_status 3'), '4' => __('Before_status 4'), '6' => __('Before_status 6'), '9' => __('Before_status 9')];
+ }
+
+ public function getServerStatusList()
+ {
+ return ['0' => __('Server_status 0'), '3' => __('Server_status 3'), '6' => __('Server_status 6')];
+ }
+
+ public function getAuthStatusList()
+ {
+ return ['0' => __('Auth_status 0'), '1' => __('Auth_status 1'), '2' => __('Auth_status 2')];
+ }
+
+
+ public function getPayTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['pay_type']) ? $data['pay_type'] : '');
+ $list = $this->getPayTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getBeforeStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['before_status']) ? $data['before_status'] : '');
+ $list = $this->getBeforeStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getServerStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['server_status']) ? $data['server_status'] : '');
+ $list = $this->getServerStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getCanceltimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['canceltime']) ? $data['canceltime'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getPaytimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['paytime']) ? $data['paytime'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getAuthTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['auth_time']) ? $data['auth_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getReservationTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['reservation_time']) ? $data['reservation_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getFinishtimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['finishtime']) ? $data['finishtime'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getRefundtimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['refundtime']) ? $data['refundtime'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getAuthStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['auth_status']) ? $data['auth_status'] : '');
+ $list = $this->getAuthStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+ protected function setCanceltimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setPaytimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setAuthTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setReservationTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setFinishtimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setRefundtimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+
+ public function user()
+ {
+ return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystoreshop()
+ {
+ return $this->belongsTo(Shop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function schoolclassesactivity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function schoolclassesactivityorderdetail()
+ {
+ return $this->belongsTo(OrderDetail::class, 'activity_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/manystore/model/school/classes/activity/order/OrderDetail.php b/application/manystore/model/school/classes/activity/order/OrderDetail.php
new file mode 100644
index 0000000..aef90fc
--- /dev/null
+++ b/application/manystore/model/school/classes/activity/order/OrderDetail.php
@@ -0,0 +1,236 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ });
+ }
+
+
+ public function getAddressTypeList()
+ {
+ return ['1' => __('Address_type 1'), '2' => __('Address_type 2')];
+ }
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')];
+ }
+
+ public function getRecommendList()
+ {
+ return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
+ }
+
+ public function getHotList()
+ {
+ return ['0' => __('Hot 0'), '1' => __('Hot 1')];
+ }
+
+ public function getNewList()
+ {
+ return ['0' => __('New 0'), '1' => __('New 1')];
+ }
+
+ public function getSelfhotList()
+ {
+ return ['0' => __('Selfhot 0'), '1' => __('Selfhot 1')];
+ }
+
+ public function getExpirestatusList()
+ {
+ return ['1' => __('Expirestatus 1'), '2' => __('Expirestatus 2')];
+ }
+
+ public function getAddTypeList()
+ {
+ return ['1' => __('Add_type 1'), '2' => __('Add_type 2')];
+ }
+
+
+ public function getAddressTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['address_type']) ? $data['address_type'] : '');
+ $list = $this->getAddressTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignStartTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_start_time']) ? $data['sign_start_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getSignEndTimeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['sign_end_time']) ? $data['sign_end_time'] : '');
+ return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getRecommendTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['recommend']) ? $data['recommend'] : '');
+ $list = $this->getRecommendList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getHotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['hot']) ? $data['hot'] : '');
+ $list = $this->getHotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getNewTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['new']) ? $data['new'] : '');
+ $list = $this->getNewList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getSelfhotTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['selfhot']) ? $data['selfhot'] : '');
+ $list = $this->getSelfhotList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getExpirestatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['expirestatus']) ? $data['expirestatus'] : '');
+ $list = $this->getExpirestatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+ public function getAddTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : '');
+ $list = $this->getAddTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+ protected function setStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+ protected function setSignEndTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+
+ public function schoolclassesactivityorder()
+ {
+ return $this->belongsTo(Order::class, 'classes_activity_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function schoolclassesactivity()
+ {
+ return $this->belongsTo(Activity::class, 'classes_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystore()
+ {
+ return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function manystoreshop()
+ {
+ return $this->belongsTo(Shop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+
+
+ public function user()
+ {
+ return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/manystore/model/school/classes/activity/order/OrderLog.php b/application/manystore/model/school/classes/activity/order/OrderLog.php
new file mode 100644
index 0000000..b0a7d02
--- /dev/null
+++ b/application/manystore/model/school/classes/activity/order/OrderLog.php
@@ -0,0 +1,53 @@
+ __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4'), '6' => __('Status 6'), '9' => __('Status 9')];
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+
+
+ public function schoolclassesactivityorder()
+ {
+ return $this->belongsTo(Order::class, 'classes_activity_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
+}
diff --git a/application/manystore/validate/school/classes/activity/Activity.php b/application/manystore/validate/school/classes/activity/Activity.php
new file mode 100644
index 0000000..27e1abd
--- /dev/null
+++ b/application/manystore/validate/school/classes/activity/Activity.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/manystore/validate/school/classes/activity/ActivityAuth.php b/application/manystore/validate/school/classes/activity/ActivityAuth.php
new file mode 100644
index 0000000..47e3bb5
--- /dev/null
+++ b/application/manystore/validate/school/classes/activity/ActivityAuth.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/manystore/validate/school/classes/activity/ActivityItem.php b/application/manystore/validate/school/classes/activity/ActivityItem.php
new file mode 100644
index 0000000..28c7655
--- /dev/null
+++ b/application/manystore/validate/school/classes/activity/ActivityItem.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/manystore/validate/school/classes/activity/ActivityItemAuth.php b/application/manystore/validate/school/classes/activity/ActivityItemAuth.php
new file mode 100644
index 0000000..790a540
--- /dev/null
+++ b/application/manystore/validate/school/classes/activity/ActivityItemAuth.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/manystore/validate/school/classes/activity/order/Order.php b/application/manystore/validate/school/classes/activity/order/Order.php
new file mode 100644
index 0000000..4c5df80
--- /dev/null
+++ b/application/manystore/validate/school/classes/activity/order/Order.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/manystore/validate/school/classes/activity/order/OrderDetail.php b/application/manystore/validate/school/classes/activity/order/OrderDetail.php
new file mode 100644
index 0000000..4f7d993
--- /dev/null
+++ b/application/manystore/validate/school/classes/activity/order/OrderDetail.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/manystore/validate/school/classes/activity/order/OrderLog.php b/application/manystore/validate/school/classes/activity/order/OrderLog.php
new file mode 100644
index 0000000..2b55eae
--- /dev/null
+++ b/application/manystore/validate/school/classes/activity/order/OrderLog.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/manystore/view/school/classes/activity/activity/add.html b/application/manystore/view/school/classes/activity/activity/add.html
new file mode 100644
index 0000000..2f2f2e8
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity/add.html
@@ -0,0 +1,272 @@
+
diff --git a/application/manystore/view/school/classes/activity/activity/edit.html b/application/manystore/view/school/classes/activity/activity/edit.html
new file mode 100644
index 0000000..a0ea2c8
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity/edit.html
@@ -0,0 +1,272 @@
+
diff --git a/application/manystore/view/school/classes/activity/activity/index.html b/application/manystore/view/school/classes/activity/activity/index.html
new file mode 100644
index 0000000..02f2a50
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity/index.html
@@ -0,0 +1,44 @@
+
+
+
+ {:build_heading(null,FALSE)}
+
+
+
+
+
+
diff --git a/application/manystore/view/school/classes/activity/activity/recyclebin.html b/application/manystore/view/school/classes/activity/activity/recyclebin.html
new file mode 100644
index 0000000..b6bf105
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity/recyclebin.html
@@ -0,0 +1,25 @@
+
+ {:build_heading()}
+
+
+
diff --git a/application/manystore/view/school/classes/activity/activity_auth/add.html b/application/manystore/view/school/classes/activity/activity_auth/add.html
new file mode 100644
index 0000000..8dc9940
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity_auth/add.html
@@ -0,0 +1,308 @@
+
diff --git a/application/manystore/view/school/classes/activity/activity_auth/edit.html b/application/manystore/view/school/classes/activity/activity_auth/edit.html
new file mode 100644
index 0000000..38b1975
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity_auth/edit.html
@@ -0,0 +1,308 @@
+
diff --git a/application/manystore/view/school/classes/activity/activity_auth/index.html b/application/manystore/view/school/classes/activity/activity_auth/index.html
new file mode 100644
index 0000000..9c2b2e8
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity_auth/index.html
@@ -0,0 +1,44 @@
+
+
+
+ {:build_heading(null,FALSE)}
+
+
+
+
+
+
diff --git a/application/manystore/view/school/classes/activity/activity_auth/recyclebin.html b/application/manystore/view/school/classes/activity/activity_auth/recyclebin.html
new file mode 100644
index 0000000..8db8446
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity_auth/recyclebin.html
@@ -0,0 +1,25 @@
+
+ {:build_heading()}
+
+
+
diff --git a/application/manystore/view/school/classes/activity/activity_item/add.html b/application/manystore/view/school/classes/activity/activity_item/add.html
new file mode 100644
index 0000000..5a3b388
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity_item/add.html
@@ -0,0 +1,88 @@
+
diff --git a/application/manystore/view/school/classes/activity/activity_item/edit.html b/application/manystore/view/school/classes/activity/activity_item/edit.html
new file mode 100644
index 0000000..ff6eeb5
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity_item/edit.html
@@ -0,0 +1,88 @@
+
diff --git a/application/manystore/view/school/classes/activity/activity_item/index.html b/application/manystore/view/school/classes/activity/activity_item/index.html
new file mode 100644
index 0000000..9a0d780
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity_item/index.html
@@ -0,0 +1,44 @@
+
+
+
+ {:build_heading(null,FALSE)}
+
+
+
+
+
+
diff --git a/application/manystore/view/school/classes/activity/activity_item/recyclebin.html b/application/manystore/view/school/classes/activity/activity_item/recyclebin.html
new file mode 100644
index 0000000..384b254
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity_item/recyclebin.html
@@ -0,0 +1,25 @@
+
+ {:build_heading()}
+
+
+
diff --git a/application/manystore/view/school/classes/activity/activity_item_auth/add.html b/application/manystore/view/school/classes/activity/activity_item_auth/add.html
new file mode 100644
index 0000000..5a3b388
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity_item_auth/add.html
@@ -0,0 +1,88 @@
+
diff --git a/application/manystore/view/school/classes/activity/activity_item_auth/edit.html b/application/manystore/view/school/classes/activity/activity_item_auth/edit.html
new file mode 100644
index 0000000..ff6eeb5
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity_item_auth/edit.html
@@ -0,0 +1,88 @@
+
diff --git a/application/manystore/view/school/classes/activity/activity_item_auth/index.html b/application/manystore/view/school/classes/activity/activity_item_auth/index.html
new file mode 100644
index 0000000..a8fc55a
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity_item_auth/index.html
@@ -0,0 +1,44 @@
+
+
+
+ {:build_heading(null,FALSE)}
+
+
+
+
+
+
diff --git a/application/manystore/view/school/classes/activity/activity_item_auth/recyclebin.html b/application/manystore/view/school/classes/activity/activity_item_auth/recyclebin.html
new file mode 100644
index 0000000..700c159
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/activity_item_auth/recyclebin.html
@@ -0,0 +1,25 @@
+
+ {:build_heading()}
+
+
+
diff --git a/application/manystore/view/school/classes/activity/order/order/add.html b/application/manystore/view/school/classes/activity/order/order/add.html
new file mode 100644
index 0000000..05c1c38
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/order/order/add.html
@@ -0,0 +1,264 @@
+
diff --git a/application/manystore/view/school/classes/activity/order/order/edit.html b/application/manystore/view/school/classes/activity/order/order/edit.html
new file mode 100644
index 0000000..25187db
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/order/order/edit.html
@@ -0,0 +1,264 @@
+
diff --git a/application/manystore/view/school/classes/activity/order/order/index.html b/application/manystore/view/school/classes/activity/order/order/index.html
new file mode 100644
index 0000000..a05b883
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/order/order/index.html
@@ -0,0 +1,44 @@
+
+
+
+ {:build_heading(null,FALSE)}
+
+
+
+
+
+
diff --git a/application/manystore/view/school/classes/activity/order/order/recyclebin.html b/application/manystore/view/school/classes/activity/order/order/recyclebin.html
new file mode 100644
index 0000000..ce56d45
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/order/order/recyclebin.html
@@ -0,0 +1,25 @@
+
+ {:build_heading()}
+
+
+
diff --git a/application/manystore/view/school/classes/activity/order/order_detail/add.html b/application/manystore/view/school/classes/activity/order/order_detail/add.html
new file mode 100644
index 0000000..e470f44
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/order/order_detail/add.html
@@ -0,0 +1,290 @@
+
diff --git a/application/manystore/view/school/classes/activity/order/order_detail/edit.html b/application/manystore/view/school/classes/activity/order/order_detail/edit.html
new file mode 100644
index 0000000..977ea48
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/order/order_detail/edit.html
@@ -0,0 +1,290 @@
+
diff --git a/application/manystore/view/school/classes/activity/order/order_detail/index.html b/application/manystore/view/school/classes/activity/order/order_detail/index.html
new file mode 100644
index 0000000..dd1507c
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/order/order_detail/index.html
@@ -0,0 +1,44 @@
+
+
+
+ {:build_heading(null,FALSE)}
+
+
+
+
+
+
diff --git a/application/manystore/view/school/classes/activity/order/order_detail/recyclebin.html b/application/manystore/view/school/classes/activity/order/order_detail/recyclebin.html
new file mode 100644
index 0000000..98cc60d
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/order/order_detail/recyclebin.html
@@ -0,0 +1,25 @@
+
+ {:build_heading()}
+
+
+
diff --git a/application/manystore/view/school/classes/activity/order/order_log/add.html b/application/manystore/view/school/classes/activity/order/order_log/add.html
new file mode 100644
index 0000000..34877a0
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/order/order_log/add.html
@@ -0,0 +1,46 @@
+
diff --git a/application/manystore/view/school/classes/activity/order/order_log/edit.html b/application/manystore/view/school/classes/activity/order/order_log/edit.html
new file mode 100644
index 0000000..7c594d6
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/order/order_log/edit.html
@@ -0,0 +1,46 @@
+
diff --git a/application/manystore/view/school/classes/activity/order/order_log/index.html b/application/manystore/view/school/classes/activity/order/order_log/index.html
new file mode 100644
index 0000000..5516031
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/order/order_log/index.html
@@ -0,0 +1,44 @@
+
+
+
+ {:build_heading(null,FALSE)}
+
+
+
+
+
+
diff --git a/application/manystore/view/school/classes/activity/order/order_log/recyclebin.html b/application/manystore/view/school/classes/activity/order/order_log/recyclebin.html
new file mode 100644
index 0000000..cf21422
--- /dev/null
+++ b/application/manystore/view/school/classes/activity/order/order_log/recyclebin.html
@@ -0,0 +1,25 @@
+
+ {:build_heading()}
+
+
+
diff --git a/public/assets/js/backend/school/classes/activity/activity.js b/public/assets/js/backend/school/classes/activity/activity.js
new file mode 100644
index 0000000..7377eab
--- /dev/null
+++ b/public/assets/js/backend/school/classes/activity/activity.js
@@ -0,0 +1,293 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'school/classes/activity/activity/index' + location.search,
+ add_url: 'school/classes/activity/activity/add'+ location.search,
+ edit_url: 'school/classes/activity/activity/edit'+ location.search,
+ del_url: 'school/classes/activity/activity/del',
+ multi_url: 'school/classes/activity/activity/multi',
+ import_url: 'school/classes/activity/activity/import',
+ table: 'school_classes_activity',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'weigh',
+ fixedColumns: true,
+ fixedRightNumber: 1,
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'manystore_id', title: __('Manystore_id')},
+ {field: 'shop_id', title: __('Shop_id')},
+ {field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {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: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal},
+ {field: 'address_city', title: __('Address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'province', title: __('Province')},
+ {field: 'city', title: __('City')},
+ {field: 'district', title: __('District')},
+ {field: 'address', title: __('Address'), operate: 'LIKE'},
+ {field: 'address_detail', title: __('Address_detail'), operate: 'LIKE'},
+ {field: 'longitude', title: __('Longitude'), operate: 'LIKE'},
+ {field: 'latitude', title: __('Latitude'), operate: 'LIKE'},
+ {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'sign_start_time', title: __('Sign_start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'sign_end_time', title: __('Sign_end_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'price', title: __('Price'), operate:'BETWEEN'},
+ {field: 'people_num', title: __('People_num')},
+ {field: 'item', title: __('Item'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
+ {field: 'weigh', title: __('Weigh'), operate: false},
+ {field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal},
+ {field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal},
+ {field: 'new', title: __('New'), searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal},
+ {field: 'selfhot', title: __('Selfhot'), searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal},
+ {field: 'sale', title: __('Sale')},
+ {field: 'stock', title: __('Stock')},
+ {field: 'views', title: __('Views')},
+ {field: 'expirestatus', title: __('Expirestatus'), searchList: {"1":__('Expirestatus 1'),"2":__('Expirestatus 2')}, formatter: Table.api.formatter.status},
+ {field: 'add_type', title: __('Add_type'), searchList: {"1":__('Add_type 1'),"2":__('Add_type 2')}, formatter: Table.api.formatter.normal},
+ {field: 'add_id', title: __('Add_id')},
+ {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},
+ {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
+ {field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'},
+ {field: 'shop.logo', title: __('Shop.logo'), operate: 'LIKE'},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ $(document).on('click', '.btn-changeuser', function (event) {
+ var url = $(this).attr('data-url');
+ if(!url) return false;
+ var title = $(this).attr('title');
+ var width = $(this).attr('data-width');
+ var height = $(this).attr('data-height');
+ // var ids = $(this).attr('data-id');
+ var area = ['98%','98%'];
+ var options = {
+ shadeClose: false,
+ shade: [0.3, '#393D49'],
+ area: area,
+ callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果;
+ Fast.api.close(ret);
+ }
+ };
+ Fast.api.open(url,title,options);
+ });
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ recyclebin: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ 'dragsort_url': ''
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'school/classes/activity/activity/recyclebin' + location.search,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'title', title: __('Title'), align: 'left'},
+ {
+ field: 'deletetime',
+ title: __('Deletetime'),
+ operate: 'RANGE',
+ addclass: 'datetimerange',
+ formatter: Table.api.formatter.datetime
+ },
+ {
+ field: 'operate',
+ width: '140px',
+ title: __('Operate'),
+ table: table,
+ events: Table.api.events.operate,
+ buttons: [
+ {
+ name: 'Restore',
+ text: __('Restore'),
+ classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
+ icon: 'fa fa-rotate-left',
+ url: 'school/classes/activity/activity/restore',
+ refresh: true
+ },
+ {
+ name: 'Destroy',
+ text: __('Destroy'),
+ classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+ icon: 'fa fa-times',
+ url: 'school/classes/activity/activity/destroy',
+ refresh: true
+ }
+ ],
+ formatter: Table.api.formatter.operate
+ }
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+
+ add: function () {
+ Controller.api.bindevent();
+ generrate.setOfflineType($("input:radio[name='row[address_type]']").val());
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+
+ $(document).on("dp.change", "#add-form .datetimerange", function () {
+ $(this).parent().prev().find("input").trigger("change");
+ });
+
+ $(document).on("dp.change", "#add-form .datetimepicker", function () {
+ $(this).parent().prev().find("input").trigger("change");
+ });
+ $(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", "#add-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) + "')");
+ // })
+ });
+ $(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) + "')");
+ // })
+ });
+
+ $("#c-address_city").on("cp:updated", function() {
+ var citypicker = $(this).data("citypicker");
+ var province = citypicker.getCode("province");
+ var city = citypicker.getCode("city");
+ var district = citypicker.getCode("district");
+ if(province){
+ $("#province").val(province);
+ }
+ if(city){
+ $("#city").val(city);
+ }
+ if(district){
+ $("#district").val(district);
+ }
+ $(this).blur();
+ });
+ generrate.listen();
+
+ $(document).on('click', '.btn-changeuser', function (event) {
+ var url = $(this).attr('data-url');
+ if(!url) return false;
+ var title = $(this).attr('title');
+ var width = $(this).attr('data-width');
+ var height = $(this).attr('data-height');
+ // var ids = $(this).attr('data-id');
+ var area = ['98%','98%'];
+ var options = {
+ shadeClose: false,
+ shade: [0.3, '#393D49'],
+ area: area,
+ callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果;
+ Fast.api.close(ret);
+ }
+ };
+ Fast.api.open(url,title,options);
+ });
+
+
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+
+
+ var generrate = {
+ listen:function () {
+ this.offlineListen();
+ this.priceListen();
+ },
+ offlineListen:function () {
+ var that = this;
+ // console.log($("input:radio[name='row[address_type]']").val())
+ // this.setOfflineType($("input:radio[name='row[address_type]']").val());
+ $("input:radio[name='row[address_type]']").change(function (){
+ that.setOfflineType($(this).val());
+ });
+ },
+ setOfflineType:function (val) {
+ switch (val) {
+ case '1':
+ $('#c_position').hide();
+ break;
+ case '2':
+ $('#c_position').show();
+ break;
+ }
+ },
+ priceListen:function () {
+ $('#spec').bind('input propertychange', function(){
+ var length = $("#spec").val().length;
+ console.log(length);
+ });
+ }
+ }
+
+
+ return Controller;
+});
diff --git a/public/assets/js/backend/school/classes/activity/activity_auth.js b/public/assets/js/backend/school/classes/activity/activity_auth.js
new file mode 100644
index 0000000..2cd8ef0
--- /dev/null
+++ b/public/assets/js/backend/school/classes/activity/activity_auth.js
@@ -0,0 +1,157 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'school/classes/activity/activity_auth/index' + location.search,
+ add_url: 'school/classes/activity/activity_auth/add',
+ edit_url: 'school/classes/activity/activity_auth/edit',
+ del_url: 'school/classes/activity/activity_auth/del',
+ multi_url: 'school/classes/activity/activity_auth/multi',
+ import_url: 'school/classes/activity/activity_auth/import',
+ table: 'school_classes_activity_auth',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'weigh',
+ fixedColumns: true,
+ fixedRightNumber: 1,
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'classes_activity_id', title: __('Classes_activity_id')},
+ {field: 'manystore_id', title: __('Manystore_id')},
+ {field: 'shop_id', title: __('Shop_id')},
+ {field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {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: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal},
+ {field: 'address_city', title: __('Address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'province', title: __('Province')},
+ {field: 'city', title: __('City')},
+ {field: 'district', title: __('District')},
+ {field: 'address', title: __('Address'), operate: 'LIKE'},
+ {field: 'address_detail', title: __('Address_detail'), operate: 'LIKE'},
+ {field: 'longitude', title: __('Longitude'), operate: 'LIKE'},
+ {field: 'latitude', title: __('Latitude'), operate: 'LIKE'},
+ {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'sign_start_time', title: __('Sign_start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'sign_end_time', title: __('Sign_end_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'price', title: __('Price'), operate:'BETWEEN'},
+ {field: 'people_num', title: __('People_num')},
+ {field: 'item', title: __('Item'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
+ {field: 'weigh', title: __('Weigh'), operate: false},
+ {field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal},
+ {field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal},
+ {field: 'new', title: __('New'), searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal},
+ {field: 'selfhot', title: __('Selfhot'), searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal},
+ {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: 'sale', title: __('Sale')},
+ {field: 'stock', title: __('Stock')},
+ {field: 'views', title: __('Views')},
+ {field: 'expirestatus', title: __('Expirestatus'), searchList: {"1":__('Expirestatus 1'),"2":__('Expirestatus 2')}, formatter: Table.api.formatter.status},
+ {field: 'add_type', title: __('Add_type'), searchList: {"1":__('Add_type 1'),"2":__('Add_type 2')}, formatter: Table.api.formatter.normal},
+ {field: 'add_id', title: __('Add_id')},
+ {field: 'admin_id', title: __('Admin_id')},
+ {field: 'auth_time', title: __('Auth_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {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},
+ {field: 'activity.id', title: __('Activity.id')},
+ {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
+ {field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'},
+ {field: 'shop.logo', title: __('Shop.logo'), operate: 'LIKE'},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ recyclebin: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ 'dragsort_url': ''
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'school/classes/activity/activity_auth/recyclebin' + location.search,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'title', title: __('Title'), align: 'left'},
+ {
+ field: 'deletetime',
+ title: __('Deletetime'),
+ operate: 'RANGE',
+ addclass: 'datetimerange',
+ formatter: Table.api.formatter.datetime
+ },
+ {
+ field: 'operate',
+ width: '140px',
+ title: __('Operate'),
+ table: table,
+ events: Table.api.events.operate,
+ buttons: [
+ {
+ name: 'Restore',
+ text: __('Restore'),
+ classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
+ icon: 'fa fa-rotate-left',
+ url: 'school/classes/activity/activity_auth/restore',
+ refresh: true
+ },
+ {
+ name: 'Destroy',
+ text: __('Destroy'),
+ classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+ icon: 'fa fa-times',
+ url: 'school/classes/activity/activity_auth/destroy',
+ refresh: true
+ }
+ ],
+ formatter: Table.api.formatter.operate
+ }
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+
+ add: function () {
+ Controller.api.bindevent();
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+ return Controller;
+});
diff --git a/public/assets/js/backend/school/classes/activity/activity_item.js b/public/assets/js/backend/school/classes/activity/activity_item.js
new file mode 100644
index 0000000..7a6da0e
--- /dev/null
+++ b/public/assets/js/backend/school/classes/activity/activity_item.js
@@ -0,0 +1,132 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'school/classes/activity/activity_item/index' + location.search,
+ add_url: 'school/classes/activity/activity_item/add',
+ edit_url: 'school/classes/activity/activity_item/edit',
+ del_url: 'school/classes/activity/activity_item/del',
+ multi_url: 'school/classes/activity/activity_item/multi',
+ import_url: 'school/classes/activity/activity_item/import',
+ table: 'school_classes_activity_item',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'weigh',
+ fixedColumns: true,
+ fixedRightNumber: 1,
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'manystore_id', title: __('Manystore_id')},
+ {field: 'shop_id', title: __('Shop_id')},
+ {field: 'classes_activity_id', title: __('Classes_activity_id')},
+ {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'price', title: __('Price'), operate:'BETWEEN'},
+ {field: 'limit_num', title: __('Limit_num')},
+ {field: 'age', title: __('Age'), operate: 'LIKE'},
+ {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
+ {field: 'sex', title: __('Sex'), searchList: {"1":__('Sex 1'),"2":__('Sex 2'),"3":__('Sex 3')}, formatter: Table.api.formatter.normal},
+ {field: 'weigh', title: __('Weigh'), operate: false},
+ {field: 'sign_num', title: __('Sign_num')},
+ {field: 'verification_num', title: __('Verification_num')},
+ {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},
+ {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
+ {field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'},
+ {field: 'shop.logo', title: __('Shop.logo'), operate: 'LIKE'},
+ {field: 'activity.title', title: __('Activity.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'activity.headimage', title: __('Activity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ recyclebin: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ 'dragsort_url': ''
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'school/classes/activity/activity_item/recyclebin' + location.search,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'name', title: __('Name'), align: 'left'},
+ {
+ field: 'deletetime',
+ title: __('Deletetime'),
+ operate: 'RANGE',
+ addclass: 'datetimerange',
+ formatter: Table.api.formatter.datetime
+ },
+ {
+ field: 'operate',
+ width: '140px',
+ title: __('Operate'),
+ table: table,
+ events: Table.api.events.operate,
+ buttons: [
+ {
+ name: 'Restore',
+ text: __('Restore'),
+ classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
+ icon: 'fa fa-rotate-left',
+ url: 'school/classes/activity/activity_item/restore',
+ refresh: true
+ },
+ {
+ name: 'Destroy',
+ text: __('Destroy'),
+ classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+ icon: 'fa fa-times',
+ url: 'school/classes/activity/activity_item/destroy',
+ refresh: true
+ }
+ ],
+ formatter: Table.api.formatter.operate
+ }
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+
+ add: function () {
+ Controller.api.bindevent();
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+ return Controller;
+});
diff --git a/public/assets/js/backend/school/classes/activity/activity_item_auth.js b/public/assets/js/backend/school/classes/activity/activity_item_auth.js
new file mode 100644
index 0000000..916f126
--- /dev/null
+++ b/public/assets/js/backend/school/classes/activity/activity_item_auth.js
@@ -0,0 +1,132 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'school/classes/activity/activity_item_auth/index' + location.search,
+ add_url: 'school/classes/activity/activity_item_auth/add',
+ edit_url: 'school/classes/activity/activity_item_auth/edit',
+ del_url: 'school/classes/activity/activity_item_auth/del',
+ multi_url: 'school/classes/activity/activity_item_auth/multi',
+ import_url: 'school/classes/activity/activity_item_auth/import',
+ table: 'school_classes_activity_item_auth',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'weigh',
+ fixedColumns: true,
+ fixedRightNumber: 1,
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'manystore_id', title: __('Manystore_id')},
+ {field: 'shop_id', title: __('Shop_id')},
+ {field: 'classes_activity_id', title: __('Classes_activity_id')},
+ {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'price', title: __('Price'), operate:'BETWEEN'},
+ {field: 'limit_num', title: __('Limit_num')},
+ {field: 'age', title: __('Age'), operate: 'LIKE'},
+ {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
+ {field: 'sex', title: __('Sex'), searchList: {"1":__('Sex 1'),"2":__('Sex 2'),"3":__('Sex 3')}, formatter: Table.api.formatter.normal},
+ {field: 'weigh', title: __('Weigh'), operate: false},
+ {field: 'sign_num', title: __('Sign_num')},
+ {field: 'verification_num', title: __('Verification_num')},
+ {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},
+ {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
+ {field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'},
+ {field: 'shop.logo', title: __('Shop.logo'), operate: 'LIKE'},
+ {field: 'activity.title', title: __('Activity.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'activity.headimage', title: __('Activity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ recyclebin: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ 'dragsort_url': ''
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'school/classes/activity/activity_item_auth/recyclebin' + location.search,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'name', title: __('Name'), align: 'left'},
+ {
+ field: 'deletetime',
+ title: __('Deletetime'),
+ operate: 'RANGE',
+ addclass: 'datetimerange',
+ formatter: Table.api.formatter.datetime
+ },
+ {
+ field: 'operate',
+ width: '140px',
+ title: __('Operate'),
+ table: table,
+ events: Table.api.events.operate,
+ buttons: [
+ {
+ name: 'Restore',
+ text: __('Restore'),
+ classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
+ icon: 'fa fa-rotate-left',
+ url: 'school/classes/activity/activity_item_auth/restore',
+ refresh: true
+ },
+ {
+ name: 'Destroy',
+ text: __('Destroy'),
+ classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+ icon: 'fa fa-times',
+ url: 'school/classes/activity/activity_item_auth/destroy',
+ refresh: true
+ }
+ ],
+ formatter: Table.api.formatter.operate
+ }
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+
+ add: function () {
+ Controller.api.bindevent();
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+ return Controller;
+});
diff --git a/public/assets/js/backend/school/classes/activity/order/order.js b/public/assets/js/backend/school/classes/activity/order/order.js
new file mode 100644
index 0000000..2ea1a16
--- /dev/null
+++ b/public/assets/js/backend/school/classes/activity/order/order.js
@@ -0,0 +1,158 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'school/classes/activity/order/order/index' + location.search,
+ add_url: 'school/classes/activity/order/order/add',
+ edit_url: 'school/classes/activity/order/order/edit',
+ del_url: 'school/classes/activity/order/order/del',
+ multi_url: 'school/classes/activity/order/order/multi',
+ import_url: 'school/classes/activity/order/order/import',
+ table: 'school_classes_activity_order',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'id',
+ fixedColumns: true,
+ fixedRightNumber: 1,
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'order_no', title: __('Order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'pay_no', title: __('Pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'user_id', title: __('User_id')},
+ {field: 'manystore_id', title: __('Manystore_id')},
+ {field: 'shop_id', title: __('Shop_id')},
+ {field: 'code', title: __('Code'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'codeimage', title: __('Codeimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ {field: 'codeoneimage', title: __('Codeoneimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ {field: 'classes_activity_id', title: __('Classes_activity_id')},
+ {field: 'activity_order_detail_id', title: __('Activity_order_detail_id')},
+ {field: 'beforeprice', title: __('Beforeprice'), operate:'BETWEEN'},
+ {field: 'totalprice', title: __('Totalprice'), operate:'BETWEEN'},
+ {field: 'payprice', title: __('Payprice'), operate:'BETWEEN'},
+ {field: 'pay_type', title: __('Pay_type'), searchList: {"yue":__('Pay_type yue'),"wechat":__('Pay_type wechat')}, formatter: Table.api.formatter.normal},
+ {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status},
+ {field: 'before_status', title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"2":__('Before_status 2'),"3":__('Before_status 3'),"4":__('Before_status 4'),"6":__('Before_status 6'),"9":__('Before_status 9')}, formatter: Table.api.formatter.status},
+ {field: 'server_status', title: __('Server_status'), searchList: {"0":__('Server_status 0'),"3":__('Server_status 3'),"6":__('Server_status 6')}, formatter: Table.api.formatter.status},
+ {field: 'canceltime', title: __('Canceltime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'auth_time', title: __('Auth_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'reservation_time', title: __('Reservation_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'finishtime', title: __('Finishtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'refundtime', title: __('Refundtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'total_refundprice', title: __('Total_refundprice'), operate:'BETWEEN'},
+ {field: 'real_refundprice', title: __('Real_refundprice'), operate:'BETWEEN'},
+ {field: 'sub_refundprice', title: __('Sub_refundprice'), operate:'BETWEEN'},
+ {field: 'platform', title: __('Platform'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'verification_user_id', title: __('Verification_user_id')},
+ {field: 'verification_type', title: __('Verification_type'), operate: 'LIKE'},
+ {field: 'reason', title: __('Reason'), operate: 'LIKE'},
+ {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: 'auth_user_id', title: __('Auth_user_id')},
+ {field: 'auth_type', title: __('Auth_type'), operate: 'LIKE'},
+ {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},
+ {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: 'shop.name', title: __('Shop.name'), operate: 'LIKE'},
+ {field: 'shop.logo', title: __('Shop.logo'), operate: 'LIKE'},
+ {field: 'activity.title', title: __('Activity.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'activity.headimage', title: __('Activity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ {field: 'detail.title', title: __('Detail.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'detail.headimage', title: __('Detail.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ recyclebin: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ 'dragsort_url': ''
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'school/classes/activity/order/order/recyclebin' + location.search,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {
+ field: 'deletetime',
+ title: __('Deletetime'),
+ operate: 'RANGE',
+ addclass: 'datetimerange',
+ formatter: Table.api.formatter.datetime
+ },
+ {
+ field: 'operate',
+ width: '140px',
+ title: __('Operate'),
+ table: table,
+ events: Table.api.events.operate,
+ buttons: [
+ {
+ name: 'Restore',
+ text: __('Restore'),
+ classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
+ icon: 'fa fa-rotate-left',
+ url: 'school/classes/activity/order/order/restore',
+ refresh: true
+ },
+ {
+ name: 'Destroy',
+ text: __('Destroy'),
+ classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+ icon: 'fa fa-times',
+ url: 'school/classes/activity/order/order/destroy',
+ refresh: true
+ }
+ ],
+ formatter: Table.api.formatter.operate
+ }
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+
+ add: function () {
+ Controller.api.bindevent();
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+ return Controller;
+});
diff --git a/public/assets/js/backend/school/classes/activity/order/order_detail.js b/public/assets/js/backend/school/classes/activity/order/order_detail.js
new file mode 100644
index 0000000..4b09b9f
--- /dev/null
+++ b/public/assets/js/backend/school/classes/activity/order/order_detail.js
@@ -0,0 +1,162 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'school/classes/activity/order/order_detail/index' + location.search,
+ add_url: 'school/classes/activity/order/order_detail/add',
+ edit_url: 'school/classes/activity/order/order_detail/edit',
+ del_url: 'school/classes/activity/order/order_detail/del',
+ multi_url: 'school/classes/activity/order/order_detail/multi',
+ import_url: 'school/classes/activity/order/order_detail/import',
+ table: 'school_classes_activity_order_detail',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'weigh',
+ fixedColumns: true,
+ fixedRightNumber: 1,
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'classes_activity_order_id', title: __('Classes_activity_order_id')},
+ {field: 'classes_activity_id', title: __('Classes_activity_id')},
+ {field: 'manystore_id', title: __('Manystore_id')},
+ {field: 'shop_id', title: __('Shop_id')},
+ {field: 'user_id', title: __('User_id')},
+ {field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {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: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal},
+ {field: 'address_city', title: __('Address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'province', title: __('Province')},
+ {field: 'city', title: __('City')},
+ {field: 'district', title: __('District')},
+ {field: 'address', title: __('Address'), operate: 'LIKE'},
+ {field: 'address_detail', title: __('Address_detail'), operate: 'LIKE'},
+ {field: 'longitude', title: __('Longitude'), operate: 'LIKE'},
+ {field: 'latitude', title: __('Latitude'), operate: 'LIKE'},
+ {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'sign_start_time', title: __('Sign_start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'sign_end_time', title: __('Sign_end_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'price', title: __('Price'), operate:'BETWEEN'},
+ {field: 'people_num', title: __('People_num')},
+ {field: 'item', title: __('Item'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
+ {field: 'weigh', title: __('Weigh'), operate: false},
+ {field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal},
+ {field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal},
+ {field: 'new', title: __('New'), searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal},
+ {field: 'selfhot', title: __('Selfhot'), searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal},
+ {field: 'sale', title: __('Sale')},
+ {field: 'stock', title: __('Stock')},
+ {field: 'views', title: __('Views')},
+ {field: 'expirestatus', title: __('Expirestatus'), searchList: {"1":__('Expirestatus 1'),"2":__('Expirestatus 2')}, formatter: Table.api.formatter.status},
+ {field: 'add_type', title: __('Add_type'), searchList: {"1":__('Add_type 1'),"2":__('Add_type 2')}, formatter: Table.api.formatter.normal},
+ {field: 'add_id', title: __('Add_id')},
+ {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},
+ {field: 'activityorder.order_no', title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'activityorder.pay_no', title: __('Order.pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'activity.title', title: __('Activity.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'activity.headimage', title: __('Activity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
+ {field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'},
+ {field: 'shop.logo', title: __('Shop.logo'), 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: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ recyclebin: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ 'dragsort_url': ''
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'school/classes/activity/order/order_detail/recyclebin' + location.search,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'title', title: __('Title'), align: 'left'},
+ {
+ field: 'deletetime',
+ title: __('Deletetime'),
+ operate: 'RANGE',
+ addclass: 'datetimerange',
+ formatter: Table.api.formatter.datetime
+ },
+ {
+ field: 'operate',
+ width: '140px',
+ title: __('Operate'),
+ table: table,
+ events: Table.api.events.operate,
+ buttons: [
+ {
+ name: 'Restore',
+ text: __('Restore'),
+ classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
+ icon: 'fa fa-rotate-left',
+ url: 'school/classes/activity/order/order_detail/restore',
+ refresh: true
+ },
+ {
+ name: 'Destroy',
+ text: __('Destroy'),
+ classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+ icon: 'fa fa-times',
+ url: 'school/classes/activity/order/order_detail/destroy',
+ refresh: true
+ }
+ ],
+ formatter: Table.api.formatter.operate
+ }
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+
+ add: function () {
+ Controller.api.bindevent();
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+ return Controller;
+});
diff --git a/public/assets/js/backend/school/classes/activity/order/order_log.js b/public/assets/js/backend/school/classes/activity/order/order_log.js
new file mode 100644
index 0000000..15b748f
--- /dev/null
+++ b/public/assets/js/backend/school/classes/activity/order/order_log.js
@@ -0,0 +1,119 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'school/classes/activity/order/order_log/index' + location.search,
+ add_url: 'school/classes/activity/order/order_log/add',
+ edit_url: 'school/classes/activity/order/order_log/edit',
+ del_url: 'school/classes/activity/order/order_log/del',
+ multi_url: 'school/classes/activity/order/order_log/multi',
+ import_url: 'school/classes/activity/order/order_log/import',
+ table: 'school_classes_activity_order_log',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'classes_activity_order_id', title: __('Classes_activity_order_id')},
+ {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status},
+ {field: 'log_text', title: __('Log_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'oper_type', title: __('Oper_type'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'oper_id', title: __('Oper_id')},
+ {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},
+ {field: 'activityorder.order_no', title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'activityorder.pay_no', title: __('Order.pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ recyclebin: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ 'dragsort_url': ''
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'school/classes/activity/order/order_log/recyclebin' + location.search,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {
+ field: 'deletetime',
+ title: __('Deletetime'),
+ operate: 'RANGE',
+ addclass: 'datetimerange',
+ formatter: Table.api.formatter.datetime
+ },
+ {
+ field: 'operate',
+ width: '140px',
+ title: __('Operate'),
+ table: table,
+ events: Table.api.events.operate,
+ buttons: [
+ {
+ name: 'Restore',
+ text: __('Restore'),
+ classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
+ icon: 'fa fa-rotate-left',
+ url: 'school/classes/activity/order/order_log/restore',
+ refresh: true
+ },
+ {
+ name: 'Destroy',
+ text: __('Destroy'),
+ classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+ icon: 'fa fa-times',
+ url: 'school/classes/activity/order/order_log/destroy',
+ refresh: true
+ }
+ ],
+ formatter: Table.api.formatter.operate
+ }
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+
+ add: function () {
+ Controller.api.bindevent();
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+ return Controller;
+});
diff --git a/public/assets/js/manystore/school/classes/activity/activity.js b/public/assets/js/manystore/school/classes/activity/activity.js
new file mode 100644
index 0000000..7988328
--- /dev/null
+++ b/public/assets/js/manystore/school/classes/activity/activity.js
@@ -0,0 +1,291 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'school/classes/activity/activity/index' + location.search,
+ add_url: 'school/classes/activity/activity/add' + location.search,
+ edit_url: 'school/classes/activity/activity/edit' + location.search,
+ del_url: 'school/classes/activity/activity/del',
+ multi_url: 'school/classes/activity/activity/multi',
+ import_url: 'school/classes/activity/activity/import',
+ table: 'school_classes_activity',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'weigh',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'manystore_id', title: __('Manystore_id')},
+ {field: 'shop_id', title: __('Shop_id')},
+ {field: 'title', title: __('Title'), operate: 'LIKE'},
+ {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: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal},
+ {field: 'address_city', title: __('Address_city'), operate: 'LIKE'},
+ {field: 'province', title: __('Province')},
+ {field: 'city', title: __('City')},
+ {field: 'district', title: __('District')},
+ {field: 'address', title: __('Address'), operate: 'LIKE'},
+ {field: 'address_detail', title: __('Address_detail'), operate: 'LIKE'},
+ {field: 'longitude', title: __('Longitude'), operate: 'LIKE'},
+ {field: 'latitude', title: __('Latitude'), operate: 'LIKE'},
+ {field: 'start_time', title: __('Start_time')},
+ {field: 'end_time', title: __('End_time')},
+ {field: 'sign_start_time', title: __('Sign_start_time')},
+ {field: 'sign_end_time', title: __('Sign_end_time')},
+ {field: 'price', title: __('Price'), operate:'BETWEEN'},
+ {field: 'people_num', title: __('People_num')},
+ {field: 'item', title: __('Item'), operate: 'LIKE'},
+ {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
+ {field: 'weigh', title: __('Weigh'), operate: false},
+ {field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal},
+ {field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal},
+ {field: 'new', title: __('New'), searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal},
+ {field: 'selfhot', title: __('Selfhot'), searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal},
+ {field: 'sale', title: __('Sale')},
+ {field: 'stock', title: __('Stock')},
+ {field: 'views', title: __('Views')},
+ {field: 'expirestatus', title: __('Expirestatus'), searchList: {"1":__('Expirestatus 1'),"2":__('Expirestatus 2')}, formatter: Table.api.formatter.status},
+ {field: 'add_type', title: __('Add_type'), searchList: {"1":__('Add_type 1'),"2":__('Add_type 2')}, formatter: Table.api.formatter.normal},
+ {field: 'add_id', title: __('Add_id')},
+ {field: 'createtime', title: __('Createtime')},
+ {field: 'updatetime', title: __('Updatetime')},
+ {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
+ {field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'},
+ {field: 'manystoreshop.logo', title: __('Manystoreshop.logo'), operate: 'LIKE'},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ $(document).on('click', '.btn-changeuser', function (event) {
+ var url = $(this).attr('data-url');
+ if(!url) return false;
+ var title = $(this).attr('title');
+ var width = $(this).attr('data-width');
+ var height = $(this).attr('data-height');
+ // var ids = $(this).attr('data-id');
+ var area = ['98%','98%'];
+ var options = {
+ shadeClose: false,
+ shade: [0.3, '#393D49'],
+ area: area,
+ callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果;
+ Fast.api.close(ret);
+ }
+ };
+ Fast.api.open(url,title,options);
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ recyclebin: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ 'dragsort_url': ''
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'school/classes/activity/activity/recyclebin' + location.search,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'title', title: __('Title'), align: 'left'},
+ {
+ field: 'deletetime',
+ title: __('Deletetime'),
+ operate: 'RANGE',
+ addclass: 'datetimerange',
+ formatter: Table.api.formatter.datetime
+ },
+ {
+ field: 'operate',
+ width: '130px',
+ title: __('Operate'),
+ table: table,
+ events: Table.api.events.operate,
+ buttons: [
+ {
+ name: 'Restore',
+ text: __('Restore'),
+ classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
+ icon: 'fa fa-rotate-left',
+ url: 'school/classes/activity/activity/restore',
+ refresh: true
+ },
+ {
+ name: 'Destroy',
+ text: __('Destroy'),
+ classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+ icon: 'fa fa-times',
+ url: 'school/classes/activity/activity/destroy',
+ refresh: true
+ }
+ ],
+ formatter: Table.api.formatter.operate
+ }
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ add: function () {
+ Controller.api.bindevent();
+ generrate.setOfflineType($("input:radio[name='row[address_type]']").val());
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+
+ $(document).on("dp.change", "#add-form .datetimerange", function () {
+ $(this).parent().prev().find("input").trigger("change");
+ });
+
+ $(document).on("dp.change", "#add-form .datetimepicker", function () {
+ $(this).parent().prev().find("input").trigger("change");
+ });
+ $(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", "#add-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) + "')");
+ // })
+ });
+ $(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) + "')");
+ // })
+ });
+
+ $("#c-address_city").on("cp:updated", function() {
+ var citypicker = $(this).data("citypicker");
+ var province = citypicker.getCode("province");
+ var city = citypicker.getCode("city");
+ var district = citypicker.getCode("district");
+ if(province){
+ $("#province").val(province);
+ }
+ if(city){
+ $("#city").val(city);
+ }
+ if(district){
+ $("#district").val(district);
+ }
+ $(this).blur();
+ });
+
+ generrate.listen();
+ $(document).on('click', '.btn-changeuser', function (event) {
+ var url = $(this).attr('data-url');
+ if(!url) return false;
+ var title = $(this).attr('title');
+ var width = $(this).attr('data-width');
+ var height = $(this).attr('data-height');
+ // var ids = $(this).attr('data-id');
+ var area = ['98%','98%'];
+ var options = {
+ shadeClose: false,
+ shade: [0.3, '#393D49'],
+ area: area,
+ callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果;
+ Fast.api.close(ret);
+ }
+ };
+ Fast.api.open(url,title,options);
+ });
+
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+
+
+
+ var generrate = {
+ listen:function () {
+ this.offlineListen();
+ this.priceListen();
+ },
+ offlineListen:function () {
+ var that = this;
+ // console.log($("input:radio[name='row[address_type]']").val())
+ // this.setOfflineType($("input:radio[name='row[address_type]']").val());
+ $("input:radio[name='row[address_type]']").change(function (){
+ that.setOfflineType($(this).val());
+ });
+ },
+ setOfflineType:function (val) {
+ switch (val) {
+ case '1':
+ $('#c_position').hide();
+ break;
+ case '2':
+ $('#c_position').show();
+ break;
+ }
+ },
+ priceListen:function () {
+ $('#spec').bind('input propertychange', function(){
+ var length = $("#spec").val().length;
+ console.log(length);
+ });
+ }
+ }
+
+
+ return Controller;
+});
\ No newline at end of file
diff --git a/public/assets/js/manystore/school/classes/activity/activity_auth.js b/public/assets/js/manystore/school/classes/activity/activity_auth.js
new file mode 100644
index 0000000..f9f8fef
--- /dev/null
+++ b/public/assets/js/manystore/school/classes/activity/activity_auth.js
@@ -0,0 +1,154 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'school/classes/activity/activity_auth/index' + location.search,
+ add_url: 'school/classes/activity/activity_auth/add',
+ edit_url: 'school/classes/activity/activity_auth/edit',
+ del_url: 'school/classes/activity/activity_auth/del',
+ multi_url: 'school/classes/activity/activity_auth/multi',
+ import_url: 'school/classes/activity/activity_auth/import',
+ table: 'school_classes_activity_auth',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'weigh',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'classes_activity_id', title: __('Classes_activity_id')},
+ {field: 'manystore_id', title: __('Manystore_id')},
+ {field: 'shop_id', title: __('Shop_id')},
+ {field: 'title', title: __('Title'), operate: 'LIKE'},
+ {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: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal},
+ {field: 'address_city', title: __('Address_city'), operate: 'LIKE'},
+ {field: 'province', title: __('Province')},
+ {field: 'city', title: __('City')},
+ {field: 'district', title: __('District')},
+ {field: 'address', title: __('Address'), operate: 'LIKE'},
+ {field: 'address_detail', title: __('Address_detail'), operate: 'LIKE'},
+ {field: 'longitude', title: __('Longitude'), operate: 'LIKE'},
+ {field: 'latitude', title: __('Latitude'), operate: 'LIKE'},
+ {field: 'start_time', title: __('Start_time')},
+ {field: 'end_time', title: __('End_time')},
+ {field: 'sign_start_time', title: __('Sign_start_time')},
+ {field: 'sign_end_time', title: __('Sign_end_time')},
+ {field: 'price', title: __('Price'), operate:'BETWEEN'},
+ {field: 'people_num', title: __('People_num')},
+ {field: 'item', title: __('Item'), operate: 'LIKE'},
+ {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
+ {field: 'weigh', title: __('Weigh'), operate: false},
+ {field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal},
+ {field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal},
+ {field: 'new', title: __('New'), searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal},
+ {field: 'selfhot', title: __('Selfhot'), searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal},
+ {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: 'sale', title: __('Sale')},
+ {field: 'stock', title: __('Stock')},
+ {field: 'views', title: __('Views')},
+ {field: 'expirestatus', title: __('Expirestatus'), searchList: {"1":__('Expirestatus 1'),"2":__('Expirestatus 2')}, formatter: Table.api.formatter.status},
+ {field: 'add_type', title: __('Add_type'), searchList: {"1":__('Add_type 1'),"2":__('Add_type 2')}, formatter: Table.api.formatter.normal},
+ {field: 'add_id', title: __('Add_id')},
+ {field: 'admin_id', title: __('Admin_id')},
+ {field: 'auth_time', title: __('Auth_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+ {field: 'createtime', title: __('Createtime')},
+ {field: 'updatetime', title: __('Updatetime')},
+ {field: 'schoolclassesactivity.id', title: __('Schoolclassesactivity.id')},
+ {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
+ {field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'},
+ {field: 'manystoreshop.logo', title: __('Manystoreshop.logo'), operate: 'LIKE'},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ recyclebin: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ 'dragsort_url': ''
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'school/classes/activity/activity_auth/recyclebin' + location.search,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'title', title: __('Title'), align: 'left'},
+ {
+ field: 'deletetime',
+ title: __('Deletetime'),
+ operate: 'RANGE',
+ addclass: 'datetimerange',
+ formatter: Table.api.formatter.datetime
+ },
+ {
+ field: 'operate',
+ width: '130px',
+ title: __('Operate'),
+ table: table,
+ events: Table.api.events.operate,
+ buttons: [
+ {
+ name: 'Restore',
+ text: __('Restore'),
+ classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
+ icon: 'fa fa-rotate-left',
+ url: 'school/classes/activity/activity_auth/restore',
+ refresh: true
+ },
+ {
+ name: 'Destroy',
+ text: __('Destroy'),
+ classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+ icon: 'fa fa-times',
+ url: 'school/classes/activity/activity_auth/destroy',
+ refresh: true
+ }
+ ],
+ formatter: Table.api.formatter.operate
+ }
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ add: function () {
+ Controller.api.bindevent();
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+ return Controller;
+});
\ No newline at end of file
diff --git a/public/assets/js/manystore/school/classes/activity/activity_item.js b/public/assets/js/manystore/school/classes/activity/activity_item.js
new file mode 100644
index 0000000..cb68e82
--- /dev/null
+++ b/public/assets/js/manystore/school/classes/activity/activity_item.js
@@ -0,0 +1,129 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'school/classes/activity/activity_item/index' + location.search,
+ add_url: 'school/classes/activity/activity_item/add',
+ edit_url: 'school/classes/activity/activity_item/edit',
+ del_url: 'school/classes/activity/activity_item/del',
+ multi_url: 'school/classes/activity/activity_item/multi',
+ import_url: 'school/classes/activity/activity_item/import',
+ table: 'school_classes_activity_item',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'weigh',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'manystore_id', title: __('Manystore_id')},
+ {field: 'shop_id', title: __('Shop_id')},
+ {field: 'classes_activity_id', title: __('Classes_activity_id')},
+ {field: 'name', title: __('Name'), operate: 'LIKE'},
+ {field: 'price', title: __('Price'), operate:'BETWEEN'},
+ {field: 'limit_num', title: __('Limit_num')},
+ {field: 'age', title: __('Age'), operate: 'LIKE'},
+ {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
+ {field: 'sex', title: __('Sex'), searchList: {"1":__('Sex 1'),"2":__('Sex 2'),"3":__('Sex 3')}, formatter: Table.api.formatter.normal},
+ {field: 'weigh', title: __('Weigh'), operate: false},
+ {field: 'sign_num', title: __('Sign_num')},
+ {field: 'verification_num', title: __('Verification_num')},
+ {field: 'createtime', title: __('Createtime')},
+ {field: 'updatetime', title: __('Updatetime')},
+ {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
+ {field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'},
+ {field: 'manystoreshop.logo', title: __('Manystoreshop.logo'), operate: 'LIKE'},
+ {field: 'schoolclassesactivity.title', title: __('Schoolclassesactivity.title'), operate: 'LIKE'},
+ {field: 'schoolclassesactivity.headimage', title: __('Schoolclassesactivity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ recyclebin: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ 'dragsort_url': ''
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'school/classes/activity/activity_item/recyclebin' + location.search,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'name', title: __('Name'), align: 'left'},
+ {
+ field: 'deletetime',
+ title: __('Deletetime'),
+ operate: 'RANGE',
+ addclass: 'datetimerange',
+ formatter: Table.api.formatter.datetime
+ },
+ {
+ field: 'operate',
+ width: '130px',
+ title: __('Operate'),
+ table: table,
+ events: Table.api.events.operate,
+ buttons: [
+ {
+ name: 'Restore',
+ text: __('Restore'),
+ classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
+ icon: 'fa fa-rotate-left',
+ url: 'school/classes/activity/activity_item/restore',
+ refresh: true
+ },
+ {
+ name: 'Destroy',
+ text: __('Destroy'),
+ classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+ icon: 'fa fa-times',
+ url: 'school/classes/activity/activity_item/destroy',
+ refresh: true
+ }
+ ],
+ formatter: Table.api.formatter.operate
+ }
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ add: function () {
+ Controller.api.bindevent();
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+ return Controller;
+});
\ No newline at end of file
diff --git a/public/assets/js/manystore/school/classes/activity/activity_item_auth.js b/public/assets/js/manystore/school/classes/activity/activity_item_auth.js
new file mode 100644
index 0000000..3316752
--- /dev/null
+++ b/public/assets/js/manystore/school/classes/activity/activity_item_auth.js
@@ -0,0 +1,129 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'school/classes/activity/activity_item_auth/index' + location.search,
+ add_url: 'school/classes/activity/activity_item_auth/add',
+ edit_url: 'school/classes/activity/activity_item_auth/edit',
+ del_url: 'school/classes/activity/activity_item_auth/del',
+ multi_url: 'school/classes/activity/activity_item_auth/multi',
+ import_url: 'school/classes/activity/activity_item_auth/import',
+ table: 'school_classes_activity_item_auth',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'weigh',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'manystore_id', title: __('Manystore_id')},
+ {field: 'shop_id', title: __('Shop_id')},
+ {field: 'classes_activity_id', title: __('Classes_activity_id')},
+ {field: 'name', title: __('Name'), operate: 'LIKE'},
+ {field: 'price', title: __('Price'), operate:'BETWEEN'},
+ {field: 'limit_num', title: __('Limit_num')},
+ {field: 'age', title: __('Age'), operate: 'LIKE'},
+ {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
+ {field: 'sex', title: __('Sex'), searchList: {"1":__('Sex 1'),"2":__('Sex 2'),"3":__('Sex 3')}, formatter: Table.api.formatter.normal},
+ {field: 'weigh', title: __('Weigh'), operate: false},
+ {field: 'sign_num', title: __('Sign_num')},
+ {field: 'verification_num', title: __('Verification_num')},
+ {field: 'createtime', title: __('Createtime')},
+ {field: 'updatetime', title: __('Updatetime')},
+ {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
+ {field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'},
+ {field: 'manystoreshop.logo', title: __('Manystoreshop.logo'), operate: 'LIKE'},
+ {field: 'schoolclassesactivity.title', title: __('Schoolclassesactivity.title'), operate: 'LIKE'},
+ {field: 'schoolclassesactivity.headimage', title: __('Schoolclassesactivity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ recyclebin: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ 'dragsort_url': ''
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'school/classes/activity/activity_item_auth/recyclebin' + location.search,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'name', title: __('Name'), align: 'left'},
+ {
+ field: 'deletetime',
+ title: __('Deletetime'),
+ operate: 'RANGE',
+ addclass: 'datetimerange',
+ formatter: Table.api.formatter.datetime
+ },
+ {
+ field: 'operate',
+ width: '130px',
+ title: __('Operate'),
+ table: table,
+ events: Table.api.events.operate,
+ buttons: [
+ {
+ name: 'Restore',
+ text: __('Restore'),
+ classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
+ icon: 'fa fa-rotate-left',
+ url: 'school/classes/activity/activity_item_auth/restore',
+ refresh: true
+ },
+ {
+ name: 'Destroy',
+ text: __('Destroy'),
+ classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+ icon: 'fa fa-times',
+ url: 'school/classes/activity/activity_item_auth/destroy',
+ refresh: true
+ }
+ ],
+ formatter: Table.api.formatter.operate
+ }
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ add: function () {
+ Controller.api.bindevent();
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+ return Controller;
+});
\ No newline at end of file
diff --git a/public/assets/js/manystore/school/classes/activity/order/order.js b/public/assets/js/manystore/school/classes/activity/order/order.js
new file mode 100644
index 0000000..8fdc160
--- /dev/null
+++ b/public/assets/js/manystore/school/classes/activity/order/order.js
@@ -0,0 +1,155 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'school/classes/activity/order/order/index' + location.search,
+ add_url: 'school/classes/activity/order/order/add',
+ edit_url: 'school/classes/activity/order/order/edit',
+ del_url: 'school/classes/activity/order/order/del',
+ multi_url: 'school/classes/activity/order/order/multi',
+ import_url: 'school/classes/activity/order/order/import',
+ table: 'school_classes_activity_order',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
+ {field: 'pay_no', title: __('Pay_no'), operate: 'LIKE'},
+ {field: 'user_id', title: __('User_id')},
+ {field: 'manystore_id', title: __('Manystore_id')},
+ {field: 'shop_id', title: __('Shop_id')},
+ {field: 'code', title: __('Code'), operate: 'LIKE'},
+ {field: 'codeimage', title: __('Codeimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ {field: 'codeoneimage', title: __('Codeoneimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ {field: 'classes_activity_id', title: __('Classes_activity_id')},
+ {field: 'activity_order_detail_id', title: __('Activity_order_detail_id')},
+ {field: 'beforeprice', title: __('Beforeprice'), operate:'BETWEEN'},
+ {field: 'totalprice', title: __('Totalprice'), operate:'BETWEEN'},
+ {field: 'payprice', title: __('Payprice'), operate:'BETWEEN'},
+ {field: 'pay_type', title: __('Pay_type'), searchList: {"yue":__('Pay_type yue'),"wechat":__('Pay_type wechat')}, formatter: Table.api.formatter.normal},
+ {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status},
+ {field: 'before_status', title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"2":__('Before_status 2'),"3":__('Before_status 3'),"4":__('Before_status 4'),"6":__('Before_status 6'),"9":__('Before_status 9')}, formatter: Table.api.formatter.status},
+ {field: 'server_status', title: __('Server_status'), searchList: {"0":__('Server_status 0'),"3":__('Server_status 3'),"6":__('Server_status 6')}, formatter: Table.api.formatter.status},
+ {field: 'canceltime', title: __('Canceltime')},
+ {field: 'paytime', title: __('Paytime')},
+ {field: 'auth_time', title: __('Auth_time')},
+ {field: 'reservation_time', title: __('Reservation_time')},
+ {field: 'finishtime', title: __('Finishtime')},
+ {field: 'refundtime', title: __('Refundtime')},
+ {field: 'total_refundprice', title: __('Total_refundprice'), operate:'BETWEEN'},
+ {field: 'real_refundprice', title: __('Real_refundprice'), operate:'BETWEEN'},
+ {field: 'sub_refundprice', title: __('Sub_refundprice'), operate:'BETWEEN'},
+ {field: 'platform', title: __('Platform'), operate: 'LIKE'},
+ {field: 'verification_user_id', title: __('Verification_user_id')},
+ {field: 'verification_type', title: __('Verification_type'), operate: 'LIKE'},
+ {field: 'reason', title: __('Reason'), operate: 'LIKE'},
+ {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: 'auth_user_id', title: __('Auth_user_id')},
+ {field: 'auth_type', title: __('Auth_type'), operate: 'LIKE'},
+ {field: 'createtime', title: __('Createtime')},
+ {field: 'updatetime', title: __('Updatetime')},
+ {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: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'},
+ {field: 'manystoreshop.logo', title: __('Manystoreshop.logo'), operate: 'LIKE'},
+ {field: 'schoolclassesactivity.title', title: __('Schoolclassesactivity.title'), operate: 'LIKE'},
+ {field: 'schoolclassesactivity.headimage', title: __('Schoolclassesactivity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ {field: 'schoolclassesactivityorderdetail.title', title: __('Schoolclassesactivityorderdetail.title'), operate: 'LIKE'},
+ {field: 'schoolclassesactivityorderdetail.headimage', title: __('Schoolclassesactivityorderdetail.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ recyclebin: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ 'dragsort_url': ''
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'school/classes/activity/order/order/recyclebin' + location.search,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {
+ field: 'deletetime',
+ title: __('Deletetime'),
+ operate: 'RANGE',
+ addclass: 'datetimerange',
+ formatter: Table.api.formatter.datetime
+ },
+ {
+ field: 'operate',
+ width: '130px',
+ title: __('Operate'),
+ table: table,
+ events: Table.api.events.operate,
+ buttons: [
+ {
+ name: 'Restore',
+ text: __('Restore'),
+ classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
+ icon: 'fa fa-rotate-left',
+ url: 'school/classes/activity/order/order/restore',
+ refresh: true
+ },
+ {
+ name: 'Destroy',
+ text: __('Destroy'),
+ classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+ icon: 'fa fa-times',
+ url: 'school/classes/activity/order/order/destroy',
+ refresh: true
+ }
+ ],
+ formatter: Table.api.formatter.operate
+ }
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ add: function () {
+ Controller.api.bindevent();
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+ return Controller;
+});
\ No newline at end of file
diff --git a/public/assets/js/manystore/school/classes/activity/order/order_detail.js b/public/assets/js/manystore/school/classes/activity/order/order_detail.js
new file mode 100644
index 0000000..d77d94a
--- /dev/null
+++ b/public/assets/js/manystore/school/classes/activity/order/order_detail.js
@@ -0,0 +1,159 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'school/classes/activity/order/order_detail/index' + location.search,
+ add_url: 'school/classes/activity/order/order_detail/add',
+ edit_url: 'school/classes/activity/order/order_detail/edit',
+ del_url: 'school/classes/activity/order/order_detail/del',
+ multi_url: 'school/classes/activity/order/order_detail/multi',
+ import_url: 'school/classes/activity/order/order_detail/import',
+ table: 'school_classes_activity_order_detail',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'weigh',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'classes_activity_order_id', title: __('Classes_activity_order_id')},
+ {field: 'classes_activity_id', title: __('Classes_activity_id')},
+ {field: 'manystore_id', title: __('Manystore_id')},
+ {field: 'shop_id', title: __('Shop_id')},
+ {field: 'user_id', title: __('User_id')},
+ {field: 'title', title: __('Title'), operate: 'LIKE'},
+ {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: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal},
+ {field: 'address_city', title: __('Address_city'), operate: 'LIKE'},
+ {field: 'province', title: __('Province')},
+ {field: 'city', title: __('City')},
+ {field: 'district', title: __('District')},
+ {field: 'address', title: __('Address'), operate: 'LIKE'},
+ {field: 'address_detail', title: __('Address_detail'), operate: 'LIKE'},
+ {field: 'longitude', title: __('Longitude'), operate: 'LIKE'},
+ {field: 'latitude', title: __('Latitude'), operate: 'LIKE'},
+ {field: 'start_time', title: __('Start_time')},
+ {field: 'end_time', title: __('End_time')},
+ {field: 'sign_start_time', title: __('Sign_start_time')},
+ {field: 'sign_end_time', title: __('Sign_end_time')},
+ {field: 'price', title: __('Price'), operate:'BETWEEN'},
+ {field: 'people_num', title: __('People_num')},
+ {field: 'item', title: __('Item'), operate: 'LIKE'},
+ {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
+ {field: 'weigh', title: __('Weigh'), operate: false},
+ {field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal},
+ {field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal},
+ {field: 'new', title: __('New'), searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal},
+ {field: 'selfhot', title: __('Selfhot'), searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal},
+ {field: 'sale', title: __('Sale')},
+ {field: 'stock', title: __('Stock')},
+ {field: 'views', title: __('Views')},
+ {field: 'expirestatus', title: __('Expirestatus'), searchList: {"1":__('Expirestatus 1'),"2":__('Expirestatus 2')}, formatter: Table.api.formatter.status},
+ {field: 'add_type', title: __('Add_type'), searchList: {"1":__('Add_type 1'),"2":__('Add_type 2')}, formatter: Table.api.formatter.normal},
+ {field: 'add_id', title: __('Add_id')},
+ {field: 'createtime', title: __('Createtime')},
+ {field: 'updatetime', title: __('Updatetime')},
+ {field: 'schoolclassesactivityorder.order_no', title: __('Schoolclassesactivityorder.order_no'), operate: 'LIKE'},
+ {field: 'schoolclassesactivityorder.pay_no', title: __('Schoolclassesactivityorder.pay_no'), operate: 'LIKE'},
+ {field: 'schoolclassesactivity.title', title: __('Schoolclassesactivity.title'), operate: 'LIKE'},
+ {field: 'schoolclassesactivity.headimage', title: __('Schoolclassesactivity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
+ {field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'},
+ {field: 'manystoreshop.logo', title: __('Manystoreshop.logo'), 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: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ recyclebin: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ 'dragsort_url': ''
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'school/classes/activity/order/order_detail/recyclebin' + location.search,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'title', title: __('Title'), align: 'left'},
+ {
+ field: 'deletetime',
+ title: __('Deletetime'),
+ operate: 'RANGE',
+ addclass: 'datetimerange',
+ formatter: Table.api.formatter.datetime
+ },
+ {
+ field: 'operate',
+ width: '130px',
+ title: __('Operate'),
+ table: table,
+ events: Table.api.events.operate,
+ buttons: [
+ {
+ name: 'Restore',
+ text: __('Restore'),
+ classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
+ icon: 'fa fa-rotate-left',
+ url: 'school/classes/activity/order/order_detail/restore',
+ refresh: true
+ },
+ {
+ name: 'Destroy',
+ text: __('Destroy'),
+ classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+ icon: 'fa fa-times',
+ url: 'school/classes/activity/order/order_detail/destroy',
+ refresh: true
+ }
+ ],
+ formatter: Table.api.formatter.operate
+ }
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ add: function () {
+ Controller.api.bindevent();
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+ return Controller;
+});
\ No newline at end of file
diff --git a/public/assets/js/manystore/school/classes/activity/order/order_log.js b/public/assets/js/manystore/school/classes/activity/order/order_log.js
new file mode 100644
index 0000000..d9f53f8
--- /dev/null
+++ b/public/assets/js/manystore/school/classes/activity/order/order_log.js
@@ -0,0 +1,118 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+ var Controller = {
+ index: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'school/classes/activity/order/order_log/index' + location.search,
+ add_url: 'school/classes/activity/order/order_log/add',
+ edit_url: 'school/classes/activity/order/order_log/edit',
+ del_url: 'school/classes/activity/order/order_log/del',
+ multi_url: 'school/classes/activity/order/order_log/multi',
+ import_url: 'school/classes/activity/order/order_log/import',
+ table: 'school_classes_activity_order_log',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'classes_activity_order_id', title: __('Classes_activity_order_id')},
+ {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status},
+ {field: 'log_text', title: __('Log_text'), operate: 'LIKE'},
+ {field: 'oper_type', title: __('Oper_type'), operate: 'LIKE'},
+ {field: 'oper_id', title: __('Oper_id')},
+ {field: 'createtime', title: __('Createtime')},
+ {field: 'updatetime', title: __('Updatetime')},
+ {field: 'schoolclassesactivityorder.order_no', title: __('Schoolclassesactivityorder.order_no'), operate: 'LIKE'},
+ {field: 'schoolclassesactivityorder.pay_no', title: __('Schoolclassesactivityorder.pay_no'), operate: 'LIKE'},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ recyclebin: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ 'dragsort_url': ''
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'school/classes/activity/order/order_log/recyclebin' + location.search,
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {
+ field: 'deletetime',
+ title: __('Deletetime'),
+ operate: 'RANGE',
+ addclass: 'datetimerange',
+ formatter: Table.api.formatter.datetime
+ },
+ {
+ field: 'operate',
+ width: '130px',
+ title: __('Operate'),
+ table: table,
+ events: Table.api.events.operate,
+ buttons: [
+ {
+ name: 'Restore',
+ text: __('Restore'),
+ classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
+ icon: 'fa fa-rotate-left',
+ url: 'school/classes/activity/order/order_log/restore',
+ refresh: true
+ },
+ {
+ name: 'Destroy',
+ text: __('Destroy'),
+ classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+ icon: 'fa fa-times',
+ url: 'school/classes/activity/order/order_log/destroy',
+ refresh: true
+ }
+ ],
+ formatter: Table.api.formatter.operate
+ }
+ ]
+ ]
+ });
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+ add: function () {
+ Controller.api.bindevent();
+ },
+ edit: function () {
+ Controller.api.bindevent();
+ },
+ api: {
+ bindevent: function () {
+ Form.api.bindevent($("form[role=form]"));
+ }
+ }
+ };
+ return Controller;
+});
\ No newline at end of file