diff --git a/application/admin/controller/school/classes/ClassesLib.php b/application/admin/controller/school/classes/ClassesLib.php
index 0eecd7d..88ae2a9 100644
--- a/application/admin/controller/school/classes/ClassesLib.php
+++ b/application/admin/controller/school/classes/ClassesLib.php
@@ -209,29 +209,7 @@ class ClassesLib extends Backend
}
- protected function no_auth_fields_check($params,$row){
- foreach ($params as $k=>$v){
-
- //说明数值有变动
- //$params[$k] 去掉两端空格
- $params[$k] = trim($v);
-
- if($row[$k]!=$params[$k]){
- //当修改参数不在允许修改的字段中
- if(!in_array($k,$this->no_auth_fields)){
-// var_dump($row[$k],$params[$k]);
-
- $this->have_auth = true;break;
-
- }
- }
-
- }
-
- return $this->have_auth;
-
- }
protected function updateCheck($id,$params=[],$row=null){
if($params && $row){
@@ -432,7 +410,7 @@ class ClassesLib extends Backend
//因为是批量添加,所有规格重新进行检测,防止出现时间重叠
$specss = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$this->model["id"])->select();
foreach ($specss as $k=>$specs){
- $params =$specs;
+ $params =$specs->toArray();
(new \app\common\model\school\classes\ClassesSpec)->specCheck($params,null,$specs);
}
@@ -551,7 +529,7 @@ class ClassesLib extends Backend
$specss = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row["id"])->select();
foreach ($specss as $k=>$specs){
- $params =$specs;
+ $params =$specs->toArray();
(new \app\common\model\school\classes\ClassesSpec)->specCheck($params,null,$specs);
}
diff --git a/application/admin/controller/school/classes/ClassesSpec.php b/application/admin/controller/school/classes/ClassesSpec.php
index 7371d11..7137552 100644
--- a/application/admin/controller/school/classes/ClassesSpec.php
+++ b/application/admin/controller/school/classes/ClassesSpec.php
@@ -88,28 +88,7 @@ class ClassesSpec extends Backend
return $this->view->fetch();
}
- protected function no_auth_fields_check($params,$row){
- foreach ($params as $k=>$v){
-
- //说明数值有变动
- //$params[$k] 去掉两端空格
- $params[$k] = trim($v);
-
- if($row[$k]!=$params[$k]){
- //当修改参数不在允许修改的字段中
- if(!in_array($k,$this->no_auth_fields)){
-
- $this->have_auth = true;break;
-
- }
- }
-
- }
-
- return $this->have_auth;
-
- }
protected function update_classes($classes_lib_id){
//更新课程规格库存
diff --git a/application/admin/controller/school/classes/activity/Activity.php b/application/admin/controller/school/classes/activity/Activity.php
index cd23d1a..548c4fa 100644
--- a/application/admin/controller/school/classes/activity/Activity.php
+++ b/application/admin/controller/school/classes/activity/Activity.php
@@ -30,6 +30,11 @@ class Activity extends Backend
protected $qSwitch = true;
protected $qFields = ["user_id","shop_id","manystore_id"];
+
+ //不用审核允许修改的字段
+ protected $no_auth_fields = ["status","weigh","recommend","hot","new","selfhot","feel","start_time","end_time","sign_start_time","sign_end_time","longitude","latitude","address_city","province","city","district","address","address_detail","address_type","title",'headimage','images','content',"price"];
+
+
public function _initialize()
{
@@ -70,6 +75,7 @@ class Activity extends Backend
{
//当前是否为关联查询
$this->relationSearch = true;
+ $this->searchFields = ["id","title","address","address_detail","address_city","shop.name"];
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
@@ -162,8 +168,8 @@ class Activity extends Backend
}
// 课程存在售后订单则不允许操作
- $order = Order::where("classes_activity_item_id",$id)->where("status","not in","-3,6,9")->find();
- if($order)throw new \Exception("{$order['name']}存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!");
+ $order = Order::where("classes_activity_id",$id)->where("status","not in","-3,6,9")->find();
+ if($order)throw new \Exception("存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!");
}
@@ -174,7 +180,7 @@ class Activity extends Backend
if(empty($params["shop_id"]))$params["shop_id"] = $row["shop_id"];
}
- try {
+// try {
$classesLib = new \app\common\model\school\classes\activity\Activity();
$classesLib->no_auth_fields = $this->no_auth_fields;
$classesLib->need_auth = $this->need_auth;
@@ -185,9 +191,9 @@ class Activity extends Backend
$this->need_auth = $classesLib->need_auth;
$this->have_auth = $classesLib->have_auth;
- }catch (\Exception $e){
- $this->error($e->getMessage());
- }
+// }catch (\Exception $e){
+// $this->error($e->getMessage());
+// }
@@ -255,14 +261,14 @@ class Activity extends Backend
//因为是批量添加,所有规格重新进行检测,防止出现时间重叠
$specss = \app\common\model\school\classes\activity\ActivityItem::where("classes_activity_id",$this->model["id"])->select();
foreach ($specss as $k=>$specs){
- $params =$specs;
+ $params =$specs->toArray();
(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) {
+ } catch (ValidateException|PDOException|\Exception $e) {
Db::rollback();
$this->error($e->getMessage().$e->getFile().$e->getLine());
}
@@ -352,14 +358,14 @@ class Activity extends Backend
$specss = \app\common\model\school\classes\activity\ActivityItem::where("classes_activity_id",$row["id"])->select();
foreach ($specss as $k=>$specs){
- $params =$specs;
+ $params =$specs->toArray();
(new \app\common\model\school\classes\activity\ActivityItem)->specCheck($params,null,$specs);
}
$this->update_classes($row["id"]);
Db::commit();
- } catch (ValidateException|PDOException|Exception $e) {
+ } catch (ValidateException|PDOException|\Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
diff --git a/application/admin/controller/school/classes/activity/ActivityAuth.php b/application/admin/controller/school/classes/activity/ActivityAuth.php
index 1b25cf1..db4beb6 100644
--- a/application/admin/controller/school/classes/activity/ActivityAuth.php
+++ b/application/admin/controller/school/classes/activity/ActivityAuth.php
@@ -33,7 +33,10 @@ class ActivityAuth extends Backend
protected $error_auth = false;
//不用审核允许修改的字段
- protected $no_auth_fields = ['headimage','images','content',"price"];
+ protected $no_auth_fields = ["status","weigh","recommend","hot","new","selfhot","feel","start_time","end_time","sign_start_time","sign_end_time","longitude","latitude","address_city","province","city","district","address","address_detail","address_type","title",'headimage','images','content',"price"];
+
+
+
public function _initialize()
@@ -78,6 +81,7 @@ class ActivityAuth extends Backend
{
//当前是否为关联查询
$this->relationSearch = true;
+ $this->searchFields = ["id","classes_activity_id","title","address","address_detail","address_city","shop.name"];
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
@@ -154,8 +158,8 @@ class ActivityAuth extends Backend
}
// 课程存在售后订单则不允许操作
- $order = Order::where("classes_activity_item_id",$id)->where("status","not in","-3,6,9")->find();
- if($order)throw new \Exception("{$order['name']}存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!");
+ $order = Order::where("classes_activity_id",$id)->where("status","not in","-3,6,9")->find();
+ if($order)throw new \Exception("存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!");
}
@@ -179,7 +183,7 @@ class ActivityAuth extends Backend
//
- try {
+// try {
$classesLib = new \app\common\model\school\classes\activity\ActivityAuth();
$classesLib->no_auth_fields = $this->no_auth_fields;
$classesLib->need_auth = $this->need_auth;
@@ -190,9 +194,9 @@ class ActivityAuth extends Backend
$this->need_auth = $classesLib->need_auth;
$this->have_auth = $classesLib->have_auth;
- }catch (\Exception $e){
- $this->error($e->getMessage());
- }
+// }catch (\Exception $e){
+// $this->error($e->getMessage());
+// }
@@ -285,14 +289,14 @@ class ActivityAuth extends Backend
//因为是批量添加,所有规格重新进行检测,防止出现时间重叠
$specss = \app\common\model\school\classes\activity\ActivityItemAuth::where("classes_activity_auth_id",$this->model["id"])->select();
foreach ($specss as $k=>$specs){
- $params =$specs;
+ $params =$specs->toArray();
(new \app\common\model\school\classes\activity\ActivityItemAuth)->specCheck($params,null,$specs);
}
$this->update_classes($this->model["classes_activity_id"] ?? 0,$this->model);
Db::commit();
- } catch (ValidateException|PDOException|Exception $e) {
+ } catch (ValidateException|PDOException|\Exception $e) {
Db::rollback();
$this->error($e->getMessage().$e->getFile().$e->getLine());
}
@@ -384,11 +388,12 @@ class ActivityAuth extends Backend
$specss = \app\common\model\school\classes\activity\ActivityItemAuth::where("classes_activity_auth_id",$row["id"])->select();
foreach ($specss as $k=>$specs){
- $params =$specs;
+ $params =$specs->toArray();
(new \app\common\model\school\classes\activity\ActivityItemAuth)->specCheck($params,null,$specs);
}
$this->update_classes($row["classes_activity_id"] ?? 0 ,$row);
if($this->success_auth){
+
$activity = (new \app\common\model\school\classes\activity\Activity)->successAuth($row["id"]);
$this->update_classes($activity["id"] ?? 0 ,$row);
@@ -409,7 +414,7 @@ class ActivityAuth extends Backend
Db::commit();
- } catch (ValidateException|PDOException|Exception $e) {
+ } catch (ValidateException|PDOException|\Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
diff --git a/application/admin/controller/school/classes/activity/order/Order.php b/application/admin/controller/school/classes/activity/order/Order.php
index 800bccc..35e1930 100644
--- a/application/admin/controller/school/classes/activity/order/Order.php
+++ b/application/admin/controller/school/classes/activity/order/Order.php
@@ -45,6 +45,10 @@ class Order extends Backend
{
//当前是否为关联查询
$this->relationSearch = true;
+
+ $this->searchFields = ["id","refund_error","code","refund_no","order_no","pay_no","user_id","orderitem.name","detail.title","user.nickname","user.realname","user.mobile","shop.name"];
+
+
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
@@ -55,7 +59,7 @@ class Order extends Backend
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
- ->with(['user','manystore','shop','activity','detail'])
+ ->with(['user',"orderitem",'manystore','shop','activity','detail'])
->where($where)
->order($sort, $order)
->paginate($limit);
@@ -67,6 +71,7 @@ class Order extends Backend
$row->getRelation('shop')->visible(['name','logo']);
$row->getRelation('activity')->visible(['title','headimage']);
$row->getRelation('detail')->visible(['title','headimage']);
+ $row->getRelation('orderitem')->visible(['name','price','feel']);
}
$result = array("total" => $list->total(), "rows" => $list->items());
@@ -76,4 +81,132 @@ class Order extends Backend
return $this->view->fetch();
}
+
+
+
+ /**
+ * 课程订单取消
+ * @return string
+ * @throws \think\Exception
+ * @throws \think\db\exception\BindParamException
+ * @throws \think\exception\DbException
+ * @throws \think\exception\PDOException
+ */
+ public function cancel($ids = ''){
+ $param = $this->request->param();
+ if($this->request->isPost()){
+ try{
+ if(isset($param['ids']))$ids = $param['ids'];
+ //设置模拟资格
+ $model = (new \app\common\model\school\classes\activity\order\Order);
+ $model->cancel($ids,0,true,'admin',$this->auth->id,true);
+
+ }catch (\Exception $e){
+ $this->error($e->getMessage());
+ }
+ $this->success('取消成功!');
+ }
+ $row = $this->model->get($ids);
+ $this->view->assign('vo', $row);
+ return $this->view->fetch();
+ }
+
+
+
+
+
+
+ /**预约审核
+ * @return string
+ * @throws \think\Exception
+ * @throws \think\exception\DbException
+ */
+ public function examine($ids = ""){
+
+ if($this->request->isPost())
+ {
+ try{
+ $params = $this->request->post("row/a");
+
+
+ $auth_status = $params["auth_status"];
+ $reason = $params["reason"];
+ $model = (new \app\common\model\school\classes\activity\order\Order);
+ $model->examine($params["id"],$auth_status,$reason,0,true,'admin',$this->auth->id,true);
+
+ }catch (\Exception $e){
+ $this->error($e->getMessage());
+ }
+
+ $this->success("已完成审核");
+ }
+
+ $row = $this->model->where(array('id'=>$ids))->find();
+ if (!$row) {
+ $this->error(__('No Results were found'));
+ }
+
+// $row = $this->model->get($param['ids']);
+ $this->view->assign('row', $row);
+ return $this->view->fetch();
+ }
+
+
+ /**
+ * 后台核销
+ * @return string
+ * @throws \think\Exception
+ * @throws \think\db\exception\BindParamException
+ * @throws \think\exception\DbException
+ * @throws \think\exception\PDOException
+ */
+ public function verification($ids = ''){
+ $param = $this->request->param();
+ if($this->request->isPost()){
+ try{
+ if(isset($param['ids']))$ids = $param['ids'];
+ //设置模拟资格
+ $model = (new \app\common\model\school\classes\activity\order\Order);
+ $model->verification($ids,0,true,'admin',$this->auth->id,true);
+
+
+ }catch (\Exception $e){
+ $this->error($e->getMessage());
+ }
+ $this->success('核销成功!');
+ }
+ $row = $this->model->get($ids);
+ $this->view->assign('vo', $row);
+ return $this->view->fetch();
+ }
+
+
+ /**
+ * 退款重试
+ * @return string
+ * @throws \think\Exception
+ * @throws \think\db\exception\BindParamException
+ * @throws \think\exception\DbException
+ * @throws \think\exception\PDOException
+ */
+ public function refund($ids = ''){
+ $param = $this->request->param();
+ if($this->request->isPost()){
+ try{
+ if(isset($param['ids']))$ids = $param['ids'];
+ //设置模拟资格
+ $model = (new \app\common\model\school\classes\activity\order\Order);
+ $model->orderRefund($ids,null,'admin',$this->auth->id,true,true);
+
+
+ }catch (\Exception $e){
+ $this->error($e->getMessage());
+ }
+ $this->success('已重新发起退款,如果是第三方支付请等待回调!');
+ }
+ $row = $this->model->get($ids);
+ $this->view->assign('vo', $row);
+ return $this->view->fetch();
+ }
+
}
diff --git a/application/admin/controller/school/help/Article.php b/application/admin/controller/school/help/Article.php
new file mode 100644
index 0000000..89b2f05
--- /dev/null
+++ b/application/admin/controller/school/help/Article.php
@@ -0,0 +1,42 @@
+model = new \app\admin\model\school\help\Article;
+ parent::_initialize();
+
+ $this->view->assign("statusList", $this->model->getStatusList());
+ $this->view->assign("hotList", $this->model->getHotList());
+ }
+
+
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+}
diff --git a/application/admin/controller/school/help/Cate.php b/application/admin/controller/school/help/Cate.php
new file mode 100644
index 0000000..d4fc7c6
--- /dev/null
+++ b/application/admin/controller/school/help/Cate.php
@@ -0,0 +1,165 @@
+model = new \app\admin\model\school\help\Cate;
+ parent::_initialize();
+
+ $this->view->assign("statusList", $this->model->getStatusList());
+
+ Tree::instance()->init(collection($this->model->order('weigh DESC,id ASC')->select())->toArray())->icon = [' ', ' ', ' '];
+ $this->rulelist = Tree::instance()->getTreeList(Tree::instance()->getTreeArray(0), 'name');
+ $ruledata = [0 => __('None')];
+ foreach ($this->rulelist as $k => &$v) {
+ $ruledata[$v['id']] = $v['name'];
+ }
+ unset($v);
+ $this->view->assign('ruledata', $ruledata);
+
+ }
+
+
+
+ /**
+ * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+ * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+ * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+ */
+
+
+
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if ($this->request->isAjax()) {
+ $list = $this->rulelist;
+ $total = count($this->rulelist);
+ $result = array("total" => $total, "rows" => $list);
+
+ return json($result);
+ }
+ return $this->view->fetch();
+ }
+
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if ($this->request->isPost()) {
+ $this->token();
+ $params = $this->request->post("row/a", [], 'strip_tags');
+ if ($params) {
+// if (!$params['ismenu'] && !$params['pid']) {
+// $this->error(__('The non-menu rule must have parent'));
+// }
+ $result = $this->model->save($params);
+ if ($result === false) {
+ $this->error($this->model->getError());
+ }
+
+ $this->success();
+ }
+ $this->error();
+ }
+ return $this->view->fetch();
+ }
+
+ /**
+ * 编辑
+ */
+ public function edit($ids = null)
+ {
+ $row = $this->model->get(['id' => $ids]);
+ if (!$row) {
+ $this->error(__('No Results were found'));
+ }
+ if ($this->request->isPost()) {
+ $this->token();
+ $params = $this->request->post("row/a", [], 'strip_tags');
+ if ($params) {
+// if (!$params['ismenu'] && !$params['pid']) {
+// $this->error(__('The non-menu rule must have parent'));
+// }
+ if ($params['pid'] == $row['id']) {
+ $this->error(__('Can not change the parent to self'));
+ }
+ if ($params['pid'] != $row['pid']) {
+ $childrenIds = Tree::instance()->init(collection($this->model->order('weigh DESC,id ASC')->select())->toArray())->getChildrenIds($row['id']);
+ if (in_array($params['pid'], $childrenIds)) {
+ $this->error(__('Can not change the parent to child'));
+ }
+ }
+ //这里需要针对name做唯一验证
+ $ruleValidate = \app\admin\model\school\help\Cate::where( 'name' , $params['name'] )-> where( 'id' , '<>' , $row['id'] )->find();
+
+ if( $ruleValidate ){
+ $this->error( '分类名称已存在' );
+ }
+
+ $result = $row->save($params);
+ if ($result === false) {
+ $this->error($row->getError());
+ }
+
+ $this->success();
+ }
+ $this->error();
+ }
+ $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) {
+ $delIds = [];
+ foreach (explode(',', $ids) as $k => $v) {
+ $delIds = array_merge($delIds, Tree::instance()->getChildrenIds($v, true));
+ }
+ $delIds = array_unique($delIds);
+ $count = $this->model->where('id', 'in', $delIds)->delete();
+ if ($count) {
+
+ $this->success();
+ }
+ }
+ $this->error();
+ }
+
+}
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
index 2c327da..0997b1f 100644
--- a/application/admin/lang/zh-cn/school/classes/activity/order/order.php
+++ b/application/admin/lang/zh-cn/school/classes/activity/order/order.php
@@ -27,6 +27,7 @@ return [
'Status 3' => '已预约',
'Set status to 3' => '设为已预约',
'Status 4' => '售后中',
+ 'Status 5' => '退款结算中',
'Set status to 4' => '设为售后中',
'Status 6' => '已退款',
'Set status to 6' => '设为已退款',
@@ -77,5 +78,9 @@ return [
'Activity.title' => '标题',
'Activity.headimage' => '头图',
'Detail.title' => '标题',
- 'Detail.headimage' => '头图'
+ 'Detail.headimage' => '头图',
+ 'Orderitem.name' => '活动规格',
+ 'Feel' => '是否免费',
+ 'Feel 0' => '否',
+ 'Feel 1' => '是',
];
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
index 97a87fd..408d472 100644
--- 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
@@ -12,6 +12,7 @@ return [
'Status 3' => '已预约',
'Set status to 3' => '设为已预约',
'Status 4' => '售后中',
+ 'Status 5' => '退款结算中',
'Set status to 4' => '设为售后中',
'Status 6' => '已退款',
'Set status to 6' => '设为已退款',
diff --git a/application/admin/lang/zh-cn/school/help/article.php b/application/admin/lang/zh-cn/school/help/article.php
new file mode 100644
index 0000000..ac6957e
--- /dev/null
+++ b/application/admin/lang/zh-cn/school/help/article.php
@@ -0,0 +1,20 @@
+ '平台帮助分类ids',
+ 'Title' => '标题',
+ 'Content' => '文章详情',
+ 'Status' => '状态',
+ 'Status 1' => '上架',
+ 'Set status to 1'=> '设为上架',
+ 'Status 2' => '下架',
+ 'Set status to 2'=> '设为下架',
+ 'Hot' => '平台热门',
+ 'Hot 0' => '否',
+ 'Hot 1' => '是',
+ 'Start_time' => '更新时间',
+ 'Weigh' => '权重',
+ 'Views' => '浏览量',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间'
+];
diff --git a/application/admin/lang/zh-cn/school/help/cate.php b/application/admin/lang/zh-cn/school/help/cate.php
new file mode 100644
index 0000000..d7c75b1
--- /dev/null
+++ b/application/admin/lang/zh-cn/school/help/cate.php
@@ -0,0 +1,15 @@
+ 'pid',
+ 'Name' => '帮助分类名',
+ 'Status' => '状态',
+ 'Status 1' => '上架',
+ 'Set status to 1'=> '设为上架',
+ 'Status 2' => '下架',
+ 'Set status to 2'=> '设为下架',
+ 'Weigh' => '权重',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '修改时间',
+ 'Deletetime' => '删除时间'
+];
diff --git a/application/admin/model/school/classes/activity/Activity.php b/application/admin/model/school/classes/activity/Activity.php
index 50ca95e..c06be26 100644
--- a/application/admin/model/school/classes/activity/Activity.php
+++ b/application/admin/model/school/classes/activity/Activity.php
@@ -43,6 +43,8 @@ class Activity extends Model
'has_sign_expire',
];
+ //不用审核允许修改的字段
+ public $no_auth_fields = ["status","weigh","recommend","hot","new","selfhot","feel","start_time","end_time","sign_start_time","sign_end_time","longitude","latitude","address_city","province","city","district","address","address_detail","address_type","title",'headimage','images','content',"price"];
public function getHasSignExpireAttr($value, $data)
{
diff --git a/application/admin/model/school/classes/activity/ActivityAuth.php b/application/admin/model/school/classes/activity/ActivityAuth.php
index 6c8debb..01428c5 100644
--- a/application/admin/model/school/classes/activity/ActivityAuth.php
+++ b/application/admin/model/school/classes/activity/ActivityAuth.php
@@ -24,6 +24,7 @@ class ActivityAuth extends Model
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
+ public $no_auth_fields = ["status","weigh","recommend","hot","new","selfhot","feel","start_time","end_time","sign_start_time","sign_end_time","longitude","latitude","address_city","province","city","district","address","address_detail","address_type","title",'headimage','images','content',"price"];
// 追加属性
protected $append = [
diff --git a/application/admin/model/school/classes/activity/order/Order.php b/application/admin/model/school/classes/activity/order/Order.php
index 784b96f..d4ec665 100644
--- a/application/admin/model/school/classes/activity/order/Order.php
+++ b/application/admin/model/school/classes/activity/order/Order.php
@@ -50,7 +50,7 @@ class Order extends Model
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')];
+ return ['-3' => __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4'), '5' => __('Status 5'), '6' => __('Status 6'), '9' => __('Status 9')];
}
public function getBeforeStatusList()
@@ -209,4 +209,9 @@ class Order extends Model
{
return $this->belongsTo(OrderDetail::class, 'activity_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
+ public function orderitem()
+ {
+ return $this->belongsTo(OrderItem::class, 'activity_order_item_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
index 74e71e0..e7a9907 100644
--- a/application/admin/model/school/classes/activity/order/OrderLog.php
+++ b/application/admin/model/school/classes/activity/order/OrderLog.php
@@ -32,7 +32,7 @@ class OrderLog extends Model
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')];
+ return ['-3' => __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4'),'5' => __('Status 5'), '6' => __('Status 6'), '9' => __('Status 9')];
}
diff --git a/application/admin/model/school/help/Article.php b/application/admin/model/school/help/Article.php
new file mode 100644
index 0000000..bfd5dd9
--- /dev/null
+++ b/application/admin/model/school/help/Article.php
@@ -0,0 +1,84 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ }
+ });
+ }
+
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2')];
+ }
+
+ public function getHotList()
+ {
+ return ['0' => __('Hot 0'), '1' => __('Hot 1')];
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ 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 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;
+ }
+
+ protected function setStartTimeAttr($value)
+ {
+ return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+ }
+
+
+}
diff --git a/application/admin/model/school/help/Cate.php b/application/admin/model/school/help/Cate.php
new file mode 100644
index 0000000..096bac3
--- /dev/null
+++ b/application/admin/model/school/help/Cate.php
@@ -0,0 +1,60 @@
+getPk();
+ $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+ }
+ });
+ }
+
+
+ public function getStatusList()
+ {
+ return ['1' => __('Status 1'), '2' => __('Status 2')];
+ }
+
+
+ public function getStatusTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+ $list = $this->getStatusList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
+
+
+
+
+
+}
diff --git a/application/admin/validate/school/help/Article.php b/application/admin/validate/school/help/Article.php
new file mode 100644
index 0000000..d51fb23
--- /dev/null
+++ b/application/admin/validate/school/help/Article.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/admin/validate/school/help/Cate.php b/application/admin/validate/school/help/Cate.php
new file mode 100644
index 0000000..c516dd3
--- /dev/null
+++ b/application/admin/validate/school/help/Cate.php
@@ -0,0 +1,27 @@
+ [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/application/admin/view/manystore/index/add.html b/application/admin/view/manystore/index/add.html
index 5253ba9..d55e71d 100644
--- a/application/admin/view/manystore/index/add.html
+++ b/application/admin/view/manystore/index/add.html
@@ -136,6 +136,7 @@
diff --git a/application/admin/view/school/classes/activity/activity/add.html b/application/admin/view/school/classes/activity/activity/add.html
index be4f46a..137a318 100644
--- a/application/admin/view/school/classes/activity/activity/add.html
+++ b/application/admin/view/school/classes/activity/activity/add.html
@@ -33,6 +33,7 @@