2024-06-22 17:29:06 +08:00
|
|
|
<?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];
|
|
|
|
|
|
2024-06-22 17:29:06 +08:00
|
|
|
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-22 17:29:06 +08:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-29 15:07:27 +08:00
|
|
|
public static function get_data($id)
|
|
|
|
|
{
|
|
|
|
|
return LocalStore::where(['lstore_id' => $id])->find();
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-22 17:29:06 +08:00
|
|
|
public static function update_state($id, $state)
|
|
|
|
|
{
|
|
|
|
|
return LocalStore::where(['lstore_id' => $id])->update(['store_state' => $state]);
|
|
|
|
|
}
|
2024-07-01 18:05:42 +08:00
|
|
|
|
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 获取未审核数据
|
|
|
|
|
*/
|
2024-07-01 18:05:42 +08:00
|
|
|
public static function get_unaudited_data()
|
|
|
|
|
{
|
|
|
|
|
return LocalStore::where(['store_state' => 0])->count();
|
|
|
|
|
}
|
2024-06-22 17:29:06 +08:00
|
|
|
}
|