|
|
@@ -65,7 +65,7 @@ class ContractTemplate extends BaseController
|
|
|
// ['is_init','0'],
|
|
|
// ['code','','empty','请输入CODE'],
|
|
|
// ['status','0'],
|
|
|
- ['content', ''],
|
|
|
+ ['content', []],
|
|
|
], $request);
|
|
|
$save = [];
|
|
|
$save["title"] = $post["title"];
|
|
|
@@ -76,7 +76,7 @@ class ContractTemplate extends BaseController
|
|
|
// $save["is_hot"] = (int)$post["is_hot"] == 1 ? 1 : 0;
|
|
|
// $save["is_recommend"] = (int)$post["is_recommend"]== 1 ? 1 : 0;
|
|
|
// $save["is_init"] = (int)$post["is_init"] == 1 ? 1 : 0;
|
|
|
- $save["content"] = $post["content"];
|
|
|
+ $save["content"] = json_encode($post["content"]);;
|
|
|
// $save["unreal_sales"] = (int)$post["unreal_sales"];
|
|
|
$save["admin_time"] = time();
|
|
|
@file_put_contents('quanju.txt', json_encode($request->adminInfo) . "-管理员信息\r\n", 8);
|
|
|
@@ -93,9 +93,9 @@ class ContractTemplate extends BaseController
|
|
|
|
|
|
$id = empty($post["id"]) ? 0 : (int)$post["id"];
|
|
|
// $codeWhere[]=["code","=",$save["code"]];
|
|
|
- if ($id > 0) {
|
|
|
- $codeWhere[] = ["id", "<>", $id];
|
|
|
- }
|
|
|
+// if ($id > 0) {
|
|
|
+// $codeWhere[] = ["id", "<>", $id];
|
|
|
+// }
|
|
|
// $count = (new ContractTemplateModel)->where($codeWhere)->where("id","<>",$id)->count();
|
|
|
// if($count>0){
|
|
|
// return app('json')->fail("当前code已存在");
|
|
|
@@ -109,7 +109,7 @@ class ContractTemplate extends BaseController
|
|
|
if ($r) {
|
|
|
return app('json')->success("数据保存成功");
|
|
|
} else {
|
|
|
- return app('json')->fail("数据保存失败");
|
|
|
+ return app('json')->fail("数据保存失败".$r);
|
|
|
}
|
|
|
} catch (\Exception $e) {
|
|
|
@file_put_contents('quanju.txt', $e->getLine(). $e->getMessage(). $e->getFile() . "-报错内容\r\n", 8);
|