小程序端浏览、聊一聊、下单支付与自提确认;平台后台审核与分类管理;实施人员按需执行数据库补丁即可开通。
在商城使用的 MySQL 库中执行项目内 SQL 文件(路径相对代码根目录 core/sql/):
| 文件 | 作用 |
|---|---|
patch_tc_secondhand.sql | 帖子表增加 sale_price、trade_status;创建订单表 yjd_tc_post_trade_order |
patch_tc_secondhand_review.sql | 交易评价表 yjd_tc_post_trade_review(订单完成后互评) |
patch_tc_secondhand_settle.sql | 订单表增加 is_settle、settle_time(卖家货款入账标记) |
patch_makefriends_message.sql | 私信消息表 yjd_makefriends_message(未建表时聊天发送会提示「私信功能未开通」) |
若历史二手帖已发布但详情无「立即购买」,可在库中核对:
post_type = 7(二手)status = 2(已发布)、sale_price > 0trade_status = 1(在售;0 会被系统视为未初始化,保存或访问详情时会自动纠正为在售)分包根目录 tongcheng/(以实际编译的小程序工程为准,如 xiaochengxu):
tongcheng/secondhand/index/indextongcheng/secondhand/detail/detailtongcheng/secondhand/confirm/confirm?post_id=帖子IDtongcheng/chat/conversation/conversation?to_user_id=卖家用户ID&post_id=帖子IDtongcheng/secondhand/orderlist/orderlisttongcheng/secondhand/orderdetail/orderdetail?id=订单IDpatch_makefriends_message.sql 创建 yjd_makefriends_message 表。scene=tongcheng,不要求用户完成「交友资料认证」。makefriends/chat/infomakefriends/chat/messagesmakefriends/chat/send(POST,to_user_id、message、scene=tongcheng)平台后台 → 交友 → 聊天监控(mch/makefriends/chat/index),可查看站内私信记录;命中平台敏感词的消息会标记违规。
yjd_tc_post_trade_order 订单并调起微信支付。trade_status 变为已售。yjd_user.money),卖家可在小程序个人余额页提现。yjd_option 中设置 name=secondhand_auto_confirm_hours、group=tongcheng、对应 store_id(单位:小时)。接口前缀:tongcheng/secondhand/trade/(preview、submit、pay-data、mark-ready、confirm、order-list、order-detail、review)。
yjd_wechat_app,与当前小程序 _acid 对应)。wechat_open_id 发起 JSAPI 支付。/web/post-notify.php(由 pay_notify_url() 拼接域名)。mch/forum/secondhand-category/indexmch/forum/secondhand-post/indexsale_price),保存后 C 端才显示购买按钮。patch_makefriends_message.sql。trade_status 是否为 1(在售)。patch_tc_secondhand_settle.sql;订单须为「已完成」且 is_settle=1;查看卖家个人余额流水(yjd_user_account_log,order_type=21)。app.json 已注册二手分包页并重新上传小程序代码。