Contract.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  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. "mark",
  134. // "template_id",
  135. "start_time",
  136. "end_time",
  137. "create_time",
  138. "delete_time",
  139. "check_time",
  140. "longitude",
  141. "latitude"
  142. // ['start_time', 'start_time', function ($item) {
  143. // return empty($item) ? "-" : date('Y-m-d H:i:s', $item);
  144. // }],
  145. // ['end_time', 'end_time', function ($item) {
  146. // return empty($item) ? "-" : date('Y-m-d H:i:s', $item);
  147. // }],
  148. // ['create_time', 'create_time', function ($item) {
  149. // return empty($item) ? "-" : date('Y-m-d H:i:s', $item);
  150. // }],
  151. // ['delete_time', 'delete_time', function ($item) {
  152. // return empty($item) ? "-" : date('Y-m-d H:i:s', $item);
  153. // }],
  154. // ['check_time', 'check_time', function ($item) {
  155. // return empty($item) ? "-" : date('Y-m-d H:i:s', $item);
  156. // }],
  157. ], $data);
  158. return app('json')->success([
  159. 'list' => $result,
  160. 'pageCount' => $pageCount,
  161. 'pageSize' => $pageSize,
  162. 'page' => $post['page'],
  163. ]);
  164. }
  165. /**
  166. * 合约详细
  167. * @param Request $request
  168. * @return mixed
  169. */
  170. public function getContractInfo(Request $request) {
  171. [$id] = UtilService::getMore([
  172. ['id','']
  173. ],$request,true);
  174. $adminInfo = UserContractRecordModel::where("id",$id)->find()->toArray();
  175. return app('json')->success([
  176. 'id' => $id,
  177. 'contract_no' =>$adminInfo['contract_no'],
  178. 'uid' => $adminInfo['uid'],
  179. 'phone' => $adminInfo['phone'],
  180. 'address' => $adminInfo['address'],
  181. 'card' =>$adminInfo['card'],
  182. 'to_uid' => $adminInfo['to_uid'],
  183. 'to_phone' => $adminInfo['to_phone'],
  184. 'to_address' => $adminInfo['to_address'],
  185. 'to_card' => $adminInfo['to_card'],
  186. 'status' => $adminInfo['status'],
  187. 'from_check' => $adminInfo['from_check'],
  188. 'to_check' => $adminInfo['to_check'],
  189. 'uid_img' => $adminInfo['uid_img'],
  190. 'to_uid_img' => $adminInfo['to_uid_img'],
  191. 'price' => $adminInfo['price'],
  192. 'deposit' => $adminInfo['deposit'],
  193. 'balance' => $adminInfo['balance'],
  194. 'content' => $adminInfo['content'],
  195. 'period' => $adminInfo['period'],
  196. 'mark' => $adminInfo['mark'],
  197. 'start_time' =>$adminInfo['start_time'],
  198. 'end_time' =>$adminInfo['end_time'],
  199. 'create_time' =>$adminInfo['create_time'],
  200. 'delete_time' =>$adminInfo['delete_time'],
  201. 'check_time' =>$adminInfo['check_time'],
  202. 'longitude' =>$adminInfo['longitude'],
  203. 'latitude' => $adminInfo['latitude'],
  204. // 'start_time' => date('Y-m-d H:i:s', $adminInfo['start_time']),
  205. // 'end_time' => date('Y-m-d H:i:s', $adminInfo['end_time']),
  206. // 'create_time' => date('Y-m-d H:i:s', $adminInfo['create_time']),
  207. // 'delete_time' => date('Y-m-d H:i:s', $adminInfo['delete_time']),
  208. // 'check_time' => date('Y-m-d H:i:s', $adminInfo['check_time']),
  209. // 'template_id' => $adminInfo['template_id'],
  210. ]);
  211. }
  212. /**
  213. * 打卡列表
  214. * @param Request $request
  215. */
  216. public function UserClockList(Request $request)
  217. {
  218. $pageSize = 50;
  219. $post = UtilService::getMore(
  220. [
  221. ['page', 1],
  222. ['uid',0], //员工uid
  223. ['nickname',''], //员工名
  224. ['contract_id', ''], //签约id
  225. ['time',[]],
  226. ], $request
  227. );
  228. $where = [];
  229. if(!empty($post['uid'])){
  230. $where[]=["uid","=",$post['uid']];
  231. }
  232. // else
  233. // if(!empty($post['mobile'])){
  234. // $m = Db::name("user")->where("mobile",$post['mobile'])->find();
  235. // if(!empty($m)) {
  236. // $where[]=["o.uid","=",$m['uid']];
  237. // }
  238. // }
  239. if(!empty($post['nickname'])){
  240. $where[]=["nickname","like","%{$post["name"]}%"];
  241. }
  242. if(!empty($post['contract_id'])){
  243. $where[]=["contract_id","=",$post['contract_id']];
  244. }
  245. //创建时间
  246. $startTime="";
  247. $endTime="";
  248. if(!empty($post['time'][0]) && !empty($post['time'][1])) {
  249. $startTime = strtotime($post['time'][0]);
  250. $endTime = strtotime($post['time'][1]);
  251. $where[]=["create_time","between","{$startTime},{$endTime}"];
  252. }
  253. $order = new UserClockModel;
  254. $data = $order
  255. // ->alias("o")
  256. // ->field("*,u1.mobile,u1.nickname,a.title as show_template_title,a.imgs as show_template_imgs")
  257. // ->leftJoin("user u1","u1.uid = uid")
  258. // ->leftJoin("show_template a","a.id = show_template_id")
  259. ->field('*')
  260. ->where($where)
  261. ->page((int)$post["page"], $pageSize)
  262. ->order("id","desc")
  263. ->select()
  264. ->toArray();
  265. $pageCount = $order->where($where)->count();
  266. $result = UtilService::getParam([
  267. "id",
  268. "uid",
  269. "nickname",
  270. "contract_id",
  271. "longitude",
  272. "latitude",
  273. "create_time"
  274. // ['create_time', 'create_time', function ($item) {
  275. // return empty($item) ? "-" : date('Y-m-d H:i:s', $item);
  276. // }],
  277. ], $data);
  278. return app('json')->success([
  279. 'list' => $result,
  280. 'pageCount' => $pageCount,
  281. 'pageSize' => $pageSize,
  282. 'page' => $post['page'],
  283. ]);
  284. }
  285. /**
  286. * 评论列表
  287. * @param Request $request
  288. */
  289. public function contractCommentList(Request $request)
  290. {
  291. $pageSize = 50;
  292. $post = UtilService::getMore(
  293. [
  294. ['page', 1],
  295. ['uid',0], //甲方
  296. ['to_uid',''], //乙方
  297. ['contract_id', ''], //签约id
  298. ['contract_no', ''], //签约编号
  299. ['time',[]],
  300. ], $request
  301. );
  302. $where = [];
  303. if(!empty($post['uid'])){
  304. $where[]=["uid","=",$post['uid']];
  305. }
  306. // else
  307. // if(!empty($post['mobile'])){
  308. // $m = Db::name("user")->where("mobile",$post['mobile'])->find();
  309. // if(!empty($m)) {
  310. // $where[]=["o.uid","=",$m['uid']];
  311. // }
  312. // }
  313. if(!empty($post['nickname'])){
  314. $where[]=["nickname","like","%{$post["name"]}%"];
  315. }
  316. if(!empty($post['contract_id'])){
  317. $where[]=["contract_id","=",$post['contract_id']];
  318. }
  319. //创建时间
  320. $startTime="";
  321. $endTime="";
  322. if(!empty($post['time'][0]) && !empty($post['time'][1])) {
  323. $startTime = strtotime($post['time'][0]);
  324. $endTime = strtotime($post['time'][1]);
  325. $where[]=["create_time","between","{$startTime},{$endTime}"];
  326. }
  327. $order = new ContractCommentModel();
  328. $data = $order
  329. // ->alias("o")
  330. // ->field("*,u1.mobile,u1.nickname,a.title as show_template_title,a.imgs as show_template_imgs")
  331. // ->leftJoin("user u1","u1.uid = uid")
  332. // ->leftJoin("show_template a","a.id = show_template_id")
  333. ->field('*')
  334. ->where($where)
  335. ->page((int)$post["page"], $pageSize)
  336. ->order("id","desc")
  337. ->select()
  338. ->toArray();
  339. $pageCount = $order->where($where)->count();
  340. $result = UtilService::getParam([
  341. "id",
  342. "contract_no",
  343. "uid",
  344. "to_uid",
  345. "create_time",
  346. // ['create_time', 'create_time', function ($item) {
  347. // return empty($item) ? "-" : date('Y-m-d H:i:s', $item);
  348. // }],
  349. ], $data);
  350. return app('json')->success([
  351. 'list' => $result,
  352. 'pageCount' => $pageCount,
  353. 'pageSize' => $pageSize,
  354. 'page' => $post['page'],
  355. ]);
  356. }
  357. // 删除评论
  358. public function deleteComment(\think\Request $request)
  359. {
  360. $id = $request->param('id');
  361. $article = ContractCommentModel::where('id', $id)->find();
  362. if (!$article) {
  363. return app('json')->fail('评论不存在');
  364. }
  365. $article->delete();
  366. return app('json')->success();
  367. }
  368. //
  369. // /**
  370. // * 合约列表
  371. // * @param \app\Request $request
  372. // * @return mixed
  373. // */
  374. // public function getContractList(\think\Request $request)
  375. // {
  376. //// $pageSize = 50;
  377. //// $post = UtilService::getMore([
  378. //// ['page',1],
  379. //// ['pageSize',50],
  380. //// ['nickname',''],
  381. ////// ['uid',''],
  382. //// ['parent_uid',''],
  383. //// ['mobile',''],
  384. //// ['status',''],
  385. //// ['time',[]],
  386. //// ],$request);
  387. ////// $post['uid']=$request->user["uid"];
  388. //// $data = (new UserModel)->getDataList($post,"*",1);
  389. //// return app('json')->success([
  390. //// 'list' => $data["list"],
  391. //// 'pageCount' => $data["totalCount"],
  392. //// 'pageSize' => $data["pageSize"],
  393. //// 'page' => $data["page"],
  394. //// ]);
  395. // $post = UtilService::getMore([
  396. // ['page', 1],
  397. // ['pageSize', 50],
  398. // ['status',-2] //1未签约 2已签约 3已解约
  399. // ], $request);
  400. // $post["pageSize"] = $post["pageSize"]>50 ? 50 : (int)$post["pageSize"];
  401. // $post["page"] = $post["page"]<=0 ? 1 : (int)$post["page"];
  402. // $where=[];
  403. // $uid = UtilService::getMore([
  404. // ['uid', 0],
  405. // ], $request);
  406. // $uid=$uid['uid'];
  407. // $where[]=["uid","=",$uid];
  408. // $totalCount = (new UserContractRecordModel)->where($where)->count();
  409. // if ($post["status"]!=-2){
  410. // $where[]=['status','=',$post["status"]];
  411. // }
  412. // $data=null;
  413. // if($totalCount>0){
  414. // $data = (new UserContractRecordModel)
  415. //// ->field("")
  416. //// ->alias("ut")
  417. //// ->join("show_template t", "t.id = show_template_id","left")
  418. // ->where($where)
  419. // ->order("is_default", "desc")
  420. // ->order("id", "desc")
  421. // ->page($post["page"], $post["pageSize"])
  422. // ->select();
  423. // foreach($data as $k=>$v){
  424. // $data[$k]["is_use"] = 1;//是否已经购买或者可以使用
  425. // switch ($data[$k]["status"]){
  426. // case 0:
  427. // $data[$k]["status_name"] = "未签约";
  428. // break;
  429. // case 1:
  430. // $data[$k]["status_name"] = "已签约";
  431. // break;
  432. // case -1:
  433. // $data[$k]["status_name"] = "已解约";
  434. // break;
  435. // }
  436. // }
  437. // }
  438. // $data = empty($data)?[]:$data;
  439. // return app('json')->success(["list" => $data, "pageSize" => $post["pageSize"],"page"=>$post["page"],"totalCount"=>$totalCount]);
  440. // }
  441. //
  442. // /**
  443. // * 甲方创建合约
  444. // */
  445. // public function form_save(Request $request){
  446. // $post = UtilService::getMore([
  447. // ['uid','0'], //甲方uid
  448. // ['phone',''], //甲方手机号
  449. // ['address',''], //甲方地址
  450. // ['card',''], //甲方身份证号
  451. // ['to_uid','0'], //员工uid
  452. // ['price',0], //服务费
  453. // ['deposit',0], // 定金
  454. // ['balance',0], //余款
  455. // ['period',0], // 周期天数
  456. // ['start_time',''], // 开始时间
  457. // ['end_time',''], // 结束时间
  458. //
  459. //// ['uid_img',''] //甲方签名图片路径
  460. //// ['to_phone',''].
  461. //// ['to_address',''],
  462. //// ['to_card',''],
  463. //// ['data',[]],
  464. //// ['year',''],
  465. //// ['month',''],
  466. //// ['day',''],
  467. //
  468. // ],$request);
  469. // $id = (int)$post["id"];
  470. //
  471. // $uid = (int)$post["uid"];
  472. // if(empty($uid)){
  473. // return app('json')->fail("参数错误");
  474. // }
  475. //// $year = $post['year'];
  476. //// $month = $post['month'];
  477. //// $day = $post['day'];
  478. ////
  479. ////// 检查年月日是否为空
  480. //// if (empty($year) || empty($month) || empty($day)) {
  481. //// return app('json')->fail("日期参数错误");
  482. //// }
  483. ////
  484. ////// 创建 DateTime 对象
  485. //// $date = \DateTime::createFromFormat('Y-m-d', "$year-$month-$day");
  486. ////
  487. ////// 检查日期是否有效
  488. //// if (!$date || $date->format('Y-m-d') !== "$year-$month-$day") {
  489. //// return app('json')->fail("无效的日期");
  490. //// }
  491. //// unset($post['year']);
  492. //// unset($post['month']);
  493. //// unset($post['day']);
  494. ////// 转换为时间戳
  495. //// $timestamp = $date->getTimestamp();
  496. ////
  497. //// $post['create_time'] = $timestamp;
  498. // //用户信息
  499. //// if(!empty($post["uid_img"])){
  500. //// $post['status'] = 2;
  501. //// }else{
  502. // $post['status'] = 0;
  503. //// }
  504. // if (empty($id)){
  505. // $post['contract_no'] = makeOrderId($post['uid'],"CR");
  506. // $r = (new UserContractRecordModel)->save($post);
  507. // }else{
  508. // $r = (new UserContractRecordModel)->where("id",$id)->update($post);
  509. // }
  510. //
  511. // return app('json')->success("数据保存成功");
  512. // }
  513. // /**
  514. // * 甲方签约合约
  515. // */
  516. // public function check(Request $request){
  517. // $post = UtilService::getMore([
  518. // ['id',0], //合约id
  519. // ['uid_img',''], //甲方签名图片路径
  520. // ['check_time','']//签约时间
  521. //// ['to_phone',''].
  522. //// ['to_address',''],
  523. //// ['to_card',''],
  524. //// ['data',[]],
  525. //// ['year',''],
  526. //// ['month',''],
  527. //// ['day',''],
  528. //
  529. // ],$request);
  530. // $info = (new UserContractRecordModel)->where("id",$post["id"])->find();
  531. // if(empty($info)){
  532. // return app('json')->fail("合约不存在");
  533. // }
  534. //
  535. // // 检查签约时间是否为空
  536. // if (empty($post['uid_img'])) {
  537. // return app('json')->fail("签字错误");
  538. // }
  539. //// 检查签约时间是否为空
  540. // if (empty($post['check_time'])) {
  541. // return app('json')->fail("日期参数错误");
  542. // }
  543. //
  544. //// $post['status'] = 1;
  545. // $post['from_check'] = 1;
  546. // if ($info['to_check']==1){
  547. // $post['status']==1;
  548. // }
  549. //
  550. //// $post['contract_no'] = makeOrderId($post['uid'],"CR");
  551. // $r = (new UserContractRecordModel)->where("id",$post["id"])->update($post);
  552. // return app('json')->success("数据保存成功");
  553. // }
  554. //// 乙方确认
  555. // public function to_check(Request $request){
  556. // $post = UtilService::getMore([
  557. // ['id','0'], //
  558. // ['to_uid_img',''], //乙方签名图片路径
  559. // ['to_phone',''], //乙方手机号
  560. // ['to_address',''], //乙方地址
  561. // ['to_card',''], //乙方身份证号
  562. // ['to_check_time','']//签约时间
  563. // ],$request);
  564. // $info = (new UserContractRecordModel)->where("id",$post["id"])->find();
  565. // if(empty($info)){
  566. // return app('json')->fail("合约不存在");
  567. // }
  568. // // 检查签约时间是否为空
  569. // if (empty($post['to_uid_img'])) {
  570. // return app('json')->fail("签字错误");
  571. // }
  572. //// 检查签约时间是否为空
  573. // if (empty($post['to_check_time'])) {
  574. // return app('json')->fail("日期参数错误");
  575. // }
  576. // $post['to_check'] = 1;
  577. // if ($info['from_check']==1){
  578. // $post['status']==1;
  579. // }
  580. // $r = (new UserContractRecordModel)->where("id",$post["id"])->update($post);
  581. // return app('json')->success("数据保存成功");
  582. // }
  583. //// 员工签到
  584. // public function clock_in(Request $request){
  585. // $post = UtilService::getMore([
  586. // ['id','0'], //合约id
  587. // ['longitude',''], //经度
  588. // ['latitude',''], //纬度
  589. //
  590. // ],$request);
  591. // $uid = (int)$post["uid"];
  592. // // 检查签约时间是否为空
  593. // if (empty($post['id'])) {
  594. // return app('json')->fail("签字错误");
  595. // }
  596. // $nickname=\app\model\api\User::where('uid',$uid)->value('nickname');
  597. // $r = (new UserContractRecordModel)->where("id",$post["id"])->save([
  598. // 'uid'=>$uid,
  599. // 'nickname' => $nickname,
  600. // 'longitude'=>$post['longitude'],
  601. // 'latitude'=>$post['latitude'],
  602. // 'contract_id'=>$post['id'],
  603. // 'create_time'=>time()
  604. // ]);
  605. // return app('json')->success("数据保存成功");
  606. // }
  607. //// 添加客户评论
  608. // public function comment(Request $request){
  609. // $post = UtilService::getMore([
  610. // ['id','0'], //合约id
  611. // ['content',''], //评论内容
  612. // ],$request);
  613. // $uid = (int)$post["uid"];
  614. // $info = (new UserContractRecordModel)->where("id",$post["id"])->find();
  615. // if(empty($info)){
  616. // return app('json')->fail("合约不存在");
  617. // }
  618. // if ($info['status']!=1){
  619. // return app('json')->fail("只能在签约期间才能发表评论");
  620. // }
  621. // // 检查签约时间是否为空
  622. // if (empty($post['id'])) {
  623. // return app('json')->fail("签字错误");
  624. // }
  625. // $r = (new ContractCommentModel)->save([
  626. // 'uid'=>$uid,
  627. // 'contract_id'=>$post['id'],
  628. // 'content'=>$post['content'],
  629. // 'create_time'=>time()
  630. // ]);
  631. // return app('json')->success("数据保存成功");
  632. // }
  633. }