dlhmaster/app/admin/logic/shop/LocalStoreLogic.php

46 lines
1.0 KiB
PHP
Raw Normal View History

<?php
namespace app\admin\logic\shop;
use app\common\basics\Logic;
use app\common\model\LocalStore;
class LocalStoreLogic extends Logic
{
2024-06-29 15:07:27 +08:00
public static $STATE_ENUM = [1, 2];
public static function lists()
{
return array(
2024-07-02 14:03:00 +08:00
'lists' => LocalStore::where(['del' => 0])->with('info')->select()->toArray()
);
}
2024-06-29 15:07:27 +08:00
public static function get_data($id)
{
return LocalStore::where(['lstore_id' => $id])->find();
}
public static function update_state($id, $state)
{
return LocalStore::where(['lstore_id' => $id])->update(['store_state' => $state]);
}
2024-07-02 14:03:00 +08:00
/**
* @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();
}
}