Userevaluation.php
2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
namespace app\admin\controller;
class Userevaluation extends Base
{
public function index()
{
$stoid=getAdmStoId();
$type=I("type",1);
$this->assign("type",$type);
$is_ajax=I("is_ajax");
$list=M("marketing_comments_reward")->where("store_id",$stoid)->where("type",$type)->find();
$this->assign("list",$list);
//---保存的操作---
if($is_ajax){
$data=I("post.");
$data['begindate']=strtotime( $data['begindate']);
$data['enddate']=strtotime($data['enddate']);
$str="";
if($data['condition1']) $str=",1,";
if($data['condition2']) $str="2,";
if($str) $data['sendconditions']=$str;
$data['gifbagid']=(int)$data['gifbagid'];
if($list){
M("marketing_comments_reward")->where("id",$list['id'])->save($data);
}else{
$data['store_id'] =$stoid;
M("marketing_comments_reward")->save($data);
}
$this->success("保存成功");
}
//礼包数据
$lblist = M('marketing_libao_form')->where(array('store_id' => $stoid, 'is_act' => 1))->select();
$this->assign('lblist', $lblist);
$this->initEditor(); // 编辑器
return $this->fetch('', getAdmStoId());
}
//评价领取记录
public function receive()
{
return $this->fetch('', getAdmStoId());
}
/**
* 初始化编辑器链接
* 本编辑器参考 地址 http://fex.baidu.com/ueditor/
*/
private function initEditor()
{
$this->assign("URL_upload", U('Admin/Ueditor/imageUp', array('savepath' => 'userevaluation', 'savepath1' => strtolower(getERPId()))));
$this->assign("URL_fileUp", U('Admin/Ueditor/fileUp', array('savepath' => 'userevaluation', 'savepath1' => strtolower(getERPId()))));
$this->assign("URL_scrawlUp", U('Admin/Ueditor/scrawlUp', array('savepath' => 'userevaluation', 'savepath1' => strtolower(getERPId()))));
$this->assign("URL_getRemoteImage", U('Admin/Ueditor/getRemoteImage', array('savepath' => 'userevaluation', 'savepath1' => strtolower(getERPId()))));
$this->assign("URL_imageManager", U('Admin/Ueditor/imageManager', array('savepath' => 'userevaluation', 'savepath1' => strtolower(getERPId()))));
$this->assign("URL_imageUp", U('Admin/Ueditor/imageUp', array('savepath' => 'userevaluation', 'savepath1' => strtolower(getERPId()))));
$this->assign("URL_getMovie", U('Admin/Ueditor/getMovie', array('savepath' => 'userevaluation', 'savepath1' => strtolower(getERPId()))));
$this->assign("URL_Home", "");
}
//动态查询数据
public function ajaxindex()
{
return $this->fetch('', getAdmStoId());
}
}