本地生活添加软删除
This commit is contained in:
parent
e3df409bd0
commit
630c4c756d
@ -46,6 +46,23 @@ class LocalStore extends AdminBase
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除本地生活
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
try {
|
||||
if (LocalStoreLogic::del_data($id)) {
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return JsonServer::error('操作失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 审核操作
|
||||
*/
|
||||
|
||||
@ -4,7 +4,6 @@ namespace app\admin\logic\shop;
|
||||
|
||||
use app\common\basics\Logic;
|
||||
use app\common\model\LocalStore;
|
||||
use app\common\model\user\User;
|
||||
|
||||
class LocalStoreLogic extends Logic
|
||||
{
|
||||
@ -13,7 +12,7 @@ class LocalStoreLogic extends Logic
|
||||
public static function lists()
|
||||
{
|
||||
return array(
|
||||
'lists' => LocalStore::with('info')->select()->toArray()
|
||||
'lists' => LocalStore::where(['del' => 0])->with('info')->select()->toArray()
|
||||
);
|
||||
}
|
||||
|
||||
@ -27,7 +26,19 @@ class LocalStoreLogic extends Logic
|
||||
return LocalStore::where(['lstore_id' => $id])->update(['store_state' => $state]);
|
||||
}
|
||||
|
||||
// 获取未审核数据
|
||||
/**
|
||||
* @notes 删除本地商家数据
|
||||
*/
|
||||
public static function del_data($id) {
|
||||
return LocalStore::where(['lstore_id' => $id, 'del' => 0])->update([
|
||||
'del' => 1,
|
||||
'del_time' => date('Y-m-d H:i:s')
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取未审核数据
|
||||
*/
|
||||
public static function get_unaudited_data()
|
||||
{
|
||||
return LocalStore::where(['store_state' => 0])->count();
|
||||
|
||||
@ -162,10 +162,10 @@
|
||||
});
|
||||
},
|
||||
del: function (obj) {
|
||||
layer.confirm("确定删除主营类目:" + obj.data.name, function (index) {
|
||||
layer.confirm("确定删除该条数据吗?", function (index) {
|
||||
like.ajax({
|
||||
url: "{:url('shop.Category/del')}",
|
||||
data: {id: obj.data.id},
|
||||
url: "{:url('shop.LocalStore/del')}",
|
||||
data: {id: obj.data.lstore_id},
|
||||
type: "POST",
|
||||
success: function (res) {
|
||||
if (res.code === 1) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user