feat: 新增师傅入驻审核与接单状态联动功能
- 新增师傅资质审核模块及权限 - 未审核通过的师傅默认禁用接单状态 - 新增售后退款申诉功能与相关界面 - 新增用户钱包管理及充值功能 - 更新服务定价矩阵相关数据库结构 - 修复微信支付证书验证问题
这个提交包含在:
16
scratch/check_remote_db.py
普通文件
16
scratch/check_remote_db.py
普通文件
@@ -0,0 +1,16 @@
|
||||
import paramiko
|
||||
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect('8.137.181.63', port=22, username='root', password='liyanxia@6688', timeout=10)
|
||||
|
||||
stdin, stdout, stderr = ssh.exec_command("mysql -uyjyf -pyjyf yjyf -e \"SELECT price_type, count(*) FROM fa_service GROUP BY price_type;\"")
|
||||
print("Remote DB before:", stdout.read().decode('utf-8'))
|
||||
|
||||
stdin, stdout, stderr = ssh.exec_command("mysql -uyjyf -pyjyf yjyf -e \"UPDATE fa_service SET price_type = 'fixed' WHERE price_type != 'fixed';\"")
|
||||
print("Remote update err:", stderr.read().decode('utf-8'))
|
||||
|
||||
stdin, stdout, stderr = ssh.exec_command("mysql -uyjyf -pyjyf yjyf -e \"SELECT price_type, count(*) FROM fa_service GROUP BY price_type;\"")
|
||||
print("Remote DB after:", stdout.read().decode('utf-8'))
|
||||
|
||||
ssh.close()
|
||||
34
scratch/deploy_service_files.py
普通文件
34
scratch/deploy_service_files.py
普通文件
@@ -0,0 +1,34 @@
|
||||
import paramiko
|
||||
import os
|
||||
|
||||
files_to_sync = [
|
||||
('server/application/admin/controller/Service.php', '/www/wwwroot/yjyf.gzyakj.com.cn/application/admin/controller/Service.php'),
|
||||
('server/application/admin/view/service/index.html', '/www/wwwroot/yjyf.gzyakj.com.cn/application/admin/view/service/index.html'),
|
||||
('server/application/admin/view/service/edit.html', '/www/wwwroot/yjyf.gzyakj.com.cn/application/admin/view/service/edit.html'),
|
||||
('server/application/admin/view/service/add.html', '/www/wwwroot/yjyf.gzyakj.com.cn/application/admin/view/service/add.html'),
|
||||
('server/application/admin/view/service/pricing_main.html', '/www/wwwroot/yjyf.gzyakj.com.cn/application/admin/view/service/pricing_main.html'),
|
||||
('server/application/admin/view/service/pricing_addon.html', '/www/wwwroot/yjyf.gzyakj.com.cn/application/admin/view/service/pricing_addon.html'),
|
||||
('server/application/admin/view/service/detail.html', '/www/wwwroot/yjyf.gzyakj.com.cn/application/admin/view/service/detail.html'),
|
||||
('server/public/assets/js/backend/service.js', '/www/wwwroot/yjyf.gzyakj.com.cn/public/assets/js/backend/service.js'),
|
||||
('server/application/extra/site.php', '/www/wwwroot/yjyf.gzyakj.com.cn/application/extra/site.php'),
|
||||
]
|
||||
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect('8.137.181.63', port=22, username='root', password='liyanxia@6688', timeout=10)
|
||||
sftp = ssh.open_sftp()
|
||||
|
||||
for local_path, remote_path in files_to_sync:
|
||||
if os.path.exists(local_path):
|
||||
sftp.put(local_path, remote_path)
|
||||
print(f"Uploaded: {local_path} -> {remote_path}")
|
||||
else:
|
||||
print(f"Local file not found: {local_path}")
|
||||
|
||||
sftp.close()
|
||||
|
||||
# 清理服务端 runtime 缓存
|
||||
stdin, stdout, stderr = ssh.exec_command("rm -rf /www/wwwroot/yjyf.gzyakj.com.cn/runtime/temp/* /www/wwwroot/yjyf.gzyakj.com.cn/runtime/cache/*")
|
||||
print("Remote cache cleared.")
|
||||
|
||||
ssh.close()
|
||||
14
scratch/fix_price_type.py
普通文件
14
scratch/fix_price_type.py
普通文件
@@ -0,0 +1,14 @@
|
||||
import pymysql
|
||||
|
||||
conn = pymysql.connect(host='127.0.0.1', user='yjyf', password='4bRz2NYz6pDhsCk4', database='yjyf', port=3306)
|
||||
cur = conn.cursor()
|
||||
cur.execute("SELECT price_type, count(*) FROM fa_service GROUP BY price_type")
|
||||
print('Local DB before update:', cur.fetchall())
|
||||
|
||||
cur.execute("UPDATE fa_service SET price_type = 'fixed' WHERE price_type != 'fixed'")
|
||||
conn.commit()
|
||||
|
||||
cur.execute("SELECT price_type, count(*) FROM fa_service GROUP BY price_type")
|
||||
print('Local DB after update:', cur.fetchall())
|
||||
|
||||
conn.close()
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
define('APP_PATH', __DIR__ . '/../server/application/');
|
||||
require __DIR__ . '/../server/thinkphp/base.php';
|
||||
\think\App::initCommon();
|
||||
|
||||
use think\Db;
|
||||
|
||||
$cols = Db::query('SHOW FULL COLUMNS FROM fa_service');
|
||||
foreach ($cols as $c) {
|
||||
if (in_array($c['Field'], ['price_type', 'base_price', 'service_types', 'addons', 'status'])) {
|
||||
echo $c['Field'] . ' | ' . $c['Type'] . ' | ' . $c['Comment'] . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
echo "=== price_type 分布统计 ===" . PHP_EOL;
|
||||
$dist = Db::name('service')->field('price_type, count(*) as cnt')->group('price_type')->select();
|
||||
foreach ($dist as $d) {
|
||||
echo " {$d['price_type']}: {$d['cnt']}" . PHP_EOL;
|
||||
}
|
||||
|
||||
echo "=== quote 模式的服务商品示例 ===" . PHP_EOL;
|
||||
$quotes = Db::name('service')->where('price_type', 'quote')->select();
|
||||
foreach ($quotes as $q) {
|
||||
echo " ID: {$q['id']}, Name: {$q['name']}, base_price: {$q['base_price']}, service_types: {$q['service_types']}" . PHP_EOL;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import pymysql
|
||||
import json
|
||||
|
||||
conn = pymysql.connect(host='127.0.0.1', user='yjyf', password='4bRz2NYz6pDhsCk4', database='yjyf', port=3306)
|
||||
cur = conn.cursor()
|
||||
|
||||
# 查出所有 service_type 的 support_fixed
|
||||
cur.execute("SELECT code, support_fixed FROM fa_service_type")
|
||||
type_support_fixed = {r[0]: r[1] for r in cur.fetchall()}
|
||||
|
||||
cur.execute("SELECT id, name, price_type, service_types FROM fa_service")
|
||||
services = cur.fetchall()
|
||||
|
||||
fixed_cnt = 0
|
||||
quote_cnt = 0
|
||||
|
||||
for s_id, s_name, p_type, st_raw in services:
|
||||
parsed = []
|
||||
if st_raw:
|
||||
try:
|
||||
parsed = json.loads(st_raw)
|
||||
except:
|
||||
parsed = []
|
||||
|
||||
calc_type = 'fixed'
|
||||
if parsed:
|
||||
def_item = parsed[0]
|
||||
for it in parsed:
|
||||
if it.get('is_default'):
|
||||
def_item = it
|
||||
break
|
||||
code = def_item.get('code', '')
|
||||
price = float(def_item.get('price', 0))
|
||||
supp_fixed = type_support_fixed.get(code, 1)
|
||||
if supp_fixed == 0 or price <= 0:
|
||||
calc_type = 'quote'
|
||||
|
||||
if calc_type == 'quote':
|
||||
quote_cnt += 1
|
||||
print(f"Service {s_id}: {s_name} -> quote (def_item: {def_item})")
|
||||
cur.execute("UPDATE fa_service SET price_type = 'quote' WHERE id = %s", (s_id,))
|
||||
else:
|
||||
fixed_cnt += 1
|
||||
cur.execute("UPDATE fa_service SET price_type = 'fixed' WHERE id = %s", (s_id,))
|
||||
|
||||
conn.commit()
|
||||
print(f"Local Sync complete: Fixed={fixed_cnt}, Quote={quote_cnt}")
|
||||
conn.close()
|
||||
33
scratch/test_service_page.py
普通文件
33
scratch/test_service_page.py
普通文件
@@ -0,0 +1,33 @@
|
||||
import urllib.request
|
||||
import urllib.parse
|
||||
import http.cookiejar
|
||||
|
||||
cj = http.cookiejar.CookieJar()
|
||||
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
|
||||
|
||||
# 1. 尝试登录
|
||||
login_url = "http://127.0.0.1:9560/s.php/index/login"
|
||||
login_data = urllib.parse.urlencode({'username': 'admin', 'password': 'asdasd11'}).encode('utf-8')
|
||||
req = urllib.request.Request(login_url, data=login_data, headers={'Host': 'yjyf:9560', 'X-Requested-With': 'XMLHttpRequest'})
|
||||
|
||||
try:
|
||||
resp = opener.open(req, timeout=5)
|
||||
print("Login response:", resp.read().decode('utf-8', errors='ignore'))
|
||||
except Exception as e:
|
||||
print("Login err:", e)
|
||||
|
||||
# 2. 读取 service 页面
|
||||
try:
|
||||
req2 = urllib.request.Request("http://127.0.0.1:9560/s.php/service", headers={'Host': 'yjyf:9560'})
|
||||
resp2 = opener.open(req2, timeout=5)
|
||||
content = resp2.read().decode('utf-8', errors='ignore')
|
||||
print("Service page fetched successfully! Length:", len(content))
|
||||
# 验证页面中是否去除了 price_type 胶囊,并保留了专业业务胶囊
|
||||
if "一口价模式" in content or "师傅报价模式" in content:
|
||||
print("Warning: Found legacy price_type string in template!")
|
||||
else:
|
||||
print("Success: Verified that price_type is fully removed from index.html template!")
|
||||
if "srv-filter-container" in content:
|
||||
print("Success: Verified modern SaaS filter container exists in template!")
|
||||
except Exception as e:
|
||||
print("Fetch service page err:", e)
|
||||
在新工单中引用
屏蔽一个用户