From abccb6c47cb43d9b0a51bd00b79c1a9b53051c6a Mon Sep 17 00:00:00 2001
From: panx <651666084@qq.com>
Date: Fri, 23 Aug 2024 16:04:38 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95=E7=9A=84?=
=?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E4=BB=A5=E5=8F=8A=E9=87=87?=
=?UTF-8?q?=E8=B4=AD=E7=BC=96=E7=A0=81=E7=9A=84=E9=A1=B5=E9=9D=A2=E7=9A=84?=
=?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/admin/controller/Ceshi.php | 52 ++++
app/admin/controller/PdmPartitem.php | 36 +++
app/admin/controller/PdmPurchasecode.php | 36 +++
app/admin/model/Ceshi.php | 95 ++++++++
app/admin/model/PdmPartitem.php | 59 +++++
app/admin/model/PdmParttype.php | 21 ++
app/admin/validate/Ceshi.php | 36 +++
app/admin/validate/PdmPartitem.php | 36 +++
app/admin/view/ceshi/add.html | 155 ++++++++++++
app/admin/view/ceshi/index.html | 269 +++++++++++++++++++++
app/admin/view/ceshi/xiao_ming.html | 9 +
app/admin/view/ceshi/zdy.html | 9 +
app/admin/view/pdm_partitem/add.html | 67 +++++
app/admin/view/pdm_partitem/index.html | 172 +++++++++++++
app/admin/view/pdm_parttype/add.html | 27 +++
app/admin/view/pdm_purchasecode/add.html | 62 +++++
app/admin/view/pdm_purchasecode/index.html | 161 ++++++++++++
app/common/model/PdmPurchasecode.php | 59 +++++
app/common/validate/PdmPurchasecode.php | 36 +++
19 files changed, 1397 insertions(+)
create mode 100644 app/admin/controller/Ceshi.php
create mode 100644 app/admin/controller/PdmPartitem.php
create mode 100644 app/admin/controller/PdmPurchasecode.php
create mode 100644 app/admin/model/Ceshi.php
create mode 100644 app/admin/model/PdmPartitem.php
create mode 100644 app/admin/validate/Ceshi.php
create mode 100644 app/admin/validate/PdmPartitem.php
create mode 100644 app/admin/view/ceshi/add.html
create mode 100644 app/admin/view/ceshi/index.html
create mode 100644 app/admin/view/ceshi/xiao_ming.html
create mode 100644 app/admin/view/ceshi/zdy.html
create mode 100644 app/admin/view/pdm_partitem/add.html
create mode 100644 app/admin/view/pdm_partitem/index.html
create mode 100644 app/admin/view/pdm_purchasecode/add.html
create mode 100644 app/admin/view/pdm_purchasecode/index.html
create mode 100644 app/common/model/PdmPurchasecode.php
create mode 100644 app/common/validate/PdmPurchasecode.php
diff --git a/app/admin/controller/Ceshi.php b/app/admin/controller/Ceshi.php
new file mode 100644
index 0000000..2635957
--- /dev/null
+++ b/app/admin/controller/Ceshi.php
@@ -0,0 +1,52 @@
+
+ * Class Ceshi
+ * @package app\admin\controller
+ */
+class Ceshi extends AdminController
+{
+ /**
+ * Ceshi模型对象
+ * @var \app\admin\model\Ceshi
+ */
+
+ public function __construct()
+ {
+ parent::__construct();
+ $this->model = new CeshiModel;
+ }
+
+ /**
+ * 默认生成的方法为index/add/edit/del/status 五个方法
+ * 当创建CURD的时候,DIY的函数体和模板为空,请自行编写代码
+ */
+
+ /**
+ * zdy 函数
+ */
+ public function zdy()
+ {
+ return $this->view();
+ }
+
+ /**
+ * xiaoMing 函数
+ */
+ public function xiaoMing()
+ {
+ return $this->view();
+ }
+
+
+
+}
diff --git a/app/admin/controller/PdmPartitem.php b/app/admin/controller/PdmPartitem.php
new file mode 100644
index 0000000..53ca232
--- /dev/null
+++ b/app/admin/controller/PdmPartitem.php
@@ -0,0 +1,36 @@
+
+ * Class PdmPartitem
+ * @package app\admin\controller
+ */
+class PdmPartitem extends AdminController
+{
+ /**
+ * PdmPartitem模型对象
+ * @var \app\admin\model\PdmPartitem
+ */
+
+ public function __construct()
+ {
+ parent::__construct();
+ $this->model = new PdmPartitemModel;
+ }
+
+ /**
+ * 默认生成的方法为index/add/edit/del/status 五个方法
+ * 当创建CURD的时候,DIY的函数体和模板为空,请自行编写代码
+ */
+
+
+
+}
diff --git a/app/admin/controller/PdmPurchasecode.php b/app/admin/controller/PdmPurchasecode.php
new file mode 100644
index 0000000..9c5198a
--- /dev/null
+++ b/app/admin/controller/PdmPurchasecode.php
@@ -0,0 +1,36 @@
+
+ * Class PdmPurchasecode
+ * @package app\admin\controller
+ */
+class PdmPurchasecode extends AdminController
+{
+ /**
+ * PdmPurchasecode模型对象
+ * @var \app\common\model\PdmPurchasecode
+ */
+
+ public function __construct()
+ {
+ parent::__construct();
+ $this->model = new PdmPurchasecodeModel;
+ }
+
+ /**
+ * 默认生成的方法为index/add/edit/del/status 五个方法
+ * 当创建CURD的时候,DIY的函数体和模板为空,请自行编写代码
+ */
+
+
+
+}
diff --git a/app/admin/model/Ceshi.php b/app/admin/model/Ceshi.php
new file mode 100644
index 0000000..fb60fc1
--- /dev/null
+++ b/app/admin/model/Ceshi.php
@@ -0,0 +1,95 @@
+
+ * 测试代码
+ * Class Ceshi
+ * @package app\admin\model
+ */
+class Ceshi extends Model
+{
+
+ use SoftDelete;
+
+ // 定义时间戳字段名
+ protected $createTime = 'create_time';
+ protected $updateTime = 'update_time';
+ protected $deleteTime = 'delete_time';
+
+
+ /**
+ * 定义 sa_user 关联模型
+ * @localKey id
+ * @bind nickname
+ */
+ public function user()
+ {
+ return $this->hasOne(\app\common\model\system\User::Class,'group_id','id')->bind(['nickname']);
+ }
+
+ public function setHobbyAttr($value)
+ {
+ if (!empty($value) && is_array($value)) {
+ $value = implode(',',$value);
+ }
+
+ return $value;
+ }
+
+ public function getHobbyAttr($value)
+ {
+ if (!empty($value) && is_string($value)) {
+ $value = explode(',',$value);
+ }
+
+ return $value;
+ }
+
+ public function setAlbumAttr($value)
+ {
+ if (!empty($value)) {
+ $value = serialize($value);
+ }
+
+ return $value;
+ }
+
+ public function getAlbumAttr($value)
+ {
+ if (!empty($value)) {
+ $value = unserialize($value);
+ }
+
+ return $value;
+ }
+
+ public function setJsonAttr($value)
+ {
+ if (!empty($value) && is_array($value)) {
+ $arr = [];
+ foreach ($value['key'] as $key => $elem) {
+ $arr[$elem] = $value['value'][$key];
+ }
+
+ $value = json_encode($arr,JSON_UNESCAPED_UNICODE);
+ }
+
+ return $value ?: json_encode([]);
+ }
+
+ public function getJsonAttr($value)
+ {
+ if (!empty($value) && is_string($value)) {
+ $value = json_decode($value, true);
+ }
+
+ return $value;
+ }
+
+}
\ No newline at end of file
diff --git a/app/admin/model/PdmPartitem.php b/app/admin/model/PdmPartitem.php
new file mode 100644
index 0000000..23df366
--- /dev/null
+++ b/app/admin/model/PdmPartitem.php
@@ -0,0 +1,59 @@
+
+ * 部件
+ * Class PdmPartitem
+ * @package app\admin\model
+ */
+class PdmPartitem extends Model
+{
+
+ use SoftDelete;
+
+ // 定义时间戳字段名
+ protected $createTime = 'create_time';
+ protected $updateTime = 'update_time';
+ protected $deleteTime = 'delete_time';
+
+
+ /**
+ * 定义 sa_user 关联模型
+ * @localKey createrid
+ * @bind nickname,name
+ */
+ public function user()
+ {
+ return $this->hasOne(\app\common\model\system\User::Class,'id','createrid')->bind(['nickname','name']);
+ }
+
+ public function setPartattributeAttr($value)
+ {
+ if (!empty($value) && is_array($value)) {
+ $arr = [];
+ foreach ($value['key'] as $key => $elem) {
+ $arr[$elem] = $value['value'][$key];
+ }
+
+ $value = json_encode($arr,JSON_UNESCAPED_UNICODE);
+ }
+
+ return $value ?: json_encode([]);
+ }
+
+ public function getPartattributeAttr($value)
+ {
+ if (!empty($value) && is_string($value)) {
+ $value = json_decode($value, true);
+ }
+
+ return $value;
+ }
+
+}
\ No newline at end of file
diff --git a/app/admin/model/PdmParttype.php b/app/admin/model/PdmParttype.php
index 96df81c..59dcedd 100644
--- a/app/admin/model/PdmParttype.php
+++ b/app/admin/model/PdmParttype.php
@@ -39,7 +39,28 @@ class PdmParttype extends Model
return \app\common\model\system\Admin::select()->toArray();
}
+ public function setPartattributeAttr($value)
+ {
+ if (!empty($value) && is_array($value)) {
+ $arr = [];
+ foreach ($value['key'] as $key => $elem) {
+ $arr[$elem] = $value['value'][$key];
+ }
+ $value = json_encode($arr,JSON_UNESCAPED_UNICODE);
+ }
+
+ return $value ?: json_encode([]);
+ }
+
+ public function getPartattributeAttr($value)
+ {
+ if (!empty($value) && is_string($value)) {
+ $value = json_decode($value, true);
+ }
+
+ return $value;
+ }
diff --git a/app/admin/validate/Ceshi.php b/app/admin/validate/Ceshi.php
new file mode 100644
index 0000000..035de33
--- /dev/null
+++ b/app/admin/validate/Ceshi.php
@@ -0,0 +1,36 @@
+
+ * Ceshi 验证器
+ * Class Ceshi
+ * @package app\admin\validate
+ */
+class Ceshi extends Validate
+{
+ /**
+ * 验证规则
+ */
+ protected $rule = [
+ ];
+
+
+ /**
+ * 提示消息
+ */
+ protected $message = [
+ ];
+
+
+ /**
+ * 验证场景
+ */
+ protected $scene = [
+ 'add' => [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/app/admin/validate/PdmPartitem.php b/app/admin/validate/PdmPartitem.php
new file mode 100644
index 0000000..c33869f
--- /dev/null
+++ b/app/admin/validate/PdmPartitem.php
@@ -0,0 +1,36 @@
+
+ * PdmPartitem 验证器
+ * Class PdmPartitem
+ * @package app\admin\validate
+ */
+class PdmPartitem extends Validate
+{
+ /**
+ * 验证规则
+ */
+ protected $rule = [
+ ];
+
+
+ /**
+ * 提示消息
+ */
+ protected $message = [
+ ];
+
+
+ /**
+ * 验证场景
+ */
+ protected $scene = [
+ 'add' => [],
+ 'edit' => [],
+ ];
+
+}
diff --git a/app/admin/view/ceshi/add.html b/app/admin/view/ceshi/add.html
new file mode 100644
index 0000000..739339d
--- /dev/null
+++ b/app/admin/view/ceshi/add.html
@@ -0,0 +1,155 @@
+