|
|
@@ -23,6 +23,7 @@ use app\common\model\master_worker_credential\MasterWorkerCredentialImages;
|
|
|
use app\common\model\service_area\ServiceArea;
|
|
|
use app\common\model\master_worker\MasterWorkerStop;
|
|
|
use app\common\model\master_worker\MasterWorkerRetentionMoneyOrder;
|
|
|
+use app\common\model\dict\DictConfig;
|
|
|
use think\db\Query;
|
|
|
use think\facade\Config;
|
|
|
use think\facade\Db;
|
|
|
@@ -391,11 +392,19 @@ class MasterWorkerLogic extends BaseLogic
|
|
|
*/
|
|
|
public static function retentionMoneyOrder($params){
|
|
|
// 创建分享单Id
|
|
|
- $is_share = false;
|
|
|
- $params['amount'] = (float)$params['amount']??0;
|
|
|
+ $is_share = true;
|
|
|
+
|
|
|
+ //系统配置的质保金缴费金额
|
|
|
+ if (empty($params['amount']) ) {
|
|
|
+ $content = DictConfig::where('value', 'retention_money')->value('content');
|
|
|
+ $content = json_decode($content,true);
|
|
|
+ $params['amount'] = $content[0]['value'];
|
|
|
+ $is_share = false;
|
|
|
+ } else {
|
|
|
+ $params['amount'] = (float)$params['amount'];
|
|
|
+ }
|
|
|
$order = MasterWorkerRetentionMoneyOrder::where(['worker_id'=>$params['worker_id']])->findOrEmpty();
|
|
|
if($order->isEmpty() || $order->order_status === 2){
|
|
|
- $is_share = true;
|
|
|
$sn = generate_sn(MasterWorkerRetentionMoneyOrder::class, 'sn');
|
|
|
$order = MasterWorkerRetentionMoneyOrder::create(['sn' => $sn, 'order_status'=>1,'worker_id'=>$params['worker_id'],'order_amount'=>$params['amount']??0]);
|
|
|
}else{
|