|
@@ -11,6 +11,7 @@ use app\model\saas\SaasGoods;
|
|
|
use app\model\saas\SaasGoodsSku;
|
|
use app\model\saas\SaasGoodsSku;
|
|
|
use app\model\saas\SaasOrder;
|
|
use app\model\saas\SaasOrder;
|
|
|
use app\model\saas\SaasOrderItem;
|
|
use app\model\saas\SaasOrderItem;
|
|
|
|
|
+use app\model\saas\SaasOrderVerify;
|
|
|
use LinFly\Annotation\Attributes\Route\Controller;
|
|
use LinFly\Annotation\Attributes\Route\Controller;
|
|
|
use LinFly\Annotation\Attributes\Route\GetMapping;
|
|
use LinFly\Annotation\Attributes\Route\GetMapping;
|
|
|
use LinFly\Annotation\Attributes\Route\RequestMapping;
|
|
use LinFly\Annotation\Attributes\Route\RequestMapping;
|
|
@@ -164,8 +165,17 @@ class Solution extends Base
|
|
|
public function setTest()
|
|
public function setTest()
|
|
|
{
|
|
{
|
|
|
try {
|
|
try {
|
|
|
- $data = (new Relation)->config($this->getDyConfig())->token()->createOrderFirst(['1865253598118939']);
|
|
|
|
|
- return success("ok",$data);
|
|
|
|
|
|
|
+// $data = (new Relation)->config($this->getDyConfig())->token()->createOrderFirst(['1865253598118939']);
|
|
|
|
|
+ $data = (new SaasOrderVerify)->where("status",0)->with(['orders'])->select();
|
|
|
|
|
+ if ($data->isEmpty()) return error("err");
|
|
|
|
|
+ $upData = array_map(function ($val) {
|
|
|
|
|
+ return [
|
|
|
|
|
+ "id" => $val['id'],
|
|
|
|
|
+ "money" => $val['orders']['price'] / $val['orders']['number']
|
|
|
|
|
+ ];
|
|
|
|
|
+ }, $data->toArray());
|
|
|
|
|
+ (new SaasOrderVerify)->saveAll($upData);
|
|
|
|
|
+ return success("ok",$upData);
|
|
|
} catch (\Throwable $throwable) {
|
|
} catch (\Throwable $throwable) {
|
|
|
return error($throwable->getMessage());
|
|
return error($throwable->getMessage());
|
|
|
}
|
|
}
|