作者 郭鑫
1 个管道 的构建 通过 耗费 1 秒

页面修改

... ... @@ -10,13 +10,8 @@ namespace app\portal\controller;
use app\portal\model\HireModel;
use app\portal\model\OrderModel;
use app\portal\model\ResumeModel;
use app\portal\validate\ResumeValidate;
use cmf\controller\HomeBaseController;
use think\Db;
use think\Loader;
use think\Session;
class MemberController extends CommentController
... ... @@ -239,15 +234,29 @@ class MemberController extends CommentController
}
}
// 评价1
// 评价
public function common(){
if($this->request->isPost()){
$data = $this->request->param();
echo "<pre/>";
print_r($data);
die;
return $this->fetch('evalute');
}
// 评价提交
public function subCommon(){
$data = $this->request->param();
$where_log['id'] = $data['id'];
$where_log['status'] = 7;
$log = Db::name('CompareLog')->where($where_log)->find();
if($log){
$up['start'] = $data['start']+1;
$up['status'] = 8;
$up['common_time'] = time();
$up['update_time'] = time();
$res = Db::name('CompareLog')->where($where_log)->update($up);
if($res){
$this->apiResponse('1','评论成功');
}else{
$this->apiResponse('0','评论失败');
}
}else{
return $this->fetch('evalute');
$this->apiResponse('0','订单错误');
}
}
... ...
... ... @@ -128,12 +128,18 @@
var id = $('.id').val();
$.ajax({
type: 'POST',
url: "{:url('Member/common')}",
url: "{:url('Member/subCommon')}",
data: {
'start':start,
'id':id,
},
success: function (res) {
popup(res.message);
if(res.code == 1){
var url = "{:url('Member/myOrder')}";
setTimeout("url",2500);
}
console.log(res);
},
error: function (res) {
... ...