完善本地生活审核操作

This commit is contained in:
wangxiaowei 2024-06-29 15:07:27 +08:00
parent e2691eae9b
commit f8e59ea570
2 changed files with 16 additions and 3 deletions

@ -2,13 +2,12 @@
namespace app\admin\controller\shop;
use app\admin\logic\shop\AuthLogic;
use app\admin\validate\ShopAuthValidate;
use app\common\basics\AdminBase;
use app\common\server\ConfigServer;
use app\common\enum\LocalLifeICBCEnum;
use app\admin\logic\shop\LocalStoreLogic;
use app\common\server\JsonServer;
use think\facade\Request;
class LocalStore extends AdminBase
{
@ -54,7 +53,14 @@ class LocalStore extends AdminBase
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if ($post['state'] == 1 || $post['state'] == 2) {
if (in_array($post['state'], LocalStoreLogic::$STATE_ENUM)) {
if ($post['state'] == 1) {
$data = LocalStoreLogic::get_data($post['id']);
Request::post('https://dlh.hainings.com/shop/abutment/test', [
'empowerPhone' => $data['empowerPhone'],
'crftNo1' => $data['crftNo1']
]);
}
if (LocalStoreLogic::update_state($post['id'], $post['state'])) {
return JsonServer::success('操作成功');
}

@ -8,6 +8,8 @@ use app\common\model\user\User;
class LocalStoreLogic extends Logic
{
public static $STATE_ENUM = [1, 2];
public static function lists()
{
return array(
@ -15,6 +17,11 @@ class LocalStoreLogic extends Logic
);
}
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]);