diff --git a/application/admin/controller/dyqc/ManystoreShop.php b/application/admin/controller/dyqc/ManystoreShop.php new file mode 100644 index 0000000..0795b38 --- /dev/null +++ b/application/admin/controller/dyqc/ManystoreShop.php @@ -0,0 +1,71 @@ +model = new \app\admin\model\dyqc\ManystoreShop; + $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(['admin']) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + + foreach ($list as $row) { + + $row->getRelation('admin')->visible(['nickname']); + } + + $result = array("total" => $list->total(), "rows" => $list->items()); + + return json($result); + } + return $this->view->fetch(); + } + +} diff --git a/application/admin/controller/school/classes/VirtualUser.php b/application/admin/controller/school/classes/VirtualUser.php index e99bd8f..a35ccc2 100644 --- a/application/admin/controller/school/classes/VirtualUser.php +++ b/application/admin/controller/school/classes/VirtualUser.php @@ -22,7 +22,8 @@ class VirtualUser extends Backend { parent::_initialize(); $this->model = new \app\admin\model\school\classes\VirtualUser; - + $this->view->assign("jointypeList", $this->model->getJointypeList()); + $this->view->assign("havetypeList", $this->model->getHavetypeList()); } @@ -57,8 +58,9 @@ class VirtualUser extends Backend ->paginate($limit); foreach ($list as $row) { - - $row->getRelation('lib')->visible(['title','headimage']); +// $row->visible(['id','classes_lib_id']); +// $row->visible(['lib']); + $row->getRelation('lib')->visible(['title','headimage']); } $result = array("total" => $list->total(), "rows" => $list->items()); diff --git a/application/admin/controller/school/classes/hourorder/Order.php b/application/admin/controller/school/classes/hourorder/Order.php index b705ab9..2b6f4a2 100644 --- a/application/admin/controller/school/classes/hourorder/Order.php +++ b/application/admin/controller/school/classes/hourorder/Order.php @@ -51,14 +51,14 @@ class Order extends Backend list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $list = $this->model - ->with(['order','spec','user','detail','lib']) + ->with(['classesorder','spec','user','detail','lib']) ->where($where) ->order($sort, $order) ->paginate($limit); foreach ($list as $row) { - $row->getRelation('order')->visible(['order_no']); + $row->getRelation('classesorder')->visible(['order_no']); $row->getRelation('spec')->visible(['name']); $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); $row->getRelation('detail')->visible(['title','headimage']); diff --git a/application/admin/lang/zh-cn/dyqc/manystore_shop.php b/application/admin/lang/zh-cn/dyqc/manystore_shop.php new file mode 100644 index 0000000..35d9aba --- /dev/null +++ b/application/admin/lang/zh-cn/dyqc/manystore_shop.php @@ -0,0 +1,34 @@ + 'ID', + 'Name' => '店铺名称', + 'Logo' => '品牌LOGO', + 'Image' => '封面图', + 'Images' => '店铺环境照片', + 'Address_city' => '城市选择', + 'Province' => '省编号', + 'City' => '市编号', + 'District' => '县区编号', + 'Address' => '店铺地址', + 'Address_detail' => '店铺详细地址', + 'Longitude' => '经度', + 'Latitude' => '纬度', + 'Yyzzdm' => '营业执照', + 'Yyzz_images' => '营业执照照片', + 'Tel' => '服务电话', + 'Content' => '店铺详情', + 'Status' => '审核状态', + 'Status 0' => '待审核', + 'Set status to 0'=> '设为待审核', + 'Status 1' => '审核通过', + 'Set status to 1'=> '设为审核通过', + 'Status 2' => '审核失败', + 'Set status to 2'=> '设为审核失败', + 'Reason' => '审核不通过原因', + 'Auth_time' => '审核时间', + 'Admin_id' => '审核管理员id', + 'Create_time' => '创建时间', + 'Update_time' => '修改时间', + 'Admin.nickname' => '昵称' +]; diff --git a/application/admin/lang/zh-cn/school/classes/hourorder/order.php b/application/admin/lang/zh-cn/school/classes/hourorder/order.php index d005421..3432102 100644 --- a/application/admin/lang/zh-cn/school/classes/hourorder/order.php +++ b/application/admin/lang/zh-cn/school/classes/hourorder/order.php @@ -16,6 +16,8 @@ return [ 'Status' => '订单状态', 'Status -3' => '已取消', 'Set status to -3' => '设为已取消', + 'Status -1' => '已报名待审核', + 'Set status to -1' => '设为已报名待审核', 'Status 0' => '已预约', 'Set status to 0' => '设为已预约', 'Status 3' => '已完成', diff --git a/application/admin/lang/zh-cn/school/classes/hourorder/order_log.php b/application/admin/lang/zh-cn/school/classes/hourorder/order_log.php index 6ba3615..8ad69ca 100644 --- a/application/admin/lang/zh-cn/school/classes/hourorder/order_log.php +++ b/application/admin/lang/zh-cn/school/classes/hourorder/order_log.php @@ -5,6 +5,8 @@ return [ 'Status' => '订单状态', 'Status -3' => '已取消', 'Set status to -3' => '设为已取消', + 'Status -1' => '已报名待审核', + 'Set status to -1' => '设为已报名待审核', 'Status 0' => '已预约', 'Set status to 0' => '设为已预约', 'Status 3' => '已完成', diff --git a/application/admin/lang/zh-cn/school/classes/virtual_user.php b/application/admin/lang/zh-cn/school/classes/virtual_user.php index 1c87a80..8461481 100644 --- a/application/admin/lang/zh-cn/school/classes/virtual_user.php +++ b/application/admin/lang/zh-cn/school/classes/virtual_user.php @@ -5,6 +5,12 @@ return [ 'Head_image' => '头像', 'Classes_lib_id' => '课程id', 'Time' => '虚拟下单时间', + 'Jointype' => '参与中', + 'Jointype 1' => '是', + 'Jointype 0' => '否', + 'Havetype' => '已报名', + 'Havetype 1' => '是', + 'Havetype 0' => '否', 'Lib.title' => '标题', 'Lib.headimage' => '头图' ]; diff --git a/application/admin/model/dyqc/ManystoreShop.php b/application/admin/model/dyqc/ManystoreShop.php new file mode 100644 index 0000000..3213277 --- /dev/null +++ b/application/admin/model/dyqc/ManystoreShop.php @@ -0,0 +1,104 @@ + __('Status 0'), '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] : ''; + } + + + 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 getCreateTimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['create_time']) ? $data['create_time'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + + public function getUpdateTimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['update_time']) ? $data['update_time'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + protected function setAuthTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + protected function setCreateTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + protected function setUpdateTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + + public function admin() + { + return $this->belongsTo('app\admin\model\Admin', 'admin_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/application/admin/model/school/classes/Teacher.php b/application/admin/model/school/classes/Teacher.php index fe3d566..8873287 100644 --- a/application/admin/model/school/classes/Teacher.php +++ b/application/admin/model/school/classes/Teacher.php @@ -27,7 +27,20 @@ class Teacher extends Model protected $append = [ 'status_text' ]; - + + + public function getHeadImageAttr($value, $data) + { + if (!empty($value)) return cdnurl($value, true); + } + + public function getExpertImageAttr($value, $data) + { + if (!empty($value)) return cdnurl($value, true); + } + + + protected static function init() { diff --git a/application/admin/model/school/classes/VirtualUser.php b/application/admin/model/school/classes/VirtualUser.php index bc167f1..4b4d75f 100644 --- a/application/admin/model/school/classes/VirtualUser.php +++ b/application/admin/model/school/classes/VirtualUser.php @@ -25,12 +25,22 @@ class VirtualUser extends Model // 追加属性 protected $append = [ - 'time_text' + 'time_text', + 'jointype_text', + 'havetype_text' ]; + public function getJointypeList() + { + return ['1' => __('Jointype 1'), '0' => __('Jointype 0')]; + } + public function getHavetypeList() + { + return ['1' => __('Havetype 1'), '0' => __('Havetype 0')]; + } public function getTimeTextAttr($value, $data) @@ -39,6 +49,22 @@ class VirtualUser extends Model return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } + + public function getJointypeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['jointype']) ? $data['jointype'] : ''); + $list = $this->getJointypeList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getHavetypeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['havetype']) ? $data['havetype'] : ''); + $list = $this->getHavetypeList(); + return isset($list[$value]) ? $list[$value] : ''; + } + protected function setTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); diff --git a/application/admin/model/school/classes/hourorder/Order.php b/application/admin/model/school/classes/hourorder/Order.php index 8e5cbce..5fa1483 100644 --- a/application/admin/model/school/classes/hourorder/Order.php +++ b/application/admin/model/school/classes/hourorder/Order.php @@ -37,7 +37,7 @@ class Order extends Model public function getStatusList() { - return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3')]; + return ['-3' => __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')]; } @@ -109,7 +109,7 @@ class Order extends Model } - public function order() + public function classesorder() { return $this->belongsTo('app\admin\model\school\classes\Order', 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0); } diff --git a/application/admin/model/school/classes/hourorder/OrderLog.php b/application/admin/model/school/classes/hourorder/OrderLog.php index da7afa2..422394c 100644 --- a/application/admin/model/school/classes/hourorder/OrderLog.php +++ b/application/admin/model/school/classes/hourorder/OrderLog.php @@ -32,7 +32,7 @@ class OrderLog extends Model public function getStatusList() { - return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3')]; + return ['-3' => __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')]; } diff --git a/application/admin/validate/dyqc/ManystoreShop.php b/application/admin/validate/dyqc/ManystoreShop.php new file mode 100644 index 0000000..5f60c6b --- /dev/null +++ b/application/admin/validate/dyqc/ManystoreShop.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/view/dyqc/manystore_shop/add.html b/application/admin/view/dyqc/manystore_shop/add.html new file mode 100644 index 0000000..6fad076 --- /dev/null +++ b/application/admin/view/dyqc/manystore_shop/add.html @@ -0,0 +1,165 @@ +
diff --git a/application/admin/view/dyqc/manystore_shop/edit.html b/application/admin/view/dyqc/manystore_shop/edit.html new file mode 100644 index 0000000..9887622 --- /dev/null +++ b/application/admin/view/dyqc/manystore_shop/edit.html @@ -0,0 +1,165 @@ + diff --git a/application/admin/view/dyqc/manystore_shop/index.html b/application/admin/view/dyqc/manystore_shop/index.html new file mode 100644 index 0000000..68d5cdf --- /dev/null +++ b/application/admin/view/dyqc/manystore_shop/index.html @@ -0,0 +1,46 @@ +