application/index/controller/NeedDetail.php
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace app\index\controller;
use app\index\controller\Ajax;
use app\index\model\UserSpace;
use app\index\model\NeedSpace;
use app\index\model\FeedSpace;
use app\index\model\DealSpace;
use app\index\model\ShopSpace;
class NeedDetail extends Base {
public function index() {
$need_status=$this->check_need_status(request()->param('id')) ;
if($need_status !=1 && $need_status !=2 ){return $this->fetch('ajax/tip', ['info'=>'该需求不存在或已关闭']); }
$UserSpace = UserSpace::where('uid', session('uid', '', 'index'))->find();
$need_detail = NeedSpace::get(['id' => request()->param('id')]);
if(!$need_detail){ return $this->fetch('ajax/tip', ['info'=>'该任务不存在或者已删除']);}
//增加围观次数
$need_detail->saw_num+=1;
$need_detail->save();
//检查是否已投标
$is_feed = $this->check_feed_already(request()->param('id'));
if ($need_detail['file']) {
$arr_file = explode(",", $need_detail['file']);
}
$FeedSpace_old = FeedSpace::where(['need_id' => request()->param('id')])->order('update_time', 'desc')->select();
foreach ($FeedSpace_old as $value) {
$ShopSpace = ShopSpace::where(['shop_uid' => $value['pub_uid']])->find();
$value['shop_id'] = $ShopSpace['id'];
$FeedSpace[]=$value;
}
//银行账户 开始
$WebAccountSpace_old = db('money_web_account_space')->order('id', 'asc')->select();
foreach ($WebAccountSpace_old as $value) {
$value['arr_pic'] = explode(",", $value['pic']);
$WebAccountSpace[] = $value;
}
$this->assign('is_feed', $is_feed);
$this->assign('WebAccountSpace', $WebAccountSpace);
//银行账户 结束
$this->assign('user_money', $UserSpace['money']);
$this->assign('arr_file', $arr_file);
$this->assign('need_detail', $need_detail);
$this->assign('FeedSpace', $FeedSpace);
return $this->fetch();
}
//检查是否已经投标
protected function check_feed_already($need_id) {
$FeedSpace = FeedSpace::where(['need_id' => $need_id, 'pub_uid' => session('uid', '', 'index')])->find();
if ($FeedSpace) {
return 1;
} else {
return 0;
}
}
后面还有 68 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。