Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 关于php二次开发的疑问

关于php二次开发的疑问

Jun 23, 2016 pm 01:54 PM
php Secondary development doubt

我现在要做一个功能就是关于交易流程的,1)前台卖家发布服务信息,2)经过后台管理员审核,审核通过,卖方的服务信息可以发布到网站上。。3)买方通过搜索搜索到合适的服务,4)买方付款(通过支付宝)5)管理员审核。审核通过后,卖方收到通知。6)等待卖方确认,同意后服务达成。之后就是卖方提供服务。服务进行过程中,卖方可以发布信息,买方可以实时查看服务进度。服务完成后双方可以互评。至此流程结束。后台管理员要可以监控整个交易流程。而我现在的任务就是要实现第2步还有第5步的功能,也就是说整个流程中网站后台需要做的事情。可是现在流程的其他部分都没有做,老板就要我做后台的这两步,我大脑里面根本就没有思路。这是我工作以来第一次做二次开发,PHP断断续续刚学了一个来月,就被老板赶鸭子上架,也算是对小弟的依次工作考核,所以现在小弟求各位大大指导一下啊。


回复讨论(解决方案)

1)卖家发布服务信息时,你可以把数据库里的字段,比如status置为0
2)将status为0的服务信息取出来审核,通过后置为1
4)将买方付款记录status字段置为0
5)将status为0的交易记录取出进行审核,通过后置为1,再进行其它操作,如卖方收到通知

思路就是这样,status字段的值可以自己定义,不一定是0,或1,根据自己的实际情况定

1)卖家发布服务信息时,你可以把数据库里的字段,比如status置为0
2)将status为0的服务信息取出来审核,通过后置为1
4)将买方付款记录status字段置为0
5)将status为0的交易记录取出进行审核,通过后置为1,再进行其它操作,如卖方收到通知

思路就是这样,status字段的值可以自己定义,不一定是0,或1,根据自己的实际情况定

请问有没有相关类似的源码呢,本人第一次做二次开发,想参照一下相关的项目。

源码项目我就不知道了

源码项目我就不知道了

哦,那好吧,谢谢你了

服务信息表字段:tb_ser     sid(服务信息id) , mc , status(审核标志字段)  ...(其他信息字段);
收款记录表 :       tb_pay    id(收款记录id), sid(服务信息id) , status(收费审核标志字段) ...  (收款方和付款方的一些信息字段,不要怕产生冗余,也不要和其他表关联,收费记录信息不能随其他表记录更改而改变)

前台显示和搜索服务信息时  取   tb_ser.status='1'    ;

如果不是二次开发,让你完整开发你会吗?
估计也不会吧?
所以,这个跟二次开发没什么关系。
业务逻辑搞清楚了,代码上实现就好了。
无非就是CRUD

如果不是二次开发,让你完整开发你会吗?
估计也不会吧?
所以,这个跟二次开发没什么关系。
业务逻辑搞清楚了,代码上实现就好了。
无非就是CRUD

求指导....

2)经过后台管理员审核,审核通过,卖方的服务信息可以发布到网站上。
5)管理员审核。审核通过后,卖方收到通知。
这不就是模块化吗?
流程都是:
获取未审核的条目
填写已审核标记
发出消息

至于未审核数据的来源和消息发往何处,都由配置文件指定,开发时可虚拟一个

服务信息表字段:tb_ser     sid(服务信息id) , mc , status(审核标志字段)  ...(其他信息字段);
收款记录表 :       tb_pay    id(收款记录id), sid(服务信息id) , status(收费审核标志字段) ...  (收款方和付款方的一些信息字段,不要怕产生冗余,也不要和其他表关联,收费记录信息不能随其他表记录更改而改变)

前台显示和搜索服务信息时  取   tb_ser.status='1'    ;

那服务表和收款表里的sid需要关联么。还有“mc”是啥意思。。。如果服务信息里面要包含服务介绍包括文字介绍还有图片介绍。那学不需要,见一个附表啥的,把这些内容放在附表里。


服务信息表字段:tb_ser     sid(服务信息id) , mc , status(审核标志字段)  ...(其他信息字段);
收款记录表 :       tb_pay    id(收款记录id), sid(服务信息id) , status(收费审核标志字段) ...  (收款方和付款方的一些信息字段,不要怕产生冗余,也不要和其他表关联,收费记录信息不能随其他表记录更改而改变)

前台显示和搜索服务信息时  取   tb_ser.status='1'    ;

那服务表和收款表里的sid需要关联么。还有“mc”是啥意思。。。如果服务信息里面要包含服务介绍包括文字介绍还有图片介绍。那学不需要,见一个附表啥的,把这些内容放在附表里。

sid 要关联;mc是名称啊(mc可能会改动别关联),还有服务信息表是查询频率非常高的,最好要显示的信息一表搞定,你建附表动不动就要几表联查影响效率。



服务信息表字段:tb_ser     sid(服务信息id) , mc , status(审核标志字段)  ...(其他信息字段);
收款记录表 :       tb_pay    id(收款记录id), sid(服务信息id) , status(收费审核标志字段) ...  (收款方和付款方的一些信息字段,不要怕产生冗余,也不要和其他表关联,收费记录信息不能随其他表记录更改而改变)

前台显示和搜索服务信息时  取   tb_ser.status='1'    ;

那服务表和收款表里的sid需要关联么。还有“mc”是啥意思。。。如果服务信息里面要包含服务介绍包括文字介绍还有图片介绍。那学不需要,见一个附表啥的,把这些内容放在附表里。

sid 要关联;mc是名称啊(mc可能会改动别关联),还有服务信息表是查询频率非常高的,最好要显示的信息一表搞定,你建附表动不动就要几表联查影响效率。 哦,那好吧,最后一个问题,那个关联是不是设置设置外键啊

是的




服务信息表字段:tb_ser     sid(服务信息id) , mc , status(审核标志字段)  ...(其他信息字段);
收款记录表 :       tb_pay    id(收款记录id), sid(服务信息id) , status(收费审核标志字段) ...  (收款方和付款方的一些信息字段,不要怕产生冗余,也不要和其他表关联,收费记录信息不能随其他表记录更改而改变)

前台显示和搜索服务信息时  取   tb_ser.status='1'    ;

那服务表和收款表里的sid需要关联么。还有“mc”是啥意思。。。如果服务信息里面要包含服务介绍包括文字介绍还有图片介绍。那学不需要,见一个附表啥的,把这些内容放在附表里。

sid 要关联;mc是名称啊(mc可能会改动别关联),还有服务信息表是查询频率非常高的,最好要显示的信息一表搞定,你建附表动不动就要几表联查影响效率。 哦,那好吧,最后一个问题,那个关联是不是设置设置外键啊

是的




服务信息表字段:tb_ser     sid(服务信息id) , mc , status(审核标志字段)  ...(其他信息字段);
收款记录表 :       tb_pay    id(收款记录id), sid(服务信息id) , status(收费审核标志字段) ...  (收款方和付款方的一些信息字段,不要怕产生冗余,也不要和其他表关联,收费记录信息不能随其他表记录更改而改变)

前台显示和搜索服务信息时  取   tb_ser.status='1'    ;

那服务表和收款表里的sid需要关联么。还有“mc”是啥意思。。。如果服务信息里面要包含服务介绍包括文字介绍还有图片介绍。那学不需要,见一个附表啥的,把这些内容放在附表里。

sid 要关联;mc是名称啊(mc可能会改动别关联),还有服务信息表是查询频率非常高的,最好要显示的信息一表搞定,你建附表动不动就要几表联查影响效率。 哦,那好吧,最后一个问题,那个关联是不是设置设置外键啊
关联不一定要设置外键,数据库字段数据做好关联就行了,从程序上做好数据关联约束。你去了解下数据设计的范式。





服务信息表字段:tb_ser     sid(服务信息id) , mc , status(审核标志字段)  ...(其他信息字段);
收款记录表 :       tb_pay    id(收款记录id), sid(服务信息id) , status(收费审核标志字段) ...  (收款方和付款方的一些信息字段,不要怕产生冗余,也不要和其他表关联,收费记录信息不能随其他表记录更改而改变)

前台显示和搜索服务信息时  取   tb_ser.status='1'    ;

那服务表和收款表里的sid需要关联么。还有“mc”是啥意思。。。如果服务信息里面要包含服务介绍包括文字介绍还有图片介绍。那学不需要,见一个附表啥的,把这些内容放在附表里。

sid 要关联;mc是名称啊(mc可能会改动别关联),还有服务信息表是查询频率非常高的,最好要显示的信息一表搞定,你建附表动不动就要几表联查影响效率。 哦,那好吧,最后一个问题,那个关联是不是设置设置外键啊
关联不一定要设置外键,数据库字段数据做好关联就行了,从程序上做好数据关联约束。你去了解下数据设计的范式。 哦,好的,谢谢你了
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

7 PHP Functions I Regret I Didn't Know Before 7 PHP Functions I Regret I Didn't Know Before Nov 13, 2024 am 09:42 AM

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

See all articles