Contract.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | [ WE CAN DO IT MORE SIMPLE ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2018-2020 rights reserved.
  6. // +----------------------------------------------------------------------
  7. // |
  8. // +----------------------------------------------------------------------
  9. // | Date: 2020-08-31 20:43
  10. // +----------------------------------------------------------------------
  11. namespace app\system\controller;
  12. use app\BaseController;
  13. use app\lib\OrderLib;
  14. use app\model\api\ArticleModel;
  15. use app\model\api\InfoAudit;
  16. use app\model\api\PayTrade;
  17. use library\utils\WxpayV2 as wxpayApi;
  18. use app\model\api\User as UserModel;
  19. use app\model\api\ContractRecord as UserContractRecordModel;
  20. use app\model\api\UserClock as UserClockModel;
  21. use app\model\api\ContractComment as ContractCommentModel;
  22. use app\model\api\UserDetail as UserDetailModel;
  23. use app\model\api\UserScoreDetail as UserScoreDetailModel;
  24. use app\model\api\UserShowTemplate;
  25. use library\services\UtilService;
  26. use app\Request;
  27. use think\facade\Db;
  28. class Contract extends BaseController
  29. {
  30. /**
  31. * 合同列表
  32. * @param Request $request
  33. * @return
  34. */
  35. public function ContractRecordList(Request $request)
  36. {
  37. $pageSize = 50;
  38. $post = UtilService::getMore(
  39. [
  40. ['page', 1],
  41. ['uid',''], //甲方uid
  42. ['name',''], //甲方姓名
  43. ['phone',''], //甲方电话
  44. ['to_uid',''], //乙方uid
  45. ['to_name',''], //乙方姓名
  46. ['to_phone',''], //乙方电话
  47. ['contract_id', ''], //订单id
  48. ['contract_no', ''], //订单编号
  49. ['status',''],//状态 0未确认 1已签约 2已到期 -1取消签约
  50. ['time',[]],
  51. ], $request
  52. );
  53. $where = [];
  54. if(!empty($post['uid'])){
  55. $where[]=["uid","=",$post['uid']];
  56. }
  57. if(!empty($post['name'])){
  58. $where[]=["name","like","%{$post["name"]}%"];
  59. }
  60. if(!empty($post['phone'])){
  61. $where[]=["phone","=",$post['phone']];
  62. }
  63. // else
  64. // if(!empty($post['mobile'])){
  65. // $m = Db::name("user")->where("mobile",$post['mobile'])->find();
  66. // if(!empty($m)) {
  67. // $where[]=["o.uid","=",$m['uid']];
  68. // }
  69. // }
  70. if(!empty($post['to_uid'])){
  71. $where[]=["to_uid","=",$post['to_uid']];
  72. }
  73. if(!empty($post['to_name'])){
  74. $where[]=["to_name","like","%{$post["to_name"]}%"];
  75. }
  76. if(!empty($post['to_phone'])){
  77. $where[]=["to_phone","=",$post['to_phone']];
  78. }
  79. if(!empty($post['contract_no'])){
  80. $where[]=["contract_no","like","%{$post["contract_no"]}%"];
  81. }
  82. if(!empty($post['contract_id'])){
  83. $where[]=["contract_id","=",$post['contract_id']];
  84. }
  85. if(!empty($post['status'])){
  86. $where[]=["status","=",$post['status']];
  87. }
  88. // if(in_array((string)$post['status'],["0","1","-1"])){
  89. // $where[]=["status","=",(int)$post['status']];
  90. // }
  91. //创建时间
  92. $startTime="";
  93. $endTime="";
  94. if(!empty($post['time'][0]) && !empty($post['time'][1])) {
  95. $startTime = strtotime($post['time'][0]);
  96. $endTime = strtotime($post['time'][1]);
  97. $where[]=["check_time","between","{$startTime},{$endTime}"];
  98. }
  99. $order = new UserContractRecordModel();
  100. $data = $order
  101. // ->alias("o")
  102. // ->field("*,u1.mobile,u1.nickname,a.title as show_template_title,a.imgs as show_template_imgs")
  103. // ->leftJoin("user u1","u1.uid = uid")
  104. // ->leftJoin("show_template a","a.id = show_template_id")
  105. ->field('*')
  106. ->where($where)
  107. ->page((int)$post["page"], $pageSize)
  108. ->order("id","desc")
  109. ->select()
  110. ->toArray();
  111. $pageCount = $order->where($where)->count();
  112. $result = UtilService::getParam([
  113. "id",
  114. "contract_no",
  115. "uid",
  116. "phone",
  117. "address",
  118. "card",
  119. "to_uid",
  120. "to_phone",
  121. "to_address",
  122. "to_card",
  123. "status",
  124. "from_check",
  125. "to_check",
  126. "uid_img",
  127. "to_uid_img",
  128. "price",
  129. "deposit",
  130. "balance",
  131. "content",
  132. "period",
  133. // "template_id",
  134. "start_time",
  135. "end_time",
  136. "create_time",
  137. "delete_time",
  138. "check_time",
  139. // ['start_time', 'start_time', function ($item) {
  140. // return empty($item) ? "-" : date('Y-m-d H:i:s', $item);
  141. // }],
  142. // ['end_time', 'end_time', function ($item) {
  143. // return empty($item) ? "-" : date('Y-m-d H:i:s', $item);
  144. // }],
  145. // ['create_time', 'create_time', function ($item) {
  146. // return empty($item) ? "-" : date('Y-m-d H:i:s', $item);
  147. // }],
  148. // ['delete_time', 'delete_time', function ($item) {
  149. // return empty($item) ? "-" : date('Y-m-d H:i:s', $item);
  150. // }],
  151. // ['check_time', 'check_time', function ($item) {
  152. // return empty($item) ? "-" : date('Y-m-d H:i:s', $item);
  153. // }],
  154. ], $data);
  155. return app('json')->success([
  156. 'list' => $result,
  157. 'pageCount' => $pageCount,
  158. 'pageSize' => $pageSize,
  159. 'page' => $post['page'],
  160. ]);
  161. }
  162. /**
  163. * 合约详细
  164. * @param Request $request
  165. * @return mixed
  166. */
  167. public function getContractInfo(Request $request) {
  168. [$id] = UtilService::getMore([
  169. ['id','']
  170. ],$request,true);
  171. $adminInfo = UserContractRecordModel::where("id",$id)->find()->toArray();
  172. return app('json')->success([
  173. 'id' => $id,
  174. 'contract_no' =>$adminInfo['contract_no'],
  175. 'uid' => $adminInfo['uid'],
  176. 'phone' => $adminInfo['phone'],
  177. 'address' => $adminInfo['address'],
  178. 'card' =>$adminInfo['card'],
  179. 'to_uid' => $adminInfo['to_uid'],
  180. 'to_phone' => $adminInfo['to_phone'],
  181. 'to_address' => $adminInfo['to_address'],
  182. 'to_card' => $adminInfo['to_card'],
  183. 'status' => $adminInfo['status'],
  184. 'from_check' => $adminInfo['from_check'],
  185. 'to_check' => $adminInfo['to_check'],
  186. 'uid_img' => $adminInfo['uid_img'],
  187. 'to_uid_img' => $adminInfo['to_uid_img'],
  188. 'price' => $adminInfo['price'],
  189. 'deposit' => $adminInfo['deposit'],
  190. 'balance' => $adminInfo['balance'],
  191. 'content' => $adminInfo['content'],
  192. 'period' => $adminInfo['period'],
  193. 'start_time' =>$adminInfo['start_time'],
  194. 'end_time' =>$adminInfo['end_time'],
  195. 'create_time' =>$adminInfo['create_time'],
  196. 'delete_time' =>$adminInfo['delete_time'],
  197. 'check_time' =>$adminInfo['check_time'],
  198. // 'start_time' => date('Y-m-d H:i:s', $adminInfo['start_time']),
  199. // 'end_time' => date('Y-m-d H:i:s', $adminInfo['end_time']),
  200. // 'create_time' => date('Y-m-d H:i:s', $adminInfo['create_time']),
  201. // 'delete_time' => date('Y-m-d H:i:s', $adminInfo['delete_time']),
  202. // 'check_time' => date('Y-m-d H:i:s', $adminInfo['check_time']),
  203. // 'template_id' => $adminInfo['template_id'],
  204. ]);
  205. }
  206. /**
  207. * 打卡列表
  208. * @param Request $request
  209. */
  210. public function UserClockList(Request $request)
  211. {
  212. $pageSize = 50;
  213. $post = UtilService::getMore(
  214. [
  215. ['page', 1],
  216. ['uid',0], //员工uid
  217. ['nickname',''], //员工名
  218. ['contract_id', ''], //签约id
  219. ['time',[]],
  220. ], $request
  221. );
  222. $where = [];
  223. if(!empty($post['uid'])){
  224. $where[]=["uid","=",$post['uid']];
  225. }
  226. // else
  227. // if(!empty($post['mobile'])){
  228. // $m = Db::name("user")->where("mobile",$post['mobile'])->find();
  229. // if(!empty($m)) {
  230. // $where[]=["o.uid","=",$m['uid']];
  231. // }
  232. // }
  233. if(!empty($post['nickname'])){
  234. $where[]=["nickname","like","%{$post["name"]}%"];
  235. }
  236. if(!empty($post['contract_id'])){
  237. $where[]=["contract_id","=",$post['contract_id']];
  238. }
  239. //创建时间
  240. $startTime="";
  241. $endTime="";
  242. if(!empty($post['time'][0]) && !empty($post['time'][1])) {
  243. $startTime = strtotime($post['time'][0]);
  244. $endTime = strtotime($post['time'][1]);
  245. $where[]=["create_time","between","{$startTime},{$endTime}"];
  246. }
  247. $order = new UserClockModel;
  248. $data = $order
  249. // ->alias("o")
  250. // ->field("*,u1.mobile,u1.nickname,a.title as show_template_title,a.imgs as show_template_imgs")
  251. // ->leftJoin("user u1","u1.uid = uid")
  252. // ->leftJoin("show_template a","a.id = show_template_id")
  253. ->field('*')
  254. ->where($where)
  255. ->page((int)$post["page"], $pageSize)
  256. ->order("id","desc")
  257. ->select()
  258. ->toArray();
  259. $pageCount = $order->where($where)->count();
  260. $result = UtilService::getParam([
  261. "id",
  262. "uid",
  263. "nickname",
  264. "contract_id",
  265. "longitude",
  266. "latitude",
  267. "create_time"
  268. // ['create_time', 'create_time', function ($item) {
  269. // return empty($item) ? "-" : date('Y-m-d H:i:s', $item);
  270. // }],
  271. ], $data);
  272. return app('json')->success([
  273. 'list' => $result,
  274. 'pageCount' => $pageCount,
  275. 'pageSize' => $pageSize,
  276. 'page' => $post['page'],
  277. ]);
  278. }
  279. /**
  280. * 评论列表
  281. * @param Request $request
  282. */
  283. public function contractCommentList(Request $request)
  284. {
  285. $pageSize = 50;
  286. $post = UtilService::getMore(
  287. [
  288. ['page', 1],
  289. ['uid',0], //甲方
  290. ['to_uid',''], //乙方
  291. ['contract_id', ''], //签约id
  292. ['contract_no', ''], //签约编号
  293. ['time',[]],
  294. ], $request
  295. );
  296. $where = [];
  297. if(!empty($post['uid'])){
  298. $where[]=["uid","=",$post['uid']];
  299. }
  300. // else
  301. // if(!empty($post['mobile'])){
  302. // $m = Db::name("user")->where("mobile",$post['mobile'])->find();
  303. // if(!empty($m)) {
  304. // $where[]=["o.uid","=",$m['uid']];
  305. // }
  306. // }
  307. if(!empty($post['nickname'])){
  308. $where[]=["nickname","like","%{$post["name"]}%"];
  309. }
  310. if(!empty($post['contract_id'])){
  311. $where[]=["contract_id","=",$post['contract_id']];
  312. }
  313. //创建时间
  314. $startTime="";
  315. $endTime="";
  316. if(!empty($post['time'][0]) && !empty($post['time'][1])) {
  317. $startTime = strtotime($post['time'][0]);
  318. $endTime = strtotime($post['time'][1]);
  319. $where[]=["create_time","between","{$startTime},{$endTime}"];
  320. }
  321. $order = new ContractCommentModel();
  322. $data = $order
  323. // ->alias("o")
  324. // ->field("*,u1.mobile,u1.nickname,a.title as show_template_title,a.imgs as show_template_imgs")
  325. // ->leftJoin("user u1","u1.uid = uid")
  326. // ->leftJoin("show_template a","a.id = show_template_id")
  327. ->field('*')
  328. ->where($where)
  329. ->page((int)$post["page"], $pageSize)
  330. ->order("id","desc")
  331. ->select()
  332. ->toArray();
  333. $pageCount = $order->where($where)->count();
  334. $result = UtilService::getParam([
  335. "id",
  336. "contract_no",
  337. "uid",
  338. "to_uid",
  339. "create_time",
  340. // ['create_time', 'create_time', function ($item) {
  341. // return empty($item) ? "-" : date('Y-m-d H:i:s', $item);
  342. // }],
  343. ], $data);
  344. return app('json')->success([
  345. 'list' => $result,
  346. 'pageCount' => $pageCount,
  347. 'pageSize' => $pageSize,
  348. 'page' => $post['page'],
  349. ]);
  350. }
  351. // 删除评论
  352. public function deleteComment(\think\Request $request)
  353. {
  354. $id = $request->param('id');
  355. $article = ContractCommentModel::where('id', $id)->find();
  356. if (!$article) {
  357. return app('json')->fail('评论不存在');
  358. }
  359. $article->delete();
  360. return app('json')->success();
  361. }
  362. //
  363. // /**
  364. // * 合约列表
  365. // * @param \app\Request $request
  366. // * @return mixed
  367. // */
  368. // public function getContractList(\think\Request $request)
  369. // {
  370. //// $pageSize = 50;
  371. //// $post = UtilService::getMore([
  372. //// ['page',1],
  373. //// ['pageSize',50],
  374. //// ['nickname',''],
  375. ////// ['uid',''],
  376. //// ['parent_uid',''],
  377. //// ['mobile',''],
  378. //// ['status',''],
  379. //// ['time',[]],
  380. //// ],$request);
  381. ////// $post['uid']=$request->user["uid"];
  382. //// $data = (new UserModel)->getDataList($post,"*",1);
  383. //// return app('json')->success([
  384. //// 'list' => $data["list"],
  385. //// 'pageCount' => $data["totalCount"],
  386. //// 'pageSize' => $data["pageSize"],
  387. //// 'page' => $data["page"],
  388. //// ]);
  389. // $post = UtilService::getMore([
  390. // ['page', 1],
  391. // ['pageSize', 50],
  392. // ['status',-2] //1未签约 2已签约 3已解约
  393. // ], $request);
  394. // $post["pageSize"] = $post["pageSize"]>50 ? 50 : (int)$post["pageSize"];
  395. // $post["page"] = $post["page"]<=0 ? 1 : (int)$post["page"];
  396. // $where=[];
  397. // $uid = UtilService::getMore([
  398. // ['uid', 0],
  399. // ], $request);
  400. // $uid=$uid['uid'];
  401. // $where[]=["uid","=",$uid];
  402. // $totalCount = (new UserContractRecordModel)->where($where)->count();
  403. // if ($post["status"]!=-2){
  404. // $where[]=['status','=',$post["status"]];
  405. // }
  406. // $data=null;
  407. // if($totalCount>0){
  408. // $data = (new UserContractRecordModel)
  409. //// ->field("")
  410. //// ->alias("ut")
  411. //// ->join("show_template t", "t.id = show_template_id","left")
  412. // ->where($where)
  413. // ->order("is_default", "desc")
  414. // ->order("id", "desc")
  415. // ->page($post["page"], $post["pageSize"])
  416. // ->select();
  417. // foreach($data as $k=>$v){
  418. // $data[$k]["is_use"] = 1;//是否已经购买或者可以使用
  419. // switch ($data[$k]["status"]){
  420. // case 0:
  421. // $data[$k]["status_name"] = "未签约";
  422. // break;
  423. // case 1:
  424. // $data[$k]["status_name"] = "已签约";
  425. // break;
  426. // case -1:
  427. // $data[$k]["status_name"] = "已解约";
  428. // break;
  429. // }
  430. // }
  431. // }
  432. // $data = empty($data)?[]:$data;
  433. // return app('json')->success(["list" => $data, "pageSize" => $post["pageSize"],"page"=>$post["page"],"totalCount"=>$totalCount]);
  434. // }
  435. //
  436. // /**
  437. // * 甲方创建合约
  438. // */
  439. // public function form_save(Request $request){
  440. // $post = UtilService::getMore([
  441. // ['uid','0'], //甲方uid
  442. // ['phone',''], //甲方手机号
  443. // ['address',''], //甲方地址
  444. // ['card',''], //甲方身份证号
  445. // ['to_uid','0'], //员工uid
  446. // ['price',0], //服务费
  447. // ['deposit',0], // 定金
  448. // ['balance',0], //余款
  449. // ['period',0], // 周期天数
  450. // ['start_time',''], // 开始时间
  451. // ['end_time',''], // 结束时间
  452. //
  453. //// ['uid_img',''] //甲方签名图片路径
  454. //// ['to_phone',''].
  455. //// ['to_address',''],
  456. //// ['to_card',''],
  457. //// ['data',[]],
  458. //// ['year',''],
  459. //// ['month',''],
  460. //// ['day',''],
  461. //
  462. // ],$request);
  463. // $id = (int)$post["id"];
  464. //
  465. // $uid = (int)$post["uid"];
  466. // if(empty($uid)){
  467. // return app('json')->fail("参数错误");
  468. // }
  469. //// $year = $post['year'];
  470. //// $month = $post['month'];
  471. //// $day = $post['day'];
  472. ////
  473. ////// 检查年月日是否为空
  474. //// if (empty($year) || empty($month) || empty($day)) {
  475. //// return app('json')->fail("日期参数错误");
  476. //// }
  477. ////
  478. ////// 创建 DateTime 对象
  479. //// $date = \DateTime::createFromFormat('Y-m-d', "$year-$month-$day");
  480. ////
  481. ////// 检查日期是否有效
  482. //// if (!$date || $date->format('Y-m-d') !== "$year-$month-$day") {
  483. //// return app('json')->fail("无效的日期");
  484. //// }
  485. //// unset($post['year']);
  486. //// unset($post['month']);
  487. //// unset($post['day']);
  488. ////// 转换为时间戳
  489. //// $timestamp = $date->getTimestamp();
  490. ////
  491. //// $post['create_time'] = $timestamp;
  492. // //用户信息
  493. //// if(!empty($post["uid_img"])){
  494. //// $post['status'] = 2;
  495. //// }else{
  496. // $post['status'] = 0;
  497. //// }
  498. // if (empty($id)){
  499. // $post['contract_no'] = makeOrderId($post['uid'],"CR");
  500. // $r = (new UserContractRecordModel)->save($post);
  501. // }else{
  502. // $r = (new UserContractRecordModel)->where("id",$id)->update($post);
  503. // }
  504. //
  505. // return app('json')->success("数据保存成功");
  506. // }
  507. // /**
  508. // * 甲方签约合约
  509. // */
  510. // public function check(Request $request){
  511. // $post = UtilService::getMore([
  512. // ['id',0], //合约id
  513. // ['uid_img',''], //甲方签名图片路径
  514. // ['check_time','']//签约时间
  515. //// ['to_phone',''].
  516. //// ['to_address',''],
  517. //// ['to_card',''],
  518. //// ['data',[]],
  519. //// ['year',''],
  520. //// ['month',''],
  521. //// ['day',''],
  522. //
  523. // ],$request);
  524. // $info = (new UserContractRecordModel)->where("id",$post["id"])->find();
  525. // if(empty($info)){
  526. // return app('json')->fail("合约不存在");
  527. // }
  528. //
  529. // // 检查签约时间是否为空
  530. // if (empty($post['uid_img'])) {
  531. // return app('json')->fail("签字错误");
  532. // }
  533. //// 检查签约时间是否为空
  534. // if (empty($post['check_time'])) {
  535. // return app('json')->fail("日期参数错误");
  536. // }
  537. //
  538. //// $post['status'] = 1;
  539. // $post['from_check'] = 1;
  540. // if ($info['to_check']==1){
  541. // $post['status']==1;
  542. // }
  543. //
  544. //// $post['contract_no'] = makeOrderId($post['uid'],"CR");
  545. // $r = (new UserContractRecordModel)->where("id",$post["id"])->update($post);
  546. // return app('json')->success("数据保存成功");
  547. // }
  548. //// 乙方确认
  549. // public function to_check(Request $request){
  550. // $post = UtilService::getMore([
  551. // ['id','0'], //
  552. // ['to_uid_img',''], //乙方签名图片路径
  553. // ['to_phone',''], //乙方手机号
  554. // ['to_address',''], //乙方地址
  555. // ['to_card',''], //乙方身份证号
  556. // ['to_check_time','']//签约时间
  557. // ],$request);
  558. // $info = (new UserContractRecordModel)->where("id",$post["id"])->find();
  559. // if(empty($info)){
  560. // return app('json')->fail("合约不存在");
  561. // }
  562. // // 检查签约时间是否为空
  563. // if (empty($post['to_uid_img'])) {
  564. // return app('json')->fail("签字错误");
  565. // }
  566. //// 检查签约时间是否为空
  567. // if (empty($post['to_check_time'])) {
  568. // return app('json')->fail("日期参数错误");
  569. // }
  570. // $post['to_check'] = 1;
  571. // if ($info['from_check']==1){
  572. // $post['status']==1;
  573. // }
  574. // $r = (new UserContractRecordModel)->where("id",$post["id"])->update($post);
  575. // return app('json')->success("数据保存成功");
  576. // }
  577. //// 员工签到
  578. // public function clock_in(Request $request){
  579. // $post = UtilService::getMore([
  580. // ['id','0'], //合约id
  581. // ['longitude',''], //经度
  582. // ['latitude',''], //纬度
  583. //
  584. // ],$request);
  585. // $uid = (int)$post["uid"];
  586. // // 检查签约时间是否为空
  587. // if (empty($post['id'])) {
  588. // return app('json')->fail("签字错误");
  589. // }
  590. // $nickname=\app\model\api\User::where('uid',$uid)->value('nickname');
  591. // $r = (new UserContractRecordModel)->where("id",$post["id"])->save([
  592. // 'uid'=>$uid,
  593. // 'nickname' => $nickname,
  594. // 'longitude'=>$post['longitude'],
  595. // 'latitude'=>$post['latitude'],
  596. // 'contract_id'=>$post['id'],
  597. // 'create_time'=>time()
  598. // ]);
  599. // return app('json')->success("数据保存成功");
  600. // }
  601. //// 添加客户评论
  602. // public function comment(Request $request){
  603. // $post = UtilService::getMore([
  604. // ['id','0'], //合约id
  605. // ['content',''], //评论内容
  606. // ],$request);
  607. // $uid = (int)$post["uid"];
  608. // $info = (new UserContractRecordModel)->where("id",$post["id"])->find();
  609. // if(empty($info)){
  610. // return app('json')->fail("合约不存在");
  611. // }
  612. // if ($info['status']!=1){
  613. // return app('json')->fail("只能在签约期间才能发表评论");
  614. // }
  615. // // 检查签约时间是否为空
  616. // if (empty($post['id'])) {
  617. // return app('json')->fail("签字错误");
  618. // }
  619. // $r = (new ContractCommentModel)->save([
  620. // 'uid'=>$uid,
  621. // 'contract_id'=>$post['id'],
  622. // 'content'=>$post['content'],
  623. // 'create_time'=>time()
  624. // ]);
  625. // return app('json')->success("数据保存成功");
  626. // }
  627. }