作者 何书鹏
1 个管道 的构建 通过 耗费 3 秒

合并分支 'heshupeng' 到 'master'

商圈信息删除权限



查看合并请求 !392
... ... @@ -224,4 +224,46 @@ class StoreInform extends Backend
}
}
/**
* 删除
*/
public function del($ids = "")
{
if ($ids) {
$pk = $this->model->getPk();
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
$this->model->where($this->dataLimitField, 'in', $adminIds);
}
$list = $this->model->where($pk, 'in', $ids)->select();
$count = 0;
Db::startTrans();
try {
foreach ($list as $k => $v) {
// 删除商家发布信息点赞
Db::name('store_inform_good')->where('object_id',$v['id'])->delete();
// 删除红包领取记录
Db::name('store_inform_log')->where('inform_id',$v['id'])->delete();
// 删除商圈浏览量记录
Db::name('store_inform_view')->where('object_id',$v['id'])->delete();
$count += $v->delete();
}
Db::commit();
} catch (PDOException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
if ($count) {
$this->success();
} else {
$this->error(__('No rows were deleted'));
}
}
$this->error(__('Parameter %s can not be empty', 'ids'));
}
}
... ...
... ... @@ -8,7 +8,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
index_url: 'store/store_inform/index/ids/' + Config.ids + location.search,
// add_url: 'store/store_inform/add',
// edit_url: 'store/store_inform/edit',
// del_url: 'store/store_inform/del',
del_url: 'store/store_inform/del',
// multi_url: 'store/store_inform/multi',
examine_url: 'store/store_inform/examine',
table: 'store_inform',
... ...