diff --git a/app/Http/Controllers/Shop/ShopsController.php b/app/Http/Controllers/Shop/ShopsController.php index 5ec522d..d32528c 100644 --- a/app/Http/Controllers/Shop/ShopsController.php +++ b/app/Http/Controllers/Shop/ShopsController.php @@ -3,6 +3,8 @@ namespace App\Http\Controllers\Shop; use App\Http\Controllers\Controller; +use App\Listeners\BindBusinessGoods; +use App\Listeners\UpdateBusinessGoodsStock; use App\Models\Shop; use App\Http\Resources\ShopsResource; use Illuminate\Http\Request; @@ -86,10 +88,12 @@ class ShopsController extends Controller $business = BusinessFactory::init()->make($shop->plat_id); $business->setShop($shop); if ('goods' === $request->get('type')) { - $business->downloadGoodsAndBind($request->get('data')); + $business->bindGoods($request->get('data')); + event(new BindBusinessGoods($shop)); } if ('orders' === $request->get('type')) { - $business->downloadOrders(); + $business->saveOrders(); + event(new UpdateBusinessGoodsStock($shop)); } } } diff --git a/app/Listeners/BindBusinessGoods.php b/app/Listeners/BindBusinessGoods.php new file mode 100644 index 0000000..b6c3ed8 --- /dev/null +++ b/app/Listeners/BindBusinessGoods.php @@ -0,0 +1,34 @@ +shop = $shop; + } + + /** + * Handle the event. + * + * @param Registered $event + * @return void + */ + public function handle(Registered $event) + { + // + } +} diff --git a/app/Listeners/SendDatabaseNotification.php b/app/Listeners/SendDatabaseNotification.php new file mode 100644 index 0000000..ce0cbee --- /dev/null +++ b/app/Listeners/SendDatabaseNotification.php @@ -0,0 +1,31 @@ +shop = $shop; + } + + /** + * Handle the event. + * + * @param Registered $event + * @return void + */ + public function handle(Registered $event) + { + // + } +} diff --git a/app/Models/Log.php b/app/Models/Log.php index 75c1cd7..06bc265 100644 --- a/app/Models/Log.php +++ b/app/Models/Log.php @@ -38,6 +38,8 @@ class Log extends Model 'permission' => '权限', 'role' => '角色', 'user' => '用户', + 'plat' => '平台', + 'file' => '文件', ]; return $map[$value]; @@ -65,6 +67,9 @@ class Log extends Model 'role' => '角色', 'menu' => '菜单', 'user' => '用户', + 'upload' => '上传', + 'kuaituantuan' => '快团团', + 'miaoxuan' => '妙选', ]; return $map[$value]; @@ -80,6 +85,9 @@ class Log extends Model 'import' => '导入', 'export' => '导出', 'set' => '设置', + 'cost' => '成本', + 'stock' => '库存', + 'inventory' => '库存盘点', ]; return $map[$value]; diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 723a290..b975ef6 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -6,6 +6,9 @@ use Illuminate\Auth\Events\Registered; use Illuminate\Auth\Listeners\SendEmailVerificationNotification; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Event; +use App\Listeners\SendDatabaseNotification; +use App\Listeners\BindBusinessGoods; +use App\Listeners\UpdateBusinessGoodsStock; class EventServiceProvider extends ServiceProvider { @@ -17,6 +20,9 @@ class EventServiceProvider extends ServiceProvider protected $listen = [ Registered::class => [ SendEmailVerificationNotification::class, + SendDatabaseNotification::class, + BindBusinessGoods::class, + UpdateBusinessGoodsStock::class, ], ]; diff --git a/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php b/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php index 9b588be..d75d708 100644 --- a/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php +++ b/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php @@ -2,6 +2,7 @@ namespace App\Services\Business\KuaiTuanTuan; +use App\Listeners\BindBusinessGoods; use App\Models\BusinessGoodsSku; use App\Models\GoodsSku; use App\Services\Business\BusinessClient;