本文整理汇总了PHP中Common::saveExtendData方法的典型用法代码示例。如果您正苦于以下问题:PHP Common::saveExtendData方法的具体用法?PHP Common::saveExtendData怎么用?PHP Common::saveExtendData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Common
的用法示例。
在下文中一共展示了Common::saveExtendData方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_ajax_save
public function action_ajax_save()
{
$action = Arr::get($_POST, 'action');
//当前操作
$id = Arr::get($_POST, 'productid');
$status = false;
$webid = Arr::get($_POST, 'webid');
//所属站点
$allow = Arr::get($_POST, 'allow');
//封面图片上传方式.
$content = Arr::get($_POST, 'content');
//文章内容
$bzcontent = Arr::get($_POST, 'bzcontent');
$templet = Arr::get($_POST, 'templet');
//图片处理
$imagestitle = Arr::get($_POST, 'imagestitle');
$images = Arr::get($_POST, 'images');
$imgheadindex = Arr::get($_POST, 'imgheadindex');
$piclist = '';
$litpic = $images[$imgheadindex];
for ($i = 1; isset($images[$i]); $i++) {
$desc = isset($imagestitle[$i]) ? $imagestitle[$i] : '';
$pic = !empty($desc) ? $images[$i] . '||' . $desc : $images[$i];
$piclist .= $pic . ',';
}
$piclist = strlen($piclist) > 0 ? substr($piclist, 0, strlen($piclist) - 1) : '';
//图片
//添加操作
if ($action == 'add' && empty($id)) {
$model = ORM::factory('article');
$model->aid = Common::getLastAid('sline_article', $webid);
$model->addtime = time();
} else {
$model = ORM::factory('article', $id);
if ($model->webid != $webid) {
$aid = Common::getLastAid('sline_article', $webid);
$model->aid = $aid;
}
}
$content = $templet == 'moban2' ? $content : $bzcontent;
if ($allow == 'usecontentpic') {
$litpic = self::dowloadPicture($content);
}
$summary = Arr::get($_POST, 'summary');
$summary = empty($summary) ? mb_substr(strip_tags(Arr::get($_POST, 'content')), 0, 140, 'utf-8') . '...' : $summary;
$webid = Arr::get($_POST, 'webid');
$kindlist = Arr::get($_POST, 'kindlist');
if ($webid != 0) {
if (is_array($kindlist)) {
if (!in_array($webid, $kindlist)) {
array_push($kindlist, $webid);
}
} else {
$kindlist = array($webid);
//如果为空则直接加webid
}
}
$model->title = Arr::get($_POST, 'title');
$model->fromsite = Arr::get($_POST, 'fromsite');
$model->author = Arr::get($_POST, 'author');
$model->webid = $webid;
$link = new Model_Tool_Link();
$model->content = $link->keywordReplaceBody($content, 4);
//$model->content = $content;
$model->modtime = Arr::get($_POST, 'modtime');
$model->comefrom = Arr::get($_POST, 'comefrom');
$model->litpic = $litpic;
$model->ishidden = Arr::get($_POST, 'ishidden') ? Arr::get($_POST, 'ishidden') : 0;
//显示隐藏
$model->seotitle = Arr::get($_POST, 'seotitle');
//优化标题
$model->tagword = Arr::get($_POST, 'tagword');
$model->keyword = Arr::get($_POST, 'keyword');
$model->description = Arr::get($_POST, 'description');
$model->shownum = Arr::get($_POST, 'shownum') ? Arr::get($_POST, 'shownum') : 0;
$model->redirecturl = Arr::get($_POST, 'redirecturl');
$model->kindlist = implode(',', $kindlist);
//所属目的地
$model->attrid = implode(',', Arr::get($_POST, 'attrlist'));
//属性
$model->iconlist = implode(',', Arr::get($_POST, 'iconlist'));
//图标
$model->modtime = time();
$model->templet = $templet;
$model->summary = $summary;
$model->piclist = $piclist;
$model->attachment = Arr::get($_POST, 'attachment');
if ($action == 'add' && empty($id)) {
$model->create();
} else {
$model->update();
}
Common::saveExtendData(4, $id, $_POST);
//扩展信息保存
if ($model->saved()) {
if ($action == 'add') {
$productid = $model->id;
//插入的产品id
} else {
$productid = null;
//.........这里部分代码省略.........
示例2: action_ajax_save
//.........这里部分代码省略.........
$model = ORM::factory('spot', $id);
if ($model->webid != $webid) {
$aid = Common::getLastAid('sline_spot', $webid);
$model->aid = $aid;
}
}
//选中上级属性
$attrids = implode(',', Arr::get($_POST, 'attrlist'));
//属性
if (!empty($attrids)) {
$attrmode = ORM::factory("spot_attr")->where("id in ({$attrids})")->group_by('pid')->get_all();
foreach ($attrmode as $k => $v) {
$attrids = $v['pid'] . ',' . $attrids;
}
}
$imagestitle = Arr::get($_POST, 'imagestitle');
$images = Arr::get($_POST, 'images');
$imgheadindex = Arr::get($_POST, 'imgheadindex');
//图片处理
$piclist = '';
$litpic = $images[$imgheadindex];
for ($i = 1; isset($images[$i]); $i++) {
$desc = isset($imagestitle[$i]) ? $imagestitle[$i] : '';
$pic = !empty($desc) ? $images[$i] . '||' . $desc : $images[$i];
$piclist .= $pic . ',';
}
$piclist = strlen($piclist) > 0 ? substr($piclist, 0, strlen($piclist) - 1) : '';
//图片
$model->title = Arr::get($_POST, 'title');
$model->shortname = Arr::get($_POST, 'shortname');
$model->address = Arr::get($_POST, 'address');
$model->webid = $webid;
$model->shownum = Arr::get($_POST, 'shownum') ? Arr::get($_POST, 'shownum') : 0;
$model->author = Arr::get($_POST, 'author');
//编辑人
$model->ishidden = Arr::get($_POST, 'ishidden') ? Arr::get($_POST, 'ishidden') : 0;
//显示隐藏
$model->getway = Arr::get($_POST, 'getway');
//取票方式
$model->sellpoint = Arr::get($_POST, 'sellpoint');
$model->kindlist = implode(',', $kindlist);
//所属目的地
$model->attrid = $attrids;
//属性
$model->lng = Arr::get($_POST, 'lng') ? Arr::get($_POST, 'lng') : 0;
$model->lat = Arr::get($_POST, 'lat') ? Arr::get($_POST, 'lat') : 0;
$model->iconlist = implode(',', Arr::get($_POST, 'iconlist'));
//图标
$model->satisfyscore = Arr::get($_POST, 'satisfyscore') ? Arr::get($_POST, 'satisfyscore') : 0;
//满意度
$model->bookcount = Arr::get($_POST, 'bookcount') ? Arr::get($_POST, 'bookcount') : 0;
//销量
$model->piclist = $piclist;
$link = new Model_Tool_Link();
$model->content = $link->keywordReplaceBody(Arr::get($_POST, 'content'), 5);
//$model->content = Arr::get($_POST,'content');//景点介绍
$model->isspotarea = 0;
$model->booknotice = Arr::get($_POST, 'booknotice');
$model->recommendnum = $_POST['recommendnum'];
$model->seotitle = Arr::get($_POST, 'seotitle');
//优化标题
$model->tagword = Arr::get($_POST, 'tagword');
$model->keyword = Arr::get($_POST, 'keyword');
$model->description = Arr::get($_POST, 'description');
$model->kindlist = implode(',', Arr::get($_POST, 'kindlist'));
//所属目的地
$model->attrid = implode(',', Arr::get($_POST, 'attrlist'));
//属性
$model->iconlist = implode(',', Arr::get($_POST, 'iconlist'));
//图标
$model->supplierlist = implode(',', Arr::get($_POST, 'supplierlist'));
$model->modtime = time();
$model->litpic = $litpic;
/*$columnlist = $model->table_columns();
foreach($columnlist as $key=>$v)
{
if($v['type']=='int' && $key!='id')
{
$model->$key = empty($model->$key) ? 0 : $model->$key;
}
}*/
if ($action == 'add' && empty($id)) {
$model->create();
} else {
$model->update();
}
if ($model->saved()) {
if ($action == 'add') {
$productid = $model->id;
//插入的产品id
} else {
$productid = null;
}
Common::saveExtendData(5, $model->id, $_POST);
//扩展信息保存
$status = true;
}
echo json_encode(array('status' => $status, 'productid' => $productid));
}
示例3: action_ajax_carsave
public function action_ajax_carsave()
{
$carid = Arr::get($_POST, 'carid');
$webid = Arr::get($_POST, 'webid');
$kindlist = Arr::get($_POST, 'kindlist');
if ($webid != 0) {
if (is_array($kindlist)) {
if (!in_array($webid, $kindlist)) {
array_push($kindlist, $webid);
}
} else {
$kindlist = array($webid);
//如果为空则直接加webid
}
}
$attrids = implode(',', Arr::get($_POST, 'attrlist'));
//属性
if (!empty($attrids)) {
$attrmode = ORM::factory("car_attr")->where("id in ({$attrids})")->group_by('pid')->get_all();
foreach ($attrmode as $k => $v) {
$attrids = $v['pid'] . ',' . $attrids;
}
}
$data_arr = array();
$data_arr['title'] = Arr::get($_POST, 'title');
$data_arr['sellpoint'] = Arr::get($_POST, 'sellpoint') ? Arr::get($_POST, 'sellpoint') : '';
$data_arr['seatnum'] = Arr::get($_POST, 'seatnum') ? Arr::get($_POST, 'seatnum') : 0;
$data_arr['maxseatnum'] = Arr::get($_POST, 'maxseatnum') ? Arr::get($_POST, 'maxseatnum') : 0;
$data_arr['usedyears'] = Arr::get($_POST, 'usedyears') ? Arr::get($_POST, 'usedyears') : 0;
$data_arr['phone'] = Arr::get($_POST, 'phone') ? Arr::get($_POST, 'phone') : 0;
$link = new Model_Tool_Link();
$data_arr['content'] = $link->keywordReplaceBody(Arr::get($_POST, 'content'), 3);
//$data_arr['content']=Arr::get($_POST,'content');
$data_arr['notice'] = Arr::get($_POST, 'notice');
$data_arr['recommendnum'] = $_POST['recommendnum'];
$data_arr['satisfyscore'] = Arr::get($_POST, 'satisfyscore') ? Arr::get($_POST, 'satisfyscore') : 90;
$data_arr['bookcount'] = Arr::get($_POST, 'bookcount') ? Arr::get($_POST, 'bookcount') : 0;
$data_arr['webid'] = $webid;
$data_arr['carkindid'] = Arr::get($_POST, 'carkindid');
$data_arr['ishidden'] = Arr::get($_POST, 'ishidden');
$data_arr['kindlist'] = implode(',', $kindlist);
$data_arr['attrid'] = $attrids;
$data_arr['iconlist'] = implode(',', Arr::get($_POST, 'iconlist'));
$data_arr['supplierlist'] = implode(',', Arr::get($_POST, 'supplierlist'));
$data_arr['seotitle'] = Arr::get($_POST, 'seotitle');
//优化标题
$data_arr['tagword'] = Arr::get($_POST, 'tagword');
$data_arr['keyword'] = Arr::get($_POST, 'keyword');
$data_arr['description'] = Arr::get($_POST, 'description');
$data_arr['templet'] = Arr::get($_POST, 'templet');
//图片处理
$images_arr = Arr::get($_POST, 'images');
$imagestitle_arr = Arr::get($_POST, 'imagestitle');
$headimgindex = Arr::get($_POST, 'imgheadindex');
$imgstr = "";
foreach ($images_arr as $k => $v) {
$imgstr .= $v . '||' . $imagestitle_arr[$k] . ',';
if ($headimgindex == $k) {
$data_arr['litpic'] = $v;
}
}
$imgstr = trim($imgstr, ',');
$data_arr['piclist'] = $imgstr;
if ($carid) {
$model = ORM::factory('car', $carid);
$model->addtime = time();
} else {
$model = ORM::factory('car');
$model->aid = Common::getLastAid('sline_car', $data_arr['webid']);
$model->modtime = time();
}
foreach ($data_arr as $k => $v) {
$model->{$k} = $v;
}
$model->save();
if ($model->saved()) {
$model->reload();
$carid = $model->id;
Common::saveExtendData(3, $carid, $_POST);
//扩展信息保存
echo $carid;
} else {
echo 'no';
}
}
示例4: action_ajax_photosave
public function action_ajax_photosave()
{
$photoid = Arr::get($_POST, 'photoid');
$webid = Arr::get($_POST, 'webid');
$kindlist = Arr::get($_POST, 'kindlist');
if ($webid != 0) {
if (is_array($kindlist)) {
if (!in_array($webid, $kindlist)) {
array_push($kindlist, $webid);
}
} else {
$kindlist = array($webid);
//如果为空则直接加webid
}
}
$data_arr = array();
$data_arr['title'] = Arr::get($_POST, 'title');
$data_arr['attrid'] = implode(',', Arr::get($_POST, 'attrlist'));
$data_arr['webid'] = Arr::get($_POST, 'webid');
$data_arr['webid'] = empty($data_arr['webid']) ? 0 : $data_arr['webid'];
$data_arr['seotitle'] = Arr::get($_POST, 'seotitle');
$data_arr['keyword'] = Arr::get($_POST, 'keyword');
$data_arr['description'] = Arr::get($_POST, 'description');
$data_arr['kindlist'] = implode(',', $kindlist);
$data_arr['author'] = Arr::get($_POST, 'author');
$data_arr['content'] = Arr::get($_POST, 'content');
$data_arr['tagword'] = Arr::get($_POST, 'tagword');
$data_arr['ishidden'] = Arr::get($_POST, 'ishidden') ? Arr::get($_POST, 'ishidden') : 0;
//显示隐藏
if ($photoid) {
$model = ORM::factory('photo', $photoid);
if ($model->webid != $data_arr['webid']) {
$aid = Common::getLastAid('sline_photo', $data_arr['webid']);
$model->aid = $aid;
}
$model->addtime = time();
} else {
$model = ORM::factory('photo');
$model->aid = Common::getLastAid('sline_photo', $data_arr['webid']);
$model->modtime = time();
}
foreach ($data_arr as $k => $v) {
$model->{$k} = $v;
}
$model->save();
Common::saveExtendData(6, $photoid, $_POST);
//扩展信息保存
if ($model->saved()) {
$model->reload();
$id = $model->id;
$webid = $model->webid;
//图片处理
$org_images = ORM::factory('photo_picture')->where("pid={$id}")->find_all()->as_array();
foreach ($org_images as $v) {
$v->delete();
}
$images_arr = Arr::get($_POST, 'images');
$imagestitle_arr = Arr::get($_POST, 'imagestitle');
$headimgindex = Arr::get($_POST, 'imgheadindex');
foreach ($images_arr as $k => $v) {
$picture = ORM::factory('photo_picture');
$picture->pid = $id;
$picture->litpic = $v;
$picture->description = $imagestitle_arr[$k];
$picture->save();
if ($headimgindex == $k) {
$model->litpic = $v;
$model->save();
}
}
echo $id;
} else {
echo 'no';
}
}
示例5: action_ajax_linesave
public function action_ajax_linesave()
{
$attrids = implode(',', Arr::get($_POST, 'attrlist'));
//属性
if (!empty($attrids)) {
$attrids = implode(',', Model_Attrlist::getParentsStr($attrids, 1));
}
$lineid = Arr::get($_POST, 'lineid');
$data_arr = array();
$data_arr['webid'] = Arr::get($_POST, 'webid');
$data_arr['webid'] = empty($data_arr['webid']) ? 0 : $data_arr['webid'];
$webid = $data_arr['webid'];
$kindlist = Arr::get($_POST, 'kindlist');
if ($webid != 0) {
if (is_array($kindlist)) {
if (!in_array($webid, $kindlist)) {
array_push($kindlist, $webid);
}
} else {
$kindlist = array($webid);
//如果为空则直接加webid
}
}
$data_arr['title'] = Arr::get($_POST, 'title');
$data_arr['sellpoint'] = Arr::get($_POST, 'sellpoint');
$data_arr['kindlist'] = implode(',', Model_Destinations::getParentsStr(implode(',', $kindlist)));
$data_arr['attrid'] = $attrids;
$data_arr['lineday'] = Arr::get($_POST, 'lineday') ? Arr::get($_POST, 'lineday') : 1;
$data_arr['linenight'] = Arr::get($_POST, 'linenight') ? Arr::get($_POST, 'linenight') : 0;
$data_arr['islinebefore'] = $_POST['islinebefore'] ? 1 : 0;
$data_arr['recommendnum'] = $_POST['recommendnum'];
$data_arr['supplierlist'] = implode(',', Arr::get($_POST, 'supplierlist'));
$data_arr['linebefore'] = Arr::get($_POST, 'linebefore') ? Arr::get($_POST, 'linebefore') : 0;
$data_arr['storeprice'] = Arr::get($_POST, 'storeprice') ? Arr::get($_POST, 'storeprice') : 0;
$data_arr['childrule'] = Arr::get($_POST, 'childrule');
$data_arr['templet'] = Arr::get($_POST, 'templet');
$data_arr['templet'] = empty($data_arr['templet']) ? 'line_show.htm' : $data_arr['templet'];
$data_arr['color'] = Arr::get($_POST, 'color');
$data_arr['satisfyscore'] = Arr::get($_POST, 'satisfyscore') ? Arr::get($_POST, 'satisfyscore') : 0;
$data_arr['bookcount'] = Arr::get($_POST, 'bookcount') ? Arr::get($_POST, 'bookcount') : 0;
$data_arr['ishidden'] = Arr::get($_POST, 'ishidden') ? Arr::get($_POST, 'ishidden') : 0;
//显示隐藏
$data_arr['seotitle'] = Arr::get($_POST, 'seotitle');
$data_arr['keyword'] = Arr::get($_POST, 'keyword');
$data_arr['tagword'] = Arr::get($_POST, 'tagword');
$data_arr['description'] = Arr::get($_POST, 'description');
$data_arr['modtime'] = time();
$data_arr['isstyle'] = Arr::get($_POST, 'isstyle') ? Arr::get($_POST, 'isstyle') : 2;
//默认标准版
$data_arr['showrepast'] = Arr::get($_POST, 'showrepast');
$data_arr['jieshao'] = Arr::get($_POST, 'jieshao');
$data_arr['biaozhun'] = Arr::get($_POST, 'biaozhun');
$data_arr['beizu'] = Arr::get($_POST, 'beizu');
$data_arr['payment'] = Arr::get($_POST, 'payment');
$data_arr['feeinclude'] = Arr::get($_POST, 'feeinclude');
$data_arr['features'] = Arr::get($_POST, 'features');
$data_arr['reserved1'] = Arr::get($_POST, 'reserved1');
$data_arr['reserved2'] = Arr::get($_POST, 'reserved2');
$data_arr['reserved3'] = Arr::get($_POST, 'reserved3');
$data_arr['startcity'] = Arr::get($_POST, 'startcity');
$data_arr['transport'] = Arr::get($_POST, 'transport_pub') ? implode(',', Arr::get($_POST, 'transport_pub')) : '';
$data_arr['iconlist'] = Arr::get($_POST, 'iconlist') ? implode(',', Arr::get($_POST, 'iconlist')) : '';
$data_arr['insuranceids'] = Arr::get($_POST, 'insuranceids') ? implode(',', Arr::get($_POST, 'insuranceids')) : '';
//图片处理
$images_arr = Arr::get($_POST, 'images');
$imagestitle_arr = Arr::get($_POST, 'imagestitle');
$headimgindex = Arr::get($_POST, 'imgheadindex');
$imgstr = "";
foreach ($images_arr as $k => $v) {
$imgstr .= $v . '||' . $imagestitle_arr[$k] . ',';
if ($headimgindex == $k) {
$data_arr['litpic'] = $v;
}
}
$imgstr = trim($imgstr, ',');
$data_arr['piclist'] = $imgstr;
$data_arr['linedoc'] = Arr::get($_POST, 'linedoc');
if ($lineid == 0) {
$data_arr['addtime'] = $data_arr['modtime'];
$model = ORM::factory('line');
$model->aid = Common::getLastAid('sline_line', $data_arr['webid']);
$model->addtime = time();
} else {
$data_arr['modtime'] = time();
$model = ORM::factory('line', $lineid);
if ($model->webid != $data_arr['webid']) {
$aid = Common::getLastAid('sline_line', $data_arr['webid']);
$model->aid = $aid;
}
$model->modtime = time();
}
foreach ($data_arr as $k => $v) {
$model->{$k} = $v;
}
$model->save();
if ($model->saved()) {
$model->reload();
$lineid = $model->id;
$this->savejieshao($lineid);
Common::saveExtendData(1, $lineid, $_POST);
//.........这里部分代码省略.........
示例6: action_ajax_save
public function action_ajax_save()
{
$action = Arr::get($_POST, 'action');
//当前操作
$id = Arr::get($_POST, 'productid');
$status = false;
//添加操作
if ($action == 'add' && empty($id)) {
$model = ORM::factory('visa');
$model->aid = Common::getLastAid('sline_visa', 0);
$model->addtime = time();
} else {
$model = ORM::factory('visa', $id);
}
$model->title = Arr::get($_POST, 'title');
$model->webid = 0;
$model->keyword = Arr::get($_POST, 'keyword');
$model->seotitle = Arr::get($_POST, 'seotitle');
$model->description = Arr::get($_POST, 'description');
$model->tagword = Arr::get($_POST, 'tagword');
$model->sellpoint = Arr::get($_POST, 'sellpoint') ? Arr::get($_POST, 'sellpoint') : '';
$model->visatype = Arr::get($_POST, 'visatype') ? Arr::get($_POST, 'visatype') : 0;
$model->litpic = Arr::get($_POST, 'litpic');
//封面图
$model->feeinclude = Arr::get($_POST, 'feeinclude');
$model->handleday = Arr::get($_POST, 'handleday');
$model->validday = Arr::get($_POST, 'validday');
$model->needinterview = Arr::get($_POST, 'needinterview');
//
$model->needletter = Arr::get($_POST, 'needletter');
//优化标题
$model->price = Arr::get($_POST, 'price');
$model->marketprice = Arr::get($_POST, 'marketprice');
$model->handlerange = Arr::get($_POST, 'handlerange');
$model->areaid = Arr::get($_POST, 'areaid') ? Arr::get($_POST, 'areaid') : 0;
$model->cityid = Arr::get($_POST, 'cityid') ? Arr::get($_POST, 'cityid') : 0;
$model->nationid = Arr::get($_POST, 'nationid');
$link = new Model_Tool_Link();
$model->content = $link->keywordReplaceBody(Arr::get($_POST, 'content'), 8);
//$model->content = Arr::get($_POST,'content');
$model->shownum = Arr::get($_POST, 'shownum') ? Arr::get($_POST, 'shownum') : 0;
//优化标题
$model->partday = Arr::get($_POST, 'partday');
$model->acceptday = Arr::get($_POST, 'acceptday');
$model->handlepeople = Arr::get($_POST, 'handlepeople');
$model->belongconsulate = Arr::get($_POST, 'belongconsulate');
//优化标题
$model->material = Arr::get($_POST, 'material');
$model->material2 = Arr::get($_POST, 'material2');
$model->material3 = Arr::get($_POST, 'material3');
$model->material4 = Arr::get($_POST, 'material4');
$model->material5 = Arr::get($_POST, 'material5');
$model->booknotice = Arr::get($_POST, 'booknotice');
$model->circuit = Arr::get($_POST, 'circuit');
$model->friendtip = Arr::get($_POST, 'friendtip');
$model->paytype = Arr::get($_POST, 'paytype') ? Arr::get($_POST, 'paytype') : 1;
$model->dingjin = Arr::get($_POST, 'dingjin');
$model->ishidden = Arr::get($_POST, 'ishidden') ? Arr::get($_POST, 'ishidden') : 0;
//显示隐藏
$model->jifentprice = Arr::get($_POST, 'jifentprice') ? Arr::get($_POST, 'jifentprice') : 0;
$model->jifenbook = Arr::get($_POST, 'jifenbook') ? Arr::get($_POST, 'jifenbook') : 0;
$model->jifencomment = Arr::get($_POST, 'jifencomment') ? Arr::get($_POST, 'jifencomment') : 0;
$model->iconlist = implode(',', Arr::get($_POST, 'iconlist'));
//图标
$model->supplierlist = implode(',', Arr::get($_POST, 'supplierlist'));
$model->satisfyscore = Arr::get($_POST, 'satisfyscore') ? Arr::get($_POST, 'satisfyscore') : 0;
//满意度
$model->bookcount = Arr::get($_POST, 'bookcount') ? Arr::get($_POST, 'bookcount') : 0;
//销量
$model->litpic = Arr::get($_POST, 'litpic');
$model->templet = Arr::get($_POST, 'templet');
$model->recommendnum = $_POST['recommendnum'];
$model->modtime = time();
if ($action == 'add' && empty($id)) {
$model->create();
} else {
$model->update();
}
if ($model->saved()) {
if ($action == 'add') {
$productid = $model->id;
//插入的产品id
} else {
$productid = null;
}
Common::saveExtendData(8, $model->id, $_POST);
//扩展信息保存
$status = true;
}
echo json_encode(array('status' => $status, 'productid' => $productid));
}
示例7: action_ajax_save
//.........这里部分代码省略.........
}
$productid = $id;
}
$attrids = implode(',', Arr::get($_POST, 'attrlist'));
//属性
if (!empty($attrids)) {
$attrmode = ORM::factory("hotel_attr")->where("id in ({$attrids})")->group_by('pid')->get_all();
foreach ($attrmode as $k => $v) {
$attrids = $v['pid'] . ',' . $attrids;
}
}
$imagestitle = Arr::get($_POST, 'imagestitle');
$images = Arr::get($_POST, 'images');
$imgheadindex = Arr::get($_POST, 'imgheadindex');
//图片处理
$piclist = '';
$litpic = $images[$imgheadindex];
for ($i = 1; isset($images[$i]); $i++) {
$desc = isset($imagestitle[$i]) ? $imagestitle[$i] : '';
$pic = !empty($desc) ? $images[$i] . '||' . $desc : $images[$i];
$piclist .= $pic . ',';
}
$piclist = strlen($piclist) > 0 ? substr($piclist, 0, strlen($piclist) - 1) : '';
//图片
$kindlist = Arr::get($_POST, 'kindlist');
if ($webid != 0) {
if (is_array($kindlist)) {
if (!in_array($webid, $kindlist)) {
array_push($kindlist, $webid);
}
} else {
$kindlist = array($webid);
//如果为空则直接加webid
}
}
$model->title = Arr::get($_POST, 'title');
$model->address = Arr::get($_POST, 'address');
$model->webid = $webid;
$model->sellpoint = Arr::get($_POST, 'sellpoint');
$model->recommendnum = $_POST['recommendnum'];
$model->telephone = Arr::get($_POST, 'telephone');
$model->opentime = Arr::get($_POST, 'opentime');
$model->decoratetime = Arr::get($_POST, 'decoratetime');
//装修时间
$model->opentime = Arr::get($_POST, 'opentime');
$model->kindlist = implode(',', $kindlist);
//所属目的地
$model->attrid = $attrids;
//属性
$model->iconlist = implode(',', Arr::get($_POST, 'iconlist'));
//图标
$model->supplierlist = implode(',', Arr::get($_POST, 'supplierlist'));
$model->satisfyscore = Arr::get($_POST, 'satisfyscore') ? Arr::get($_POST, 'satisfyscore') : 0;
//满意度
$model->bookcount = Arr::get($_POST, 'bookcount') ? Arr::get($_POST, 'bookcount') : 0;
//销量
$model->piclist = $piclist;
$model->ishidden = Arr::get($_POST, 'ishidden') ? Arr::get($_POST, 'ishidden') : 0;
//显示隐藏
$model->litpic = Arr::get($_POST, 'litpic');
//封面图
$model->traffic = Arr::get($_POST, 'jiaotong');
//交通指南
$model->notice = Arr::get($_POST, 'zhuyi');
//注意事项
$model->equipment = Arr::get($_POST, 'fujian');
//附件
$model->aroundspots = Arr::get($_POST, 'zhoubian');
//周边景点
$model->seotitle = Arr::get($_POST, 'seotitle');
//优化标题
$model->tagword = Arr::get($_POST, 'tagword');
$model->keyword = Arr::get($_POST, 'keyword');
$model->description = Arr::get($_POST, 'description');
$model->fuwu = $_POST['fuwu'];
$model->modtime = time();
$model->hotelrankid = Arr::get($_POST, 'hotelrankid');
$model->lng = $_POST['lng'];
$model->lat = $_POST['lat'];
$link = new Model_Tool_Link();
$model->content = $link->keywordReplaceBody(Arr::get($_POST, 'jieshao'), 2);
//$model->content = Arr::get($_POST,'jieshao');
$model->litpic = $litpic;
$model->templet = Arr::get($_POST, 'templet');
if ($action == 'add') {
$model->save();
} else {
$model->update();
}
if ($model->saved()) {
if ($action == 'add') {
$productid = $model->id;
//插入的产品id
}
Common::saveExtendData(2, $productid, $_POST);
//扩展信息保存
$status = true;
}
echo json_encode(array('status' => $status, 'productid' => $productid));
}
示例8: action_ajax_save
public function action_ajax_save()
{
$action = Arr::get($_POST, 'action');
//当前操作
$id = Arr::get($_POST, 'productid');
$status = false;
$webid = Arr::get($_POST, 'webid');
//所属站点
$typeid = $this->params['typeid'];
//添加操作
if ($action == 'add' && empty($id)) {
$model = ORM::factory('model_archive');
$model->aid = Common::getLastAid('sline_model_archive', $webid);
$model->addtime = time();
} else {
$model = ORM::factory('model_archive', $id);
if ($model->webid != $webid) {
$aid = Common::getLastAid('sline_model_archive', $webid);
$model->aid = $aid;
}
}
$imagestitle = Arr::get($_POST, 'imagestitle');
$images = Arr::get($_POST, 'images');
$imgheadindex = Arr::get($_POST, 'imgheadindex');
//图片处理
$piclist = '';
$litpic = $images[$imgheadindex];
for ($i = 1; isset($images[$i]); $i++) {
$desc = isset($imagestitle[$i]) ? $imagestitle[$i] : '';
$pic = !empty($desc) ? $images[$i] . '||' . $desc : $images[$i];
$piclist .= $pic . ',';
}
$piclist = strlen($piclist) > 0 ? substr($piclist, 0, strlen($piclist) - 1) : '';
//图片
$model->piclist = $piclist;
$model->title = Arr::get($_POST, 'title');
$model->webid = $webid;
$model->content = Arr::get($_POST, 'content');
$model->modtime = Arr::get($_POST, 'modtime');
$model->litpic = $litpic;
$model->ishidden = Arr::get($_POST, 'ishidden') ? Arr::get($_POST, 'ishidden') : 0;
//显示隐藏
$model->seotitle = Arr::get($_POST, 'seotitle');
//优化标题
$model->tagword = Arr::get($_POST, 'tagword');
$model->keyword = Arr::get($_POST, 'keyword');
$model->description = Arr::get($_POST, 'description');
$model->shownum = Arr::get($_POST, 'shownum') ? Arr::get($_POST, 'shownum') : 0;
$model->kindlist = implode(',', Arr::get($_POST, 'kindlist'));
//所属目的地
$model->attrid = implode(',', Arr::get($_POST, 'attrlist'));
//属性
$model->iconlist = implode(',', Arr::get($_POST, 'iconlist'));
//图标
$model->supplierlist = implode(',', Arr::get($_POST, 'supplierlist'));
$model->modtime = time();
$model->typeid = Arr::get($_POST, 'typeid');
$model->templet = Arr::get($_POST, 'templet');
$model->satisfyscore = Arr::get($_POST, 'satisfyscore');
$model->sellpoint = Arr::get($_POST, 'sellpoint');
if ($action == 'add' && empty($id)) {
$model->create();
} else {
$model->update();
}
if ($model->saved()) {
if ($action == 'add') {
$productid = $model->id;
//插入的产品id
} else {
$productid = null;
}
Common::saveExtendData($typeid, $model->id, $_POST);
//扩展信息保存
$status = true;
}
echo json_encode(array('status' => $status, 'productid' => $productid));
}
示例9: action_ajax_tuansave
public function action_ajax_tuansave()
{
$attrids = implode(',', Arr::get($_POST, 'attrlist'));
//属性
if (!empty($attrids)) {
$attrmode = ORM::factory("tuan_attr")->where("id in ({$attrids})")->group_by('pid')->get_all();
foreach ($attrmode as $k => $v) {
$attrids = $v['pid'] . ',' . $attrids;
}
}
$tuanid = Arr::get($_POST, 'tuanid');
$data_arr = array();
$data_arr['title'] = Arr::get($_POST, 'title');
$data_arr['shortname'] = Arr::get($_POST, 'shortname');
$data_arr['totalnum'] = Arr::get($_POST, 'totalnum') ? Arr::get($_POST, 'totalnum') : -1;
$data_arr['starttime'] = strtotime(Arr::get($_POST, 'starttime'));
$data_arr['endtime'] = strtotime(Arr::get($_POST, 'endtime'));
$data_arr['sellprice'] = Arr::get($_POST, 'sellprice') ? Arr::get($_POST, 'sellprice') : 0;
$data_arr['price'] = Arr::get($_POST, 'price') ? Arr::get($_POST, 'price') : 0;
$data_arr['jifenbook'] = Arr::get($_POST, 'jifenbook') ? Arr::get($_POST, 'jifenbook') : 0;
$data_arr['jifentprice'] = Arr::get($_POST, 'jifentprice') ? Arr::get($_POST, 'jifentprice') : 0;
$data_arr['jifencomment'] = Arr::get($_POST, 'jifencomment') ? Arr::get($_POST, 'jifencomment') : 0;
$data_arr['paytype'] = Arr::get($_POST, 'paytype') ? Arr::get($_POST, 'paytype') : 1;
$data_arr['dingjin'] = Arr::get($_POST, 'dingjin') ? Arr::get($_POST, 'dingjin') : 0;
$data_arr['sellpoint'] = Arr::get($_POST, 'sellpoint');
$data_arr['ishidden'] = Arr::get($_POST, 'ishidden') ? Arr::get($_POST, 'ishidden') : 0;
$data_arr['kindlist'] = implode(',', Arr::get($_POST, 'kindlist'));
//所属目的地
$data_arr['attrid'] = $attrids;
//属性
$data_arr['iconlist'] = implode(',', Arr::get($_POST, 'iconlist'));
//图标
$data_arr['supplierlist'] = implode(',', Arr::get($_POST, 'supplierlist'));
$link = new Model_Tool_Link();
$data_arr['content'] = $link->keywordReplaceBody(Arr::get($_POST, 'content'), 13);
$data_arr['satisfyscore'] = $_POST['satisfyscore'];
//$data_arr['content']=Arr::get($_POST,'content');
$data_arr['seotitle'] = Arr::get($_POST, 'seotitle');
$data_arr['keyword'] = Arr::get($_POST, 'keyword');
$data_arr['description'] = Arr::get($_POST, 'description');
$data_arr['sellpoint'] = Arr::get($_POST, 'sellpoint');
$data_arr['validdate'] = Arr::get($_POST, 'validdate');
$data_arr['tagword'] = Arr::get($_POST, 'tagword');
$data_arr['virtualnum'] = Arr::get($_POST, 'virtualnum') ? Arr::get($_POST, 'virtualnum') : 0;
$data_arr['templet'] = Arr::get($_POST, 'templet');
$data_arr['modtime'] = time();
//图片处理
$images_arr = Arr::get($_POST, 'images');
$imagestitle_arr = Arr::get($_POST, 'imagestitle');
$headimgindex = Arr::get($_POST, 'imgheadindex');
$imgstr = "";
foreach ($images_arr as $k => $v) {
$imgstr .= $v . '||' . $imagestitle_arr[$k] . ',';
if ($headimgindex == $k) {
$data_arr['litpic'] = $v;
}
}
$imgstr = trim($imgstr, ',');
$data_arr['piclist'] = $imgstr;
if ($tuanid) {
$model = ORM::factory('tuan', $tuanid);
} else {
$model = ORM::factory('tuan');
$model->aid = Common::getLastAid('sline_tuan', 0);
$model->addtime = time();
}
foreach ($data_arr as $k => $v) {
$model->{$k} = $v;
}
$model->save();
if ($model->saved()) {
Common::saveExtendData(13, $model->id, $_POST);
//扩展信息保存
$model->reload();
$id = $model->id;
echo $id;
} else {
echo 'no';
}
}