This commit is contained in:
wangjinlei
2025-01-09 09:25:20 +08:00
parent 0df350a819
commit 6abe90ec53
4 changed files with 40 additions and 1 deletions

View File

@@ -14,6 +14,11 @@ use PaypalServerSdkLib\Models\Builders\PaypalWalletExperienceContextBuilder;
use PaypalServerSdkLib\Models\Builders\PurchaseUnitRequestBuilder;
use PaypalServerSdkLib\PaypalServerSdkClientBuilder;
use think\Db;
use think\db\exception\DataNotFoundException;
use think\db\exception\ModelNotFoundException;
use think\Exception;
use think\exception\DbException;
use think\exception\PDOException;
use think\Queue;
use think\Validate;
@@ -28,6 +33,14 @@ class Order extends base{
}
/**
* @throws DataNotFoundException
* @throws ModelNotFoundException
* @throws DbException
* @throws PDOException
* @throws Exception
* @throws \Exception
*/
public function creatArticleOrder(){
$data = $this->request->post();
$rule = new Validate([
@@ -54,6 +67,7 @@ class Order extends base{
$re['paypal'] = $ii;
return jsonSuccess($re);
}
$insert['order_sn'] = 'TMR'.date('Ymd') . strtoupper(bin2hex(random_bytes(8)));
$insert['user_id'] = $article_info['user_id'];
$insert['type'] = 0;
$insert["article_id"] = $data['article_id'];

View File

@@ -513,6 +513,30 @@ class Preaccept extends Base
}
public function getPreacceptPayment(){
$data = $this->request->post();
$rule = new Validate([
"article_id"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
$journal_info = $this->journal_obj->where("journal_id",$article_info['journal_id'])->find();
if(intval($journal_info['fee'])==0||$article_info['ctime']<1735660800){
$re['state'] = 1;
$re['order'] = null;
$re["fee"] = 0;
return jsonSuccess($re);
}
$order_info = $this->order_obj->where("article_id",$article_info['article_id'])->find();
$re['state'] = $order_info?$order_info['state']:0;
$re['fee'] = $journal_info['fee'];
$re['order'] = $order_info;
return jsonSuccess($re);
}
public function getArticleMains(){
$data = $this->request->post();
$rule = new Validate([

View File

@@ -1399,6 +1399,7 @@ class Reviewer extends Base
->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'left')
->where('t_article_reviewer.reviewer_id', $data['user_id'])
->where('t_article_reviewer.state', 5)
->where("t_article.state",2)
->select();
foreach ($res as $k => $v) {
if ($v['type']) {

View File

@@ -16,7 +16,7 @@
}
],
"require": {
"php": ">=5.4.0",
"php": ">=7.0",
"topthink/framework": "5.0.*",
"topthink/think-captcha": "1.*",
"phpmailer/phpmailer": "^6.9",